-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(*)!: add deposit and withdraw events
Signed-off-by: Brooks Townsend <[email protected]> ensure providers run on cosmonic Signed-off-by: Brooks Townsend <[email protected]>
- Loading branch information
1 parent
cb9d6d7
commit 3a75bd9
Showing
17 changed files
with
456 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
name: DepositFunds | ||
summary: "A request to deposit funds into an account" | ||
version: 0.0.1 | ||
consumers: | ||
- 'Bank Account Aggregate' | ||
tags: | ||
- label: 'command' | ||
externalLinks: [] | ||
badges: [] | ||
--- | ||
Requests the deposit of a specified amount into the account. This command can fail to process if the parameters are invalid. | ||
|
||
<Mermaid /> | ||
|
||
## Schema | ||
<SchemaViewer /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"$id": "https://cosmonic.com/concordance/bankaccount/DepositFunds.json", | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"title": "DepositFunds", | ||
"type": "object", | ||
"properties": { | ||
"accountNumber": { | ||
"type": "string", | ||
"description": "The account number" | ||
}, | ||
"amount": { | ||
"type": "integer", | ||
"description": "The amount to deposit" | ||
}, | ||
"note": { | ||
"type": "string", | ||
"description": "An optional note to be associated with the deposit" | ||
}, | ||
"customerId": { | ||
"type": "string", | ||
"description": "The ID of the customer performing the deposit" | ||
}, | ||
"transferId": { | ||
"type": "string", | ||
"description": "A unique ID identifying the transfer transaction if applicable" | ||
} | ||
}, | ||
"required": ["accountNumber", "amount", "customerId"] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: FundsDeposited | ||
summary: "Indicates funds have been deposited into an account" | ||
version: 0.0.1 | ||
consumers: | ||
- 'Bank Account Aggregate' | ||
- 'Bank Account Projector' | ||
producers: | ||
- 'Bank Account Aggregate' | ||
tags: | ||
- label: 'event' | ||
externalLinks: [] | ||
badges: [] | ||
--- | ||
Indicates that funds have been deposited into an account. | ||
|
||
<Mermaid /> | ||
|
||
## Schema | ||
<SchemaViewer /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"$id": "https://cosmonic.com/concordance/bankaccount/FundsDeposited.json", | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"title": "FundsDeposited", | ||
"type": "object", | ||
"properties": { | ||
"accountNumber": { | ||
"type": "string", | ||
"description": "The account number" | ||
}, | ||
"amount": { | ||
"type": "integer", | ||
"description": "The amount deposited" | ||
}, | ||
"note": { | ||
"type": "string", | ||
"description": "An optional note to associated with the deposit" | ||
}, | ||
"customerId": { | ||
"type": "string", | ||
"description": "The ID of the customer that performed the deposit" | ||
} | ||
}, | ||
"required": ["accountNumber", "amount", "customerId"] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: FundsWithdrawn | ||
summary: "Indicates a successful withdrawal of funds" | ||
version: 0.0.1 | ||
consumers: | ||
- 'Bank Account Aggregate' | ||
- 'Bank Account Projector' | ||
producers: | ||
- 'Bank Account Aggregate' | ||
tags: | ||
- label: 'event' | ||
externalLinks: [] | ||
badges: [] | ||
--- | ||
Indicates funds have been withdrawn from the account | ||
|
||
<Mermaid /> | ||
|
||
## Schema | ||
<SchemaViewer /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"$id": "https://cosmonic.com/concordance/bankaccount/FundsWithdrawn.json", | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"title": "FundsWithdrawn", | ||
"type": "object", | ||
"properties": { | ||
"accountNumber": { | ||
"type": "string", | ||
"description": "The account number" | ||
}, | ||
"amount": { | ||
"type": "integer", | ||
"description": "The amount withdrawn" | ||
}, | ||
"note": { | ||
"type": "string", | ||
"description": "An optional note associated with the withdrawal" | ||
}, | ||
"customerId": { | ||
"type": "string", | ||
"description": "The ID of the customer that performed the withdrawal" | ||
} | ||
}, | ||
"required": ["accountNumber", "amount", "customerId"] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: WithdrawFunds | ||
summary: "A request to withdraw funds from an account" | ||
version: 0.0.1 | ||
consumers: | ||
- 'Bank Account Aggregate' | ||
tags: | ||
- label: 'command' | ||
externalLinks: [] | ||
badges: [] | ||
--- | ||
Requests the withdrawal of a specified amount from the account. This command can fail to process if the parameters are invalid or if the account does not have sufficient funds. | ||
|
||
Note that there is a design decision here. You can allow the withdrawal to go through even if there is insufficient funds, and then also emit an overdraft event. Or all commands attempting to withdraw below the minimum (or 0 if omitted) are rejected. This is a domain/application decision and | ||
not really something that can be decided by the framework. | ||
|
||
<Mermaid /> | ||
|
||
## Schema | ||
<SchemaViewer /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"$id": "https://cosmonic.com/concordance/bankaccount/WithdrawFunds.json", | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"title": "WithdrawFunds", | ||
"type": "object", | ||
"properties": { | ||
"accountNumber": { | ||
"type": "string", | ||
"description": "The account number" | ||
}, | ||
"amount": { | ||
"type": "integer", | ||
"description": "The amount to withdraw" | ||
}, | ||
"note": { | ||
"type": "string", | ||
"description": "An optional note to be associated with the withdrawal" | ||
}, | ||
"customerId": { | ||
"type": "string", | ||
"description": "The ID of the customer performing the withdrawal" | ||
} | ||
}, | ||
"required": ["accountNumber", "amount", "customerId"] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.