{
  "entityType": "purchase-order",
  "title": "Purchase Order Details",
  "columns": 12,
  "styles": {
    "containerClass": "entity-container entity-p-4",
    "titleClass": "entity-title entity-text-primary entity-mb-4",
    "sectionClass": "entity-section entity-card entity-mb-4",
    "rowClass": "entity-row entity-gap-3",
    "fieldClass": "field-container"
  },
  "sections": [
    {
      "id": "header",
      "title": "PO Information",
      "columns": 12,
      "styles": {
        "containerClass": "entity-section entity-card",
        "titleClass": "entity-section-title"
      },
      "rows": [
        {
          "fields": [
            {
              "id": "poNumber",
              "label": "PO Number",
              "dataKey": "poNumber",
              "type": "text",
              "span": 3,
              "styles": {
                "valueClass": "entity-fs-5 entity-fw-bold entity-text-primary",
                "containerClass": "field-container"
              }
            },
            {
              "id": "status",
              "label": "Status",
              "dataKey": "status",
              "type": "badge",
              "span": 3,
              "badgeMap": {
                "draft": {
                  "class": "field-badge badge-secondary",
                  "text": "Draft"
                },
                "pending": {
                  "class": "field-badge badge-warning",
                  "text": "Pending"
                },
                "approved": {
                  "class": "field-badge badge-success",
                  "text": "Approved"
                },
                "processing": {
                  "class": "field-badge badge-info",
                  "text": "Processing"
                },
                "shipped": {
                  "class": "field-badge badge-primary",
                  "text": "Shipped"
                },
                "delivered": {
                  "class": "field-badge badge-success",
                  "text": "Delivered"
                },
                "cancelled": {
                  "class": "field-badge badge-danger",
                  "text": "Cancelled"
                }
              }
            },
            {
              "id": "date",
              "label": "PO Date",
              "dataKey": "date",
              "type": "date",
              "span": 3
            },
            {
              "id": "expectedDelivery",
              "label": "Expected Delivery",
              "dataKey": "expectedDelivery",
              "type": "date",
              "span": 3
            }
          ]
        }
      ]
    },
    {
      "id": "vendor",
      "title": "Vendor Information",
      "columns": 6,
      "styles": {
        "containerClass": "entity-section entity-card",
        "titleClass": "entity-section-title"
      },
      "rows": [
        {
          "fields": [
            {
              "id": "vendorName",
              "label": "Vendor Name",
              "dataKey": "vendor.name",
              "type": "text",
              "span": 12,
              "styles": {
                "valueClass": "entity-fs-5 entity-fw-bold",
                "containerClass": "field-container entity-mb-3"
              }
            }
          ]
        },
        {
          "fields": [
            {
              "id": "vendorContact",
              "label": "Contact Person",
              "dataKey": "vendor.contact",
              "type": "text",
              "span": 6
            },
            {
              "id": "vendorPhone",
              "label": "Phone",
              "dataKey": "vendor.phone",
              "type": "phone",
              "span": 6
            }
          ]
        },
        {
          "fields": [
            {
              "id": "vendorEmail",
              "label": "Email",
              "dataKey": "vendor.email",
              "type": "email",
              "span": 12
            }
          ]
        }
      ]
    },
    {
      "id": "shipping",
      "title": "Shipping Details",
      "columns": 6,
      "styles": {
        "containerClass": "entity-section entity-card",
        "titleClass": "entity-section-title"
      },
      "rows": [
        {
          "fields": [
            {
              "id": "shippingAddress",
              "label": "Shipping Address",
              "dataKey": "shippingAddress",
              "type": "object",
              "span": 12,
              "styles": {
                "containerClass": "field-container entity-bg-light entity-p-3 entity-rounded",
                "valueClass": "entity-mb-0"
              }
            }
          ]
        },
        {
          "fields": [
            {
              "id": "shippingCost",
              "label": "Shipping Cost",
              "dataKey": "shipping",
              "type": "currency",
              "span": 12
            }
          ]
        }
      ]
    },
    {
      "id": "items",
      "title": "Order Items",
      "columns": 12,
      "styles": {
        "containerClass": "entity-section entity-card",
        "titleClass": "entity-section-title"
      },
      "rows": [
        {
          "fields": [
            {
              "id": "itemsList",
              "label": "",
              "dataKey": "items",
              "type": "array",
              "span": 12,
              "styles": {
                "containerClass": "entity-table-responsive",
                "valueClass": ""
              }
            }
          ]
        }
      ]
    },
    {
      "id": "financial-summary",
      "title": "Financial Summary",
      "columns": 6,
      "styles": {
        "containerClass": "entity-section entity-card entity-bg-light",
        "titleClass": "entity-section-title entity-text-dark"
      },
      "rows": [
        {
          "fields": [
            {
              "id": "subtotal",
              "label": "Subtotal",
              "dataKey": "subtotal",
              "type": "currency",
              "span": 12,
              "styles": {
                "containerClass": "field-container entity-border-bottom entity-pb-2"
              }
            }
          ]
        },
        {
          "fields": [
            {
              "id": "taxAmount",
              "label": "Tax Amount",
              "dataKey": "tax",
              "type": "currency",
              "span": 6,
              "styles": {
                "containerClass": "field-container entity-border-bottom entity-pb-2"
              }
            },
            {
              "id": "taxRate",
              "label": "Tax Rate",
              "dataKey": "taxRate",
              "type": "percentage",
              "span": 6,
              "styles": {
                "containerClass": "field-container entity-border-bottom entity-pb-2"
              }
            }
          ]
        },
        {
          "fields": [
            {
              "id": "shippingDisplay",
              "label": "Shipping",
              "dataKey": "shipping",
              "type": "currency",
              "span": 12,
              "styles": {
                "containerClass": "field-container entity-border-bottom entity-pb-2"
              }
            }
          ]
        },
        {
          "fields": [
            {
              "id": "total",
              "label": "Total Amount",
              "dataKey": "total",
              "type": "currency",
              "span": 12,
              "styles": {
                "valueClass": "entity-fs-4 entity-fw-bold entity-text-success",
                "containerClass": "field-container entity-pt-2 entity-border-top"
              }
            }
          ]
        }
      ]
    },
    {
      "id": "approval",
      "title": "Approval Information",
      "columns": 6,
      "styles": {
        "containerClass": "entity-section entity-card entity-bg-success entity-bg-opacity-10",
        "titleClass": "entity-section-title"
      },
      "rows": [
        {
          "fields": [
            {
              "id": "approvedBy",
              "label": "Approved By",
              "dataKey": "approvedBy",
              "type": "text",
              "span": 12,
              "styles": {
                "valueClass": "entity-fw-bold",
                "containerClass": "field-container entity-mb-3"
              }
            }
          ]
        },
        {
          "fields": [
            {
              "id": "approvalDate",
              "label": "Approval Date",
              "dataKey": "approvalDate",
              "type": "date",
              "span": 12
            }
          ]
        },
        {
          "fields": [
            {
              "id": "terms",
              "label": "Payment Terms",
              "dataKey": "terms",
              "type": "text",
              "span": 12
            }
          ]
        }
      ]
    },
    {
      "id": "notes",
      "title": "Additional Information",
      "columns": 12,
      "styles": {
        "containerClass": "entity-section entity-card",
        "titleClass": "entity-section-title"
      },
      "rows": [
        {
          "fields": [
            {
              "id": "notes",
              "label": "Special Instructions",
              "dataKey": "notes",
              "type": "textarea",
              "span": 12,
              "styles": {
                "containerClass": "field-container entity-bg-light entity-p-3 entity-rounded",
                "valueClass": "entity-fst-italic entity-mb-0"
              }
            }
          ]
        },
        {
          "fields": [
            {
              "id": "priority",
              "label": "Priority",
              "dataKey": "priority",
              "type": "badge",
              "span": 3,
              "badgeMap": {
                "high": {
                  "class": "field-badge badge-danger",
                  "text": "High Priority"
                },
                "medium": {
                  "class": "field-badge badge-warning",
                  "text": "Medium Priority"
                },
                "low": {
                  "class": "field-badge badge-success",
                  "text": "Low Priority"
                },
                "default": {
                  "class": "field-badge badge-secondary",
                  "text": "Standard"
                }
              }
            },
            {
              "id": "deliveryMethod",
              "label": "Delivery Method",
              "dataKey": "deliveryMethod",
              "type": "text",
              "span": 3
            },
            {
              "id": "paymentMethod",
              "label": "Payment Method",
              "dataKey": "paymentMethod",
              "type": "text",
              "span": 3
            },
            {
              "id": "createdBy",
              "label": "Created By",
              "dataKey": "createdBy",
              "type": "text",
              "span": 3
            }
          ]
        }
      ]
    },
    {
      "id": "attachments",
      "title": "Documents & Attachments",
      "columns": 12,
      "styles": {
        "containerClass": "entity-section entity-card",
        "titleClass": "entity-section-title"
      },
      "rows": [
        {
          "fields": [
            {
              "id": "attachments",
              "label": "Attached Files",
              "dataKey": "attachments",
              "type": "array",
              "span": 12,
              "badgeMap": {
                "pdf": {
                  "class": "field-badge badge-danger",
                  "text": "PDF"
                },
                "doc": {
                  "class": "field-badge badge-primary",
                  "text": "DOC"
                },
                "excel": {
                  "class": "field-badge badge-success",
                  "text": "Excel"
                },
                "image": {
                  "class": "field-badge badge-info",
                  "text": "Image"
                }
              }
            }
          ]
        }
      ]
    }
  ]
}