Define object commonly used in a document.
{
"$id": "https://www.igarment.net/schema/json/v1-0/object-document.json",
"title": "Document Related Objects",
"$defs": {
// This is a generic reference number for all kind of documents.
"reference": {
"type": "object",
"properties": {
"no": { "type": "string" },
"issue_date": { "type": "string", "format": "date" },
"party_code": { "type": "string" }
},
"required": ["no", "issue_date", "party_code"]
},
// Description of price term.
"pricing": {
"type": "object",
"properties": {
"cur": { "type": "string", "maxLength": 3 }, // currency code define in our system!
"vat": { "type": "number" }, // Value Added Tax amount
"price_term": { "type": "string", "maxLength": 50 },
"payment_term": { "type": "string", "maxLength": 50 }
}
},
// Shipping date and destination.
"shipping": {
"type": "object",
"properties": {
"ship_method": { "type": "string", "maxLength": 20 },
"ship_to_warehouse": { "type": "string", "maxLength": 5 },
"etd_date": { "type": "string", "format": "date" },
"eta_date": { "type": "string", "format": "date" },
"final_warehouse": { "type": "string", "maxLength": 5 },
"final_eta": { "type": "string", "format": "date" }
},
"required": ["ship_method", "ship_to_warehouse", "etd_date"]
},
// Internal reference
"internal": {
"type": "object",
"properties": {
"season": { "type": "string", "maxLength": 16 },
"prepared_by": { "type": "string" },
"division": { "type": "string" },
"remark": { "type": "string" }
}
},
// Extra attributes which may apply to the document but not stored into the system.
"userdefs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"ext_name": { "type": "string" },
"ext_value": { "type": "string" }
}
}
},
// Document status
"status": {
"type": "object",
"properties": {
"status_code": { "enum": [ "confirmed", "cancelled" ] },
"status_date": { "type": "string", "format": "date" },
"status_remark": { "type": "string" },
"status_by": { "type": "string" }
}
},
// Properties of a document updated by the system.
"system": {
"type": "object",
"properties": {
"version": { "type": "string" },
"created_user": { "type": "string" },
"created_date": { "type": "string", "format": "date" },
"last_modified_user": { "type": "string" },
"last_modified_date": { "type": "string", "format": "date" }
}
},
}
}