{
  "name": "feishu_unified_reimbursement_template_draft",
  "version": "0.4.0",
  "updated_at": "2026-06-08",
  "status": "test_template_updated_invoice_binary_no_payment_plan",
  "scope": "new unified reimbursement approval template; old templates remain unchanged",
  "recommended_template_names": {
    "test": "公司统一报销申请（测试）",
    "production": "公司统一报销申请"
  },
  "design_principles": [
    "User-facing Feishu form should stay short.",
    "Backend and robot derive accounting fields where possible.",
    "Existing company/project-specific reimbursement templates remain unchanged.",
    "Approval approved is not equal to paid; payment status is updated by payment/fund flow."
  ],
  "do_not_modify_existing_templates": true,
  "old_reimbursement_templates_kept_as_legacy": [
    "点绛报销专用",
    "云汉寻真报销专用",
    "万物有灵公共账报销专用",
    "万物有灵相关项目组报销专用"
  ],
  "minimal_first_version_fields": [
    "owner_subject",
    "owner_project",
    "expense_type",
    "expense_date",
    "amount",
    "description",
    "invoice_status",
    "attachments",
    "payee_account_note",
    "line_items_note",
    "remark"
  ],
  "core_required_fields": [
    {
      "key": "owner_subject",
      "label": "公司主体",
      "control": "radioV2",
      "required": true,
      "system_mapping": "owner_subject_id",
      "options": [
        "万物有灵",
        "云汉寻真",
        "点绛",
        "秘色破茧",
        "其他/待确认"
      ]
    },
    {
      "key": "owner_project",
      "label": "归属项目/公共账",
      "control": "radioV2_or_select",
      "required": true,
      "system_mapping": "project_id",
      "resolution_rule": "owner_subject + owner_project",
      "options": [
        "公共经营/公共账",
        "AIGC组",
        "电商业务",
        "国博业务",
        "良渚业务",
        "产品开发/打样",
        "行政/办公",
        "其他/待确认"
      ]
    },
    {
      "key": "expense_type",
      "label": "报销类型",
      "control": "radioV2",
      "required": true,
      "system_mapping": "items[].expense_category_id",
      "options": [
        "日常采买",
        "差旅费",
        "住宿费",
        "交通费",
        "招待费",
        "团建费",
        "通讯费",
        "软件/会员/订阅",
        "办公设备",
        "样品/打样/产品开发",
        "服务费",
        "其他"
      ]
    },
    {
      "key": "expense_date",
      "label": "发生日期",
      "control": "date",
      "required": true,
      "system_mapping": "items[].expense_date",
      "known_create_api_format": "YYYY-MM-DDT00:00:00+08:00"
    },
    {
      "key": "amount",
      "label": "报销金额",
      "control": "amount_or_number",
      "required": true,
      "system_mapping": "total_amount"
    },
    {
      "key": "description",
      "label": "报销内容",
      "control": "textarea",
      "required": true,
      "system_mapping": "items[].description",
      "note": "Primary content field: actual purchase/use/purpose. Do not replace with remark."
    },
    {
      "key": "invoice_status",
      "label": "发票状态",
      "control": "radioV2",
      "required": true,
      "system_mapping": "items[].invoice_status",
      "options": [
        "有票",
        "无票"
      ],
      "note": "Binary source flag only. 有票 -> 财务审批后可打款；无票 -> 审批后暂不打款，月度按无票且未打款来源记录二次计算个人账。"
    },
    {
      "key": "attachments",
      "label": "附件",
      "control": "attachmentV2",
      "required": true,
      "system_mapping": "attachments[]",
      "examples": [
        "发票",
        "订单截图",
        "支付截图",
        "聊天记录",
        "合同/凭证"
      ],
      "create_api_note": "Upload approval attachment first, then bind returned file code array."
    }
  ],
  "conditional_or_optional_fields": [
    {
      "key": "payee_account_note",
      "label": "收款账户说明",
      "control": "input_or_textarea",
      "required": "conditional_when_payment_needed",
      "system_mapping": "payee_account_note",
      "security_note": "Avoid exposing full bank account in general dashboard; redact where possible."
    },
    {
      "key": "line_items_note",
      "label": "明细说明",
      "control": "textarea_or_fieldList_later",
      "required": false,
      "system_mapping": "items[]",
      "note": "First version may use textarea; robot/backend can split to reimbursement_item later."
    },
    {
      "key": "external_refs",
      "label": "订单号/交易号",
      "control": "input",
      "required": false,
      "system_mapping": "external_refs[]"
    },
    {
      "key": "remark",
      "label": "备注",
      "control": "textarea",
      "required": false,
      "system_mapping": "remark",
      "note": "Whole-order remark only."
    }
  ],
  "deferred_or_backend_derived_fields": [
    {
      "key": "applicant_subject_id",
      "source": "submitter by default; optional override only for proxy submission"
    },
    {
      "key": "payee_subject_id",
      "source": "applicant by default; optional override only when payee differs"
    },
    {
      "key": "invoice_no",
      "source": "OCR/robot extraction from attachment or later manual supplement"
    },
    {
      "key": "invoice_amount_total",
      "source": "OCR/robot extraction from invoice attachment"
    },
    {
      "key": "risk_flags",
      "source": "backend validation: no invoice, large amount, owner/project uncertain, missing attachment, etc."
    },
    {
      "key": "payment_status",
      "source": "fund transaction / reimbursement payment flow, not approval form"
    }
  ],
  "test_flow": {
    "approver": {
      "name": "钱丽云",
      "id_record": "[REDACTED_IN_DOCS]"
    },
    "handler": {
      "name": "钱丽云",
      "id_record": "[REDACTED_IN_DOCS]"
    },
    "cc": []
  },
  "backend_mapping_rules": [
    "description maps to reimbursement_item.description and is the primary reimbursement content field.",
    "remark is whole-order remark and must not replace item description.",
    "owner_subject + owner_project resolve subject/project; do not infer department from project.",
    "approval approved does not mean paid; payment status is updated by fund transaction or reimbursement payment flow.",
    "attachments should enter source-file/audit chain and be visible from dashboard source modal."
  ],
  "next_steps": [
    "Start one test approval instance from the updated test template.",
    "Verify radioV2 option keys for 有票/无票, amount/date formats, and attachmentV2 binding.",
    "Wire backend callback/payment logic: 有票 approval -> payable/payment flow; 无票 approval -> approved_unpaid source for monthly personal-ledger calculation."
  ],
  "created_test_template": {
    "template_name": "公司统一报销申请（测试）",
    "approval_code": "04E7B2B1-DCD7-44E1-84DA-7590CDD3DFE1",
    "approval_id": "7649042051241118901",
    "admin_url": "https://www.feishu.cn/approval/admin/createApproval?id=7649042051241118901&definitionCode=04E7B2B1-DCD7-44E1-84DA-7590CDD3DFE1",
    "created_by": "OpenAPI",
    "verified_status": "ACTIVE",
    "fields_count": 12,
    "old_templates_modified": false,
    "openapi_limitation": "API-created approval definitions cannot be stopped/deleted according to Feishu official docs.",
    "latest_update": "发票状态改为有票/无票；删除付款/处理方式字段。"
  },
  "business_logic": {
    "source_principle": "统一报销入口是唯一来源入口，只记录原始审批来源，不混入个人账处理结果。",
    "invoice_status_options": [
      "有票",
      "无票"
    ],
    "with_invoice": "财务审批后进入打款流程；打款完成后由付款/核销流程更新已打款状态。",
    "without_invoice": "财务审批同意后暂不打款；月度根据无票且未打款来源记录自动核算个人账。",
    "personal_ledger": "个人账是二次计算结果，不是飞书入口字段。"
  }
}