Merge pull request #288 from Oloodi/rapid_order_client

Rapid order client
This commit is contained in:
José Salazar
2026-01-23 16:23:26 -05:00
committed by GitHub
46 changed files with 18007 additions and 17687 deletions

View File

@@ -6,6 +6,10 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <url_launcher_linux/url_launcher_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) { void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
} }

View File

@@ -3,6 +3,7 @@
# #
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
url_launcher_linux
) )
list(APPEND FLUTTER_FFI_PLUGIN_LIST list(APPEND FLUTTER_FFI_PLUGIN_LIST

View File

@@ -9,10 +9,12 @@ import firebase_app_check
import firebase_auth import firebase_auth
import firebase_core import firebase_core
import shared_preferences_foundation import shared_preferences_foundation
import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseAppCheckPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAppCheckPlugin")) FLTFirebaseAppCheckPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAppCheckPlugin"))
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
} }

View File

@@ -8,10 +8,13 @@
#include <firebase_auth/firebase_auth_plugin_c_api.h> #include <firebase_auth/firebase_auth_plugin_c_api.h>
#include <firebase_core/firebase_core_plugin_c_api.h> #include <firebase_core/firebase_core_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
FirebaseAuthPluginCApiRegisterWithRegistrar( FirebaseAuthPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi")); registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi"));
FirebaseCorePluginCApiRegisterWithRegistrar( FirebaseCorePluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
} }

View File

