{ "summary": { "name": "opportunity", "description": "商机管理表,存储销售机会的全生命周期信息", "version": "1.0.0" }, "fields": { "id": { "type": "int", "primary_key": true, "auto_increment": true, "description": "商机ID" }, "org_id": { "type": "int", "not_null": true, "description": "组织ID,用于多租户隔离" }, "customer_id": { "type": "int", "not_null": true, "description": "客户ID,关联客户管理模块" }, "customer_name": { "type": "varchar(255)", "not_null": true, "description": "客户名称" }, "title": { "type": "varchar(255)", "not_null": true, "description": "商机标题" }, "estimated_amount": { "type": "decimal(15,2)", "not_null": true, "description": "预估金额" }, "current_stage": { "type": "varchar(50)", "not_null": true, "default": "'初步接洽'", "description": "当前销售阶段" }, "expected_close_date": { "type": "date", "not_null": true, "description": "预计成交时间" }, "probability": { "type": "decimal(5,2)", "not_null": true, "default": "0.00", "description": "成交概率(百分比)" }, "source": { "type": "varchar(50)", "not_null": true, "default": "'manual'", "description": "商机来源:manual(手动录入)或 lead(线索转化)" }, "owner_id": { "type": "int", "not_null": true, "description": "负责人ID" }, "owner_name": { "type": "varchar(100)", "not_null": true, "description": "负责人姓名" }, "description": { "type": "text", "description": "商机描述" }, "created_at": { "type": "datetime", "not_null": true, "default": "CURRENT_TIMESTAMP", "description": "创建时间" }, "updated_at": { "type": "datetime", "not_null": true, "default": "CURRENT_TIMESTAMP", "on_update": "CURRENT_TIMESTAMP", "description": "更新时间" }, "status": { "type": "varchar(20)", "not_null": true, "default": "'active'", "description": "状态:active(活跃)、won(成交)、lost(丢单)" } }, "indexes": { "idx_org_customer": ["org_id", "customer_id"], "idx_org_owner": ["org_id", "owner_id"], "idx_org_stage": ["org_id", "current_stage"], "idx_org_status": ["org_id", "status"], "idx_expected_close": ["org_id", "expected_close_date"] }, "codes": { "stages": { "初步接洽": "初步接触客户,了解基本信息", "需求确认": "深入了解客户需求和痛点", "方案报价": "提供解决方案和报价", "合同谈判": "商务条款和合同细节谈判", "成交": "签订合同,完成交易" }, "sources": { "manual": "手动录入", "lead": "线索转化" }, "statuses": { "active": "活跃", "won": "成交", "lost": "丢单" } } }