Fix tests

This commit is contained in:
Paul-Henri Froidmont 2025-11-04 14:03:20 +01:00
parent aa9d60e4d1
commit 96b3b77b79
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE
3 changed files with 13 additions and 3 deletions

View file

@ -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] =

View file

@ -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)

View file

@ -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