UC-802: Artikelregister (Manufacturer Article/SKU Registry)
UC-802: Artikelregister (Manufacturer Article/SKU Registry)
Intent (confirmed by Paul, 2026-07-02)
“Som tillverkare behöver jag ett auktoritativt artikel-/SKU-register där varje säljbar variant är en verifierbar artikel: kunder och återförsäljare kan lita på vad ett föremål är (äkthet, specifikationer, rätt reservdel), produktionen kan delegeras i spårbara batcher, och all objektdata skrivs EN gång på artikeln i stället för per exemplar — vilket gör märkning billig nog att användas på allt, från påsar till maskiner.”
In English: as a manufacturer I need an authoritative article/SKU registry where every sellable variant is a verifiable article — customers and retailers can trust what an item is (authenticity, specifications, the right spare part), production can be delegated in traceable batches, and all object data is written ONCE on the article instead of per unit, which makes tagging cheap enough to use on everything, from bags to machines.
Summary
Let a manufacturer organisation (first: Plings AB itself) maintain its article/SKU registry as
SKU-granular manufacturer :ObjectClass nodes (ADR-0063), each with an article_number and a
crypto-derived class pointer (cp, ADR-0064), placed in the production namespace tree and linked
under the community class taxonomy. Tag batches are generated against articles, with batch-level
producer metadata and a clean separation between “what the tag sits on” (the object’s cp) and
“what the tag physically is” (tag_article_ref).
Actors
| Actor | Description |
|---|---|
| Manufacturer org member (primary) | Authenticated member of a registered manufacturer organisation (e.g. Plings AB) creating and managing articles |
| Production operator | Runs the keygen CLI: registers the manufacturer public key, generates tag batches against articles |
| Retailer / customer (downstream) | Scans a tag and trusts the article identity behind it (authenticity + specs; verification flow is a future spec) |
| External factory (future) | Produces batches under delegation; today recorded only as batch metadata (producer_org_id) |
Preconditions
- The organisation is registered in
manufacturer_registryfor the wallet, with its branch public key registered (keygenregister_pubkey_flow→setManufacturerPublicKey). - The caller is a member of the manufacturer organisation (strict authz, ADR-0025).
- The production namespace tree (ADR-0050) exists or is created as articles are placed.
Main flow
- Member creates an article via
createManufacturerArticle(web console wizard in the article view): name, article number, community parent class, namespace placement, optional image. - The system atomically: creates/links the canonical namespace node, derives the crypto
cpserver-side (pubkey-only, ADR-0064), creates the manufacturer:ObjectClass(article_numberunique per org), linksSUBCLASS_OFthe community parent, and setsnamespace_node.class_ref. - Operator generates a tag batch under the article’s node (keygen reserve→generate→confirm).
The cp-mode prompt distinguishes object articles (cp on tags) from tag-product articles
(mint without cp;
tag_article_refrecords what the carriers are — ADR-0063/0064). - Batch metadata records who produced it (
producer_org_id/producer_note; NULL = self-minted). - A scan of a tag carrying the article’s cp runs the unchanged class-seeded pipeline: the thin
instance links
INSTANCE_OFthe article and inherits its image/name/description — zero per-object data entry.
Alternative flows
| Alt | When | Behaviour |
|---|---|---|
| Duplicate article number | Number already used within the org | Mutation rejected with the colliding class ref |
| Node already class-linked | existingNodeId points at a node with a class_ref |
Explicit error; unlink deliberately first (no silent overwrite) |
| No registered public key | Manufacturer has no public_key for the wallet |
Rejected: register via keygen first |
| Partial failure | Class node created but a later step fails | Postgres rolls back; the Neo4j class node is deleted (compensating cleanup) |
| Generic tag batch | Tags sold as product, applied to unknown future objects | Minted without cp; user classifies at scan via the community flow |
Acceptance criteria (slice 1)
- A manufacturer org member can create both bag articles (green/white 10x15cm) through the
console, each
SUBCLASS_OFthe community classPåse 10x15cm. - Each article gets a deterministic 11-char crypto
cpderived from the registered pubkey + its node’s decimal prefix — identical to keygen’s derivation. article_numberis rejected when reused within the organisation.- A 50-tag batch generated under an article carries its cp; scanning a tag yields an instance showing the article’s image and name with no per-object work.
- A tag-product batch can be generated without cp, with
tag_article_refset on the batch. - Non-members of the manufacturer organisation cannot create or list its articles.
Out of scope for this use-case
- Manufacturer-cp verification flow (separate future spec — ADR-0055/0064 deferral).
- External factory delegation build-out (producer-delegation slice).
- Commerce fields (
article_catalog: price, stock) and kitComponentRequirementwiring. - Self-service generation / virtual codes for customer-site marking equipment.
Related
- Flow doc:
Plings-API/docs/flows/artikelregister.md(how it works now) - Spec (history):
internal/specs/2026-07-02-manufacturer-article-registry-design.md - ADR-0063: An article is a SKU-granular manufacturer ObjectClass (no new entity)
- ADR-0064: Crypto-cp minted at article creation (pubkey-only); factory = batch metadata;
tag_article_refsplit - Core systems:
class-system.md,path-registry.md