{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","description":"Country-agnostic Goods Received Note (GRN) raised at an inbound warehouse to record what was physically received against a purchase order. Supports full-quality and discrepancy flows; good-practice reference for ISO 9001:2015 §8.4 (externally provided processes, products and services).","required":["receiver","supplier","po_reference","received_on","received_by","items","overall_status"],"additionalProperties":false,"properties":{"receiver":{"type":"object","required":["warehouse_name","address"],"additionalProperties":false,"properties":{"warehouse_name":{"type":"string","minLength":1},"address":{"type":"string","minLength":1},"warehouse_code":{"type":"string"}}},"supplier":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1},"address":{"type":"string"},"supplier_code":{"type":"string"},"vat_id":{"type":"string"}}},"po_reference":{"type":"string","minLength":1},"delivery_note_reference":{"type":"string","description":"Optional. Carrier waybill or supplier delivery-note number."},"received_on":{"type":"string","format":"date"},"received_by":{"type":"object","required":["name","role"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1},"role":{"type":"string","minLength":1}}},"items":{"type":"array","minItems":1,"items":{"type":"object","required":["sku","description","ordered_quantity","received_quantity"],"additionalProperties":false,"properties":{"sku":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"unit":{"type":"string"},"ordered_quantity":{"type":"number","minimum":0},"received_quantity":{"type":"number","minimum":0},"discrepancy":{"type":"object","description":"Present only when the line has a quantity difference, damage, or other issue.","required":["quantity_diff","damaged_quantity","notes"],"additionalProperties":false,"properties":{"quantity_diff":{"type":"number","description":"received_quantity - ordered_quantity. Negative = short-shipment."},"damaged_quantity":{"type":"number","minimum":0},"notes":{"type":"string","minLength":1}}},"lot_or_batch":{"type":"string"}}}},"overall_status":{"type":"string","enum":["accepted","accepted_with_discrepancy","rejected","partial"]},"notes":{"type":"string"},"signatory":{"type":"object","required":["name","role"],"additionalProperties":false,"properties":{"name":{"type":"string"},"role":{"type":"string"},"date":{"type":"string","format":"date"}}}}}