Repository navigation
Data Model
The Quality Inspection System uses a relational data model as the system of record while exposing business documents through MySQL JSON Duality Views.
The model was intentionally designed to represent a realistic manufacturing quality inspection process.
The Inspection Card is the root business document.
An inspection card represents a quality inspection performed against a manufacturing work order.
Each card contains:
- General inspection information
- Measurements
- Checklist results
- Findings
- Attachments
Inspection Card
├── Measurements
├── Checklist Items
├── Findings
└── Attachments
Stores the inspection header information.
Typical attributes include:
- Card ID
- Work Order
- Status
- Inspector
- Inspection Date
- Product Information
Purpose:
Acts as the parent record for all inspection-related data.
Stores numerical inspection results.
Examples:
- Pressure
- Length
- Voltage
- Temperature
- Weight
Purpose:
Capture measurable values and compare them against acceptable limits.
Relationship:
One Inspection Card
|
v
Many Measurements
Stores inspection checkpoints.
Examples:
- Label verified
- Visual inspection completed
- Safety check completed
- Documentation reviewed
Purpose:
Track pass/fail inspection requirements.
Relationship:
One Inspection Card
|
v
Many Checklist Items
Stores issues discovered during inspection.
Examples:
- Cosmetic defect
- Missing part
- Incorrect assembly
- Process deviation
Purpose:
Provide structured quality observations.
Relationship:
One Inspection Card
|
v
Many Findings
Stores evidence associated with inspections.
Examples:
- Photographs
- Reports
- Supporting documents
Purpose:
Provide traceability and supporting evidence.
Relationship:
One Inspection Card
|
v
Many Attachments
+------------------+
| Inspection Card |
+------------------+
|
+----------------------+
| |
v v
+----------------+ +----------------+
| Measurements | | Checklist Items|
+----------------+ +----------------+
|
|
+----------------------+
| |
v v
+----------------+ +----------------+
| Findings | | Attachments |
+----------------+ +----------------+
The project intentionally uses relational tables because manufacturing and quality systems require:
- Data integrity
- Referential integrity
- Transactions
- Reporting capabilities
- Auditable records
Relational storage remains the authoritative source of data.
The relational model is ideal for storage, but applications frequently consume data as documents.
JSON Duality Views provide a document representation without duplicating data.
This allows:
- Relational consistency
- Document-oriented APIs
- Simplified application development
The application exposes a complete inspection card as a single JSON document.
Example structure:
{
"cardId": 1001,
"workOrder": "WO-10001",
"measurements": [],
"checklist": [],
"findings": [],
"attachments": []
}The document is generated from relational tables through JSON Duality Views.
The data model was designed to achieve:
- Normalized storage
- Document-oriented access
- AI readiness
- Simplified APIs
- Real-world manufacturing applicability