Domain Model
This document defines the core domain models and entity relationships for BayanCore's key workflows: contracting (BOQ), trading, invoicing, and ZATCA compliance.
Core Entity Relationships
Key Business Rules
Contracting Domain
- BOQ approval required before progress billing
- Retention held at 5-10% per contract terms
- WIP tracked against BOQ line items
- Progress billing capped at BOQ total - retention
Trading Domain
- Landed cost = purchase cost + freight + insurance + customs
- Multi-warehouse inventory with batch tracking
- Reorder point triggers automated PO drafts
- FIFO cost flow for inventory valuation
Invoicing & ZATCA
- Every B2B invoice requires ZATCA pre-clearance
- QR code contains TLV-encoded invoice data
- Hash chain links successive invoices for tamper evidence
- PDF/A-3 with embedded XML for archive