@@ -5,6 +5,7 @@
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
firebase_auth firebase_auth
firebase_core firebase_core
url_launcher_windows
) )
list(APPEND FLUTTER_FFI_PLUGIN_LIST list(APPEND FLUTTER_FFI_PLUGIN_LIST

View File

@@ -1,16 +1,16 @@
# Basic Usage # Basic Usage
```dart ```dart
ExampleConnector.instance.createTeamHudDepartment(createTeamHudDepartmentVariables).execute(); ExampleConnector.instance.createAccount(createAccountVariables).execute();
ExampleConnector.instance.updateTeamHudDepartment(updateTeamHudDepartmentVariables).execute(); ExampleConnector.instance.updateAccount(updateAccountVariables).execute();
ExampleConnector.instance.deleteTeamHudDepartment(deleteTeamHudDepartmentVariables).execute(); ExampleConnector.instance.deleteAccount(deleteAccountVariables).execute();
ExampleConnector.instance.listAssignments(listAssignmentsVariables).execute(); ExampleConnector.instance.listBenefitsData(listBenefitsDataVariables).execute();
ExampleConnector.instance.getAssignmentById(getAssignmentByIdVariables).execute(); ExampleConnector.instance.getBenefitsDataByKey(getBenefitsDataByKeyVariables).execute();
ExampleConnector.instance.listAssignmentsByWorkforceId(listAssignmentsByWorkforceIdVariables).execute(); ExampleConnector.instance.listBenefitsDataByStaffId(listBenefitsDataByStaffIdVariables).execute();
ExampleConnector.instance.listAssignmentsByWorkforceIds(listAssignmentsByWorkforceIdsVariables).execute(); ExampleConnector.instance.listBenefitsDataByVendorBenefitPlanId(listBenefitsDataByVendorBenefitPlanIdVariables).execute();
ExampleConnector.instance.listAssignmentsByShiftRole(listAssignmentsByShiftRoleVariables).execute(); ExampleConnector.instance.listBenefitsDataByVendorBenefitPlanIds(listBenefitsDataByVendorBenefitPlanIdsVariables).execute();
ExampleConnector.instance.filterAssignments(filterAssignmentsVariables).execute(); ExampleConnector.instance.createConversation(createConversationVariables).execute();
ExampleConnector.instance.CreateCertificate(createCertificateVariables).execute(); ExampleConnector.instance.updateConversation(updateConversationVariables).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: This is an example of a mutation with an optional field:
```dart ```dart
await ExampleConnector.instance.updateShift({ ... }) await ExampleConnector.instance.filterVendorBenefitPlans({ ... })
.title(...) .vendorId(...)
.execute(); .execute();
``` ```

View File

@@ -1,7 +1,7 @@
part of 'generated.dart'; part of 'generated.dart';
class CreateOrderVariablesBuilder { class CreateOrderVariablesBuilder {
String vendorId; Optional<String> _vendorId = Optional.optional(nativeFromJson, nativeToJson);
String businessId; String businessId;
OrderType orderType; OrderType orderType;
Optional<String> _location = Optional.optional(nativeFromJson, nativeToJson); Optional<String> _location = Optional.optional(nativeFromJson, nativeToJson);
@@ -24,7 +24,12 @@ class CreateOrderVariablesBuilder {
Optional<AnyValue> _detectedConflicts = Optional.optional(AnyValue.fromJson, defaultSerializer); Optional<AnyValue> _detectedConflicts = Optional.optional(AnyValue.fromJson, defaultSerializer);
Optional<String> _poReference = Optional.optional(nativeFromJson, nativeToJson); Optional<String> _poReference = Optional.optional(nativeFromJson, nativeToJson);
final FirebaseDataConnect _dataConnect; CreateOrderVariablesBuilder location(String? t) { final FirebaseDataConnect _dataConnect;
CreateOrderVariablesBuilder vendorId(String? t) {
_vendorId.value = t;
return this;
}
CreateOrderVariablesBuilder location(String? t) {
_location.value = t; _location.value = t;
return this; return this;
} }
@@ -101,7 +106,7 @@ class CreateOrderVariablesBuilder {
return this; return this;
} }
CreateOrderVariablesBuilder(this._dataConnect, {required this.vendorId,required this.businessId,required this.orderType,}); CreateOrderVariablesBuilder(this._dataConnect, {required this.businessId,required this.orderType,});
Deserializer<CreateOrderData> dataDeserializer = (dynamic json) => CreateOrderData.fromJson(jsonDecode(json)); Deserializer<CreateOrderData> dataDeserializer = (dynamic json) => CreateOrderData.fromJson(jsonDecode(json));
Serializer<CreateOrderVariables> varsSerializer = (CreateOrderVariables vars) => jsonEncode(vars.toJson()); Serializer<CreateOrderVariables> varsSerializer = (CreateOrderVariables vars) => jsonEncode(vars.toJson());
Future<OperationResult<CreateOrderData, CreateOrderVariables>> execute() { Future<OperationResult<CreateOrderData, CreateOrderVariables>> execute() {
@@ -109,7 +114,7 @@ class CreateOrderVariablesBuilder {
} }
MutationRef<CreateOrderData, CreateOrderVariables> ref() { MutationRef<CreateOrderData, CreateOrderVariables> ref() {
CreateOrderVariables vars= CreateOrderVariables(vendorId: vendorId,businessId: businessId,orderType: orderType,location: _location,status: _status,date: _date,startDate: _startDate,endDate: _endDate,duration: _duration,lunchBreak: _lunchBreak,total: _total,eventName: _eventName,assignedStaff: _assignedStaff,shifts: _shifts,requested: _requested,hub: _hub,recurringDays: _recurringDays,permanentStartDate: _permanentStartDate,permanentDays: _permanentDays,notes: _notes,detectedConflicts: _detectedConflicts,poReference: _poReference,); CreateOrderVariables vars= CreateOrderVariables(vendorId: _vendorId,businessId: businessId,orderType: orderType,location: _location,status: _status,date: _date,startDate: _startDate,endDate: _endDate,duration: _duration,lunchBreak: _lunchBreak,total: _total,eventName: _eventName,assignedStaff: _assignedStaff,shifts: _shifts,requested: _requested,hub: _hub,recurringDays: _recurringDays,permanentStartDate: _permanentStartDate,permanentDays: _permanentDays,notes: _notes,detectedConflicts: _detectedConflicts,poReference: _poReference,);
return _dataConnect.mutation("createOrder", dataDeserializer, varsSerializer, vars); return _dataConnect.mutation("createOrder", dataDeserializer, varsSerializer, vars);
} }
} }
@@ -184,7 +189,7 @@ class CreateOrderData {
@immutable @immutable
class CreateOrderVariables { class CreateOrderVariables {
final String vendorId; late final Optional<String>vendorId;
final String businessId; final String businessId;
final OrderType orderType; final OrderType orderType;
late final Optional<String>location; late final Optional<String>location;
@@ -209,11 +214,13 @@ class CreateOrderVariables {
@Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
CreateOrderVariables.fromJson(Map<String, dynamic> json): CreateOrderVariables.fromJson(Map<String, dynamic> json):
vendorId = nativeFromJson<String>(json['vendorId']),
businessId = nativeFromJson<String>(json['businessId']), businessId = nativeFromJson<String>(json['businessId']),
orderType = OrderType.values.byName(json['orderType']) { orderType = OrderType.values.byName(json['orderType']) {
vendorId = Optional.optional(nativeFromJson, nativeToJson);
vendorId.value = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']);
@@ -333,7 +340,9 @@ class CreateOrderVariables {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
Map<String, dynamic> json = {}; Map<String, dynamic> json = {};
json['vendorId'] = nativeToJson<String>(vendorId); if(vendorId.state == OptionalState.set) {
json['vendorId'] = vendorId.toJson();
}
json['businessId'] = nativeToJson<String>(businessId); json['businessId'] = nativeToJson<String>(businessId);
json['orderType'] = json['orderType'] =
orderType.name orderType.name

View File

@@ -240,9 +240,9 @@ class FilterShiftsShiftsOrder {
final EnumValue<OrderStatus> status; final EnumValue<OrderStatus> status;
final EnumValue<OrderType> orderType; final EnumValue<OrderType> orderType;
final String businessId; final String businessId;
final String vendorId; final String? vendorId;
final FilterShiftsShiftsOrderBusiness business; final FilterShiftsShiftsOrderBusiness business;
final FilterShiftsShiftsOrderVendor vendor; final FilterShiftsShiftsOrderVendor? vendor;
FilterShiftsShiftsOrder.fromJson(dynamic json): FilterShiftsShiftsOrder.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
@@ -250,9 +250,9 @@ class FilterShiftsShiftsOrder {
status = orderStatusDeserializer(json['status']), status = orderStatusDeserializer(json['status']),
orderType = orderTypeDeserializer(json['orderType']), orderType = orderTypeDeserializer(json['orderType']),
businessId = nativeFromJson<String>(json['businessId']), businessId = nativeFromJson<String>(json['businessId']),
vendorId = nativeFromJson<String>(json['vendorId']), vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
business = FilterShiftsShiftsOrderBusiness.fromJson(json['business']), business = FilterShiftsShiftsOrderBusiness.fromJson(json['business']),
vendor = FilterShiftsShiftsOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : FilterShiftsShiftsOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -290,9 +290,13 @@ class FilterShiftsShiftsOrder {
orderTypeSerializer(orderType) orderTypeSerializer(orderType)
; ;
json['businessId'] = nativeToJson<String>(businessId); json['businessId'] = nativeToJson<String>(businessId);
json['vendorId'] = nativeToJson<String>(vendorId); if (vendorId != null) {
json['vendorId'] = nativeToJson<String?>(vendorId);
}
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -302,9 +306,9 @@ class FilterShiftsShiftsOrder {
required this.status, required this.status,
required this.orderType, required this.orderType,
required this.businessId, required this.businessId,
required this.vendorId, this.vendorId,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -200,14 +200,14 @@ class GetApplicationByIdApplicationShiftOrder {
final String? eventName; final String? eventName;
final String? location; final String? location;
final GetApplicationByIdApplicationShiftOrderBusiness business; final GetApplicationByIdApplicationShiftOrderBusiness business;
final GetApplicationByIdApplicationShiftOrderVendor vendor; final GetApplicationByIdApplicationShiftOrderVendor? vendor;
GetApplicationByIdApplicationShiftOrder.fromJson(dynamic json): GetApplicationByIdApplicationShiftOrder.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']), eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
location = json['location'] == null ? null : nativeFromJson<String>(json['location']), location = json['location'] == null ? null : nativeFromJson<String>(json['location']),
business = GetApplicationByIdApplicationShiftOrderBusiness.fromJson(json['business']), business = GetApplicationByIdApplicationShiftOrderBusiness.fromJson(json['business']),
vendor = GetApplicationByIdApplicationShiftOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : GetApplicationByIdApplicationShiftOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -239,7 +239,9 @@ class GetApplicationByIdApplicationShiftOrder {
json['location'] = nativeToJson<String?>(location); json['location'] = nativeToJson<String?>(location);
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -248,7 +250,7 @@ class GetApplicationByIdApplicationShiftOrder {
this.eventName, this.eventName,
this.location, this.location,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -200,14 +200,14 @@ class GetApplicationsByShiftIdApplicationsShiftOrder {
final String? eventName; final String? eventName;
final String? location; final String? location;
final GetApplicationsByShiftIdApplicationsShiftOrderBusiness business; final GetApplicationsByShiftIdApplicationsShiftOrderBusiness business;
final GetApplicationsByShiftIdApplicationsShiftOrderVendor vendor; final GetApplicationsByShiftIdApplicationsShiftOrderVendor? vendor;
GetApplicationsByShiftIdApplicationsShiftOrder.fromJson(dynamic json): GetApplicationsByShiftIdApplicationsShiftOrder.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']), eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
location = json['location'] == null ? null : nativeFromJson<String>(json['location']), location = json['location'] == null ? null : nativeFromJson<String>(json['location']),
business = GetApplicationsByShiftIdApplicationsShiftOrderBusiness.fromJson(json['business']), business = GetApplicationsByShiftIdApplicationsShiftOrderBusiness.fromJson(json['business']),
vendor = GetApplicationsByShiftIdApplicationsShiftOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : GetApplicationsByShiftIdApplicationsShiftOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -239,7 +239,9 @@ class GetApplicationsByShiftIdApplicationsShiftOrder {
json['location'] = nativeToJson<String?>(location); json['location'] = nativeToJson<String?>(location);
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -248,7 +250,7 @@ class GetApplicationsByShiftIdApplicationsShiftOrder {
this.eventName, this.eventName,
this.location, this.location,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -211,14 +211,14 @@ class GetApplicationsByShiftIdAndStatusApplicationsShiftOrder {
final String? eventName; final String? eventName;
final String? location; final String? location;
final GetApplicationsByShiftIdAndStatusApplicationsShiftOrderBusiness business; final GetApplicationsByShiftIdAndStatusApplicationsShiftOrderBusiness business;
final GetApplicationsByShiftIdAndStatusApplicationsShiftOrderVendor vendor; final GetApplicationsByShiftIdAndStatusApplicationsShiftOrderVendor? vendor;
GetApplicationsByShiftIdAndStatusApplicationsShiftOrder.fromJson(dynamic json): GetApplicationsByShiftIdAndStatusApplicationsShiftOrder.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']), eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
location = json['location'] == null ? null : nativeFromJson<String>(json['location']), location = json['location'] == null ? null : nativeFromJson<String>(json['location']),
business = GetApplicationsByShiftIdAndStatusApplicationsShiftOrderBusiness.fromJson(json['business']), business = GetApplicationsByShiftIdAndStatusApplicationsShiftOrderBusiness.fromJson(json['business']),
vendor = GetApplicationsByShiftIdAndStatusApplicationsShiftOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : GetApplicationsByShiftIdAndStatusApplicationsShiftOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -250,7 +250,9 @@ class GetApplicationsByShiftIdAndStatusApplicationsShiftOrder {
json['location'] = nativeToJson<String?>(location); json['location'] = nativeToJson<String?>(location);
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -259,7 +261,7 @@ class GetApplicationsByShiftIdAndStatusApplicationsShiftOrder {
this.eventName, this.eventName,
this.location, this.location,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -210,14 +210,14 @@ class GetApplicationsByStaffIdApplicationsShiftOrder {
final String? eventName; final String? eventName;
final String? location; final String? location;
final GetApplicationsByStaffIdApplicationsShiftOrderBusiness business; final GetApplicationsByStaffIdApplicationsShiftOrderBusiness business;
final GetApplicationsByStaffIdApplicationsShiftOrderVendor vendor; final GetApplicationsByStaffIdApplicationsShiftOrderVendor? vendor;
GetApplicationsByStaffIdApplicationsShiftOrder.fromJson(dynamic json): GetApplicationsByStaffIdApplicationsShiftOrder.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']), eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
location = json['location'] == null ? null : nativeFromJson<String>(json['location']), location = json['location'] == null ? null : nativeFromJson<String>(json['location']),
business = GetApplicationsByStaffIdApplicationsShiftOrderBusiness.fromJson(json['business']), business = GetApplicationsByStaffIdApplicationsShiftOrderBusiness.fromJson(json['business']),
vendor = GetApplicationsByStaffIdApplicationsShiftOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : GetApplicationsByStaffIdApplicationsShiftOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -249,7 +249,9 @@ class GetApplicationsByStaffIdApplicationsShiftOrder {
json['location'] = nativeToJson<String?>(location); json['location'] = nativeToJson<String?>(location);
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -258,7 +260,7 @@ class GetApplicationsByStaffIdApplicationsShiftOrder {
this.eventName, this.eventName,
this.location, this.location,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -490,14 +490,14 @@ class GetAssignmentByIdAssignmentShiftRoleShiftOrder {
final String? eventName; final String? eventName;
final EnumValue<OrderType> orderType; final EnumValue<OrderType> orderType;
final GetAssignmentByIdAssignmentShiftRoleShiftOrderBusiness business; final GetAssignmentByIdAssignmentShiftRoleShiftOrderBusiness business;
final GetAssignmentByIdAssignmentShiftRoleShiftOrderVendor vendor; final GetAssignmentByIdAssignmentShiftRoleShiftOrderVendor? vendor;
GetAssignmentByIdAssignmentShiftRoleShiftOrder.fromJson(dynamic json): GetAssignmentByIdAssignmentShiftRoleShiftOrder.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']), eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
orderType = orderTypeDeserializer(json['orderType']), orderType = orderTypeDeserializer(json['orderType']),
business = GetAssignmentByIdAssignmentShiftRoleShiftOrderBusiness.fromJson(json['business']), business = GetAssignmentByIdAssignmentShiftRoleShiftOrderBusiness.fromJson(json['business']),
vendor = GetAssignmentByIdAssignmentShiftRoleShiftOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : GetAssignmentByIdAssignmentShiftRoleShiftOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -529,7 +529,9 @@ class GetAssignmentByIdAssignmentShiftRoleShiftOrder {
orderTypeSerializer(orderType) orderTypeSerializer(orderType)
; ;
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -538,7 +540,7 @@ class GetAssignmentByIdAssignmentShiftRoleShiftOrder {
this.eventName, this.eventName,
required this.orderType, required this.orderType,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -21,7 +21,7 @@ class GetOrderByIdVariablesBuilder {
class GetOrderByIdOrder { class GetOrderByIdOrder {
final String id; final String id;
final String? eventName; final String? eventName;
final String vendorId; final String? vendorId;
final String businessId; final String businessId;
final EnumValue<OrderType> orderType; final EnumValue<OrderType> orderType;
final String? location; final String? location;
@@ -43,12 +43,12 @@ class GetOrderByIdOrder {
final String? notes; final String? notes;
final Timestamp? createdAt; final Timestamp? createdAt;
final GetOrderByIdOrderBusiness business; final GetOrderByIdOrderBusiness business;
final GetOrderByIdOrderVendor vendor; final GetOrderByIdOrderVendor? vendor;
GetOrderByIdOrder.fromJson(dynamic json): GetOrderByIdOrder.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']), eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
vendorId = nativeFromJson<String>(json['vendorId']), vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
businessId = nativeFromJson<String>(json['businessId']), businessId = nativeFromJson<String>(json['businessId']),
orderType = orderTypeDeserializer(json['orderType']), orderType = orderTypeDeserializer(json['orderType']),
location = json['location'] == null ? null : nativeFromJson<String>(json['location']), location = json['location'] == null ? null : nativeFromJson<String>(json['location']),
@@ -70,7 +70,7 @@ class GetOrderByIdOrder {
notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']), notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
business = GetOrderByIdOrderBusiness.fromJson(json['business']), business = GetOrderByIdOrderBusiness.fromJson(json['business']),
vendor = GetOrderByIdOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : GetOrderByIdOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -118,7 +118,9 @@ class GetOrderByIdOrder {
if (eventName != null) { if (eventName != null) {
json['eventName'] = nativeToJson<String?>(eventName); json['eventName'] = nativeToJson<String?>(eventName);
} }
json['vendorId'] = nativeToJson<String>(vendorId); if (vendorId != null) {
json['vendorId'] = nativeToJson<String?>(vendorId);
}
json['businessId'] = nativeToJson<String>(businessId); json['businessId'] = nativeToJson<String>(businessId);
json['orderType'] = json['orderType'] =
orderTypeSerializer(orderType) orderTypeSerializer(orderType)
@@ -180,14 +182,16 @@ class GetOrderByIdOrder {
json['createdAt'] = createdAt!.toJson(); json['createdAt'] = createdAt!.toJson();
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
GetOrderByIdOrder({ GetOrderByIdOrder({
required this.id, required this.id,
this.eventName, this.eventName,
required this.vendorId, this.vendorId,
required this.businessId, required this.businessId,
required this.orderType, required this.orderType,
this.location, this.location,
@@ -209,7 +213,7 @@ class GetOrderByIdOrder {
this.notes, this.notes,
this.createdAt, this.createdAt,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -31,7 +31,7 @@ class GetOrdersByBusinessIdVariablesBuilder {
class GetOrdersByBusinessIdOrders { class GetOrdersByBusinessIdOrders {
final String id; final String id;
final String? eventName; final String? eventName;
final String vendorId; final String? vendorId;
final String businessId; final String businessId;
final EnumValue<OrderType> orderType; final EnumValue<OrderType> orderType;
final String? location; final String? location;
@@ -53,12 +53,12 @@ class GetOrdersByBusinessIdOrders {
final String? notes; final String? notes;
final Timestamp? createdAt; final Timestamp? createdAt;
final GetOrdersByBusinessIdOrdersBusiness business; final GetOrdersByBusinessIdOrdersBusiness business;
final GetOrdersByBusinessIdOrdersVendor vendor; final GetOrdersByBusinessIdOrdersVendor? vendor;
GetOrdersByBusinessIdOrders.fromJson(dynamic json): GetOrdersByBusinessIdOrders.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']), eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
vendorId = nativeFromJson<String>(json['vendorId']), vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
businessId = nativeFromJson<String>(json['businessId']), businessId = nativeFromJson<String>(json['businessId']),
orderType = orderTypeDeserializer(json['orderType']), orderType = orderTypeDeserializer(json['orderType']),
location = json['location'] == null ? null : nativeFromJson<String>(json['location']), location = json['location'] == null ? null : nativeFromJson<String>(json['location']),
@@ -80,7 +80,7 @@ class GetOrdersByBusinessIdOrders {
notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']), notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
business = GetOrdersByBusinessIdOrdersBusiness.fromJson(json['business']), business = GetOrdersByBusinessIdOrdersBusiness.fromJson(json['business']),
vendor = GetOrdersByBusinessIdOrdersVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : GetOrdersByBusinessIdOrdersVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -128,7 +128,9 @@ class GetOrdersByBusinessIdOrders {
if (eventName != null) { if (eventName != null) {
json['eventName'] = nativeToJson<String?>(eventName); json['eventName'] = nativeToJson<String?>(eventName);
} }
json['vendorId'] = nativeToJson<String>(vendorId); if (vendorId != null) {
json['vendorId'] = nativeToJson<String?>(vendorId);
}
json['businessId'] = nativeToJson<String>(businessId); json['businessId'] = nativeToJson<String>(businessId);
json['orderType'] = json['orderType'] =
orderTypeSerializer(orderType) orderTypeSerializer(orderType)
@@ -190,14 +192,16 @@ class GetOrdersByBusinessIdOrders {
json['createdAt'] = createdAt!.toJson(); json['createdAt'] = createdAt!.toJson();
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
GetOrdersByBusinessIdOrders({ GetOrdersByBusinessIdOrders({
required this.id, required this.id,
this.eventName, this.eventName,
required this.vendorId, this.vendorId,
required this.businessId, required this.businessId,
required this.orderType, required this.orderType,
this.location, this.location,
@@ -219,7 +223,7 @@ class GetOrdersByBusinessIdOrders {
this.notes, this.notes,
this.createdAt, this.createdAt,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -32,7 +32,7 @@ class GetOrdersByDateRangeVariablesBuilder {
class GetOrdersByDateRangeOrders { class GetOrdersByDateRangeOrders {
final String id; final String id;
final String? eventName; final String? eventName;
final String vendorId; final String? vendorId;
final String businessId; final String businessId;
final EnumValue<OrderType> orderType; final EnumValue<OrderType> orderType;
final String? location; final String? location;
@@ -54,12 +54,12 @@ class GetOrdersByDateRangeOrders {
final String? notes; final String? notes;
final Timestamp? createdAt; final Timestamp? createdAt;
final GetOrdersByDateRangeOrdersBusiness business; final GetOrdersByDateRangeOrdersBusiness business;
final GetOrdersByDateRangeOrdersVendor vendor; final GetOrdersByDateRangeOrdersVendor? vendor;
GetOrdersByDateRangeOrders.fromJson(dynamic json): GetOrdersByDateRangeOrders.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']), eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
vendorId = nativeFromJson<String>(json['vendorId']), vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
businessId = nativeFromJson<String>(json['businessId']), businessId = nativeFromJson<String>(json['businessId']),
orderType = orderTypeDeserializer(json['orderType']), orderType = orderTypeDeserializer(json['orderType']),
location = json['location'] == null ? null : nativeFromJson<String>(json['location']), location = json['location'] == null ? null : nativeFromJson<String>(json['location']),
@@ -81,7 +81,7 @@ class GetOrdersByDateRangeOrders {
notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']), notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
business = GetOrdersByDateRangeOrdersBusiness.fromJson(json['business']), business = GetOrdersByDateRangeOrdersBusiness.fromJson(json['business']),
vendor = GetOrdersByDateRangeOrdersVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : GetOrdersByDateRangeOrdersVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -129,7 +129,9 @@ class GetOrdersByDateRangeOrders {
if (eventName != null) { if (eventName != null) {
json['eventName'] = nativeToJson<String?>(eventName); json['eventName'] = nativeToJson<String?>(eventName);
} }
json['vendorId'] = nativeToJson<String>(vendorId); if (vendorId != null) {
json['vendorId'] = nativeToJson<String?>(vendorId);
}
json['businessId'] = nativeToJson<String>(businessId); json['businessId'] = nativeToJson<String>(businessId);
json['orderType'] = json['orderType'] =
orderTypeSerializer(orderType) orderTypeSerializer(orderType)
@@ -191,14 +193,16 @@ class GetOrdersByDateRangeOrders {
json['createdAt'] = createdAt!.toJson(); json['createdAt'] = createdAt!.toJson();
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
GetOrdersByDateRangeOrders({ GetOrdersByDateRangeOrders({
required this.id, required this.id,
this.eventName, this.eventName,
required this.vendorId, this.vendorId,
required this.businessId, required this.businessId,
required this.orderType, required this.orderType,
this.location, this.location,
@@ -220,7 +224,7 @@ class GetOrdersByDateRangeOrders {
this.notes, this.notes,
this.createdAt, this.createdAt,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -31,7 +31,7 @@ class GetOrdersByStatusVariablesBuilder {
class GetOrdersByStatusOrders { class GetOrdersByStatusOrders {
final String id; final String id;
final String? eventName; final String? eventName;
final String vendorId; final String? vendorId;
final String businessId; final String businessId;
final EnumValue<OrderType> orderType; final EnumValue<OrderType> orderType;
final String? location; final String? location;
@@ -53,12 +53,12 @@ class GetOrdersByStatusOrders {
final String? notes; final String? notes;
final Timestamp? createdAt; final Timestamp? createdAt;
final GetOrdersByStatusOrdersBusiness business; final GetOrdersByStatusOrdersBusiness business;
final GetOrdersByStatusOrdersVendor vendor; final GetOrdersByStatusOrdersVendor? vendor;
GetOrdersByStatusOrders.fromJson(dynamic json): GetOrdersByStatusOrders.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']), eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
vendorId = nativeFromJson<String>(json['vendorId']), vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
businessId = nativeFromJson<String>(json['businessId']), businessId = nativeFromJson<String>(json['businessId']),
orderType = orderTypeDeserializer(json['orderType']), orderType = orderTypeDeserializer(json['orderType']),
location = json['location'] == null ? null : nativeFromJson<String>(json['location']), location = json['location'] == null ? null : nativeFromJson<String>(json['location']),
@@ -80,7 +80,7 @@ class GetOrdersByStatusOrders {
notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']), notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
business = GetOrdersByStatusOrdersBusiness.fromJson(json['business']), business = GetOrdersByStatusOrdersBusiness.fromJson(json['business']),
vendor = GetOrdersByStatusOrdersVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : GetOrdersByStatusOrdersVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -128,7 +128,9 @@ class GetOrdersByStatusOrders {
if (eventName != null) { if (eventName != null) {
json['eventName'] = nativeToJson<String?>(eventName); json['eventName'] = nativeToJson<String?>(eventName);
} }
json['vendorId'] = nativeToJson<String>(vendorId); if (vendorId != null) {
json['vendorId'] = nativeToJson<String?>(vendorId);
}
json['businessId'] = nativeToJson<String>(businessId); json['businessId'] = nativeToJson<String>(businessId);
json['orderType'] = json['orderType'] =
orderTypeSerializer(orderType) orderTypeSerializer(orderType)
@@ -190,14 +192,16 @@ class GetOrdersByStatusOrders {
json['createdAt'] = createdAt!.toJson(); json['createdAt'] = createdAt!.toJson();
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
GetOrdersByStatusOrders({ GetOrdersByStatusOrders({
required this.id, required this.id,
this.eventName, this.eventName,
required this.vendorId, this.vendorId,
required this.businessId, required this.businessId,
required this.orderType, required this.orderType,
this.location, this.location,
@@ -219,7 +223,7 @@ class GetOrdersByStatusOrders {
this.notes, this.notes,
this.createdAt, this.createdAt,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -31,7 +31,7 @@ class GetOrdersByVendorIdVariablesBuilder {
class GetOrdersByVendorIdOrders { class GetOrdersByVendorIdOrders {
final String id; final String id;
final String? eventName; final String? eventName;
final String vendorId; final String? vendorId;
final String businessId; final String businessId;
final EnumValue<OrderType> orderType; final EnumValue<OrderType> orderType;
final String? location; final String? location;
@@ -53,12 +53,12 @@ class GetOrdersByVendorIdOrders {
final String? notes; final String? notes;
final Timestamp? createdAt; final Timestamp? createdAt;
final GetOrdersByVendorIdOrdersBusiness business; final GetOrdersByVendorIdOrdersBusiness business;
final GetOrdersByVendorIdOrdersVendor vendor; final GetOrdersByVendorIdOrdersVendor? vendor;
GetOrdersByVendorIdOrders.fromJson(dynamic json): GetOrdersByVendorIdOrders.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']), eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
vendorId = nativeFromJson<String>(json['vendorId']), vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
businessId = nativeFromJson<String>(json['businessId']), businessId = nativeFromJson<String>(json['businessId']),
orderType = orderTypeDeserializer(json['orderType']), orderType = orderTypeDeserializer(json['orderType']),
location = json['location'] == null ? null : nativeFromJson<String>(json['location']), location = json['location'] == null ? null : nativeFromJson<String>(json['location']),
@@ -80,7 +80,7 @@ class GetOrdersByVendorIdOrders {
notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']), notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
business = GetOrdersByVendorIdOrdersBusiness.fromJson(json['business']), business = GetOrdersByVendorIdOrdersBusiness.fromJson(json['business']),
vendor = GetOrdersByVendorIdOrdersVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : GetOrdersByVendorIdOrdersVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -128,7 +128,9 @@ class GetOrdersByVendorIdOrders {
if (eventName != null) { if (eventName != null) {
json['eventName'] = nativeToJson<String?>(eventName); json['eventName'] = nativeToJson<String?>(eventName);
} }
json['vendorId'] = nativeToJson<String>(vendorId); if (vendorId != null) {
json['vendorId'] = nativeToJson<String?>(vendorId);
}
json['businessId'] = nativeToJson<String>(businessId); json['businessId'] = nativeToJson<String>(businessId);
json['orderType'] = json['orderType'] =
orderTypeSerializer(orderType) orderTypeSerializer(orderType)
@@ -190,14 +192,16 @@ class GetOrdersByVendorIdOrders {
json['createdAt'] = createdAt!.toJson(); json['createdAt'] = createdAt!.toJson();
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
GetOrdersByVendorIdOrders({ GetOrdersByVendorIdOrders({
required this.id, required this.id,
this.eventName, this.eventName,
required this.vendorId, this.vendorId,
required this.businessId, required this.businessId,
required this.orderType, required this.orderType,
this.location, this.location,
@@ -219,7 +223,7 @@ class GetOrdersByVendorIdOrders {
this.notes, this.notes,
this.createdAt, this.createdAt,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -31,7 +31,7 @@ class GetRapidOrdersVariablesBuilder {
class GetRapidOrdersOrders { class GetRapidOrdersOrders {
final String id; final String id;
final String? eventName; final String? eventName;
final String vendorId; final String? vendorId;
final String businessId; final String businessId;
final EnumValue<OrderType> orderType; final EnumValue<OrderType> orderType;
final String? location; final String? location;
@@ -53,12 +53,12 @@ class GetRapidOrdersOrders {
final String? notes; final String? notes;
final Timestamp? createdAt; final Timestamp? createdAt;
final GetRapidOrdersOrdersBusiness business; final GetRapidOrdersOrdersBusiness business;
final GetRapidOrdersOrdersVendor vendor; final GetRapidOrdersOrdersVendor? vendor;
GetRapidOrdersOrders.fromJson(dynamic json): GetRapidOrdersOrders.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']), eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
vendorId = nativeFromJson<String>(json['vendorId']), vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
businessId = nativeFromJson<String>(json['businessId']), businessId = nativeFromJson<String>(json['businessId']),
orderType = orderTypeDeserializer(json['orderType']), orderType = orderTypeDeserializer(json['orderType']),
location = json['location'] == null ? null : nativeFromJson<String>(json['location']), location = json['location'] == null ? null : nativeFromJson<String>(json['location']),
@@ -80,7 +80,7 @@ class GetRapidOrdersOrders {
notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']), notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
business = GetRapidOrdersOrdersBusiness.fromJson(json['business']), business = GetRapidOrdersOrdersBusiness.fromJson(json['business']),
vendor = GetRapidOrdersOrdersVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : GetRapidOrdersOrdersVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -128,7 +128,9 @@ class GetRapidOrdersOrders {
if (eventName != null) { if (eventName != null) {
json['eventName'] = nativeToJson<String?>(eventName); json['eventName'] = nativeToJson<String?>(eventName);
} }
json['vendorId'] = nativeToJson<String>(vendorId); if (vendorId != null) {
json['vendorId'] = nativeToJson<String?>(vendorId);
}
json['businessId'] = nativeToJson<String>(businessId); json['businessId'] = nativeToJson<String>(businessId);
json['orderType'] = json['orderType'] =
orderTypeSerializer(orderType) orderTypeSerializer(orderType)
@@ -190,14 +192,16 @@ class GetRapidOrdersOrders {
json['createdAt'] = createdAt!.toJson(); json['createdAt'] = createdAt!.toJson();
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
GetRapidOrdersOrders({ GetRapidOrdersOrders({
required this.id, required this.id,
this.eventName, this.eventName,
required this.vendorId, this.vendorId,
required this.businessId, required this.businessId,
required this.orderType, required this.orderType,
this.location, this.location,
@@ -219,7 +223,7 @@ class GetRapidOrdersOrders {
this.notes, this.notes,
this.createdAt, this.createdAt,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -210,9 +210,9 @@ class GetShiftByIdShiftOrder {
final EnumValue<OrderStatus> status; final EnumValue<OrderStatus> status;
final EnumValue<OrderType> orderType; final EnumValue<OrderType> orderType;
final String businessId; final String businessId;
final String vendorId; final String? vendorId;
final GetShiftByIdShiftOrderBusiness business; final GetShiftByIdShiftOrderBusiness business;
final GetShiftByIdShiftOrderVendor vendor; final GetShiftByIdShiftOrderVendor? vendor;
GetShiftByIdShiftOrder.fromJson(dynamic json): GetShiftByIdShiftOrder.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
@@ -220,9 +220,9 @@ class GetShiftByIdShiftOrder {
status = orderStatusDeserializer(json['status']), status = orderStatusDeserializer(json['status']),
orderType = orderTypeDeserializer(json['orderType']), orderType = orderTypeDeserializer(json['orderType']),
businessId = nativeFromJson<String>(json['businessId']), businessId = nativeFromJson<String>(json['businessId']),
vendorId = nativeFromJson<String>(json['vendorId']), vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
business = GetShiftByIdShiftOrderBusiness.fromJson(json['business']), business = GetShiftByIdShiftOrderBusiness.fromJson(json['business']),
vendor = GetShiftByIdShiftOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : GetShiftByIdShiftOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -260,9 +260,13 @@ class GetShiftByIdShiftOrder {
orderTypeSerializer(orderType) orderTypeSerializer(orderType)
; ;
json['businessId'] = nativeToJson<String>(businessId); json['businessId'] = nativeToJson<String>(businessId);
json['vendorId'] = nativeToJson<String>(vendorId); if (vendorId != null) {
json['vendorId'] = nativeToJson<String?>(vendorId);
}
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -272,9 +276,9 @@ class GetShiftByIdShiftOrder {
required this.status, required this.status,
required this.orderType, required this.orderType,
required this.businessId, required this.businessId,
required this.vendorId, this.vendorId,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -252,14 +252,14 @@ class GetShiftRoleByIdShiftRoleShiftOrder {
final AnyValue? permanentDays; final AnyValue? permanentDays;
final String? notes; final String? notes;
final GetShiftRoleByIdShiftRoleShiftOrderBusiness business; final GetShiftRoleByIdShiftRoleShiftOrderBusiness business;
final GetShiftRoleByIdShiftRoleShiftOrderVendor vendor; final GetShiftRoleByIdShiftRoleShiftOrderVendor? vendor;
GetShiftRoleByIdShiftRoleShiftOrder.fromJson(dynamic json): GetShiftRoleByIdShiftRoleShiftOrder.fromJson(dynamic json):
recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']), recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']),
permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']), permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']),
notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']), notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
business = GetShiftRoleByIdShiftRoleShiftOrderBusiness.fromJson(json['business']), business = GetShiftRoleByIdShiftRoleShiftOrderBusiness.fromJson(json['business']),
vendor = GetShiftRoleByIdShiftRoleShiftOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : GetShiftRoleByIdShiftRoleShiftOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -293,7 +293,9 @@ class GetShiftRoleByIdShiftRoleShiftOrder {
json['notes'] = nativeToJson<String?>(notes); json['notes'] = nativeToJson<String?>(notes);
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -302,7 +304,7 @@ class GetShiftRoleByIdShiftRoleShiftOrder {
this.permanentDays, this.permanentDays,
this.notes, this.notes,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -230,9 +230,9 @@ class GetShiftsByBusinessIdShiftsOrder {
final EnumValue<OrderStatus> status; final EnumValue<OrderStatus> status;
final EnumValue<OrderType> orderType; final EnumValue<OrderType> orderType;
final String businessId; final String businessId;
final String vendorId; final String? vendorId;
final GetShiftsByBusinessIdShiftsOrderBusiness business; final GetShiftsByBusinessIdShiftsOrderBusiness business;
final GetShiftsByBusinessIdShiftsOrderVendor vendor; final GetShiftsByBusinessIdShiftsOrderVendor? vendor;
GetShiftsByBusinessIdShiftsOrder.fromJson(dynamic json): GetShiftsByBusinessIdShiftsOrder.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
@@ -240,9 +240,9 @@ class GetShiftsByBusinessIdShiftsOrder {
status = orderStatusDeserializer(json['status']), status = orderStatusDeserializer(json['status']),
orderType = orderTypeDeserializer(json['orderType']), orderType = orderTypeDeserializer(json['orderType']),
businessId = nativeFromJson<String>(json['businessId']), businessId = nativeFromJson<String>(json['businessId']),
vendorId = nativeFromJson<String>(json['vendorId']), vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
business = GetShiftsByBusinessIdShiftsOrderBusiness.fromJson(json['business']), business = GetShiftsByBusinessIdShiftsOrderBusiness.fromJson(json['business']),
vendor = GetShiftsByBusinessIdShiftsOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : GetShiftsByBusinessIdShiftsOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -280,9 +280,13 @@ class GetShiftsByBusinessIdShiftsOrder {
orderTypeSerializer(orderType) orderTypeSerializer(orderType)
; ;
json['businessId'] = nativeToJson<String>(businessId); json['businessId'] = nativeToJson<String>(businessId);
json['vendorId'] = nativeToJson<String>(vendorId); if (vendorId != null) {
json['vendorId'] = nativeToJson<String?>(vendorId);
}
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -292,9 +296,9 @@ class GetShiftsByBusinessIdShiftsOrder {
required this.status, required this.status,
required this.orderType, required this.orderType,
required this.businessId, required this.businessId,
required this.vendorId, this.vendorId,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -230,9 +230,9 @@ class GetShiftsByVendorIdShiftsOrder {
final EnumValue<OrderStatus> status; final EnumValue<OrderStatus> status;
final EnumValue<OrderType> orderType; final EnumValue<OrderType> orderType;
final String businessId; final String businessId;
final String vendorId; final String? vendorId;
final GetShiftsByVendorIdShiftsOrderBusiness business; final GetShiftsByVendorIdShiftsOrderBusiness business;
final GetShiftsByVendorIdShiftsOrderVendor vendor; final GetShiftsByVendorIdShiftsOrderVendor? vendor;
GetShiftsByVendorIdShiftsOrder.fromJson(dynamic json): GetShiftsByVendorIdShiftsOrder.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
@@ -240,9 +240,9 @@ class GetShiftsByVendorIdShiftsOrder {
status = orderStatusDeserializer(json['status']), status = orderStatusDeserializer(json['status']),
orderType = orderTypeDeserializer(json['orderType']), orderType = orderTypeDeserializer(json['orderType']),
businessId = nativeFromJson<String>(json['businessId']), businessId = nativeFromJson<String>(json['businessId']),
vendorId = nativeFromJson<String>(json['vendorId']), vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
business = GetShiftsByVendorIdShiftsOrderBusiness.fromJson(json['business']), business = GetShiftsByVendorIdShiftsOrderBusiness.fromJson(json['business']),
vendor = GetShiftsByVendorIdShiftsOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : GetShiftsByVendorIdShiftsOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -280,9 +280,13 @@ class GetShiftsByVendorIdShiftsOrder {
orderTypeSerializer(orderType) orderTypeSerializer(orderType)
; ;
json['businessId'] = nativeToJson<String>(businessId); json['businessId'] = nativeToJson<String>(businessId);
json['vendorId'] = nativeToJson<String>(vendorId); if (vendorId != null) {
json['vendorId'] = nativeToJson<String?>(vendorId);
}
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -292,9 +296,9 @@ class GetShiftsByVendorIdShiftsOrder {
required this.status, required this.status,
required this.orderType, required this.orderType,
required this.businessId, required this.businessId,
required this.vendorId, this.vendorId,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -199,14 +199,14 @@ class ListApplicationsApplicationsShiftOrder {
final String? eventName; final String? eventName;
final String? location; final String? location;
final ListApplicationsApplicationsShiftOrderBusiness business; final ListApplicationsApplicationsShiftOrderBusiness business;
final ListApplicationsApplicationsShiftOrderVendor vendor; final ListApplicationsApplicationsShiftOrderVendor? vendor;
ListApplicationsApplicationsShiftOrder.fromJson(dynamic json): ListApplicationsApplicationsShiftOrder.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']), eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
location = json['location'] == null ? null : nativeFromJson<String>(json['location']), location = json['location'] == null ? null : nativeFromJson<String>(json['location']),
business = ListApplicationsApplicationsShiftOrderBusiness.fromJson(json['business']), business = ListApplicationsApplicationsShiftOrderBusiness.fromJson(json['business']),
vendor = ListApplicationsApplicationsShiftOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : ListApplicationsApplicationsShiftOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -238,7 +238,9 @@ class ListApplicationsApplicationsShiftOrder {
json['location'] = nativeToJson<String?>(location); json['location'] = nativeToJson<String?>(location);
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -247,7 +249,7 @@ class ListApplicationsApplicationsShiftOrder {
this.eventName, this.eventName,
this.location, this.location,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -398,13 +398,13 @@ class ListAssignmentsAssignmentsShiftRoleShiftOrder {
final String id; final String id;
final String? eventName; final String? eventName;
final ListAssignmentsAssignmentsShiftRoleShiftOrderBusiness business; final ListAssignmentsAssignmentsShiftRoleShiftOrderBusiness business;
final ListAssignmentsAssignmentsShiftRoleShiftOrderVendor vendor; final ListAssignmentsAssignmentsShiftRoleShiftOrderVendor? vendor;
ListAssignmentsAssignmentsShiftRoleShiftOrder.fromJson(dynamic json): ListAssignmentsAssignmentsShiftRoleShiftOrder.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']), eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
business = ListAssignmentsAssignmentsShiftRoleShiftOrderBusiness.fromJson(json['business']), business = ListAssignmentsAssignmentsShiftRoleShiftOrderBusiness.fromJson(json['business']),
vendor = ListAssignmentsAssignmentsShiftRoleShiftOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : ListAssignmentsAssignmentsShiftRoleShiftOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -432,7 +432,9 @@ class ListAssignmentsAssignmentsShiftRoleShiftOrder {
json['eventName'] = nativeToJson<String?>(eventName); json['eventName'] = nativeToJson<String?>(eventName);
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -440,7 +442,7 @@ class ListAssignmentsAssignmentsShiftRoleShiftOrder {
required this.id, required this.id,
this.eventName, this.eventName,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -365,13 +365,13 @@ class ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrder {
final String id; final String id;
final String? eventName; final String? eventName;
final ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderBusiness business; final ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderBusiness business;
final ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderVendor vendor; final ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderVendor? vendor;
ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrder.fromJson(dynamic json): ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrder.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']), eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
business = ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderBusiness.fromJson(json['business']), business = ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderBusiness.fromJson(json['business']),
vendor = ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -399,7 +399,9 @@ class ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrder {
json['eventName'] = nativeToJson<String?>(eventName); json['eventName'] = nativeToJson<String?>(eventName);
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -407,7 +409,7 @@ class ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrder {
required this.id, required this.id,
this.eventName, this.eventName,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -316,13 +316,13 @@ class ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrder {
final String id; final String id;
final String? eventName; final String? eventName;
final ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderBusiness business; final ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderBusiness business;
final ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderVendor vendor; final ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderVendor? vendor;
ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrder.fromJson(dynamic json): ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrder.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']), eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
business = ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderBusiness.fromJson(json['business']), business = ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderBusiness.fromJson(json['business']),
vendor = ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -350,7 +350,9 @@ class ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrder {
json['eventName'] = nativeToJson<String?>(eventName); json['eventName'] = nativeToJson<String?>(eventName);
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -358,7 +360,7 @@ class ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrder {
required this.id, required this.id,
this.eventName, this.eventName,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -31,7 +31,7 @@ class ListOrdersVariablesBuilder {
class ListOrdersOrders { class ListOrdersOrders {
final String id; final String id;
final String? eventName; final String? eventName;
final String vendorId; final String? vendorId;
final String businessId; final String businessId;
final EnumValue<OrderType> orderType; final EnumValue<OrderType> orderType;
final String? location; final String? location;
@@ -53,12 +53,12 @@ class ListOrdersOrders {
final String? notes; final String? notes;
final Timestamp? createdAt; final Timestamp? createdAt;
final ListOrdersOrdersBusiness business; final ListOrdersOrdersBusiness business;
final ListOrdersOrdersVendor vendor; final ListOrdersOrdersVendor? vendor;
ListOrdersOrders.fromJson(dynamic json): ListOrdersOrders.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']), eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
vendorId = nativeFromJson<String>(json['vendorId']), vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
businessId = nativeFromJson<String>(json['businessId']), businessId = nativeFromJson<String>(json['businessId']),
orderType = orderTypeDeserializer(json['orderType']), orderType = orderTypeDeserializer(json['orderType']),
location = json['location'] == null ? null : nativeFromJson<String>(json['location']), location = json['location'] == null ? null : nativeFromJson<String>(json['location']),
@@ -80,7 +80,7 @@ class ListOrdersOrders {
notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']), notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
business = ListOrdersOrdersBusiness.fromJson(json['business']), business = ListOrdersOrdersBusiness.fromJson(json['business']),
vendor = ListOrdersOrdersVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : ListOrdersOrdersVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -128,7 +128,9 @@ class ListOrdersOrders {
if (eventName != null) { if (eventName != null) {
json['eventName'] = nativeToJson<String?>(eventName); json['eventName'] = nativeToJson<String?>(eventName);
} }
json['vendorId'] = nativeToJson<String>(vendorId); if (vendorId != null) {
json['vendorId'] = nativeToJson<String?>(vendorId);
}
json['businessId'] = nativeToJson<String>(businessId); json['businessId'] = nativeToJson<String>(businessId);
json['orderType'] = json['orderType'] =
orderTypeSerializer(orderType) orderTypeSerializer(orderType)
@@ -190,14 +192,16 @@ class ListOrdersOrders {
json['createdAt'] = createdAt!.toJson(); json['createdAt'] = createdAt!.toJson();
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
ListOrdersOrders({ ListOrdersOrders({
required this.id, required this.id,
this.eventName, this.eventName,
required this.vendorId, this.vendorId,
required this.businessId, required this.businessId,
required this.orderType, required this.orderType,
this.location, this.location,
@@ -219,7 +223,7 @@ class ListOrdersOrders {
this.notes, this.notes,
this.createdAt, this.createdAt,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -261,14 +261,14 @@ class ListShiftRolesByRoleIdShiftRolesShiftOrder {
final AnyValue? permanentDays; final AnyValue? permanentDays;
final String? notes; final String? notes;
final ListShiftRolesByRoleIdShiftRolesShiftOrderBusiness business; final ListShiftRolesByRoleIdShiftRolesShiftOrderBusiness business;
final ListShiftRolesByRoleIdShiftRolesShiftOrderVendor vendor; final ListShiftRolesByRoleIdShiftRolesShiftOrderVendor? vendor;
ListShiftRolesByRoleIdShiftRolesShiftOrder.fromJson(dynamic json): ListShiftRolesByRoleIdShiftRolesShiftOrder.fromJson(dynamic json):
recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']), recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']),
permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']), permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']),
notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']), notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
business = ListShiftRolesByRoleIdShiftRolesShiftOrderBusiness.fromJson(json['business']), business = ListShiftRolesByRoleIdShiftRolesShiftOrderBusiness.fromJson(json['business']),
vendor = ListShiftRolesByRoleIdShiftRolesShiftOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : ListShiftRolesByRoleIdShiftRolesShiftOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -302,7 +302,9 @@ class ListShiftRolesByRoleIdShiftRolesShiftOrder {
json['notes'] = nativeToJson<String?>(notes); json['notes'] = nativeToJson<String?>(notes);
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -311,7 +313,7 @@ class ListShiftRolesByRoleIdShiftRolesShiftOrder {
this.permanentDays, this.permanentDays,
this.notes, this.notes,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -261,14 +261,14 @@ class ListShiftRolesByShiftIdShiftRolesShiftOrder {
final AnyValue? permanentDays; final AnyValue? permanentDays;
final String? notes; final String? notes;
final ListShiftRolesByShiftIdShiftRolesShiftOrderBusiness business; final ListShiftRolesByShiftIdShiftRolesShiftOrderBusiness business;
final ListShiftRolesByShiftIdShiftRolesShiftOrderVendor vendor; final ListShiftRolesByShiftIdShiftRolesShiftOrderVendor? vendor;
ListShiftRolesByShiftIdShiftRolesShiftOrder.fromJson(dynamic json): ListShiftRolesByShiftIdShiftRolesShiftOrder.fromJson(dynamic json):
recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']), recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']),
permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']), permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']),
notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']), notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
business = ListShiftRolesByShiftIdShiftRolesShiftOrderBusiness.fromJson(json['business']), business = ListShiftRolesByShiftIdShiftRolesShiftOrderBusiness.fromJson(json['business']),
vendor = ListShiftRolesByShiftIdShiftRolesShiftOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : ListShiftRolesByShiftIdShiftRolesShiftOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -302,7 +302,9 @@ class ListShiftRolesByShiftIdShiftRolesShiftOrder {
json['notes'] = nativeToJson<String?>(notes); json['notes'] = nativeToJson<String?>(notes);
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -311,7 +313,7 @@ class ListShiftRolesByShiftIdShiftRolesShiftOrder {
this.permanentDays, this.permanentDays,
this.notes, this.notes,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -263,14 +263,14 @@ class ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder {
final AnyValue? permanentDays; final AnyValue? permanentDays;
final String? notes; final String? notes;
final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderBusiness business; final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderBusiness business;
final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderVendor vendor; final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderVendor? vendor;
ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder.fromJson(dynamic json): ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder.fromJson(dynamic json):
recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']), recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']),
permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']), permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']),
notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']), notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
business = ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderBusiness.fromJson(json['business']), business = ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderBusiness.fromJson(json['business']),
vendor = ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -304,7 +304,9 @@ class ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder {
json['notes'] = nativeToJson<String?>(notes); json['notes'] = nativeToJson<String?>(notes);
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -313,7 +315,7 @@ class ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder {
this.permanentDays, this.permanentDays,
this.notes, this.notes,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -276,7 +276,7 @@ class ListShiftRolesByVendorIdShiftRolesShift {
class ListShiftRolesByVendorIdShiftRolesShiftOrder { class ListShiftRolesByVendorIdShiftRolesShiftOrder {
final String id; final String id;
final String? eventName; final String? eventName;
final String vendorId; final String? vendorId;
final String businessId; final String businessId;
final EnumValue<OrderType> orderType; final EnumValue<OrderType> orderType;
final EnumValue<OrderStatus> status; final EnumValue<OrderStatus> status;
@@ -285,12 +285,12 @@ class ListShiftRolesByVendorIdShiftRolesShiftOrder {
final AnyValue? permanentDays; final AnyValue? permanentDays;
final String? notes; final String? notes;
final ListShiftRolesByVendorIdShiftRolesShiftOrderBusiness business; final ListShiftRolesByVendorIdShiftRolesShiftOrderBusiness business;
final ListShiftRolesByVendorIdShiftRolesShiftOrderVendor vendor; final ListShiftRolesByVendorIdShiftRolesShiftOrderVendor? vendor;
ListShiftRolesByVendorIdShiftRolesShiftOrder.fromJson(dynamic json): ListShiftRolesByVendorIdShiftRolesShiftOrder.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']), eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
vendorId = nativeFromJson<String>(json['vendorId']), vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
businessId = nativeFromJson<String>(json['businessId']), businessId = nativeFromJson<String>(json['businessId']),
orderType = orderTypeDeserializer(json['orderType']), orderType = orderTypeDeserializer(json['orderType']),
status = orderStatusDeserializer(json['status']), status = orderStatusDeserializer(json['status']),
@@ -299,7 +299,7 @@ class ListShiftRolesByVendorIdShiftRolesShiftOrder {
permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']), permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']),
notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']), notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
business = ListShiftRolesByVendorIdShiftRolesShiftOrderBusiness.fromJson(json['business']), business = ListShiftRolesByVendorIdShiftRolesShiftOrderBusiness.fromJson(json['business']),
vendor = ListShiftRolesByVendorIdShiftRolesShiftOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : ListShiftRolesByVendorIdShiftRolesShiftOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -334,7 +334,9 @@ class ListShiftRolesByVendorIdShiftRolesShiftOrder {
if (eventName != null) { if (eventName != null) {
json['eventName'] = nativeToJson<String?>(eventName); json['eventName'] = nativeToJson<String?>(eventName);
} }
json['vendorId'] = nativeToJson<String>(vendorId); if (vendorId != null) {
json['vendorId'] = nativeToJson<String?>(vendorId);
}
json['businessId'] = nativeToJson<String>(businessId); json['businessId'] = nativeToJson<String>(businessId);
json['orderType'] = json['orderType'] =
orderTypeSerializer(orderType) orderTypeSerializer(orderType)
@@ -355,14 +357,16 @@ class ListShiftRolesByVendorIdShiftRolesShiftOrder {
json['notes'] = nativeToJson<String?>(notes); json['notes'] = nativeToJson<String?>(notes);
} }
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
ListShiftRolesByVendorIdShiftRolesShiftOrder({ ListShiftRolesByVendorIdShiftRolesShiftOrder({
required this.id, required this.id,
this.eventName, this.eventName,
required this.vendorId, this.vendorId,
required this.businessId, required this.businessId,
required this.orderType, required this.orderType,
required this.status, required this.status,
@@ -371,7 +375,7 @@ class ListShiftRolesByVendorIdShiftRolesShiftOrder {
this.permanentDays, this.permanentDays,
this.notes, this.notes,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -220,9 +220,9 @@ class ListShiftsShiftsOrder {
final EnumValue<OrderStatus> status; final EnumValue<OrderStatus> status;
final EnumValue<OrderType> orderType; final EnumValue<OrderType> orderType;
final String businessId; final String businessId;
final String vendorId; final String? vendorId;
final ListShiftsShiftsOrderBusiness business; final ListShiftsShiftsOrderBusiness business;
final ListShiftsShiftsOrderVendor vendor; final ListShiftsShiftsOrderVendor? vendor;
ListShiftsShiftsOrder.fromJson(dynamic json): ListShiftsShiftsOrder.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']), id = nativeFromJson<String>(json['id']),
@@ -230,9 +230,9 @@ class ListShiftsShiftsOrder {
status = orderStatusDeserializer(json['status']), status = orderStatusDeserializer(json['status']),
orderType = orderTypeDeserializer(json['orderType']), orderType = orderTypeDeserializer(json['orderType']),
businessId = nativeFromJson<String>(json['businessId']), businessId = nativeFromJson<String>(json['businessId']),
vendorId = nativeFromJson<String>(json['vendorId']), vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
business = ListShiftsShiftsOrderBusiness.fromJson(json['business']), business = ListShiftsShiftsOrderBusiness.fromJson(json['business']),
vendor = ListShiftsShiftsOrderVendor.fromJson(json['vendor']); vendor = json['vendor'] == null ? null : ListShiftsShiftsOrderVendor.fromJson(json['vendor']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if(identical(this, other)) { if(identical(this, other)) {
@@ -270,9 +270,13 @@ class ListShiftsShiftsOrder {
orderTypeSerializer(orderType) orderTypeSerializer(orderType)
; ;
json['businessId'] = nativeToJson<String>(businessId); json['businessId'] = nativeToJson<String>(businessId);
json['vendorId'] = nativeToJson<String>(vendorId); if (vendorId != null) {
json['vendorId'] = nativeToJson<String?>(vendorId);
}
json['business'] = business.toJson(); json['business'] = business.toJson();
json['vendor'] = vendor.toJson(); if (vendor != null) {
json['vendor'] = vendor!.toJson();
}
return json; return json;
} }
@@ -282,9 +286,9 @@ class ListShiftsShiftsOrder {
required this.status, required this.status,
required this.orderType, required this.orderType,
required this.businessId, required this.businessId,
required this.vendorId, this.vendorId,
required this.business, required this.business,
required this.vendor, this.vendor,
}); });
} }

View File

@@ -10,6 +10,8 @@ class OneTimeOrder extends Equatable {
required this.date, required this.date,
required this.location, required this.location,
required this.positions, required this.positions,
this.vendorId,
this.roleRates = const <String, double>{},
}); });
/// The specific date for the shift or event. /// The specific date for the shift or event.
final DateTime date; final DateTime date;
@@ -20,6 +22,18 @@ class OneTimeOrder extends Equatable {
/// The list of positions and headcounts required for this order. /// The list of positions and headcounts required for this order.
final List<OneTimeOrderPosition> positions; final List<OneTimeOrderPosition> positions;
/// Selected vendor id for this order.
final String? vendorId;
/// Role hourly rates keyed by role id.
final Map<String, double> roleRates;
@override @override
List<Object?> get props => <Object?>[date, location, positions]; List<Object?> get props => <Object?>[
date,
location,
positions,
vendorId,
roleRates,
];
} }

View File

@@ -1,6 +1,7 @@
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_modular/flutter_modular.dart'; import 'package:flutter_modular/flutter_modular.dart';
import 'package:krow_data_connect/krow_data_connect.dart'; import 'package:krow_data_connect/krow_data_connect.dart';
import 'package:firebase_auth/firebase_auth.dart' as firebase;
import 'data/repositories_impl/client_create_order_repository_impl.dart'; import 'data/repositories_impl/client_create_order_repository_impl.dart';
import 'domain/repositories/client_create_order_repository_interface.dart'; import 'domain/repositories/client_create_order_repository_interface.dart';
import 'domain/usecases/create_one_time_order_usecase.dart'; import 'domain/usecases/create_one_time_order_usecase.dart';
@@ -29,7 +30,8 @@ class ClientCreateOrderModule extends Module {
// Repositories // Repositories
i.addLazySingleton<ClientCreateOrderRepositoryInterface>( i.addLazySingleton<ClientCreateOrderRepositoryInterface>(
() => ClientCreateOrderRepositoryImpl( () => ClientCreateOrderRepositoryImpl(
orderMock: i.get<OrderRepositoryMock>(), firebaseAuth: firebase.FirebaseAuth.instance,
dataConnect: ExampleConnector.instance,
), ),
); );
@@ -41,7 +43,12 @@ class ClientCreateOrderModule extends Module {
// BLoCs // BLoCs
i.addSingleton<ClientCreateOrderBloc>(ClientCreateOrderBloc.new); i.addSingleton<ClientCreateOrderBloc>(ClientCreateOrderBloc.new);
i.add<RapidOrderBloc>(RapidOrderBloc.new); i.add<RapidOrderBloc>(RapidOrderBloc.new);
i.add<OneTimeOrderBloc>(OneTimeOrderBloc.new); i.add<OneTimeOrderBloc>(
() => OneTimeOrderBloc(
i.get<CreateOneTimeOrderUseCase>(),
ExampleConnector.instance,
),
);
} }
@override @override

View File

@@ -1,5 +1,8 @@
import 'package:krow_data_connect/krow_data_connect.dart' hide OrderType; import 'package:firebase_auth/firebase_auth.dart' as firebase;
import 'package:krow_domain/krow_domain.dart'; import 'package:firebase_data_connect/firebase_data_connect.dart' as fdc;
import 'package:intl/intl.dart';
import 'package:krow_data_connect/krow_data_connect.dart' as dc;
import 'package:krow_domain/krow_domain.dart' as domain;
import '../../domain/repositories/client_create_order_repository_interface.dart'; import '../../domain/repositories/client_create_order_repository_interface.dart';
/// Implementation of [ClientCreateOrderRepositoryInterface]. /// Implementation of [ClientCreateOrderRepositoryInterface].
@@ -12,29 +15,171 @@ import '../../domain/repositories/client_create_order_repository_interface.dart'
/// on delegation and data mapping, without business logic. /// on delegation and data mapping, without business logic.
class ClientCreateOrderRepositoryImpl class ClientCreateOrderRepositoryImpl
implements ClientCreateOrderRepositoryInterface { implements ClientCreateOrderRepositoryInterface {
/// Creates a [ClientCreateOrderRepositoryImpl]. ClientCreateOrderRepositoryImpl({
/// required firebase.FirebaseAuth firebaseAuth,
/// Requires the [OrderRepositoryMock] from the shared Data Connect package. required dc.ExampleConnector dataConnect,
/// TODO: Inject and use ExampleConnector when real mutations are available. }) : _firebaseAuth = firebaseAuth,
ClientCreateOrderRepositoryImpl({required OrderRepositoryMock orderMock}) _dataConnect = dataConnect;
: _orderMock = orderMock;
final OrderRepositoryMock _orderMock; final firebase.FirebaseAuth _firebaseAuth;
final dc.ExampleConnector _dataConnect;
@override @override
Future<List<OrderType>> getOrderTypes() { Future<List<domain.OrderType>> getOrderTypes() {
// Delegates to Data Connect layer return Future.value(const <domain.OrderType>[
return _orderMock.getOrderTypes(); domain.OrderType(
id: 'rapid',
titleKey: 'client_create_order.types.rapid',
descriptionKey: 'client_create_order.types.rapid_desc',
),
domain.OrderType(
id: 'one-time',
titleKey: 'client_create_order.types.one_time',
descriptionKey: 'client_create_order.types.one_time_desc',
),
domain.OrderType(
id: 'recurring',
titleKey: 'client_create_order.types.recurring',
descriptionKey: 'client_create_order.types.recurring_desc',
),
domain.OrderType(
id: 'permanent',
titleKey: 'client_create_order.types.permanent',
descriptionKey: 'client_create_order.types.permanent_desc',
),
]);
} }
@override @override
Future<void> createOneTimeOrder(OneTimeOrder order) { Future<void> createOneTimeOrder(domain.OneTimeOrder order) async {
// Delegates to Data Connect layer final businessId = dc.ClientSessionStore.instance.session?.business?.id;
return _orderMock.createOneTimeOrder(order); if (businessId == null || businessId.isEmpty) {
await _firebaseAuth.signOut();
throw Exception('Business is missing. Please sign in again.');
}
final vendorId = order.vendorId;
if (vendorId == null || vendorId.isEmpty) {
throw Exception('Vendor is missing.');
}
final orderTimestamp = _toTimestamp(order.date);
final orderResult = await _dataConnect
.createOrder(businessId: businessId, orderType: dc.OrderType.ONE_TIME)
.vendorId(vendorId)
.location(order.location)
.status(dc.OrderStatus.POSTED)
.date(orderTimestamp)
.execute();
final orderId = orderResult.data?.order_insert.id;
if (orderId == null) {
throw Exception('Order creation failed.');
}
final workersNeeded = order.positions.fold<int>(
0,
(sum, position) => sum + position.count,
);
final shiftTitle = 'Shift 1 ${_formatDate(order.date)}';
final shiftCost = _calculateShiftCost(order);
final shiftResult = await _dataConnect
.createShift(title: shiftTitle, orderId: orderId)
.date(orderTimestamp)
.location(order.location)
.locationAddress(order.location)
.status(dc.ShiftStatus.PENDING)
.workersNeeded(workersNeeded)
.filled(0)
.durationDays(1)
.cost(shiftCost)
.execute();
final shiftId = shiftResult.data?.shift_insert.id;
if (shiftId == null) {
throw Exception('Shift creation failed.');
}
for (final position in order.positions) {
final start = _parseTime(order.date, position.startTime);
final end = _parseTime(order.date, position.endTime);
final normalizedEnd =
end.isBefore(start) ? end.add(const Duration(days: 1)) : end;
final hours = normalizedEnd.difference(start).inMinutes / 60.0;
final rate = order.roleRates[position.role] ?? 0;
final totalValue = rate * hours;
await _dataConnect
.createShiftRole(
shiftId: shiftId,
roleId: position.role,
count: position.count,
)
.startTime(_toTimestamp(start))
.endTime(_toTimestamp(normalizedEnd))
.hours(hours)
.totalValue(totalValue)
.execute();
}
await _dataConnect
.updateOrder(id: orderId)
.shifts(fdc.AnyValue(<String>[shiftId]))
.execute();
} }
@override @override
Future<void> createRapidOrder(String description) { Future<void> createRapidOrder(String description) async {
// Delegates to Data Connect layer // TO-DO: connect IA and return array with the information.
return _orderMock.createRapidOrder(description); throw UnimplementedError('Rapid order IA is not connected yet.');
}
double _calculateShiftCost(domain.OneTimeOrder order) {
double total = 0;
for (final position in order.positions) {
final start = _parseTime(order.date, position.startTime);
final end = _parseTime(order.date, position.endTime);
final normalizedEnd =
end.isBefore(start) ? end.add(const Duration(days: 1)) : end;
final hours = normalizedEnd.difference(start).inMinutes / 60.0;
final rate = order.roleRates[position.role] ?? 0;
total += rate * hours;
}
return total;
}
DateTime _parseTime(DateTime date, String time) {
if (time.trim().isEmpty) {
throw Exception('Shift time is missing.');
}
DateTime parsed;
try {
parsed = DateFormat.jm().parse(time);
} catch (_) {
parsed = DateFormat.Hm().parse(time);
}
return DateTime(
date.year,
date.month,
date.day,
parsed.hour,
parsed.minute,
);
}
fdc.Timestamp _toTimestamp(DateTime dateTime) {
final utc = dateTime.toUtc();
final seconds = utc.millisecondsSinceEpoch ~/ 1000;
final nanoseconds = (utc.microsecondsSinceEpoch % 1000000) * 1000;
return fdc.Timestamp(nanoseconds, seconds);
}
String _formatDate(DateTime dateTime) {
final year = dateTime.year.toString().padLeft(4, '0');
final month = dateTime.month.toString().padLeft(2, '0');
final day = dateTime.day.toString().padLeft(2, '0');
return '$year-$month-$day';
} }
} }

View File

@@ -1,4 +1,5 @@
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:krow_data_connect/krow_data_connect.dart' as dc;
import 'package:krow_domain/krow_domain.dart'; import 'package:krow_domain/krow_domain.dart';
import '../../domain/arguments/one_time_order_arguments.dart'; import '../../domain/arguments/one_time_order_arguments.dart';
import '../../domain/usecases/create_one_time_order_usecase.dart'; import '../../domain/usecases/create_one_time_order_usecase.dart';
@@ -7,7 +8,7 @@ import 'one_time_order_state.dart';
/// BLoC for managing the multi-step one-time order creation form. /// BLoC for managing the multi-step one-time order creation form.
class OneTimeOrderBloc extends Bloc<OneTimeOrderEvent, OneTimeOrderState> { class OneTimeOrderBloc extends Bloc<OneTimeOrderEvent, OneTimeOrderState> {
OneTimeOrderBloc(this._createOneTimeOrderUseCase) OneTimeOrderBloc(this._createOneTimeOrderUseCase, this._dataConnect)
: super(OneTimeOrderState.initial()) { : super(OneTimeOrderState.initial()) {
on<OneTimeOrderVendorsLoaded>(_onVendorsLoaded); on<OneTimeOrderVendorsLoaded>(_onVendorsLoaded);
on<OneTimeOrderVendorChanged>(_onVendorChanged); on<OneTimeOrderVendorChanged>(_onVendorChanged);
@@ -18,52 +19,64 @@ class OneTimeOrderBloc extends Bloc<OneTimeOrderEvent, OneTimeOrderState> {
on<OneTimeOrderPositionUpdated>(_onPositionUpdated); on<OneTimeOrderPositionUpdated>(_onPositionUpdated);
on<OneTimeOrderSubmitted>(_onSubmitted); on<OneTimeOrderSubmitted>(_onSubmitted);
// Initial load of mock vendors _loadVendors();
add(
const OneTimeOrderVendorsLoaded(<Vendor>[
Vendor(
id: 'v1',
name: 'Elite Staffing',
rates: <String, double>{
'Server': 25.0,
'Bartender': 30.0,
'Cook': 28.0,
'Busser': 18.0,
'Host': 20.0,
'Barista': 22.0,
'Dishwasher': 17.0,
'Event Staff': 19.0,
},
),
Vendor(
id: 'v2',
name: 'Premier Workforce',
rates: <String, double>{
'Server': 22.0,
'Bartender': 28.0,
'Cook': 25.0,
'Busser': 16.0,
'Host': 18.0,
'Barista': 20.0,
'Dishwasher': 15.0,
'Event Staff': 18.0,
},
),
]),
);
} }
final CreateOneTimeOrderUseCase _createOneTimeOrderUseCase; final CreateOneTimeOrderUseCase _createOneTimeOrderUseCase;
final dc.ExampleConnector _dataConnect;
Future<void> _loadVendors() async {
try {
final result = await _dataConnect.listVendors().execute();
final vendors = result.data.vendors
.map(
(vendor) => Vendor(
id: vendor.id,
name: vendor.companyName,
rates: const <String, double>{},
),
)
.toList();
add(OneTimeOrderVendorsLoaded(vendors));
} catch (_) {
add(const OneTimeOrderVendorsLoaded(<Vendor>[]));
}
}
Future<void> _loadRolesForVendor(String vendorId) async {
try {
final result = await _dataConnect.listRolesByVendorId(
vendorId: vendorId,
).execute();
final roles = result.data.roles
.map(
(role) => OneTimeOrderRoleOption(
id: role.id,
name: role.name,
costPerHour: role.costPerHour,
),
)
.toList();
emit(state.copyWith(roles: roles));
} catch (_) {
emit(state.copyWith(roles: const <OneTimeOrderRoleOption>[]));
}
}
void _onVendorsLoaded( void _onVendorsLoaded(
OneTimeOrderVendorsLoaded event, OneTimeOrderVendorsLoaded event,
Emitter<OneTimeOrderState> emit, Emitter<OneTimeOrderState> emit,
) { ) {
final Vendor? selectedVendor =
event.vendors.isNotEmpty ? event.vendors.first : null;
emit( emit(
state.copyWith( state.copyWith(
vendors: event.vendors, vendors: event.vendors,
selectedVendor: event.vendors.isNotEmpty ? event.vendors.first : null, selectedVendor: selectedVendor,
), ),
); );
if (selectedVendor != null) {
_loadRolesForVendor(selectedVendor.id);
}
} }
void _onVendorChanged( void _onVendorChanged(
@@ -71,6 +84,7 @@ class OneTimeOrderBloc extends Bloc<OneTimeOrderEvent, OneTimeOrderState> {
Emitter<OneTimeOrderState> emit, Emitter<OneTimeOrderState> emit,
) { ) {
emit(state.copyWith(selectedVendor: event.vendor)); emit(state.copyWith(selectedVendor: event.vendor));
_loadRolesForVendor(event.vendor.id);
} }
void _onDateChanged( void _onDateChanged(
@@ -131,11 +145,15 @@ class OneTimeOrderBloc extends Bloc<OneTimeOrderEvent, OneTimeOrderState> {
) async { ) async {
emit(state.copyWith(status: OneTimeOrderStatus.loading)); emit(state.copyWith(status: OneTimeOrderStatus.loading));
try { try {
final Map<String, double> roleRates = <String, double>{
for (final role in state.roles) role.id: role.costPerHour,
};
final OneTimeOrder order = OneTimeOrder( final OneTimeOrder order = OneTimeOrder(
date: state.date, date: state.date,
location: state.location, location: state.location,
positions: state.positions, positions: state.positions,
// In a real app, we'd pass the vendorId here vendorId: state.selectedVendor?.id,
roleRates: roleRates,
); );
await _createOneTimeOrderUseCase(OneTimeOrderArguments(order: order)); await _createOneTimeOrderUseCase(OneTimeOrderArguments(order: order));
emit(state.copyWith(status: OneTimeOrderStatus.success)); emit(state.copyWith(status: OneTimeOrderStatus.success));

View File

@@ -12,6 +12,7 @@ class OneTimeOrderState extends Equatable {
this.errorMessage, this.errorMessage,
this.vendors = const <Vendor>[], this.vendors = const <Vendor>[],
this.selectedVendor, this.selectedVendor,
this.roles = const <OneTimeOrderRoleOption>[],
}); });
factory OneTimeOrderState.initial() { factory OneTimeOrderState.initial() {
@@ -22,6 +23,7 @@ class OneTimeOrderState extends Equatable {
OneTimeOrderPosition(role: '', count: 1, startTime: '', endTime: ''), OneTimeOrderPosition(role: '', count: 1, startTime: '', endTime: ''),
], ],
vendors: const <Vendor>[], vendors: const <Vendor>[],
roles: const <OneTimeOrderRoleOption>[],
); );
} }
final DateTime date; final DateTime date;
@@ -31,6 +33,7 @@ class OneTimeOrderState extends Equatable {
final String? errorMessage; final String? errorMessage;
final List<Vendor> vendors; final List<Vendor> vendors;
final Vendor? selectedVendor; final Vendor? selectedVendor;
final List<OneTimeOrderRoleOption> roles;
OneTimeOrderState copyWith({ OneTimeOrderState copyWith({
DateTime? date, DateTime? date,
@@ -40,6 +43,7 @@ class OneTimeOrderState extends Equatable {
String? errorMessage, String? errorMessage,
List<Vendor>? vendors, List<Vendor>? vendors,
Vendor? selectedVendor, Vendor? selectedVendor,
List<OneTimeOrderRoleOption>? roles,
}) { }) {
return OneTimeOrderState( return OneTimeOrderState(
date: date ?? this.date, date: date ?? this.date,
@@ -49,6 +53,7 @@ class OneTimeOrderState extends Equatable {
errorMessage: errorMessage ?? this.errorMessage, errorMessage: errorMessage ?? this.errorMessage,
vendors: vendors ?? this.vendors, vendors: vendors ?? this.vendors,
selectedVendor: selectedVendor ?? this.selectedVendor, selectedVendor: selectedVendor ?? this.selectedVendor,
roles: roles ?? this.roles,
); );
} }
@@ -61,5 +66,21 @@ class OneTimeOrderState extends Equatable {
errorMessage, errorMessage,
vendors, vendors,
selectedVendor, selectedVendor,
roles,
]; ];
} }
class OneTimeOrderRoleOption extends Equatable {
const OneTimeOrderRoleOption({
required this.id,
required this.name,
required this.costPerHour,
});
final String id;
final String name;
final double costPerHour;
@override
List<Object?> get props => <Object?>[id, name, costPerHour];
}

View File

@@ -64,14 +64,17 @@ class RapidOrderBloc extends Bloc<RapidOrderEvent, RapidOrderState> {
final RapidOrderState currentState = state; final RapidOrderState currentState = state;
if (currentState is RapidOrderInitial) { if (currentState is RapidOrderInitial) {
final String message = currentState.message; final String message = currentState.message;
print('RapidOrder submit: message="$message"');
emit(const RapidOrderSubmitting()); emit(const RapidOrderSubmitting());
try { try {
await _createRapidOrderUseCase( await _createRapidOrderUseCase(
RapidOrderArguments(description: message), RapidOrderArguments(description: message),
); );
print('RapidOrder submit: success');
emit(const RapidOrderSuccess()); emit(const RapidOrderSuccess());
} catch (e) { } catch (e) {
print('RapidOrder submit: error=$e');
emit(RapidOrderFailure(e.toString())); emit(RapidOrderFailure(e.toString()));
} }
} }

View File

@@ -2,6 +2,7 @@ import 'package:core_localization/core_localization.dart';
import 'package:design_system/design_system.dart'; import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:krow_domain/krow_domain.dart'; import 'package:krow_domain/krow_domain.dart';
import '../../blocs/one_time_order_state.dart';
/// A card widget for editing a specific position in a one-time order. /// A card widget for editing a specific position in a one-time order.
/// Matches the prototype layout while using design system tokens. /// Matches the prototype layout while using design system tokens.
@@ -19,7 +20,7 @@ class OneTimeOrderPositionCard extends StatelessWidget {
required this.startLabel, required this.startLabel,
required this.endLabel, required this.endLabel,
required this.lunchLabel, required this.lunchLabel,
this.vendor, required this.roles,
super.key, super.key,
}); });
@@ -56,8 +57,8 @@ class OneTimeOrderPositionCard extends StatelessWidget {
/// Label for the lunch break. /// Label for the lunch break.
final String lunchLabel; final String lunchLabel;
/// The current selected vendor to determine rates. /// Available roles for the selected vendor.
final Vendor? vendor; final List<OneTimeOrderRoleOption> roles;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -118,26 +119,7 @@ class OneTimeOrderPositionCard extends StatelessWidget {
onUpdated(position.copyWith(role: val)); onUpdated(position.copyWith(role: val));
} }
}, },
items: items: _buildRoleItems(),
<String>{
...(vendor?.rates.keys ?? <String>[]),
if (position.role.isNotEmpty &&
!(vendor?.rates.keys.contains(position.role) ??
false))
position.role,
}.map((String role) {
final double? rate = vendor?.rates[role];
final String label = rate == null
? role
: '$role - \$${rate.toStringAsFixed(0)}/hr';
return DropdownMenuItem<String>(
value: role,
child: Text(
label,
style: UiTypography.body2r.textPrimary,
),
);
}).toList(),
), ),
), ),
), ),
@@ -317,4 +299,33 @@ class OneTimeOrderPositionCard extends StatelessWidget {
], ],
); );
} }
List<DropdownMenuItem<String>> _buildRoleItems() {
final items = roles
.map(
(role) => DropdownMenuItem<String>(
value: role.id,
child: Text(
'${role.name} - \$${role.costPerHour.toStringAsFixed(0)}',
style: UiTypography.body2r.textPrimary,
),
),
)
.toList();
final hasSelected = roles.any((role) => role.id == position.role);
if (position.role.isNotEmpty && !hasSelected) {
items.add(
DropdownMenuItem<String>(
value: position.role,
child: Text(
position.role,
style: UiTypography.body2r.textPrimary,
),
),
);
}
return items;
}
} }

View File

@@ -215,7 +215,7 @@ class _OneTimeOrderForm extends StatelessWidget {
startLabel: labels.start_label, startLabel: labels.start_label,
endLabel: labels.end_label, endLabel: labels.end_label,
lunchLabel: labels.lunch_break_label, lunchLabel: labels.lunch_break_label,
vendor: state.selectedVendor, roles: state.roles,
onUpdated: (OneTimeOrderPosition updated) { onUpdated: (OneTimeOrderPosition updated) {
BlocProvider.of<OneTimeOrderBloc>( BlocProvider.of<OneTimeOrderBloc>(
context, context,

View File

@@ -288,9 +288,12 @@ class _RapidOrderActions extends StatelessWidget {
trailingIcon: UiIcons.arrowRight, trailingIcon: UiIcons.arrowRight,
onPressed: isSubmitting || isMessageEmpty onPressed: isSubmitting || isMessageEmpty
? null ? null
: () => BlocProvider.of<RapidOrderBloc>( : () {
context, print('RapidOrder send pressed');
).add(const RapidOrderSubmitted()), BlocProvider.of<RapidOrderBloc>(
context,
).add(const RapidOrderSubmitted());
},
), ),
), ),
], ],

View File

@@ -1,5 +1,5 @@
mutation createOrder( mutation createOrder(
$vendorId: UUID! $vendorId: UUID
$businessId: UUID! $businessId: UUID!
$orderType: OrderType! $orderType: OrderType!
$location: String $location: String

View File

@@ -26,8 +26,8 @@ type Order @table(name: "orders") {
id: UUID! @default(expr: "uuidV4()") id: UUID! @default(expr: "uuidV4()")
eventName: String eventName: String
vendorId: UUID! vendorId: UUID
vendor: Vendor! @ref(fields: "vendorId", references: "id") vendor: Vendor @ref(fields: "vendorId", references: "id")
businessId: UUID! businessId: UUID!
business: Business! @ref(fields: "businessId", references: "id") business: Business! @ref(fields: "businessId", references: "id")