{
    "table_name": "customers",
    "display_name": "得意先マスタ",
    "description": "得意先の基本情報（税務設定含む）",
    "type": "single_table",
    "supported_modes": [
        "insert",
        "update",
        "delete"
    ],
    "key_fields": [
        "customer_code"
    ],
    "required_fields": [
        "customer_account_type",
        "customer_type",
        "customer_code",
        "is_active"
    ],
    "unique_fields": {
        "customer_code": {
            "table": "customers",
            "column": "customer_code",
            "message": "得意先コードが重複しています"
        }
    },
    "field_labels": {
        "id": "ID",
        "customer_account_type": "得意先口座区分",
        "customer_type": "得意先区分",
        "customer_code": "得意先コード",
        "customer_name": "得意先名",
        "customer_kana": "得意先名カナ",
        "customer_abbr": "得意先略称",
        "customer_index": "得意先インデックス",
        "postal_code": "郵便番号",
        "prefecture": "都道府県",
        "address1": "住所1",
        "address2": "住所2",
        "address3": "住所3",
        "tel": "電話番号",
        "fax": "FAX番号",
        "visit_tel": "営業訪問先 TEL",
        "visit_fax": "営業訪問先 FAX",
        "visit_postal_code": "営業訪問先 郵便番号",
        "visit_prefecture": "営業訪問先 都道府県",
        "visit_address1": "営業訪問先 住所１",
        "visit_address2": "営業訪問先 住所２",
        "visit_address3": "営業訪問先 住所３",
        "president_name": "代表者名",
        "contact_person": "担当者名",
        "lead_time_days": "リードタイム（日）",
        "closing_day": "締日",
        "tax_type": "税区分",
        "bank_location_flag": "銀行所在地フラグ",
        "currency_id": "通貨ID",
        "rounding_type_amount": "金額端数処理区分",
        "rounding_type_tax": "税端数処理区分",
        "payment_cycle": "支払サイクル",
        "payment_day": "支払日",
        "payment_method": "支払方法",
        "invoice_number": "請求書番号",
        "customer_category_id": "得意先カテゴリID",
        "customer_group_id": "得意先グループID",
        "individual_total_credit_limit": "個別総与信限度額",
        "individual_regular_credit_limit": "個別通常与信限度額",
        "shipping_type": "出荷区分",
        "output_amount_flag": "金額出力フラグ",
        "issue_jan_code_flag": "JANコード発行フラグ",
        "billing_closing_target_flag": "請求締対象フラグ",
        "output_billing_invoice_flag": "請求書出力フラグ",
        "slip_attachment_type": "伝票添付区分",
        "payment_statement_type": "支払明細書区分",
        "specified_slip_name": "指定伝票名",
        "business_type_id": "業種ID",
        "block_id": "ブロックID",
        "area_id": "エリアID",
        "denomination_id": "単位ID",
        "price_rank_id": "価格ランクID",
        "invoice_customer_id": "請求先得意先ID",
        "payment_receipt_customer_id": "入金先得意先ID",
        "bank_account_holder_name": "銀行口座名義人",
        "accounts_receivable_account_id": "売掛金勘定ID",
        "supplier_id": "仕入先ID",
        "payment_type": "支払方法",
        "net_term_days": "ネット日数",
        "rebate_rate": "リベート率",
        "note_term_days": "手形期間（日）",
        "customer_info": "得意先情報",
        "teikoku_info": "帝国情報",
        "gt_rating": "GTレーティング",
        "has_contract": "契約有無",
        "gift_receipt_flag": "ギフトレシートフラグ",
        "stock_visibility_flag": "在庫表示フラグ",
        "account_opened_at": "口座開設日",
        "budget_6months": "6ヶ月予算",
        "budget_18months": "18ヶ月予算",
        "is_active": "有効フラグ",
        "note": "備考",
        "created_by": "作成者",
        "updated_by": "更新者",
        "created_at": "作成日時",
        "updated_at": "更新日時",
        "deleted_at": "削除日時"
    },
    "field_types": {
        "id": "bigint",
        "customer_account_type": "int",
        "customer_type": "int",
        "customer_code": "varchar",
        "customer_name": "varchar",
        "customer_kana": "varchar",
        "customer_abbr": "varchar",
        "customer_index": "varchar",
        "postal_code": "varchar",
        "prefecture": "varchar",
        "address1": "varchar",
        "address2": "varchar",
        "address3": "varchar",
        "tel": "varchar",
        "fax": "varchar",
        "visit_tel": "varchar",
        "visit_fax": "varchar",
        "visit_postal_code": "varchar",
        "visit_prefecture": "varchar",
        "visit_address1": "varchar",
        "visit_address2": "varchar",
        "visit_address3": "varchar",
        "president_name": "varchar",
        "contact_person": "varchar",
        "lead_time_days": "int",
        "closing_day": "int",
        "tax_type": "int",
        "bank_location_flag": "tinyint",
        "currency_id": "bigint",
        "rounding_type_amount": "int",
        "rounding_type_tax": "int",
        "payment_cycle": "int",
        "payment_day": "int",
        "payment_method": "int",
        "invoice_number": "varchar",
        "customer_category_id": "bigint",
        "customer_group_id": "bigint",
        "individual_total_credit_limit": "decimal",
        "individual_regular_credit_limit": "decimal",
        "shipping_type": "int",
        "output_amount_flag": "tinyint",
        "issue_jan_code_flag": "tinyint",
        "billing_closing_target_flag": "tinyint",
        "output_billing_invoice_flag": "tinyint",
        "slip_attachment_type": "int",
        "payment_statement_type": "int",
        "specified_slip_name": "varchar",
        "business_type_id": "bigint",
        "block_id": "bigint",
        "area_id": "bigint",
        "denomination_id": "bigint",
        "price_rank_id": "bigint",
        "invoice_customer_id": "bigint",
        "payment_receipt_customer_id": "bigint",
        "bank_account_holder_name": "varchar",
        "accounts_receivable_account_id": "bigint",
        "supplier_id": "bigint",
        "payment_type": "int",
        "net_term_days": "int",
        "rebate_rate": "decimal",
        "note_term_days": "int",
        "customer_info": "text",
        "teikoku_info": "text",
        "gt_rating": "varchar",
        "has_contract": "tinyint",
        "gift_receipt_flag": "tinyint",
        "stock_visibility_flag": "tinyint",
        "account_opened_at": "date",
        "budget_6months": "decimal",
        "budget_18months": "decimal",
        "is_active": "tinyint",
        "note": "text",
        "created_by": "bigint",
        "updated_by": "bigint",
        "created_at": "timestamp",
        "updated_at": "timestamp",
        "deleted_at": "timestamp"
    },
    "enum_values": {
        "customer_account_type": {
            "1": "通常",
            "2": "上様(諸口)"
        },
        "customer_type": {
            "1": "法人",
            "2": "個人"
        },
        "tax_type": {
            "1": "課税",
            "2": "非課税(海外)"
        },
        "bank_location_flag": {
            "1": "国内",
            "2": "海外"
        },
        "rounding_type_amount": {
            "1": "四捨五入",
            "2": "切捨て",
            "3": "切上げ"
        },
        "rounding_type_tax": {
            "1": "四捨五入",
            "2": "切捨て",
            "3": "切上げ"
        },
        "payment_cycle": {
            "0": "当月",
            "1": "翌月",
            "2": "翌々月",
            "3": "翌々翌月"
        },
        "payment_method": {
            "1": "振込",
            "2": "代引",
            "3": "集金",
            "4": "持参"
        },
        "shipping_type": {
            "1": "発送",
            "2": "直送"
        },
        "output_amount_flag": {
            "1": "出力する",
            "2": "出力しない"
        },
        "issue_jan_code_flag": {
            "1": "出力する",
            "2": "出力しない"
        },
        "issue_address_label_flag": {
            "1": "出力する",
            "2": "出力しない"
        },
        "billing_closing_target_flag": {
            "1": "締め対象",
            "2": "締め対象外"
        },
        "output_billing_invoice_flag": {
            "1": "出力する",
            "2": "出力しない"
        },
        "slip_attachment_type": {
            "1": "添付なし",
            "2": "添付あり"
        },
        "payment_statement_type": {
            "1": "明細書なし",
            "2": "明細書あり"
        },
        "payment_type": {
            "1": "振込",
            "2": "現金",
            "3": "手形",
            "4": "電子債権",
            "5": "ファクタリング",
            "6": "債権信託",
            "7": "現金手形",
            "8": "COD",
            "9": "ネット"
        },
        "gift_receipt_flag": {
            "1": "受け取らない",
            "2": "受け取る"
        },
        "stock_visibility_flag": {
            "1": "公開しない",
            "2": "公開する"
        },
        "is_active": {
            "1": "有効",
            "9": "無効"
        }
    },
    "validation_rules": {
        "customer_code": {
            "required": true,
            "max_length": 50,
            "unique": true
        },
        "customer_name": {
            "required": false,
            "max_length": 255
        },
        "postal_code": {
            "pattern": "^\\d{3}-?\\d{4}$",
            "message": "郵便番号の形式が正しくありません（例: 123-4567）"
        },
        "customer_type": {
            "enum": [
                1,
                2
            ]
        },
        "tax_type": {
            "enum": [
                1,
                2
            ]
        },
        "is_active": {
            "enum": [
                1,
                9
            ]
        }
    },
    "code_padding": {
        "customer_code": 6
    }
}