{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://llmatica.dev/schemas/1778124586772-pdf.entities.json",
  "title": "ASN Workflow",
  "type": "object",
  "x-run-id": "1778124586772-pdf",
  "x-spec-version": "0.2.0",
  "$defs": {
    "AdvancedShipmentNotice": {
      "type": "object",
      "title": "AdvancedShipmentNotice",
      "x-id": "ENT-001",
      "x-table": "advanced_shipment_notice",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "x-primary-key": true,
          "x-unique": true
        },
        "asnId": {
          "type": "string",
          "x-unique": true
        },
        "supplierId": {
          "type": "string",
          "format": "uuid"
        },
        "status": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "poNumber": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "An ASN sent by a supplier announcing inbound goods.",
      "required": [
        "id",
        "asnId",
        "supplierId",
        "status",
        "createdAt",
        "poNumber",
        "updatedAt"
      ],
      "x-relationships": [
        {
          "type": "many-to-one",
          "target": "Supplier",
          "target_id": "ENT-005",
          "foreign_key": "supplierId",
          "cascade": "restrict"
        },
        {
          "type": "many-to-one",
          "target": "PurchaseOrder",
          "target_id": null,
          "foreign_key": "poNumber",
          "cascade": "restrict"
        }
      ]
    },
    "AsnLineItem": {
      "type": "object",
      "title": "AsnLineItem",
      "x-id": "ENT-002",
      "x-table": "asn_line_item",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "x-primary-key": true,
          "x-unique": true
        },
        "poNumber": {
          "type": "string"
        },
        "upcNumber": {
          "type": "string"
        },
        "sku": {
          "type": "string"
        },
        "quantity": {
          "type": "integer"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Line items within an ASN.",
      "required": [
        "id",
        "poNumber",
        "upcNumber",
        "sku",
        "quantity",
        "createdAt",
        "updatedAt"
      ],
      "x-relationships": [
        {
          "type": "many-to-one",
          "target": "AdvancedShipmentNotice",
          "target_id": "ENT-001",
          "foreign_key": "asnId",
          "cascade": "restrict"
        }
      ]
    },
    "DoorMaster": {
      "type": "object",
      "title": "DoorMaster",
      "x-id": "ENT-003",
      "x-table": "door_master",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "x-primary-key": true,
          "x-unique": true
        },
        "doorNumber": {
          "type": "string",
          "x-unique": true
        }
      },
      "description": "Master table for door assignments.",
      "required": [
        "id",
        "doorNumber"
      ]
    },
    "ReceivingConfirmationReport": {
      "type": "object",
      "title": "ReceivingConfirmationReport",
      "x-id": "ENT-004",
      "x-table": "receiving_confirmation_report",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "x-primary-key": true,
          "x-unique": true
        },
        "rcrId": {
          "type": "string",
          "x-unique": true
        },
        "skuDetails": {
          "type": "object"
        },
        "vendorDetails": {
          "type": "object"
        },
        "asnId": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Document generated after ASN closure.",
      "required": [
        "id",
        "rcrId",
        "skuDetails",
        "vendorDetails",
        "asnId",
        "createdAt",
        "updatedAt"
      ],
      "x-relationships": [
        {
          "type": "one-to-one",
          "target": "AdvancedShipmentNotice",
          "target_id": "ENT-001",
          "foreign_key": "asnId",
          "cascade": "restrict"
        }
      ]
    },
    "Supplier": {
      "type": "object",
      "title": "Supplier",
      "x-id": "ENT-005",
      "x-table": "supplier",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "x-primary-key": true,
          "x-unique": true
        },
        "supplierId": {
          "type": "string",
          "format": "uuid",
          "x-unique": true
        },
        "supplierName": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Entity representing suppliers providing goods.",
      "required": [
        "id",
        "supplierId",
        "supplierName",
        "createdAt",
        "updatedAt"
      ]
    },
    "Order": {
      "type": "object",
      "title": "Order",
      "x-id": "ENT-006",
      "x-table": "order",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "x-primary-key": true,
          "x-unique": true
        },
        "poNumber": {
          "type": "string",
          "x-unique": true
        },
        "vendorId": {
          "type": "string",
          "format": "uuid"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Represents a purchase order used in ASN creation.",
      "required": [
        "id",
        "poNumber",
        "vendorId",
        "createdAt",
        "updatedAt"
      ]
    }
  }
}