feat: migrate experience management to V2 API; add support for industries and skills

This commit is contained in:
Achintha Isuru
2026-03-17 13:44:48 -04:00
parent e83b8fff1c
commit e1d30c124b
16 changed files with 503 additions and 314 deletions

View File

@@ -19,6 +19,8 @@ export 'src/entities/enums/onboarding_status.dart';
export 'src/entities/enums/order_type.dart';
export 'src/entities/enums/payment_status.dart';
export 'src/entities/enums/shift_status.dart';
export 'src/entities/enums/staff_industry.dart';
export 'src/entities/enums/staff_skill.dart';
export 'src/entities/enums/staff_status.dart';
export 'src/entities/enums/user_role.dart';

View File

@@ -0,0 +1,48 @@
/// Industry options for staff experience profiles.
///
/// Values match the V2 API format (UPPER_SNAKE_CASE).
enum StaffIndustry {
/// Hospitality industry.
hospitality('HOSPITALITY'),
/// Food service industry.
foodService('FOOD_SERVICE'),
/// Warehouse / logistics industry.
warehouse('WAREHOUSE'),
/// Events industry.
events('EVENTS'),
/// Retail industry.
retail('RETAIL'),
/// Healthcare industry.
healthcare('HEALTHCARE'),
/// Catering industry.
catering('CATERING'),
/// Cafe / coffee shop industry.
cafe('CAFE'),
/// Other / unspecified industry.
other('OTHER');
const StaffIndustry(this.value);
/// The V2 API string representation.
final String value;
/// Deserialises from a V2 API string with safe fallback.
static StaffIndustry? fromJson(String? value) {
if (value == null) return null;
for (final StaffIndustry industry in StaffIndustry.values) {
if (industry.value == value) return industry;
}
return null;
}
/// Serialises to the V2 API string.
String toJson() => value;
}

View File

@@ -0,0 +1,69 @@
/// Skill options for staff experience profiles.
///
/// Values match the V2 API format (UPPER_SNAKE_CASE).
enum StaffSkill {
/// Food service skill.
foodService('FOOD_SERVICE'),
/// Bartending skill.
bartending('BARTENDING'),
/// Event setup skill.
eventSetup('EVENT_SETUP'),
/// Hospitality skill.
hospitality('HOSPITALITY'),
/// Warehouse skill.
warehouse('WAREHOUSE'),
/// Customer service skill.
customerService('CUSTOMER_SERVICE'),
/// Cleaning skill.
cleaning('CLEANING'),
/// Security skill.
security('SECURITY'),
/// Retail skill.
retail('RETAIL'),
/// Driving skill.
driving('DRIVING'),
/// Cooking skill.
cooking('COOKING'),
/// Cashier skill.
cashier('CASHIER'),
/// Server skill.
server('SERVER'),
/// Barista skill.
barista('BARISTA'),
/// Host / hostess skill.
hostHostess('HOST_HOSTESS'),
/// Busser skill.
busser('BUSSER');
const StaffSkill(this.value);
/// The V2 API string representation.
final String value;
/// Deserialises from a V2 API string with safe fallback.
static StaffSkill? fromJson(String? value) {
if (value == null) return null;
for (final StaffSkill skill in StaffSkill.values) {
if (skill.value == value) return skill;
}
return null;
}
/// Serialises to the V2 API string.
String toJson() => value;
}