suspend fun create(
member: MemberId,
request: FiatAccountRequest
) = result {
getByIdempotencyKey(request, member).bind().getOrElse {
val validated = validate(request).bind()
val input =
FiatAccountCommand(
member,
FiatAccount(validated),
FiatAccountStatus.CREATED,
)
repository.create(input).bind()
}
}
suspend fun create(
member: MemberId,
request: FiatAccountRequest
) = result {
getByIdempotencyKey(request, member).bind().getOrElse {
val validated = validate(request).bind()
val input =
FiatAccountCommand(
member,
FiatAccount(validated),
FiatAccountStatus.CREATED,
)
repository.create(input).bind()
}
}
Read our API docs