import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'outing_log_model.dart';

final mockOutingLogs = <OutingLogModel>[
  OutingLogModel(
    id: 'log-001',
    visitNo: 'VL202605001',
    salespersonId: 'u-001',
    salespersonName: '张三',
    deptId: 'dept-001',
    deptName: '市场部',
    customerName: '华软科技',
    contactName: '赵经理',
    contactPhone: '13800138001',
    visitDate: DateTime(2026, 5, 20),
    visitStartTime: DateTime(2026, 5, 20, 9, 0),
    visitEndTime: DateTime(2026, 5, 20, 11, 30),
    visitType: '常规拜访',
    visitPurpose: '产品演示及方案交流',
    visitLocation: '深圳市南山区科技园',
    visitSummary: '向客户展示了公司最新产品功能，客户对数据看板功能比较感兴趣，约定下周安排试用。',
    customerFeedback: '对产品功能表示满意，希望后续能提供定制化服务。',
    competitorInfo: '客户目前使用的是竞品A的产品，对我们产品的差异化优势表示认可。',
    nextVisitTime: DateTime(2026, 5, 27),
    status: '已完成',
    createTime: DateTime(2026, 5, 20),
    updateTime: DateTime(2026, 5, 20),
  ),
  OutingLogModel(
    id: 'log-002',
    visitNo: 'VL202605002',
    salespersonId: 'u-002',
    salespersonName: '王五',
    deptId: 'dept-002',
    deptName: '技术部',
    customerName: '云创数据',
    contactName: '陈经理',
    contactPhone: '13800138002',
    visitDate: DateTime(2026, 5, 22),
    visitStartTime: DateTime(2026, 5, 22, 14, 0),
    visitEndTime: DateTime(2026, 5, 22, 16, 0),
    visitType: '技术交流',
    visitPurpose: '技术对接方案确认',
    visitLocation: '广州市天河区软件路',
    visitSummary: '与客户技术团队确认了API对接方案，明确了数据字段映射关系，预计下周开始联调。',
    customerFeedback: '技术团队对方案表示认同，希望能尽快完成对接。',
    competitorInfo: '',
    nextVisitTime: DateTime(2026, 5, 29),
    status: '已完成',
    createTime: DateTime(2026, 5, 22),
    updateTime: DateTime(2026, 5, 22),
  ),
  OutingLogModel(
    id: 'log-003',
    visitNo: 'VL202605003',
    salespersonId: 'u-001',
    salespersonName: '张三',
    deptId: 'dept-001',
    deptName: '市场部',
    customerName: '数据引力',
    contactName: '孙总',
    contactPhone: '13800138003',
    visitDate: DateTime(2026, 5, 25),
    visitStartTime: DateTime(2026, 5, 25, 10, 0),
    visitEndTime: DateTime(2026, 5, 25, 12, 0),
    visitType: '商务洽谈',
    visitPurpose: '合同条款谈判',
    visitLocation: '北京市朝阳区望京',
    visitSummary: '就合同关键条款达成一致，客户同意签约，预计下月初正式签订合同。',
    customerFeedback: '对商务条款基本满意，个别细节需要法务确认。',
    competitorInfo: '竞品B也在接触该客户，我方在价格和服务上具有优势。',
    nextVisitTime: DateTime(2026, 6, 5),
    status: '已完成',
    createTime: DateTime(2026, 5, 25),
    updateTime: DateTime(2026, 5, 25),
  ),
];

final outingLogPageProvider = StateProvider<int>((ref) => 1);

final outingLogListProvider = FutureProvider.autoDispose<List<OutingLogModel>>((
  ref,
) async {
  ref.watch(outingLogPageProvider);
  return mockOutingLogs;
});
