Add commands engine

This commit is contained in:
Paul-Henri Froidmont 2025-02-28 05:40:32 +01:00
parent 1919e4b72c
commit 91584c18d5
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE
9 changed files with 336 additions and 58 deletions

View file

@ -9,6 +9,7 @@ enum ClientCommand derives Schema:
case Create(
lastName: ClientLastName,
firstName: ClientFirstName,
birthDate: ClientBirthDate,
drivingLicenseDate: Option[ClientDrivingLicenseDate],
phoneNumber: Option[PhoneNumberInput],
email: Option[Email],
@ -16,8 +17,14 @@ enum ClientCommand derives Schema:
case Update(
lastName: Option[ClientLastName],
firstName: Option[ClientFirstName],
birthDate: Option[ClientBirthDate],
drivingLicenseDate: Option[ClientDrivingLicenseDate],
phoneNumber: Option[PhoneNumberInput],
email: Option[Email],
address: Option[Address])
case Disable(reason: ClientDisabledReason)
object ClientCommand:
given Schema[ClientCommand.Create] = DeriveSchema.gen
given Schema[ClientCommand.Update] = DeriveSchema.gen
given Schema[ClientCommand.Disable] = DeriveSchema.gen