No description
Adds NEXT_PUBLIC_CLOSED_PO_ATTACHMENTS_ENABLED. When on, a CLOSED PO's own
submitter -- plus Accounts / Manager / SuperUser -- can attach documents to
it, so POs whose uploads were lost to the document-upload bug can be fixed
without reopening them. Off by default, so production stays unchanged until
enabled.
- lib/permissions.ts: canAddClosedPoAttachment(role, { isSubmitter }) gated
by the flag; allowed roles are ACCOUNTS/MANAGER/SUPERUSER (plus the PO's
own submitter regardless of role).
- uploadPoDocuments: a CLOSED PO is otherwise immutable, so it now enforces
the permission server-side; the normal create/receipt flows upload while
the PO is pre-CLOSED and are unaffected.
- po-detail.tsx: when allowed, the Attachments card renders an uploader
(ClosedPoAttachmentUploader) and shows even when the PO has no docs yet.
- Enabled on staging (staging-up.sh) so the remediation can be exercised;
documented in .env.example and CLAUDE.md.
Tests: closed-po-attachments.test.ts covers the flag-on role matrix (own
submitter / Accounts / Manager / SuperUser allowed; other submitter-role and
auditor refused; non-closed PO unaffected); po-document-upload.test.ts adds
the flag-off case (closed PO stays immutable). Full unit + integration suites
green; tsc clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
||
|---|---|---|
| .claude | ||
| .forgejo | ||
| App | ||
| automation | ||
| Docs | ||
| EpfoService | ||
| GstService | ||
| PdfService | ||
| Progress | ||
| static | ||
| Wireframe | ||
| .gitattributes | ||
| .gitignore | ||
| CHANGELOG.md | ||
| ecosystem.config.js | ||
| generate_po.py | ||
| inspect_po.py | ||
| test-report-2026-05-17.md | ||
Docs — retired (moved to the wiki)
The design, architecture, and test documents that used to live here have been migrated to the project wiki and removed from the repo. The wiki is the living reference going forward.
Wiki: https://git.pelagiamarine.com/shad0w/pelagia-portal/wiki
(working clone: pelagia-portal.wiki/ alongside this repo).
Where each retired doc went
| Retired file | Now in the wiki |
|---|---|
01-design-document.md |
System/Architecture, Product/Workflows (user stories), Product/Design-System, Overview/Open-Questions |
02-architecture.md |
System/Architecture (+ System/Data-Model, Ops/Deployment-and-Operations, Build-and-Run/Environment-Variables) |
03-open-questions.md |
Overview/Open-Questions |
DESIGN.md |
Product/Workflows, Product/Pages-and-Navigation, Product/Design-System |
TEST_PLAN.md |
Quality/Test-Plan |
e2e-test-framework.md |
Quality/E2E-Test-Framework |
e2e-test-plan.md |
Quality/E2E-Test-Plan |
PLAYRIGHT_TEST_DESIGN.md |
Quality/Playwright-Test-Design |
The wiki's on-disk folder layout (Overview / Build-and-Run / System / Product / Quality / Ops) mirrors its sidebar hierarchy.
Keep current behaviour documented in the wiki, not here. Other authoritative in-repo sources remain:
App/CLAUDE.md,App/README.md,automation/README.md, andCHANGELOG.md.