{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","title":"Primary production traceability register","description":"The register of a primary producer: products received (art. 6 par. 1 of the royal decree of 14 November 2003), products delivered (par. 2), the link between them (par. 3) and the plant and animal events of Regulations 852/2004 and 183/2005.","additionalProperties":false,"required":["operator"],"properties":{"operator":{"type":"object","description":"The primary producer who keeps the register.","additionalProperties":false,"required":["name","address","production_type"],"properties":{"name":{"type":"string","description":"Name of the operator.","minLength":1},"address":{"type":"string","description":"Address of the farm.","minLength":1},"enterprise_number":{"type":"string","description":"Belgian enterprise number (BCE / KBO) of the operator (optional)."},"establishment_unit_number":{"type":"string","description":"Establishment-unit number of the farm (optional); never invented."},"seat_region":{"type":"string","description":"Linguistic region of the operating seat (optional). Nothing is compared with it.","enum":["nl_region","fr_region","brussels","de_region"]},"production_type":{"type":"string","description":"Plant, animal or mixed production; it decides which event sections are printed.","enum":["plant","animal","mixed"]},"period_start":{"type":"string","description":"First day of the period covered (optional).","format":"date"},"period_end":{"type":"string","description":"Last day of the period covered (optional).","format":"date"},"retention_stated":{"type":"string","description":"Retention period the operator states, printed as typed (optional); nothing is computed or defaulted."}}},"inputs":{"type":"array","description":"Incoming products (art. 6 § 1), one line per product received.","items":{"type":"object","additionalProperties":false,"required":["date","nature","identification","quantity","unit"],"properties":{"date":{"type":"string","description":"Date of reception.","format":"date"},"nature":{"type":"string","description":"Nature of the product received.","minLength":1},"identification":{"type":"string","description":"Identification of the product (lot, batch, animal range) as the supplier gave it.","minLength":1},"quantity":{"type":"number","description":"Quantity received, as typed.","minimum":0},"unit":{"type":"string","description":"Unit of the quantity; no default.","enum":["kg","t","l","head","other"]},"unit_other":{"type":"string","description":"The unit when unit is other; required then."},"foreign_unit":{"type":"boolean","description":"True when the supplier is a non-Belgian establishment unit without a unique European identification (optional)."},"supplier_unit_number":{"type":"string","description":"Establishment-unit number of the supplier (optional); a Belgian unit without a number prints a dash."},"supplier_name_address":{"type":"string","description":"Name and address of the supplier; required when foreign_unit is true."},"category":{"type":"string","description":"Category of the incoming product (optional).","enum":["seed_plant","fertiliser","feed","animal","other_input"]},"document_ref":{"type":"string","description":"Reference of the delivery note or invoice (optional)."},"lot_reference":{"type":"string","description":"Lot reference linking this input to outputs (optional, free: the Minister fixes the level of the relation)."}},"allOf":[{"if":{"required":["unit"],"properties":{"unit":{"const":"other"}}},"then":{"required":["unit_other"]}},{"if":{"required":["foreign_unit"],"properties":{"foreign_unit":{"const":true}}},"then":{"required":["supplier_name_address"]}}]}},"outputs":{"type":"array","description":"Outgoing products (art. 6 § 2), one line per delivery.","items":{"type":"object","additionalProperties":false,"required":["date","nature","identification","quantity","unit"],"properties":{"date":{"type":"string","description":"Date of delivery.","format":"date"},"nature":{"type":"string","description":"Nature of the product delivered.","minLength":1},"identification":{"type":"string","description":"Identification of the product delivered.","minLength":1},"quantity":{"type":"number","description":"Quantity delivered, as typed.","minimum":0},"unit":{"type":"string","description":"Unit of the quantity; no default.","enum":["kg","t","l","head","other"]},"unit_other":{"type":"string","description":"The unit when unit is other; required then."},"foreign_recipient":{"type":"boolean","description":"True when the recipient is a non-Belgian establishment unit without a unique European identification (optional)."},"recipient_unit_number":{"type":"string","description":"Establishment-unit number of the recipient (optional)."},"recipient_name_address":{"type":"string","description":"Name and address of the recipient; required when foreign_recipient is true."},"lot_reference":{"type":"string","description":"Lot reference linking this output to inputs (optional)."},"document_ref":{"type":"string","description":"Reference of the delivery note or invoice (optional)."}},"allOf":[{"if":{"required":["unit"],"properties":{"unit":{"const":"other"}}},"then":{"required":["unit_other"]}},{"if":{"required":["foreign_recipient"],"properties":{"foreign_recipient":{"const":true}}},"then":{"required":["recipient_name_address"]}}]}},"plant_none_declared":{"type":"boolean","description":"True when the user declares no plant event; prints 'none (declared)' only when true."},"plant_events":{"type":"array","description":"Plant events, one line per event; printed when the production type is plant or mixed.","items":{"type":"object","additionalProperties":false,"required":["date","kind"],"properties":{"description":{"type":"string","description":"Description of the event (optional)."},"date":{"type":"string","description":"Date of the event.","format":"date"},"parcel_or_crop":{"type":"string","description":"Parcel or crop concerned (optional)."},"kind":{"type":"string","description":"Kind of event.","enum":["pest_or_disease","analysis_result","gm_seed_use","other"]},"result":{"type":"string","description":"Result (optional)."},"laboratory":{"type":"string","description":"Laboratory (optional)."}}}},"animal_none_declared":{"type":"boolean","description":"True when the user declares no animal event; prints 'none (declared)' only when true."},"animal_events":{"type":"array","description":"Animal events, one line per event; printed when the production type is animal or mixed.","items":{"type":"object","additionalProperties":false,"required":["date","kind"],"properties":{"description":{"type":"string","description":"Description of the event (optional)."},"date":{"type":"string","description":"Date of the event.","format":"date"},"group_or_animal":{"type":"string","description":"Group or animal concerned (optional)."},"kind":{"type":"string","description":"Kind of event.","enum":["disease","analysis_result","control_report","other"]},"result":{"type":"string","description":"Result (optional)."},"report_ref":{"type":"string","description":"Reference of the report (optional)."}}}},"other_registers":{"type":"object","description":"Pointers to the other registers of the farm (their content is not repeated here).","additionalProperties":false,"properties":{"ppp_register_ref":{"type":"string","description":"Reference of the plant-protection use register (optional)."},"medicines_register_ref":{"type":"string","description":"Reference of the medicines register (optional)."}}},"signature":{"type":"object","description":"Place, date and signer (optional).","additionalProperties":false,"properties":{"title":{"type":"string","description":"Function of the signer (optional)."},"place":{"type":"string","description":"Place of signature (optional)."},"date":{"type":"string","description":"Date of signature (optional).","format":"date"},"name":{"type":"string","description":"Name of the signer (optional)."}}}}}