Appearance
Multi-language products
Keeping data in sync
Products are keyed by article number + language code. The language code is yours: nl, de, en, fr — whatever you use in your ERP. AIOTIC does not interpret it; it only uses it as part of the key and passes it through in mappings.
One language
Pick one code (say nl) and use it everywhere: every PUT /product/{no}/nl, every mapping's language_code: "nl". Nothing else to do.
Several languages
Create one product record per language for the same article number:
PUT /product/620206_01/nl { "description": "Kabel 3x1,5 mm² (100 m)" }
PUT /product/620206_01/de { "description": "Kabel 3x1,5 mm² (100 m)" }
PUT /product/620206_01/en { "description": "Cable 3x1.5 mm² (100 m)" }Why bother, if the article number is the same? Two reasons:
- Descriptions help resolution. When a document prints only a description (no usable article number) the text in the matching language is what gets compared.
- Mappings point at one language record.
customer_number + customer_item_number → item_number + language_code. Use the language the customer orders in, or a fixed default; the resolvedarticle_numberis the same either way.
Filtering
GET /product/list?language_code=de lists one language. Deletions are per language record: to retire an article completely, delete every language.
Sync engine
ChangeEvent.product_upsert(item_number, language_code, description=…) takes the language explicitly; emit one event per language when a description changes, and one delete per language when the article is discontinued.