/// Mock ERP API 数据。
///
/// 模拟 .NET → ERP 适配器接口返回的数据结构。
/// 后续接入真实 API 时，替换对应的 provider 实现即可，
/// 页面逻辑无需修改。
// ═══════════════════════════════════════════
//  项目（ProjectService）
// ═══════════════════════════════════════════
class Project {
  final int id;
  final String name;
  const Project({required this.id, required this.name});
}

const mockProjects = [
  Project(id: 100, name: '华东市场拓展'),
  Project(id: 101, name: 'ERP系统升级'),
  Project(id: 102, name: '新产品研发'),
  Project(id: 103, name: '华南渠道建设'),
];

// ═══════════════════════════════════════════
//  预算科目（SubjectService）
// ═══════════════════════════════════════════
class BudgetSubject {
  final int id;
  final String name;
  const BudgetSubject({required this.id, required this.name});
}

const mockBudgetSubjects = [
  BudgetSubject(id: 5, name: '差旅费'),
  BudgetSubject(id: 6, name: '招待费'),
  BudgetSubject(id: 7, name: '办公费'),
  BudgetSubject(id: 8, name: '培训费'),
];

/// 可用预算余额查询
double getMockBudget(int projectId, int subjectId) {
  if (subjectId == 5) return 50000.00;
  if (subjectId == 6) return 30000.00;
  if (subjectId == 7) return 15000.00;
  if (subjectId == 8) return 20000.00;
  return 0;
}

// ═══════════════════════════════════════════
//  费用类别字典（SysCostCategory）
// ═══════════════════════════════════════════
class CostCategory {
  final String code;
  final String nameKey;
  final String acctSubjectId;
  final String acctSubjectName;
  const CostCategory({
    required this.code,
    required this.nameKey,
    required this.acctSubjectId,
    required this.acctSubjectName,
  });
}

const mockCostCategories = [
  CostCategory(code: 'transport', nameKey: 'costCategoryTransport', acctSubjectId: '5501', acctSubjectName: '差旅费'),
  CostCategory(code: 'hotel', nameKey: 'costCategoryHotel', acctSubjectId: '5501', acctSubjectName: '差旅费'),
  CostCategory(code: 'office_supplies', nameKey: 'costCategoryOfficeSupplies', acctSubjectId: '5502', acctSubjectName: '办公费'),
  CostCategory(code: 'meals', nameKey: 'costCategoryMeals', acctSubjectId: '5503', acctSubjectName: '招待费'),
  CostCategory(code: 'materials', nameKey: 'costCategoryMaterials', acctSubjectId: '5504', acctSubjectName: '材料费'),
  CostCategory(code: 'service', nameKey: 'costCategoryService', acctSubjectId: '5505', acctSubjectName: '服务费'),
  CostCategory(code: 'other', nameKey: 'costCategoryOther', acctSubjectId: '5599', acctSubjectName: '其他费用'),
];

/// 费用承担部门（Mock）
class CostDept {
  final String id;
  final String name;
  const CostDept({required this.id, required this.name});
}

const mockCostDepts = [
  CostDept(id: 'D001', name: '技术部'),
  CostDept(id: 'D002', name: '销售部'),
  CostDept(id: 'D003', name: '市场部'),
  CostDept(id: 'D004', name: '财务部'),
  CostDept(id: 'D005', name: '人事部'),
];

/// 计量单位（i18n key）
const unitOptions = [
  'unitPiece',
  'unitRoom',
  'unitPerson',
  'unitDay',
  'unitSet',
  'unitItem',
];
