feat(store): public product documents may name their product #109

Merged
sharang merged 1 commits from feat/public-product-docs into main 2026-10-30 10:36:21 +00:00
Owner

What

The store upload (POST /v1/tenants/{id}/store/documents) accepts the optional product_id for area product_public as well as internal. Before, it accepted product_id only for internal documents. Legal website documents (legal_web) still refuse a product with invalid_product.

Why

Werkmeister's CRA run reads a product's own, published documents that are linked to the product, its family or a component, whatever their area. A data sheet filed under "Produktdokumente (öffentlich)" could not carry a product, so it never reached the run unless staff linked it afterwards with PATCH /v1/admin/documents/{doc}.

This extends the store model from #88: public product documents can now name their product. It isn't a reading of the original spec.

Notes

  • product_id stays optional, so existing uploads and clients work unchanged.
  • Existing public product documents don't gain a link. Staff can still link them through the admin PATCH.
  • The workspace import still files product documents without a product, because the bundle names none.
  • No migration: project_ids already exists on the document.
  • The portal sends the product for public documents in a follow-up PR, which merges after this one.

Tests

TestStoreUploadRules:

  • a public product document with a product is stored with that product, as the tenant's own document;
  • a legal document with a product is refused;
  • a topic as product is still refused.

go vet ./... and go test ./... are green locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf

## What The store upload (`POST /v1/tenants/{id}/store/documents`) accepts the optional `product_id` for area `product_public` as well as `internal`. Before, it accepted `product_id` only for internal documents. Legal website documents (`legal_web`) still refuse a product with `invalid_product`. ## Why Werkmeister's CRA run reads a product's own, published documents that are linked to the product, its family or a component, whatever their area. A data sheet filed under "Produktdokumente (öffentlich)" could not carry a product, so it never reached the run unless staff linked it afterwards with `PATCH /v1/admin/documents/{doc}`. This extends the store model from #88: public product documents can now name their product. It isn't a reading of the original spec. ## Notes - `product_id` stays optional, so existing uploads and clients work unchanged. - Existing public product documents don't gain a link. Staff can still link them through the admin PATCH. - The workspace import still files product documents without a product, because the bundle names none. - No migration: `project_ids` already exists on the document. - The portal sends the product for public documents in a follow-up PR, which merges after this one. ## Tests `TestStoreUploadRules`: - a public product document with a product is stored with that product, as the tenant's own document; - a legal document with a product is refused; - a topic as product is still refused. `go vet ./...` and `go test ./...` are green locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf
sharang added 1 commit 2026-10-30 10:09:52 +00:00
feat(store): public product documents may name their product
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Successful in 25m57s
ci / image (pull_request) Skipped
852c58ce43
The store upload accepted product_id only for internal documents, so a
data sheet filed under "Produktdokumente (öffentlich)" never reached the
product's CRA run in Werkmeister, which reads own, published documents
linked to the product. product_public now takes the same optional
product; legal website documents still refuse one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf
sharang merged commit b14d6f61f0 into main 2026-10-30 10:36:21 +00:00
sharang deleted branch feat/public-product-docs 2026-10-30 10:36:21 +00:00
Sign in to join this conversation.