from __future__ import annotations

PLATFORM_DESTINATION_LOCATION_RULE_CODE = "risk.travel.destination_receipt_location"

PLATFORM_DESTINATION_LOCATION_RULE_FILENAME = "risk.travel.destination_receipt_location.json"

DEMO_EXPENSE_CLAIM_SIGNATURES = {

    (

        "EXP-202605-001",

        "张三",

        "华南客户拜访差旅报销",

        "3280.00",

        "submitted",

    ),

    (

        "EXP-202605-002",

        "李四",

        "客户路演餐费",

        "860.00",

        "approved",

    ),

    (

        "EXP-202605-003",

        "王五",

        "市场活动会务差旅",

        "3280.00",

        "review",

    ),

}

DEMO_RECEIVABLE_SIGNATURES = {

    ("AR-202605-001", "客户A", "50000.00", "partial"),

    ("AR-202605-002", "客户B", "78000.00", "overdue"),

}

DEMO_PAYABLE_SIGNATURES = {

    ("AP-202605-001", "供应商A", "33000.00", "scheduled"),

    ("AP-202605-002", "供应商B", "96000.00", "overdue"),

}

LEGACY_RULE_CODES = (

    "rule.expense.duplicate_expense_check",

    "rule.expense.travel_receipt_requirements",

    "rule.ap.payment_dual_review",

)

ATTACHMENT_RULE_ASSET_CODE = "rule.expense.attachment_submission_requirements"

COMPANY_TRAVEL_RULE_VERSION = "v1.0.0"

COMPANY_COMMUNICATION_RULE_VERSION = "v1.0.0"

COMPANY_PREAPPROVAL_RULE_VERSION = "v1.0.0"

COMPANY_TRAVEL_RULE_SCENARIO_JSON = ("差旅费",)

COMPANY_COMMUNICATION_RULE_SCENARIO_JSON = ("通信费",)

COMPANY_PREAPPROVAL_RULE_SCENARIO_JSON = ("费用申请",)

DIGITAL_EMPLOYEE_SKILL_CATEGORIES = ("积累", "升级", "整理", "评估")

DIGITAL_EMPLOYEE_FINANCE_POLICY_TASK_CODE = "task.hermes.finance_policy_knowledge_organize"

DIGITAL_EMPLOYEE_FINANCE_DASHBOARD_SNAPSHOT_TASK_CODE = "task.hermes.finance_dashboard_snapshot"

DIGITAL_EMPLOYEE_REMINDER_SCAN_TASK_CODE = "task.hermes.digital_employee_reminder_scan"

DIGITAL_EMPLOYEE_FINANCE_REPORT_TASK_CODE = "task.hermes.finance_report_orchestration"

DIGITAL_EMPLOYEE_RISK_GRAPH_SCAN_TASK_CODE = "task.hermes.global_risk_scan"

DIGITAL_EMPLOYEE_PROFILE_SCAN_TASK_CODE = "task.hermes.employee_behavior_profile_scan"

DIGITAL_EMPLOYEE_RULE_DISCOVERY_TASK_CODE = "task.hermes.risk_rule_discovery"

DIGITAL_EMPLOYEE_POLICY_CLAUSE_EXTRACT_TASK_CODE = "task.hermes.finance_policy_clause_extract"

DIGITAL_EMPLOYEE_POLICY_ALIGNMENT_TASK_CODE = "task.hermes.expense_policy_alignment"

DIGITAL_EMPLOYEE_RULE_TEMPLATE_ORGANIZE_TASK_CODE = "task.hermes.risk_rule_template_organize"

DIGITAL_EMPLOYEE_DEPARTMENT_BASELINE_TASK_CODE = (
    "task.hermes.department_expense_baseline_accumulate"
)

DIGITAL_EMPLOYEE_SUPPLIER_PROFILE_TASK_CODE = "task.hermes.supplier_risk_profile_accumulate"

DIGITAL_EMPLOYEE_FALSE_POSITIVE_SAMPLE_TASK_CODE = "task.hermes.false_positive_sample_accumulate"

DIGITAL_EMPLOYEE_FEEDBACK_SAMPLE_TASK_CODE = "task.hermes.risk_feedback_sample_accumulate"

DIGITAL_EMPLOYEE_MULTI_EVIDENCE_TASK_CODE = "task.hermes.multi_evidence_consistency_evaluate"

DIGITAL_EMPLOYEE_SPATIOTEMPORAL_TASK_CODE = "task.hermes.travel_spatiotemporal_consistency_evaluate"

DIGITAL_EMPLOYEE_BUDGET_PRECONTROL_TASK_CODE = "task.hermes.budget_overrun_precontrol_evaluate"

