feat(applications): preserve submitted packages

This commit is contained in:
cesnimda
2026-08-31 16:54:41 +02:00
parent 47e8e3e50e
commit 5337ba3a5e
22 changed files with 903 additions and 11 deletions
+19 -3
View File
@@ -14,7 +14,9 @@ application's home.
## What it is NOT
The workspace **owns no data and duplicates none**. It is an aggregate read plus a navigation shell:
The workspace normally composes existing data. Its one deliberate ownership boundary is an
append-only submitted-package snapshot: immutable evidence must duplicate what was sent so later
profile, CV, cover-letter, and attachment edits cannot rewrite history.
| Section | Backed by (existing system) |
|---|---|
@@ -26,12 +28,13 @@ The workspace **owns no data and duplicates none**. It is an aggregate read plus
| Application answers / recruiter draft | compatibility fields on `JobApplication`, exposed as separate workspace fields |
| Analysis / Match / Interview | Phase 5 `AiWorkspacePanel` + `AiInteraction` history |
| Documents | `Attachment` |
| Submitted package history | `SubmittedApplicationPackage` + copied, SHA-256-identified attachment bytes |
| Communication | `Correspondence` |
| Activity / Timeline | `JobEvent` |
| Stage semantics | `JobPipeline` |
No career data is copied into the application. Nothing in this feature writes to the master profile,
a CV variant, or a cover letter.
Nothing in this feature writes back to the master profile, a CV variant, or a cover letter. A user-
initiated submission snapshot copies their current values into an append-only evidence record.
## Backend
@@ -234,6 +237,19 @@ With no profile it returns score 0 and asks the user to build one, rather than i
## Application assets (Phase 5.4)
### Submitted application packages
`POST /api/jobapplications/{id}/submitted-packages` freezes the current package without mutating its
sources. It records the exact career-profile JSON, variant settings/version, rendered CV HTML,
cover-letter text, application drafts/notes, opportunity context, and independent copies of every
live attachment. Each copied file has its own SHA-256 digest and remains downloadable from the
package even when the live attachment is later renamed, replaced, or deleted.
Packages are append-only and numbered per application. There is no update or delete endpoint.
List/detail/download routes are tenant-scoped, and account export/deletion includes both snapshot
metadata and bytes. Capture fails as a unit if any selected attachment is unavailable; it never
creates a package that silently omits a file.
The workspace becomes the place an application is prepared. The rule is one-directional:
```