enums.dart 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /// OA 模块数据库枚举常量。
  2. ///
  3. /// PRD/Database §6 枚举取值统一维护点。
  4. /// 枚举值(value)与数据库 VARCHAR 存储值一致,
  5. /// labelKey 为 i18n 键,前端展示通过 `l10n.get(labelKey)` 获取。
  6. class EnumEntry {
  7. final String value;
  8. final String labelKey;
  9. const EnumEntry(this.value, this.labelKey);
  10. }
  11. // ═══════════════════════════════════════════
  12. // §6.1 单据审批状态
  13. // ═══════════════════════════════════════════
  14. class ApprovalStatus {
  15. ApprovalStatus._();
  16. static const draft = EnumEntry('draft', 'draft');
  17. static const pending = EnumEntry('pending', 'statusPending');
  18. static const approved = EnumEntry('approved', 'statusApproved');
  19. static const rejected = EnumEntry('rejected', 'statusRejected');
  20. static const withdrawn = EnumEntry('withdrawn', 'statusWithdrawn');
  21. static const completed = EnumEntry('completed', 'completed');
  22. static const returned = EnumEntry('returned', 'returned');
  23. static const values = [draft, pending, approved, rejected, withdrawn];
  24. }
  25. // ═══════════════════════════════════════════
  26. // §6.2 付款状态
  27. // ═══════════════════════════════════════════
  28. class PaymentStatus {
  29. PaymentStatus._();
  30. static const unpaid = EnumEntry('unpaid', 'statusWaitPay');
  31. static const paid = EnumEntry('paid', 'paid');
  32. static const values = [unpaid, paid];
  33. }
  34. // ═══════════════════════════════════════════
  35. // §6.4 紧急程度
  36. // ═══════════════════════════════════════════
  37. class Urgency {
  38. Urgency._();
  39. static const normal = EnumEntry('normal', 'normal');
  40. static const urgent = EnumEntry('urgent', 'urgent');
  41. static const critical = EnumEntry('critical', 'filterCritical');
  42. static const values = [normal, urgent, critical];
  43. }
  44. // ═══════════════════════════════════════════
  45. // §6.9 加班类型
  46. // ═══════════════════════════════════════════
  47. class OtType {
  48. OtType._();
  49. static const workday = EnumEntry('workday', 'workdayOvertime');
  50. static const weekend = EnumEntry('weekend', 'weekendOvertime');
  51. static const holiday = EnumEntry('holiday', 'holidayOvertime');
  52. static const values = [workday, weekend, holiday];
  53. }
  54. // ═══════════════════════════════════════════
  55. // §6.10 补偿方式
  56. // ═══════════════════════════════════════════
  57. class CompensationType {
  58. CompensationType._();
  59. static const overtimePay = EnumEntry(
  60. 'overtime_pay',
  61. 'compensationOvertimePay',
  62. );
  63. static const compLeave = EnumEntry('comp_leave', 'compensationCompLeave');
  64. static const mixed = EnumEntry('mixed', 'compensationMixed');
  65. static const values = [overtimePay, compLeave, mixed];
  66. }
  67. // ═══════════════════════════════════════════
  68. // §6.11 用车目的
  69. // ═══════════════════════════════════════════
  70. class VehiclePurpose {
  71. VehiclePurpose._();
  72. static const reception = EnumEntry('reception', 'customerReception');
  73. static const business = EnumEntry('business', 'businessTrip');
  74. static const official = EnumEntry('official', 'official');
  75. static const values = [reception, business, official];
  76. }
  77. // ═══════════════════════════════════════════
  78. // §6.14 公告分类
  79. // ═══════════════════════════════════════════
  80. class AnnouncementType {
  81. AnnouncementType._();
  82. static const notice = EnumEntry('notice', 'noticeAnnouncement');
  83. static const policy = EnumEntry('policy', 'hrPolicy');
  84. static const activity = EnumEntry('activity', 'holidayActivity');
  85. static const values = [notice, policy, activity];
  86. }