feat(store): Unterlagen merge into the document store #89

Merged
sharang merged 1 commits from feat/store-merges-unterlagen into main 2026-10-20 18:04:53 +00:00
Owner

One document view (decided 2026-10-20): "Unterlagen" merges into the Dokumentenablage (workspace#171).

  • Migration 0023: the tenant's own documents that staff kept as Unterlagen (area IS NULL AND own_document) become internal documents of the store. Ids and product links stay the same. BreakPilot's deliveries keep area NULL. Down moves internal own documents that were never prepared or imported back to NULL.
  • GET /v1/tenants/{id}/store lists published documents only. Deliveries (no area) come last ("Von BreakPilot" in the portal). The checked original route serves a published delivery too; drafts get 404.
  • GET /v1/tenants/{id}/documents returns every document again (all areas), so Werkmeister keeps finding a product's own documents. Internal documents uploaded in the workspace with a product become readable for Werkmeister as well.
  • An admin upload marked as own goes to the internal area. PATCH own_document moves a document between no area and internal; legal and product documents keep their area.

Tests: migration 0023 up/down with data (Postgres), the store contract on memory and Postgres (order, drafts, own toggle), handler tests (delivery served, draft refused, own upload). go test -short ./... passes, and the Postgres tests were run locally.

Portal counterpart follows (one rail entry, 4th area "Von BreakPilot", "Lesen" on own product documents).

🤖 Generated with Claude Code

One document view (decided 2026-10-20): "Unterlagen" merges into the Dokumentenablage (workspace#171). - **Migration 0023:** the tenant's own documents that staff kept as Unterlagen (`area IS NULL AND own_document`) become `internal` documents of the store. Ids and product links stay the same. BreakPilot's deliveries keep `area` NULL. Down moves internal own documents that were never prepared or imported back to NULL. - **`GET /v1/tenants/{id}/store`** lists **published** documents only. Deliveries (no area) come last ("Von BreakPilot" in the portal). The checked original route serves a published delivery too; drafts get 404. - **`GET /v1/tenants/{id}/documents`** returns every document again (all areas), so Werkmeister keeps finding a product's own documents. Internal documents uploaded in the workspace with a product become readable for Werkmeister as well. - An admin upload marked as own goes to the `internal` area. PATCH `own_document` moves a document between no area and `internal`; legal and product documents keep their area. Tests: migration 0023 up/down with data (Postgres), the store contract on memory and Postgres (order, drafts, own toggle), handler tests (delivery served, draft refused, own upload). `go test -short ./...` passes, and the Postgres tests were run locally. Portal counterpart follows (one rail entry, 4th area "Von BreakPilot", "Lesen" on own product documents). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sharang added 1 commit 2026-10-20 14:28:02 +00:00
feat(store): Unterlagen merge into the document store
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Successful in 26m2s
ci / image (pull_request) Skipped
6678fd263c
One document view (decided 2026-10-20): the tenant's own documents that
staff kept as Unterlagen become internal documents of the store (0023,
same ids and product links); BreakPilot's deliveries stay without an
area and are listed last in the store. The store lists published
documents only, and serves a delivery's original like any other.

The tenant's document list returns every document again, so Werkmeister
keeps reading a product's own documents, including internal ones
uploaded in the workspace. Marking a document as the tenant's own moves
it into the internal area and back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sharang merged commit ad4fe8f3fd into main 2026-10-20 18:04:53 +00:00
Sign in to join this conversation.