Skip to content

Data Model

morad1998 edited this page Oct 17, 2026 · 1 revision

Data Model

Overview

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.


Core Business Entity

Inspection Card

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

Main Entities

Inspection Card

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.


Measurements

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

Checklist Items

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

Findings

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

Attachments

Stores evidence associated with inspections.

Examples:

  • Photographs
  • Reports
  • Supporting documents

Purpose:

Provide traceability and supporting evidence.

Relationship:

One Inspection Card
        |
        v
Many Attachments

Relationship Overview

+------------------+
| Inspection Card  |
+------------------+
         |
         +----------------------+
         |                      |
         v                      v

+----------------+      +----------------+
| Measurements   |      | Checklist Items|
+----------------+      +----------------+

         |
         |
         +----------------------+
         |                      |
         v                      v

+----------------+      +----------------+
| Findings       |      | Attachments    |
+----------------+      +----------------+

Why a Relational Model?

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.


Why JSON Duality Views?

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

Mapping to Business Documents

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.


Design Objectives

The data model was designed to achieve:

  • Normalized storage
  • Document-oriented access
  • AI readiness
  • Simplified APIs
  • Real-world manufacturing applicability

Related Pages

Clone this wiki locally