/// 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;
  const CostCategory({required this.code, required this.nameKey});
}

const mockCostCategories = [
  CostCategory(code: 'transport', nameKey: 'costCategoryTransport'),
  CostCategory(code: 'hotel', nameKey: 'costCategoryHotel'),
  CostCategory(code: 'office_supplies', nameKey: 'costCategoryOfficeSupplies'),
  CostCategory(code: 'meals', nameKey: 'costCategoryMeals'),
  CostCategory(code: 'materials', nameKey: 'costCategoryMaterials'),
  CostCategory(code: 'service', nameKey: 'costCategoryService'),
  CostCategory(code: 'other', nameKey: 'costCategoryOther'),
];

/// 费用大类 → 可选明细类别 code 列表
const expenseTypeCategories = <String, List<String>>{
  'travel': ['transport', 'hotel', 'meals'],
  'entertainment': ['meals', 'service', 'other'],
  'procurement': ['office_supplies', 'materials', 'other'],
  'activity': ['meals', 'materials', 'service', 'other'],
  'office': ['office_supplies', 'other'],
  'meeting': ['meals', 'service', 'other'],
  'training': ['materials', 'service', 'other'],
};

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