Fix tests
This commit is contained in:
parent
aa9d60e4d1
commit
96b3b77b79
3 changed files with 13 additions and 3 deletions
|
|
@ -126,7 +126,7 @@ class TerminateHandler()
|
||||||
ContractState
|
ContractState
|
||||||
]:
|
]:
|
||||||
|
|
||||||
val name = "reject"
|
val name = "terminate"
|
||||||
|
|
||||||
def onCommand(entityId: String, state: ContractState, command: ContractCommand.Terminate)
|
def onCommand(entityId: String, state: ContractState, command: ContractCommand.Terminate)
|
||||||
: Task[ContractEvent.Terminated] =
|
: Task[ContractEvent.Terminated] =
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,14 @@ object ContractState:
|
||||||
extends ContractState derives Schema:
|
extends ContractState derives Schema:
|
||||||
|
|
||||||
def amend(e: ContractEvent.Amended) =
|
def amend(e: ContractEvent.Amended) =
|
||||||
Actif(e.product, holder, e.vehicle, e.formula, e.premium)
|
PendingAmendment(
|
||||||
|
product,
|
||||||
|
holder,
|
||||||
|
vehicle,
|
||||||
|
formula,
|
||||||
|
premium,
|
||||||
|
PendingChanges(e.product, e.vehicle, e.formula, e.premium)
|
||||||
|
)
|
||||||
|
|
||||||
def terminate() =
|
def terminate() =
|
||||||
Terminated(product, holder, vehicle, formula, premium)
|
Terminated(product, holder, vehicle, formula, premium)
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,9 @@ package lu.foyer
|
||||||
package contracts
|
package contracts
|
||||||
|
|
||||||
import zio.schema.*
|
import zio.schema.*
|
||||||
|
import zio.schema.annotation.caseName
|
||||||
|
|
||||||
enum TerminationReasonType derives Schema:
|
enum TerminationReasonType derives Schema:
|
||||||
case Rejected, HolderDeceased, TerminatedByClient
|
@caseName("rejected") case Rejected
|
||||||
|
@caseName("holder-deceased") case HolderDeceased
|
||||||
|
@caseName("terminated-by-client") case TerminatedByClient
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue