Files
alla-allaos-fullstack/docs/adr/0009-approved-document-storage-lifecycle.md
2026-06-16 14:25:26 +07:00

1.6 KiB

Status: accepted

Context: Task H introduced server-side PDF generation for quotation preview, download, and approved-document persistence. Task H.1 validated the full path with a real quotation fixture and confirmed that approved artifacts currently persist to local disk under public/generated/....

Decision:

  • Keep approved quotation PDFs on local filesystem storage for development and MVP use.
  • Persist the generated file path on the quotation row via approved_pdf_url.
  • Persist approved_snapshot and approved_template_version_id alongside the stored file path so the approved artifact can be traced back to the data and template used at generation time.
  • Treat this storage model as acceptable only for local/dev and early MVP deployment, not as the final production storage architecture.

Consequences:

  • Preview/download/generate-approved flows can ship now without blocking on object storage integration.
  • Approved PDF persistence works with the current dashboard and static file serving model.
  • Local public storage is simple, but it does not provide immutability guarantees, signed access control, retention policy, or durable storage semantics expected for long-lived production artifacts.

Future:

  • introduce an object-storage abstraction shared by generated documents and manual attachments
  • support signed URLs or another private delivery strategy where required
  • define immutable approved artifact rules and whether regeneration is allowed
  • add retention/cleanup policy for superseded or regenerated artifacts
  • move approved-PDF generation to an async job when post-approval auto-generation is introduced