HW06 Composer: Checking/Savings

Create a Business Network Archive (BNA) with the appropriate models, transactions, and access constraints that fulfill the requirements below. The BNA must have an initial transaction (setupHomework) that sets up a ledger state, where the fulfillment of each requirement can be demonstrated (assuming that the ledger is empty before the call of the initial transaction). Transactions that would dynamically add participants or assets are not needed, unless noted explicitly under the requirements, except the initializer transaction.

Please test your solution on Composer Playground before submission.

For every Participant and Asset type, the unique identifier must be a non-optional String field with the name id. The value of the field must conform to the following format: <TYPENAME>_<COUNTER>. For example, if we have a Participant type named User, then the id of the first created user must be USER_0, the id of the second user must be USER_1, etc.

Problem statement

Implement a BNA for personal finance management.

Additional requirements:

Example scenario

Alice and Bob are users of the system. Alice joined 2 years ago, while Bob just signed up. Alice has a normal account with 10 units, and a savings account with 42 units. Bob's regular account has 1 unit, while his savings account has 2. Alice puts in her salary of 3 units. Later, Bob tries to withdraw 2 units for rent, but the transaction fails. He tries using his savings account, but that fails too. Alice helps him out through a transfer from her savings account.

Transactions