Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Force to use a certain Guid generation function
- type BankAccountId = BankAccountId of Guid
- // Force to have positive values via a constructor function
- type Money = private Money of decimal
- type PersonalName = {
- FirstName: string;
- MiddleInitial: string option;
- LastName: string;
- }
- type AccountInitialization = {
- Owner: PersonalName
- }
- type CashDeposit = {
- AccountId: BankAccountId
- Amount: Money
- }
- type CashWithdrawal = {
- AccountId: BankAccountId
- Amount: Money
- }
- type Command =
- | InitializeAccount of AccountInitialization
- | WireMoney of AccountTransaction
- | DepositCash of CashDeposit
- | WithdrawCash of CashWithdrawal
- type AccountInitialized = {
- Owner: PersonalName
- AccountId: BankAccountId
- }
- type AccountDebited = {
- Amount: Money
- From: BankAccountId
- To: BankAccountId
- }
- type AccountCredited = {
- Amount: Money
- From: BankAccountId
- To: BankAccountId
- }
- type CashDeposited = {
- AccountId: BankAccountId
- Amount: Money
- }
- type CashWithdrawn = {
- AccountId: BankAccountId
- Amount: Money
- }
- type InvalidOperationAttempted = {
- AccountId: BankAccountId
- }
- type Event =
- | AccountInitialized of AccountInitialized
- | AccountCredited of AccountCredited
- | AccountDebited of AccountDebited
- | CashDeposited of CashDeposited
- | CashWithdrawn of CashWithdrawn
- | InvalidOperationAttempted
- type CashWithdrawn = {
- AccountId: BankAccountId
- Amount: Money
- }
- type CashDeposited = {
- AccountId: BankAccountId
- Amount: Money
- }
- type CashDeposit = {
- AccountId: BankAccountId
- Amount: Money
- }
- type CashWithdrawal = {
- AccountId: BankAccountId
- Amount: Money
- }
- type CashOperation = {
- AccountId: BankAccountId
- Amount: Money
- }
- type CashOperationOccured = {
- AccountId: BankAccountId
- Amount: Money
- }
- type CashOperation = {
- AccountId: BankAccountId
- Amount: Money
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement