Skip to content

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

Description

@crapougnax

Part of parent story #36.

🎯 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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions