{
  "version": "2.0",
  "screenResolution": {
    "width": 1400,
    "height": 900,
    "name": "수주등록 모달",
    "category": "modal"
  },
  "components": [
    {
      "id": "section-options",
      "url": "@/lib/registry/components/v2-section-card",
      "position": { "x": 20, "y": 20, "z": 1 },
      "size": { "width": 1360, "height": 80 },
      "overrides": {
        "componentConfig": {
          "title": "",
          "showHeader": false,
          "padding": "md",
          "borderStyle": "solid"
        }
      },
      "displayOrder": 0
    },
    {
      "id": "select-input-method",
      "url": "@/lib/registry/components/v2-select",
      "position": { "x": 40, "y": 35, "z": 2 },
      "size": { "width": 300, "height": 40 },
      "overrides": {
        "label": "입력 방식",
        "columnName": "input_method",
        "mode": "dropdown",
        "source": "static",
        "options": [
          { "value": "customer_first", "label": "거래처 우선" },
          { "value": "item_first", "label": "품목 우선" }
        ],
        "placeholder": "입력 방식 선택"
      },
      "displayOrder": 1
    },
    {
      "id": "select-sales-type",
      "url": "@/lib/registry/components/v2-select",
      "position": { "x": 360, "y": 35, "z": 2 },
      "size": { "width": 300, "height": 40 },
      "overrides": {
        "label": "판매 유형",
        "columnName": "sales_type",
        "mode": "dropdown",
        "source": "static",
        "options": [
          { "value": "domestic", "label": "국내 판매" },
          { "value": "overseas", "label": "해외 판매" }
        ],
        "placeholder": "판매 유형 선택"
      },
      "displayOrder": 2
    },
    {
      "id": "select-price-method",
      "url": "@/lib/registry/components/v2-select",
      "position": { "x": 680, "y": 35, "z": 2 },
      "size": { "width": 250, "height": 40 },
      "overrides": {
        "label": "단가 방식",
        "columnName": "price_method",
        "mode": "dropdown",
        "source": "static",
        "options": [
          { "value": "standard", "label": "기준 단가" },
          { "value": "contract", "label": "계약 단가" },
          { "value": "custom", "label": "개별 입력" }
        ],
        "placeholder": "단가 방식"
      },
      "displayOrder": 3
    },
    {
      "id": "checkbox-price-edit",
      "url": "@/lib/registry/components/v2-select",
      "position": { "x": 950, "y": 35, "z": 2 },
      "size": { "width": 150, "height": 40 },
      "overrides": {
        "label": "단가 수정 허용",
        "columnName": "allow_price_edit",
        "mode": "check",
        "source": "static",
        "options": [{ "value": "Y", "label": "허용" }]
      },
      "displayOrder": 4
    },

    {
      "id": "section-customer-info",
      "url": "@/lib/registry/components/v2-section-card",
      "position": { "x": 20, "y": 110, "z": 1 },
      "size": { "width": 1360, "height": 120 },
      "overrides": {
        "componentConfig": {
          "title": "거래처 정보",
          "showHeader": true,
          "padding": "md",
          "borderStyle": "solid"
        },
        "conditionalConfig": {
          "enabled": true,
          "field": "input_method",
          "operator": "=",
          "value": "customer_first",
          "action": "show"
        }
      },
      "displayOrder": 5
    },
    {
      "id": "select-customer",
      "url": "@/lib/registry/components/v2-select",
      "position": { "x": 40, "y": 155, "z": 3 },
      "size": { "width": 320, "height": 40 },
      "overrides": {
        "label": "거래처 *",
        "columnName": "partner_id",
        "mode": "dropdown",
        "source": "entity",
        "entityTable": "customer_mng",
        "entityValueColumn": "customer_code",
        "entityLabelColumn": "customer_name",
        "searchable": true,
        "placeholder": "거래처명 입력하여 검색",
        "required": true,
        "conditionalConfig": {
          "enabled": true,
          "field": "input_method",
          "operator": "=",
          "value": "customer_first",
          "action": "show"
        }
      },
      "displayOrder": 6
    },
    {
      "id": "input-manager",
      "url": "@/lib/registry/components/v2-input",
      "position": { "x": 380, "y": 155, "z": 3 },
      "size": { "width": 240, "height": 40 },
      "overrides": {
        "label": "담당자",
        "columnName": "manager_name",
        "placeholder": "담당자",
        "conditionalConfig": {
          "enabled": true,
          "field": "input_method",
          "operator": "=",
          "value": "customer_first",
          "action": "show"
        }
      },
      "displayOrder": 7
    },
    {
      "id": "input-delivery-partner",
      "url": "@/lib/registry/components/v2-input",
      "position": { "x": 640, "y": 155, "z": 3 },
      "size": { "width": 240, "height": 40 },
      "overrides": {
        "label": "납품처",
        "columnName": "delivery_partner_id",
        "placeholder": "납품처",
        "conditionalConfig": {
          "enabled": true,
          "field": "input_method",
          "operator": "=",
          "value": "customer_first",
          "action": "show"
        }
      },
      "displayOrder": 8
    },
    {
      "id": "input-delivery-address",
      "url": "@/lib/registry/components/v2-input",
      "position": { "x": 900, "y": 155, "z": 3 },
      "size": { "width": 460, "height": 40 },
      "overrides": {
        "label": "납품장소",
        "columnName": "delivery_address",
        "placeholder": "납품장소",
        "conditionalConfig": {
          "enabled": true,
          "field": "input_method",
          "operator": "=",
          "value": "customer_first",
          "action": "show"
        }
      },
      "displayOrder": 9
    },

    {
      "id": "section-item-first",
      "url": "@/lib/registry/components/v2-section-card",
      "position": { "x": 20, "y": 110, "z": 1 },
      "size": { "width": 1360, "height": 200 },
      "overrides": {
        "componentConfig": {
          "title": "품목 및 거래처별 수주",
          "showHeader": true,
          "padding": "md",
          "borderStyle": "solid"
        },
        "conditionalConfig": {
          "enabled": true,
          "field": "input_method",
          "operator": "=",
          "value": "item_first",
          "action": "show"
        }
      },
      "displayOrder": 10
    },

    {
      "id": "section-items",
      "url": "@/lib/registry/components/v2-section-card",
      "position": { "x": 20, "y": 240, "z": 1 },
      "size": { "width": 1360, "height": 280 },
      "overrides": {
        "componentConfig": {
          "title": "추가된 품목",
          "showHeader": true,
          "padding": "md",
          "borderStyle": "solid"
        },
        "conditionalConfig": {
          "enabled": true,
          "field": "input_method",
          "operator": "=",
          "value": "customer_first",
          "action": "show"
        }
      },
      "displayOrder": 11
    },
    {
      "id": "btn-item-search",
      "url": "@/lib/registry/components/v2-button-primary",
      "position": { "x": 1140, "y": 245, "z": 5 },
      "size": { "width": 100, "height": 36 },
      "overrides": {
        "label": "품목 검색",
        "action": {
          "type": "openModal",
          "modalType": "itemSelection"
        },
        "conditionalConfig": {
          "enabled": true,
          "field": "input_method",
          "operator": "=",
          "value": "customer_first",
          "action": "show"
        }
      },
      "displayOrder": 12
    },
    {
      "id": "btn-shipping-plan",
      "url": "@/lib/registry/components/v2-button-primary",
      "position": { "x": 1250, "y": 245, "z": 5 },
      "size": { "width": 100, "height": 36 },
      "overrides": {
        "label": "출하계획",
        "webTypeConfig": {
          "variant": "destructive"
        },
        "conditionalConfig": {
          "enabled": true,
          "field": "input_method",
          "operator": "=",
          "value": "customer_first",
          "action": "show"
        }
      },
      "displayOrder": 13
    },
    {
      "id": "repeater-items",
      "url": "@/lib/registry/components/v2-repeater",
      "position": { "x": 40, "y": 290, "z": 3 },
      "size": { "width": 1320, "height": 200 },
      "overrides": {
        "renderMode": "modal",
        "dataSource": {
          "tableName": "sales_order_detail",
          "foreignKey": "order_no",
          "referenceKey": "order_no"
        },
        "columns": [
          { "field": "part_code", "header": "품번", "width": 100 },
          { "field": "part_name", "header": "품명", "width": 150 },
          { "field": "spec", "header": "규격", "width": 100 },
          { "field": "unit", "header": "단위", "width": 80 },
          { "field": "qty", "header": "수량", "width": 100, "editable": true },
          {
            "field": "unit_price",
            "header": "단가",
            "width": 100,
            "editable": true
          },
          { "field": "amount", "header": "금액", "width": 100 },
          {
            "field": "due_date",
            "header": "납기일",
            "width": 120,
            "editable": true
          }
        ],
        "modal": {
          "sourceTable": "item_info",
          "sourceColumns": [
            "part_code",
            "part_name",
            "spec",
            "material",
            "unit_price"
          ],
          "filterCondition": {}
        },
        "features": {
          "showAddButton": false,
          "showDeleteButton": true,
          "inlineEdit": true
        },
        "conditionalConfig": {
          "enabled": true,
          "field": "input_method",
          "operator": "=",
          "value": "customer_first",
          "action": "show"
        }
      },
      "displayOrder": 14
    },

    {
      "id": "section-trade-info",
      "url": "@/lib/registry/components/v2-section-card",
      "position": { "x": 20, "y": 530, "z": 1 },
      "size": { "width": 1360, "height": 150 },
      "overrides": {
        "componentConfig": {
          "title": "무역 정보",
          "showHeader": true,
          "padding": "md",
          "borderStyle": "solid"
        },
        "conditionalConfig": {
          "enabled": true,
          "field": "sales_type",
          "operator": "=",
          "value": "overseas",
          "action": "show"
        }
      },
      "displayOrder": 15
    },
    {
      "id": "select-incoterms",
      "url": "@/lib/registry/components/v2-select",
      "position": { "x": 40, "y": 575, "z": 3 },
      "size": { "width": 200, "height": 40 },
      "overrides": {
        "label": "인코텀즈",
        "columnName": "incoterms",
        "mode": "dropdown",
        "source": "static",
        "options": [
          { "value": "FOB", "label": "FOB" },
          { "value": "CIF", "label": "CIF" },
          { "value": "EXW", "label": "EXW" },
          { "value": "DDP", "label": "DDP" }
        ],
        "placeholder": "선택",
        "conditionalConfig": {
          "enabled": true,
          "field": "sales_type",
          "operator": "=",
          "value": "overseas",
          "action": "show"
        }
      },
      "displayOrder": 16
    },
    {
      "id": "select-payment-term",
      "url": "@/lib/registry/components/v2-select",
      "position": { "x": 260, "y": 575, "z": 3 },
      "size": { "width": 200, "height": 40 },
      "overrides": {
        "label": "결제 조건",
        "columnName": "payment_term",
        "mode": "dropdown",
        "source": "static",
        "options": [
          { "value": "TT", "label": "T/T" },
          { "value": "LC", "label": "L/C" },
          { "value": "DA", "label": "D/A" },
          { "value": "DP", "label": "D/P" }
        ],
        "placeholder": "선택",
        "conditionalConfig": {
          "enabled": true,
          "field": "sales_type",
          "operator": "=",
          "value": "overseas",
          "action": "show"
        }
      },
      "displayOrder": 17
    },
    {
      "id": "select-currency",
      "url": "@/lib/registry/components/v2-select",
      "position": { "x": 480, "y": 575, "z": 3 },
      "size": { "width": 200, "height": 40 },
      "overrides": {
        "label": "통화",
        "columnName": "currency",
        "mode": "dropdown",
        "source": "static",
        "options": [
          { "value": "KRW", "label": "KRW (원)" },
          { "value": "USD", "label": "USD (달러)" },
          { "value": "EUR", "label": "EUR (유로)" },
          { "value": "JPY", "label": "JPY (엔)" },
          { "value": "CNY", "label": "CNY (위안)" }
        ],
        "conditionalConfig": {
          "enabled": true,
          "field": "sales_type",
          "operator": "=",
          "value": "overseas",
          "action": "show"
        }
      },
      "displayOrder": 18
    },
    {
      "id": "input-port-loading",
      "url": "@/lib/registry/components/v2-input",
      "position": { "x": 40, "y": 625, "z": 3 },
      "size": { "width": 200, "height": 40 },
      "overrides": {
        "label": "선적항",
        "columnName": "port_of_loading",
        "placeholder": "선적항",
        "conditionalConfig": {
          "enabled": true,
          "field": "sales_type",
          "operator": "=",
          "value": "overseas",
          "action": "show"
        }
      },
      "displayOrder": 19
    },
    {
      "id": "input-port-discharge",
      "url": "@/lib/registry/components/v2-input",
      "position": { "x": 260, "y": 625, "z": 3 },
      "size": { "width": 200, "height": 40 },
      "overrides": {
        "label": "도착항",
        "columnName": "port_of_discharge",
        "placeholder": "도착항",
        "conditionalConfig": {
          "enabled": true,
          "field": "sales_type",
          "operator": "=",
          "value": "overseas",
          "action": "show"
        }
      },
      "displayOrder": 20
    },
    {
      "id": "input-hs-code",
      "url": "@/lib/registry/components/v2-input",
      "position": { "x": 480, "y": 625, "z": 3 },
      "size": { "width": 200, "height": 40 },
      "overrides": {
        "label": "HS Code",
        "columnName": "hs_code",
        "placeholder": "HS Code",
        "conditionalConfig": {
          "enabled": true,
          "field": "sales_type",
          "operator": "=",
          "value": "overseas",
          "action": "show"
        }
      },
      "displayOrder": 21
    },

    {
      "id": "section-additional",
      "url": "@/lib/registry/components/v2-section-card",
      "position": { "x": 20, "y": 690, "z": 1 },
      "size": { "width": 1360, "height": 130 },
      "overrides": {
        "componentConfig": {
          "title": "추가 정보",
          "showHeader": true,
          "padding": "md",
          "borderStyle": "solid"
        }
      },
      "displayOrder": 22
    },
    {
      "id": "input-memo",
      "url": "@/lib/registry/components/v2-input",
      "position": { "x": 40, "y": 735, "z": 3 },
      "size": { "width": 1320, "height": 70 },
      "overrides": {
        "label": "메모",
        "columnName": "memo",
        "type": "textarea",
        "placeholder": "메모를 입력하세요"
      },
      "displayOrder": 23
    },

    {
      "id": "btn-cancel",
      "url": "@/lib/registry/components/v2-button-primary",
      "position": { "x": 1180, "y": 840, "z": 5 },
      "size": { "width": 90, "height": 40 },
      "overrides": {
        "label": "취소",
        "webTypeConfig": {
          "variant": "outline"
        },
        "action": {
          "type": "close"
        }
      },
      "displayOrder": 24
    },
    {
      "id": "btn-save",
      "url": "@/lib/registry/components/v2-button-primary",
      "position": { "x": 1280, "y": 840, "z": 5 },
      "size": { "width": 90, "height": 40 },
      "overrides": {
        "label": "저장",
        "action": {
          "type": "save"
        }
      },
      "displayOrder": 25
    }
  ],
  "gridSettings": {
    "columns": 12,
    "gap": 16,
    "padding": 20,
    "snapToGrid": true,
    "showGrid": false
  }
}
