feat: update preferredLocations field to List<String> across staff-related entities and mutations

- Changed preferredLocations from AnyValue to List<String> in GetStaffByIdStaff, GetStaffByUserIdStaffs, ListStaffStaffs, and UpdateStaffVariablesBuilder classes.
- Updated JSON serialization/deserialization for preferredLocations to handle List<String>.
- Modified Staff entity to include preferredLocations as List<String>.
- Adjusted ProfileSetupBloc and PersonalInfoBloc to accommodate changes in preferredLocations.
- Updated PersonalInfoRepositoryImpl to handle preferredLocations as List<String>.
- Refactored PersonalInfoContent and PersonalInfoForm to use locations instead of address.
- Updated GraphQL mutations and schema to reflect the new List<String> type for preferredLocations.
This commit is contained in:
Achintha Isuru
2026-01-27 02:17:52 -05:00
committed by José Salazar
parent c041796b38
commit f345e715ad
17 changed files with 17368 additions and 17426 deletions

View File

@@ -1,16 +1,16 @@
# Basic Usage
```dart
ExampleConnector.instance.createStaffRole(createStaffRoleVariables).execute();
ExampleConnector.instance.deleteStaffRole(deleteStaffRoleVariables).execute();
ExampleConnector.instance.createTeamMember(createTeamMemberVariables).execute();
ExampleConnector.instance.updateTeamMember(updateTeamMemberVariables).execute();
ExampleConnector.instance.updateTeamMemberInviteStatus(updateTeamMemberInviteStatusVariables).execute();
ExampleConnector.instance.acceptInviteByCode(acceptInviteByCodeVariables).execute();
ExampleConnector.instance.cancelInviteByCode(cancelInviteByCodeVariables).execute();
ExampleConnector.instance.deleteTeamMember(deleteTeamMemberVariables).execute();
ExampleConnector.instance.createUserConversation(createUserConversationVariables).execute();
ExampleConnector.instance.updateUserConversation(updateUserConversationVariables).execute();
ExampleConnector.instance.createTeamHudDepartment(createTeamHudDepartmentVariables).execute();
ExampleConnector.instance.updateTeamHudDepartment(updateTeamHudDepartmentVariables).execute();
ExampleConnector.instance.deleteTeamHudDepartment(deleteTeamHudDepartmentVariables).execute();
ExampleConnector.instance.CreateUser(createUserVariables).execute();
ExampleConnector.instance.UpdateUser(updateUserVariables).execute();
ExampleConnector.instance.DeleteUser(deleteUserVariables).execute();
ExampleConnector.instance.createVendorBenefitPlan(createVendorBenefitPlanVariables).execute();
ExampleConnector.instance.updateVendorBenefitPlan(updateVendorBenefitPlanVariables).execute();
ExampleConnector.instance.deleteVendorBenefitPlan(deleteVendorBenefitPlanVariables).execute();
ExampleConnector.instance.getShiftRoleById(getShiftRoleByIdVariables).execute();
```
@@ -23,8 +23,8 @@ Optional fields can be discovered based on classes that have `Optional` object t
This is an example of a mutation with an optional field:
```dart
await ExampleConnector.instance.updateShift({ ... })
.title(...)
await ExampleConnector.instance.updateStaffAvailabilityStats({ ... })
.needWorkIndex(...)
.execute();
```

View File

