Implement contracts
This commit is contained in:
parent
31014d1a0c
commit
efdc50eb1d
33 changed files with 879 additions and 173 deletions
|
|
@ -18,21 +18,9 @@ object ClientBirthDate extends RefinedLocalDate[ClientBirthDate]
|
|||
opaque type ClientDrivingLicenseDate <: LocalDate = LocalDate
|
||||
object ClientDrivingLicenseDate extends RefinedLocalDate[ClientDrivingLicenseDate]
|
||||
|
||||
opaque type Email <: String = String
|
||||
object Email extends NonBlankString[Email]
|
||||
|
||||
opaque type NationalNumber <: String = String
|
||||
object NationalNumber extends NonBlankString[NationalNumber]
|
||||
|
||||
case class Client(
|
||||
lastName: ClientFirstName,
|
||||
firstName: ClientLastName,
|
||||
drivingLicenseDate: ClientDrivingLicenseDate,
|
||||
phoneNumber: PhoneNumber,
|
||||
email: Email,
|
||||
address: Address)
|
||||
derives Schema
|
||||
|
||||
case class PhoneNumber(
|
||||
country: Country,
|
||||
nationalNumber: NationalNumber,
|
||||
|
|
@ -45,4 +33,4 @@ case class PhoneNumberInput(
|
|||
derives Schema
|
||||
|
||||
enum ClientDisabledReason derives Schema:
|
||||
case GDPR, Death
|
||||
case gdpr, death
|
||||
|
|
|
|||
|
|
@ -4,4 +4,4 @@ package clients
|
|||
import zio.schema.*
|
||||
|
||||
enum Country derives Schema:
|
||||
case LU, FR, BE
|
||||
case LU, FR, BE, CH
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue