-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschemas.edn
42 lines (42 loc) · 2.86 KB
/
schemas.edn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{:commands {:AddUserToBankAccountCommand [:iban :username :token {:name "user-to-add" :type :string}]
:CreateBankAccountCommand [:iban :username]
:CreditMoneyCommand [:iban :amount]
:DebitMoneyCommand [:iban :amount :token :username]
:MarkTransferCompletedCommand []
:MarkTransferFailedCommand [:reason]
:MoneyTransferCommand [:token :amount :from :to :description :username]
:RemoveUserFromBankAccountCommand [:iban :username :token]
:ReturnMoneyCommand [:iban :amount :reason]
:CreateUserAccountCommand [:username :password]}
:queries {:FindUserQuery [:username]
:AllLastTransactionsQuery []
:FindBankAccountQuery [:iban]
:FindBankAccountsForUserQuery [:username]
:TransactionByIdQuery [:transaction-id]
:TransactionsByIbanQuery [:iban {:name "max-items" :type :int}]}
:feedback {:CommandSucceeded [:command-name {:name "additional-info" :type [:string :null] :default :null}]
:CommandFailed [:command-name :reason]
:QuerySucceeded [:query-name {:name "query-result" :type :string :doc "The EDN formatted result"}]
:QueryFailed [:query-name :reason]}
:events {:BankAccountCreatedEvent [:iban :token :username]
:MoneyCreditedEvent [:iban :amount :id]
:MoneyDebitedEvent [:iban :amount :id]
:MoneyReturnedEvent [:iban :amount :id :reason]
:TransferStartedEvent [:id :token :amount :from :to :description :username]
:TransferCompletedEvent [:id]
:TransferFailedEvent [:id :reason]
:UserAddedToBankAccountEvent [:username :iban :token]
:UserRemovedFromBankAccountEvent [:username :iban]
:UserAccountCreatedEvent [:username :password]}
:derived-events {:TransactionHappenedEvent [:transaction-id :iban {:name "new-balance" :type :long} {:name "changed-by" :type :long} {:name "from-to" :type :string} :description]}
:types {:id {:name "Id" :type :fixed :size 16}
:transaction-id :int
:username :string
:password :string
:reason :string
:iban :string
:token :string
:from :string
:to :string
:amount :long
:description :string}}