@@ -17,7 +17,7 @@ class CreateStaffVariablesBuilder {
Optional<String> _bio = Optional.optional(nativeFromJson, nativeToJson);
Optional<AnyValue> _skills = Optional.optional(AnyValue.fromJson, defaultSerializer);
Optional<AnyValue> _industries = Optional.optional(AnyValue.fromJson, defaultSerializer);
Optional<AnyValue> _preferredLocations = Optional.optional(AnyValue.fromJson, defaultSerializer);
Optional<List<String>> _preferredLocations = Optional.optional(listDeserializer(nativeFromJson), listSerializer(nativeToJson));
Optional<int> _maxDistanceMiles = Optional.optional(nativeFromJson, nativeToJson);
Optional<AnyValue> _languages = Optional.optional(AnyValue.fromJson, defaultSerializer);
Optional<AnyValue> _itemsAttire = Optional.optional(AnyValue.fromJson, defaultSerializer);
@@ -92,7 +92,7 @@ class CreateStaffVariablesBuilder {
_industries.value = t;
return this;
}
CreateStaffVariablesBuilder preferredLocations(AnyValue? t) {
CreateStaffVariablesBuilder preferredLocations(List<String>? t) {
_preferredLocations.value = t;
return this;
}
@@ -264,7 +264,7 @@ class CreateStaffVariables {
late final Optional<String>bio;
late final Optional<AnyValue>skills;
late final Optional<AnyValue>industries;
late final Optional<AnyValue>preferredLocations;
late final Optional<List<String>>preferredLocations;
late final Optional<int>maxDistanceMiles;
late final Optional<AnyValue>languages;
late final Optional<AnyValue>itemsAttire;
@@ -347,8 +347,10 @@ class CreateStaffVariables {
industries.value = json['industries'] == null ? null : AnyValue.fromJson(json['industries']);
preferredLocations = Optional.optional(AnyValue.fromJson, defaultSerializer);
preferredLocations.value = json['preferredLocations'] == null ? null : AnyValue.fromJson(json['preferredLocations']);
preferredLocations = Optional.optional(listDeserializer(nativeFromJson), listSerializer(nativeToJson));
preferredLocations.value = json['preferredLocations'] == null ? null : (json['preferredLocations'] as List<dynamic>)
.map((e) => nativeFromJson<String>(e))
.toList();
maxDistanceMiles = Optional.optional(nativeFromJson, nativeToJson);

View File

@@ -39,7 +39,7 @@ class GetStaffByIdStaff {
final String? bio;
final AnyValue? skills;
final AnyValue? industries;
final AnyValue? preferredLocations;
final List<String>? preferredLocations;
final int? maxDistanceMiles;
final AnyValue? languages;
final AnyValue? itemsAttire;
@@ -79,7 +79,9 @@ class GetStaffByIdStaff {
bio = json['bio'] == null ? null : nativeFromJson<String>(json['bio']),
skills = json['skills'] == null ? null : AnyValue.fromJson(json['skills']),
industries = json['industries'] == null ? null : AnyValue.fromJson(json['industries']),
preferredLocations = json['preferredLocations'] == null ? null : AnyValue.fromJson(json['preferredLocations']),
preferredLocations = json['preferredLocations'] == null ? null : (json['preferredLocations'] as List<dynamic>)
.map((e) => nativeFromJson<String>(e))
.toList(),
maxDistanceMiles = json['maxDistanceMiles'] == null ? null : nativeFromJson<int>(json['maxDistanceMiles']),
languages = json['languages'] == null ? null : AnyValue.fromJson(json['languages']),
itemsAttire = json['itemsAttire'] == null ? null : AnyValue.fromJson(json['itemsAttire']),
@@ -208,7 +210,7 @@ class GetStaffByIdStaff {
json['industries'] = industries!.toJson();
}
if (preferredLocations != null) {
json['preferredLocations'] = preferredLocations!.toJson();
json['preferredLocations'] = preferredLocations?.map((e) => nativeToJson<String>(e)).toList();
}
if (maxDistanceMiles != null) {
json['maxDistanceMiles'] = nativeToJson<int?>(maxDistanceMiles);

View File

@@ -38,7 +38,7 @@ class GetStaffByUserIdStaffs {
final String? bio;
final AnyValue? skills;
final AnyValue? industries;
final AnyValue? preferredLocations;
final List<String>? preferredLocations;
final int? maxDistanceMiles;
final AnyValue? languages;
final AnyValue? itemsAttire;
@@ -77,7 +77,9 @@ class GetStaffByUserIdStaffs {
bio = json['bio'] == null ? null : nativeFromJson<String>(json['bio']),
skills = json['skills'] == null ? null : AnyValue.fromJson(json['skills']),
industries = json['industries'] == null ? null : AnyValue.fromJson(json['industries']),
preferredLocations = json['preferredLocations'] == null ? null : AnyValue.fromJson(json['preferredLocations']),
preferredLocations = json['preferredLocations'] == null ? null : (json['preferredLocations'] as List<dynamic>)
.map((e) => nativeFromJson<String>(e))
.toList(),
maxDistanceMiles = json['maxDistanceMiles'] == null ? null : nativeFromJson<int>(json['maxDistanceMiles']),
languages = json['languages'] == null ? null : AnyValue.fromJson(json['languages']),
itemsAttire = json['itemsAttire'] == null ? null : AnyValue.fromJson(json['itemsAttire']),
@@ -202,7 +204,7 @@ class GetStaffByUserIdStaffs {
json['industries'] = industries!.toJson();
}
if (preferredLocations != null) {
json['preferredLocations'] = preferredLocations!.toJson();
json['preferredLocations'] = preferredLocations?.map((e) => nativeToJson<String>(e)).toList();
}
if (maxDistanceMiles != null) {
json['maxDistanceMiles'] = nativeToJson<int?>(maxDistanceMiles);

View File

@@ -38,7 +38,7 @@ class ListStaffStaffs {
final String? bio;
final AnyValue? skills;
final AnyValue? industries;
final AnyValue? preferredLocations;
final List<String>? preferredLocations;
final int? maxDistanceMiles;
final AnyValue? languages;
final AnyValue? itemsAttire;
@@ -76,7 +76,9 @@ class ListStaffStaffs {
bio = json['bio'] == null ? null : nativeFromJson<String>(json['bio']),
skills = json['skills'] == null ? null : AnyValue.fromJson(json['skills']),
industries = json['industries'] == null ? null : AnyValue.fromJson(json['industries']),
preferredLocations = json['preferredLocations'] == null ? null : AnyValue.fromJson(json['preferredLocations']),
preferredLocations = json['preferredLocations'] == null ? null : (json['preferredLocations'] as List<dynamic>)
.map((e) => nativeFromJson<String>(e))
.toList(),
maxDistanceMiles = json['maxDistanceMiles'] == null ? null : nativeFromJson<int>(json['maxDistanceMiles']),
languages = json['languages'] == null ? null : AnyValue.fromJson(json['languages']),
itemsAttire = json['itemsAttire'] == null ? null : AnyValue.fromJson(json['itemsAttire']),
@@ -201,7 +203,7 @@ class ListStaffStaffs {
json['industries'] = industries!.toJson();
}
if (preferredLocations != null) {
json['preferredLocations'] = preferredLocations!.toJson();
json['preferredLocations'] = preferredLocations?.map((e) => nativeToJson<String>(e)).toList();
}
if (maxDistanceMiles != null) {
json['maxDistanceMiles'] = nativeToJson<int?>(maxDistanceMiles);

View File

@@ -18,7 +18,7 @@ class UpdateStaffVariablesBuilder {
Optional<String> _bio = Optional.optional(nativeFromJson, nativeToJson);
Optional<AnyValue> _skills = Optional.optional(AnyValue.fromJson, defaultSerializer);
Optional<AnyValue> _industries = Optional.optional(AnyValue.fromJson, defaultSerializer);
Optional<AnyValue> _preferredLocations = Optional.optional(AnyValue.fromJson, defaultSerializer);
Optional<List<String>> _preferredLocations = Optional.optional(listDeserializer(nativeFromJson), listSerializer(nativeToJson));
Optional<int> _maxDistanceMiles = Optional.optional(nativeFromJson, nativeToJson);
Optional<AnyValue> _languages = Optional.optional(AnyValue.fromJson, defaultSerializer);
Optional<AnyValue> _itemsAttire = Optional.optional(AnyValue.fromJson, defaultSerializer);
@@ -101,7 +101,7 @@ class UpdateStaffVariablesBuilder {
_industries.value = t;
return this;
}
UpdateStaffVariablesBuilder preferredLocations(AnyValue? t) {
UpdateStaffVariablesBuilder preferredLocations(List<String>? t) {
_preferredLocations.value = t;
return this;
}
@@ -276,7 +276,7 @@ class UpdateStaffVariables {
late final Optional<String>bio;
late final Optional<AnyValue>skills;
late final Optional<AnyValue>industries;
late final Optional<AnyValue>preferredLocations;
late final Optional<List<String>>preferredLocations;
late final Optional<int>maxDistanceMiles;
late final Optional<AnyValue>languages;
late final Optional<AnyValue>itemsAttire;
@@ -365,8 +365,10 @@ class UpdateStaffVariables {
industries.value = json['industries'] == null ? null : AnyValue.fromJson(json['industries']);
preferredLocations = Optional.optional(AnyValue.fromJson, defaultSerializer);
preferredLocations.value = json['preferredLocations'] == null ? null : AnyValue.fromJson(json['preferredLocations']);
preferredLocations = Optional.optional(listDeserializer(nativeFromJson), listSerializer(nativeToJson));
preferredLocations.value = json['preferredLocations'] == null ? null : (json['preferredLocations'] as List<dynamic>)
.map((e) => nativeFromJson<String>(e))
.toList();
maxDistanceMiles = Optional.optional(nativeFromJson, nativeToJson);