feat(example-doc-vault): design document entity with state machine lifecycle #10

Open
opened 2026-10-27 14:51:21 +00:00 by crapougnax · 0 comments
Owner

Migrated from GitHub https://github.com/Quatrain/Core/issues/37 (opened by @crapougnax on 2026-09-18).

Part of parent story #9.

🎯 Goal

Implement the core domain entities and lifecycle state machine for the Document Vault reference application.

📋 Specification

  1. Create Document model:
    • Properties: title (StringProperty), organizationId (StringProperty), state (StringProperty), fileUri (ObjectUri), financialAmount (NumberProperty).
    • Collection name: 'documents'.
  2. Configure FSM lifecycle via @quatrain/state-machine:
    • States: DRAFT, IN_REVIEW, APPROVED, REJECTED, ARCHIVED.
    • Transition rules: Only author can submit (DRAFT ➔ IN_REVIEW), only approver can approve/reject.
  3. Create AuditLog model for immutable transition history:
    • Collection name: 'audit_logs'.
    • Properties: targetUri (ObjectUri), action (StringProperty), actorId (StringProperty), timestamp (DateProperty).
> Migrated from GitHub https://github.com/Quatrain/Core/issues/37 (opened by @crapougnax on 2026-09-18). Part of parent story #9. ### 🎯 Goal Implement the core domain entities and lifecycle state machine for the Document Vault reference application. ### 📋 Specification 1. Create `Document` model: - Properties: `title` (StringProperty), `organizationId` (StringProperty), `state` (StringProperty), `fileUri` (ObjectUri), `financialAmount` (NumberProperty). - Collection name: `'documents'`. 2. Configure FSM lifecycle via `@quatrain/state-machine`: - States: `DRAFT`, `IN_REVIEW`, `APPROVED`, `REJECTED`, `ARCHIVED`. - Transition rules: Only author can submit (`DRAFT` ➔ `IN_REVIEW`), only approver can approve/reject. 3. Create `AuditLog` model for immutable transition history: - Collection name: `'audit_logs'`. - Properties: `targetUri` (ObjectUri), `action` (StringProperty), `actorId` (StringProperty), `timestamp` (DateProperty).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
quatrain/core#10
No description provided.