Newer
Older
support / domain / proof / command / api / src / ProofCommandApi.scala
Michal Prihoda on 12 Mar 2022 454 bytes Rename ff to iw.
package mdr.pdb.proof.command
package api

import endpoints.Endpoints
import entity.ProofCommandBus
import works.iterative.tapir.CustomTapir
import works.iterative.tapir.InternalServerError

object ProofCommandApi extends CustomTapir:

  val submitCommand: ZServerEndpoint[ProofCommandBus, Any] =
    Endpoints.submitCommand.zServerLogic(cmd =>
      ProofCommandBus
        .submitCommand(cmd)
        .mapError(InternalServerError.fromThrowable)
    )