DIGITAL_EMPLOYEE_SUPPLIER_RELATION_TASK_CODE = "task.hermes.supplier_abnormal_relation_evaluate"

DIGITAL_EMPLOYEE_ALGORITHM_REPLAY_TASK_CODE = "task.hermes.risk_algorithm_replay_evaluate"

DIGITAL_EMPLOYEE_POLICY_GAP_TASK_CODE = "task.hermes.policy_gap_rule_optimization"

DIGITAL_EMPLOYEE_LEGACY_TASK_CODES = (
    "task.hermes.daily_risk_scan",
    "task.hermes.weekly_ar_summary",
    "task.hermes.rule_review_digest",
    "task.hermes.knowledge_index_sync",
    "task.hermes.llm_wiki_rule_formation",
)

DIGITAL_EMPLOYEE_TASK_CATEGORY_MAP = {
    DIGITAL_EMPLOYEE_FINANCE_POLICY_TASK_CODE: "整理",
    DIGITAL_EMPLOYEE_FINANCE_DASHBOARD_SNAPSHOT_TASK_CODE: "整理",
    DIGITAL_EMPLOYEE_REMINDER_SCAN_TASK_CODE: "升级",
    DIGITAL_EMPLOYEE_FINANCE_REPORT_TASK_CODE: "整理",
    DIGITAL_EMPLOYEE_RISK_GRAPH_SCAN_TASK_CODE: "评估",
    DIGITAL_EMPLOYEE_PROFILE_SCAN_TASK_CODE: "积累",
    DIGITAL_EMPLOYEE_RULE_DISCOVERY_TASK_CODE: "升级",
    DIGITAL_EMPLOYEE_POLICY_CLAUSE_EXTRACT_TASK_CODE: "整理",
    DIGITAL_EMPLOYEE_POLICY_ALIGNMENT_TASK_CODE: "整理",
    DIGITAL_EMPLOYEE_RULE_TEMPLATE_ORGANIZE_TASK_CODE: "整理",
    DIGITAL_EMPLOYEE_DEPARTMENT_BASELINE_TASK_CODE: "积累",
    DIGITAL_EMPLOYEE_SUPPLIER_PROFILE_TASK_CODE: "积累",
    DIGITAL_EMPLOYEE_FALSE_POSITIVE_SAMPLE_TASK_CODE: "积累",
    DIGITAL_EMPLOYEE_FEEDBACK_SAMPLE_TASK_CODE: "积累",
    DIGITAL_EMPLOYEE_MULTI_EVIDENCE_TASK_CODE: "评估",
    DIGITAL_EMPLOYEE_SPATIOTEMPORAL_TASK_CODE: "评估",
    DIGITAL_EMPLOYEE_BUDGET_PRECONTROL_TASK_CODE: "评估",
    DIGITAL_EMPLOYEE_SUPPLIER_RELATION_TASK_CODE: "评估",
    DIGITAL_EMPLOYEE_ALGORITHM_REPLAY_TASK_CODE: "升级",
    DIGITAL_EMPLOYEE_POLICY_GAP_TASK_CODE: "升级",
}

ATTACHMENT_RULE_RUNTIME_CONFIG = {

    "kind": "policy_rule_draft",

    "version": 1,

    "template_key": "attachment_requirement_v1",

    "rule_name": "报销附件与单据完整性规则",

    "scenario": "attachment_policy",

    "source_document_name": "报销制度 / 单据与附件要求",

    "review_required": True,

    "target": {

        "expense_types": [

            "travel",

            "hotel",

            "transport",

            "meal",

            "office",

            "meeting",

            "training",

            "communication",

            "welfare",

            "other",

        ],

        "scene_codes": ["expense", "attachment_policy", "invoice_anomaly"],

    },

    "attachment_requirements": {

        "min_attachment_count": 1,

        "items": [

            {

                "document_type": "vat_invoice",

                "required": True,

                "min_count": 1,

                "description": "金额类报销原则上必须提供合法票据。",

            },

            {

                "document_type": "receipt",

                "required": False,

                "min_count": 1,

                "description": "特殊场景无发票时需补充收据与情况说明。",

            },

            {

                "document_type": "flight_itinerary",

                "required": False,

                "min_count": 1,

                "description": "差旅交通报销需提供行程单或等效凭证。",

            },

            {

                "document_type": "hotel_invoice",

                "required": False,

                "min_count": 1,

                "description": "住宿报销需提供酒店票据或等效住宿凭证。",

            },

        ],

        "manual_fill_required": False,

    },

    "missing_attachment_action": "block",

    "output": {

        "risk_code": "invoice_anomaly",

        "action": "block",

        "message": "附件或单据不完整，需补件后再提交。",

    },

}
