3.7 KiB
7. Epic 2: Community Expansion & The First "Cell"
Epic Goal: To transform the single-user system into a multi-user "Община" and to implement the core functionality of managing shared finances through "Cells". After this epic, the system will be fully capable of handling the entire lifecycle of a one-time shared expense, from initiation to completion, for a community of two or more "Citizens".
Story 2.1: Citizen Invitation System
As an Initiator, I want to generate a secure, single-use invitation link, so that I can invite new "Citizens" to join my "Община".
Acceptance Criteria:
- A logged-in "Citizen" (initially, only the Initiator) must have a "Generate Invitation" button on the dashboard.
- Clicking the button generates a unique, single-use URL.
- The system must store a record of the generated invitation token to validate it later.
- The user interface must provide an easy way to copy the generated link.
- Once an invitation link has been successfully used, it must be invalidated and cannot be used again.
Story 2.2: Onboarding via Invitation
As a new user, I want to be able to join an "Община" using an invitation link, so that I can become a "Citizen" and participate in shared activities.
Acceptance Criteria:
- Accessing a valid invitation URL must present the new user with the "Citizen" creation screen.
- The onboarding process must be identical to the "Genesis" flow (Story 1.2), including key generation and profile creation in the "Registry".
- Upon successful creation, the new "Citizen" is added to the "Община" and can log in.
- Attempting to access an invalid or already-used invitation URL must show a clear error message.
Story 2.3: "Cell" Creation
As a "Citizen", I want to create a new financial "Cell" for a "Common Good", so that I can initiate a collection of funds for a shared expense.
Acceptance Criteria:
- The main dashboard must have a "Create Cell" button.
- The creation form must allow the user to specify the "Common Good" (the purpose, e.g., "Суп").
- The form must allow the user to define one or more "Executor" roles, including the item to be purchased and its estimated cost (e.g., "Мясо", 100 UAH).
- Submitting the form must create a new
CELL_CREATEDtransaction in "The Main Ledger". - The newly created "Cell" must appear on the main dashboard in an "Open" state.
Story 2.4: Participating in a "Cell"
As a "Citizen", I want to be able to join an existing "Cell" as either an "Executor" or a "Consumer", so that I can take part in the shared expense.
Acceptance Criteria:
- In the "Cell" detail view, a "Citizen" can choose to become an "Executor" for an unassigned item.
- Any "Citizen" (including "Executors") can join the "Cell" as a "Consumer".
- When a "Citizen" joins, the system must re-calculate and display the updated debts for all "Consumers" to all "Executors".
- Each act of joining (as Executor or Consumer) must be recorded as a distinct, signed transaction in "The Main Ledger".
Story 2.5: Payment Confirmation
As an "Executor", I want to be able to confirm that I have received a payment from a "Consumer", so that their debt is officially cleared in the system.
Acceptance Criteria:
- In the "Cell" detail view, an "Executor" must see a list of "Consumers" who owe them money.
- Next to each "Consumer's" name, there must be a "Confirm Payment" button.
- Clicking the button must create a
PAYMENT_CONFIRMEDtransaction, signed by the "Executor's" private key, which includes the IDs of both the "Consumer" and "Executor". - After confirmation, the UI must immediately update to show that the specific debt is cleared.