Skip to content

Instantly share code, notes, and snippets.

@nemanja-da
Created February 20, 2023 14:54
Show Gist options
  • Save nemanja-da/fa30c48d46d8f355a340ce226a0fea03 to your computer and use it in GitHub Desktop.
Save nemanja-da/fa30c48d46d8f355a340ce226a0fea03 to your computer and use it in GitHub Desktop.
TransactionRequest - Financial credit reporting & management using Daml smart contracts
template TransactionRequest
with
customer: Party
balance: Decimal
creditLimit: Decimal
company: Party
amount: Decimal
date: Date
authorizationSystem: Party
where
signatory customer
observer authorizationSystem
choice AuthorizeTransaction: ContractId AuthorizedTransaction
with
fraudSystem : Party
controller authorizationSystem
do
-- check balance here
create AuthorizedTransaction with ..
template AuthorizedTransaction
with
customer: Party
balance: Decimal
creditLimit: Decimal
company: Party
amount: Decimal
date: Date
authorizationSystem: Party
fraudSystem : Party
where
signatory authorizationSystem
observer fraudSystem
choice ApproveTransaction: ContractId ApprovedTransaction
with
paymentSystem: Party
reportingApp: Party
controller fraudSystem
do
create ApprovedReport with ..
create ApprovedTransaction with ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment