import { User } from "@identity-and-access/domain/entities/user" ; import { HashedPassword } from "@identity-and-access/domain/value-objects/password" ; export const UserBuilder = ( ) => { const defaultProperties = { id : 'b8a11695-3c71-45b4-9dd8-14900412f4e1' , password : '' , contactInformation : { email : 'myemail@gmail.com' , verificationCode : '1234' , isVerified : false } } ; const overrides = { id : 'b8a11695-3c71-45b4-9dd8-14900412f4e1' , password : '' , contactInformation : { email : 'myemail@gmail.com' , verificationCode : '1234' , isVerified : false } } ; return { withId ( id ) { overrides . id = id ; return this ; } , withEmail ( email ) { overrides . contactInformation . email = email ; return this ; } , withHashedPassword ( hashedPassword ) { overrides . password = hashedPassword ; return this ; } , withVerificationCode ( code ) { overrides . contactInformation . verificationCode = code ; return this ; } , build ( ) { return User . check ( { ... defaultProperties , ... overrides , } ) ; } } ; } ;