update and correction of create order

This commit is contained in:
José Salazar
2026-01-25 13:21:16 -05:00
parent 8f8c6ff2d2
commit bda0b441e9
15 changed files with 23283 additions and 22306 deletions

View File

@@ -1,16 +1,16 @@
# Basic Usage
```dart
ExampleConnector.instance.getStaffDocumentByKey(getStaffDocumentByKeyVariables).execute();
ExampleConnector.instance.listStaffDocumentsByStaffId(listStaffDocumentsByStaffIdVariables).execute();
ExampleConnector.instance.listStaffDocumentsByDocumentType(listStaffDocumentsByDocumentTypeVariables).execute();
ExampleConnector.instance.listStaffDocumentsByStatus(listStaffDocumentsByStatusVariables).execute();
ExampleConnector.instance.createTeam(createTeamVariables).execute();
ExampleConnector.instance.updateTeam(updateTeamVariables).execute();
ExampleConnector.instance.deleteTeam(deleteTeamVariables).execute();
ExampleConnector.instance.listInvoiceTemplates(listInvoiceTemplatesVariables).execute();
ExampleConnector.instance.getInvoiceTemplateById(getInvoiceTemplateByIdVariables).execute();
ExampleConnector.instance.listInvoiceTemplatesByOwnerId(listInvoiceTemplatesByOwnerIdVariables).execute();
ExampleConnector.instance.createCustomRateCard(createCustomRateCardVariables).execute();
ExampleConnector.instance.updateCustomRateCard(updateCustomRateCardVariables).execute();
ExampleConnector.instance.deleteCustomRateCard(deleteCustomRateCardVariables).execute();
ExampleConnector.instance.listShiftsForCoverage(listShiftsForCoverageVariables).execute();
ExampleConnector.instance.listApplicationsForCoverage(listApplicationsForCoverageVariables).execute();
ExampleConnector.instance.listShiftsForDailyOpsByBusiness(listShiftsForDailyOpsByBusinessVariables).execute();
ExampleConnector.instance.listShiftsForDailyOpsByVendor(listShiftsForDailyOpsByVendorVariables).execute();
ExampleConnector.instance.listApplicationsForDailyOps(listApplicationsForDailyOpsVariables).execute();
ExampleConnector.instance.listShiftsForForecastByBusiness(listShiftsForForecastByBusinessVariables).execute();
ExampleConnector.instance.listShiftsForForecastByVendor(listShiftsForForecastByVendorVariables).execute();
```
@@ -23,8 +23,8 @@ Optional fields can be discovered based on classes that have `Optional` object t
This is an example of a mutation with an optional field:
```dart
await ExampleConnector.instance.updateMessage({ ... })
.conversationId(...)
await ExampleConnector.instance.UpdateUser({ ... })
.email(...)
.execute();
```

View File

@@ -0,0 +1,404 @@
part of 'generated.dart';
class ListShiftRolesByBusinessAndOrderVariablesBuilder {
String businessId;
String orderId;
Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);
final FirebaseDataConnect _dataConnect; ListShiftRolesByBusinessAndOrderVariablesBuilder offset(int? t) {
_offset.value = t;
return this;
}
ListShiftRolesByBusinessAndOrderVariablesBuilder limit(int? t) {
_limit.value = t;
return this;
}
ListShiftRolesByBusinessAndOrderVariablesBuilder(this._dataConnect, {required this.businessId,required this.orderId,});
Deserializer<ListShiftRolesByBusinessAndOrderData> dataDeserializer = (dynamic json) => ListShiftRolesByBusinessAndOrderData.fromJson(jsonDecode(json));
Serializer<ListShiftRolesByBusinessAndOrderVariables> varsSerializer = (ListShiftRolesByBusinessAndOrderVariables vars) => jsonEncode(vars.toJson());
Future<QueryResult<ListShiftRolesByBusinessAndOrderData, ListShiftRolesByBusinessAndOrderVariables>> execute() {
return ref().execute();
}
QueryRef<ListShiftRolesByBusinessAndOrderData, ListShiftRolesByBusinessAndOrderVariables> ref() {
ListShiftRolesByBusinessAndOrderVariables vars= ListShiftRolesByBusinessAndOrderVariables(businessId: businessId,orderId: orderId,offset: _offset,limit: _limit,);
return _dataConnect.query("listShiftRolesByBusinessAndOrder", dataDeserializer, varsSerializer, vars);
}
}
@immutable
class ListShiftRolesByBusinessAndOrderShiftRoles {
final String id;
final String shiftId;
final String roleId;
final int count;
final int? assigned;
final Timestamp? startTime;
final Timestamp? endTime;
final double? hours;
final EnumValue<BreakDuration>? breakType;
final double? totalValue;
final Timestamp? createdAt;
final ListShiftRolesByBusinessAndOrderShiftRolesRole role;
final ListShiftRolesByBusinessAndOrderShiftRolesShift shift;
ListShiftRolesByBusinessAndOrderShiftRoles.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']),
shiftId = nativeFromJson<String>(json['shiftId']),
roleId = nativeFromJson<String>(json['roleId']),
count = nativeFromJson<int>(json['count']),
assigned = json['assigned'] == null ? null : nativeFromJson<int>(json['assigned']),
startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']),
endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']),
hours = json['hours'] == null ? null : nativeFromJson<double>(json['hours']),
breakType = json['breakType'] == null ? null : breakDurationDeserializer(json['breakType']),
totalValue = json['totalValue'] == null ? null : nativeFromJson<double>(json['totalValue']),
createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
role = ListShiftRolesByBusinessAndOrderShiftRolesRole.fromJson(json['role']),
shift = ListShiftRolesByBusinessAndOrderShiftRolesShift.fromJson(json['shift']);
@override
bool operator ==(Object other) {
if(identical(this, other)) {
return true;
}
if(other.runtimeType != runtimeType) {
return false;
}
final ListShiftRolesByBusinessAndOrderShiftRoles otherTyped = other as ListShiftRolesByBusinessAndOrderShiftRoles;
return id == otherTyped.id &&
shiftId == otherTyped.shiftId &&
roleId == otherTyped.roleId &&
count == otherTyped.count &&
assigned == otherTyped.assigned &&
startTime == otherTyped.startTime &&
endTime == otherTyped.endTime &&
hours == otherTyped.hours &&
breakType == otherTyped.breakType &&
totalValue == otherTyped.totalValue &&
createdAt == otherTyped.createdAt &&
role == otherTyped.role &&
shift == otherTyped.shift;
}
@override
int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, breakType.hashCode, totalValue.hashCode, createdAt.hashCode, role.hashCode, shift.hashCode]);
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['id'] = nativeToJson<String>(id);
json['shiftId'] = nativeToJson<String>(shiftId);
json['roleId'] = nativeToJson<String>(roleId);
json['count'] = nativeToJson<int>(count);
if (assigned != null) {
json['assigned'] = nativeToJson<int?>(assigned);
}
if (startTime != null) {
json['startTime'] = startTime!.toJson();
}
if (endTime != null) {
json['endTime'] = endTime!.toJson();
}
if (hours != null) {
json['hours'] = nativeToJson<double?>(hours);
}
if (breakType != null) {
json['breakType'] =
breakDurationSerializer(breakType!)
;
}
if (totalValue != null) {
json['totalValue'] = nativeToJson<double?>(totalValue);
}
if (createdAt != null) {
json['createdAt'] = createdAt!.toJson();
}
json['role'] = role.toJson();
json['shift'] = shift.toJson();
return json;
}
ListShiftRolesByBusinessAndOrderShiftRoles({
required this.id,
required this.shiftId,
required this.roleId,
required this.count,
this.assigned,
this.startTime,
this.endTime,
this.hours,
this.breakType,
this.totalValue,
this.createdAt,
required this.role,
required this.shift,
});
}
@immutable
class ListShiftRolesByBusinessAndOrderShiftRolesRole {
final String id;
final String name;
final double costPerHour;
ListShiftRolesByBusinessAndOrderShiftRolesRole.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']),
name = nativeFromJson<String>(json['name']),
costPerHour = nativeFromJson<double>(json['costPerHour']);
@override
bool operator ==(Object other) {
if(identical(this, other)) {
return true;
}
if(other.runtimeType != runtimeType) {
return false;
}
final ListShiftRolesByBusinessAndOrderShiftRolesRole otherTyped = other as ListShiftRolesByBusinessAndOrderShiftRolesRole;
return id == otherTyped.id &&
name == otherTyped.name &&
costPerHour == otherTyped.costPerHour;
}
@override
int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]);
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['id'] = nativeToJson<String>(id);
json['name'] = nativeToJson<String>(name);
json['costPerHour'] = nativeToJson<double>(costPerHour);
return json;
}
ListShiftRolesByBusinessAndOrderShiftRolesRole({
required this.id,
required this.name,
required this.costPerHour,
});
}
@immutable
class ListShiftRolesByBusinessAndOrderShiftRolesShift {
final String id;
final String title;
final Timestamp? date;
final String orderId;
final String? location;
final String? locationAddress;
final ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder order;
ListShiftRolesByBusinessAndOrderShiftRolesShift.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']),
title = nativeFromJson<String>(json['title']),
date = json['date'] == null ? null : Timestamp.fromJson(json['date']),
orderId = nativeFromJson<String>(json['orderId']),
location = json['location'] == null ? null : nativeFromJson<String>(json['location']),
locationAddress = json['locationAddress'] == null ? null : nativeFromJson<String>(json['locationAddress']),
order = ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder.fromJson(json['order']);
@override
bool operator ==(Object other) {
if(identical(this, other)) {
return true;
}
if(other.runtimeType != runtimeType) {
return false;
}
final ListShiftRolesByBusinessAndOrderShiftRolesShift otherTyped = other as ListShiftRolesByBusinessAndOrderShiftRolesShift;
return id == otherTyped.id &&
title == otherTyped.title &&
date == otherTyped.date &&
orderId == otherTyped.orderId &&
location == otherTyped.location &&
locationAddress == otherTyped.locationAddress &&
order == otherTyped.order;
}
@override
int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, orderId.hashCode, location.hashCode, locationAddress.hashCode, order.hashCode]);
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['id'] = nativeToJson<String>(id);
json['title'] = nativeToJson<String>(title);
if (date != null) {
json['date'] = date!.toJson();
}
json['orderId'] = nativeToJson<String>(orderId);
if (location != null) {
json['location'] = nativeToJson<String?>(location);
}
if (locationAddress != null) {
json['locationAddress'] = nativeToJson<String?>(locationAddress);
}
json['order'] = order.toJson();
return json;
}
ListShiftRolesByBusinessAndOrderShiftRolesShift({
required this.id,
required this.title,
this.date,
required this.orderId,
this.location,
this.locationAddress,
required this.order,
});
}
@immutable
class ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder {
final String? vendorId;
final Timestamp? date;
final String? location;
ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder.fromJson(dynamic json):
vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
date = json['date'] == null ? null : Timestamp.fromJson(json['date']),
location = json['location'] == null ? null : nativeFromJson<String>(json['location']);
@override
bool operator ==(Object other) {
if(identical(this, other)) {
return true;
}
if(other.runtimeType != runtimeType) {
return false;
}
final ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder otherTyped = other as ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder;
return vendorId == otherTyped.vendorId &&
date == otherTyped.date &&
location == otherTyped.location;
}
@override
int get hashCode => Object.hashAll([vendorId.hashCode, date.hashCode, location.hashCode]);
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
if (vendorId != null) {
json['vendorId'] = nativeToJson<String?>(vendorId);
}
if (date != null) {
json['date'] = date!.toJson();
}
if (location != null) {
json['location'] = nativeToJson<String?>(location);
}
return json;
}
ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder({
this.vendorId,
this.date,
this.location,
});
}
@immutable
class ListShiftRolesByBusinessAndOrderData {
final List<ListShiftRolesByBusinessAndOrderShiftRoles> shiftRoles;
ListShiftRolesByBusinessAndOrderData.fromJson(dynamic json):
shiftRoles = (json['shiftRoles'] as List<dynamic>)
.map((e) => ListShiftRolesByBusinessAndOrderShiftRoles.fromJson(e))
.toList();
@override
bool operator ==(Object other) {
if(identical(this, other)) {
return true;
}
if(other.runtimeType != runtimeType) {
return false;
}
final ListShiftRolesByBusinessAndOrderData otherTyped = other as ListShiftRolesByBusinessAndOrderData;
return shiftRoles == otherTyped.shiftRoles;
}
@override
int get hashCode => shiftRoles.hashCode;
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['shiftRoles'] = shiftRoles.map((e) => e.toJson()).toList();
return json;
}
ListShiftRolesByBusinessAndOrderData({
required this.shiftRoles,
});
}
@immutable
class ListShiftRolesByBusinessAndOrderVariables {
final String businessId;
final String orderId;
late final Optional<int>offset;
late final Optional<int>limit;
@Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
ListShiftRolesByBusinessAndOrderVariables.fromJson(Map<String, dynamic> json):
businessId = nativeFromJson<String>(json['businessId']),
orderId = nativeFromJson<String>(json['orderId']) {
offset = Optional.optional(nativeFromJson, nativeToJson);
offset.value = json['offset'] == null ? null : nativeFromJson<int>(json['offset']);
limit = Optional.optional(nativeFromJson, nativeToJson);
limit.value = json['limit'] == null ? null : nativeFromJson<int>(json['limit']);
}
@override
bool operator ==(Object other) {
if(identical(this, other)) {
return true;
}
if(other.runtimeType != runtimeType) {
return false;
}
final ListShiftRolesByBusinessAndOrderVariables otherTyped = other as ListShiftRolesByBusinessAndOrderVariables;
return businessId == otherTyped.businessId &&
orderId == otherTyped.orderId &&
offset == otherTyped.offset &&
limit == otherTyped.limit;
}
@override
int get hashCode => Object.hashAll([businessId.hashCode, orderId.hashCode, offset.hashCode, limit.hashCode]);
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['businessId'] = nativeToJson<String>(businessId);
json['orderId'] = nativeToJson<String>(orderId);
if(offset.state == OptionalState.set) {
json['offset'] = offset.toJson();
}
if(limit.state == OptionalState.set) {
json['limit'] = limit.toJson();
}
return json;
}
ListShiftRolesByBusinessAndOrderVariables({
required this.businessId,
required this.orderId,
required this.offset,
required this.limit,
});
}

View File

@@ -6,6 +6,7 @@ class UpdateOrderVariablesBuilder {
Optional<String> _businessId = Optional.optional(nativeFromJson, nativeToJson);
Optional<String> _location = Optional.optional(nativeFromJson, nativeToJson);
Optional<OrderStatus> _status = Optional.optional((data) => OrderStatus.values.byName(data), enumSerializer);
Optional<Timestamp> _date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer);
Optional<Timestamp> _startDate = Optional.optional((json) => json['startDate'] = Timestamp.fromJson(json['startDate']), defaultSerializer);
Optional<Timestamp> _endDate = Optional.optional((json) => json['endDate'] = Timestamp.fromJson(json['endDate']), defaultSerializer);
Optional<double> _total = Optional.optional(nativeFromJson, nativeToJson);
@@ -36,6 +37,10 @@ class UpdateOrderVariablesBuilder {
_status.value = t;
return this;
}
UpdateOrderVariablesBuilder date(Timestamp? t) {
_date.value = t;
return this;
}
UpdateOrderVariablesBuilder startDate(Timestamp? t) {
_startDate.value = t;
return this;
@@ -97,7 +102,7 @@ class UpdateOrderVariablesBuilder {
}
MutationRef<UpdateOrderData, UpdateOrderVariables> ref() {
UpdateOrderVariables vars= UpdateOrderVariables(id: id,vendorId: _vendorId,businessId: _businessId,location: _location,status: _status,startDate: _startDate,endDate: _endDate,total: _total,eventName: _eventName,assignedStaff: _assignedStaff,shifts: _shifts,requested: _requested,hub: _hub,recurringDays: _recurringDays,permanentDays: _permanentDays,notes: _notes,detectedConflicts: _detectedConflicts,poReference: _poReference,);
UpdateOrderVariables vars= UpdateOrderVariables(id: id,vendorId: _vendorId,businessId: _businessId,location: _location,status: _status,date: _date,startDate: _startDate,endDate: _endDate,total: _total,eventName: _eventName,assignedStaff: _assignedStaff,shifts: _shifts,requested: _requested,hub: _hub,recurringDays: _recurringDays,permanentDays: _permanentDays,notes: _notes,detectedConflicts: _detectedConflicts,poReference: _poReference,);
return _dataConnect.mutation("updateOrder", dataDeserializer, varsSerializer, vars);
}
}
@@ -179,6 +184,7 @@ class UpdateOrderVariables {
late final Optional<String>businessId;
late final Optional<String>location;
late final Optional<OrderStatus>status;
late final Optional<Timestamp>date;
late final Optional<Timestamp>startDate;
late final Optional<Timestamp>endDate;
late final Optional<double>total;
@@ -215,6 +221,10 @@ class UpdateOrderVariables {
status.value = json['status'] == null ? null : OrderStatus.values.byName(json['status']);
date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer);
date.value = json['date'] == null ? null : Timestamp.fromJson(json['date']);
startDate = Optional.optional((json) => json['startDate'] = Timestamp.fromJson(json['startDate']), defaultSerializer);
startDate.value = json['startDate'] == null ? null : Timestamp.fromJson(json['startDate']);
@@ -282,6 +292,7 @@ class UpdateOrderVariables {
businessId == otherTyped.businessId &&
location == otherTyped.location &&
status == otherTyped.status &&
date == otherTyped.date &&
startDate == otherTyped.startDate &&
endDate == otherTyped.endDate &&
total == otherTyped.total &&
@@ -298,7 +309,7 @@ class UpdateOrderVariables {
}
@override
int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, businessId.hashCode, location.hashCode, status.hashCode, startDate.hashCode, endDate.hashCode, total.hashCode, eventName.hashCode, assignedStaff.hashCode, shifts.hashCode, requested.hashCode, hub.hashCode, recurringDays.hashCode, permanentDays.hashCode, notes.hashCode, detectedConflicts.hashCode, poReference.hashCode]);
int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, businessId.hashCode, location.hashCode, status.hashCode, date.hashCode, startDate.hashCode, endDate.hashCode, total.hashCode, eventName.hashCode, assignedStaff.hashCode, shifts.hashCode, requested.hashCode, hub.hashCode, recurringDays.hashCode, permanentDays.hashCode, notes.hashCode, detectedConflicts.hashCode, poReference.hashCode]);
Map<String, dynamic> toJson() {
@@ -316,6 +327,9 @@ class UpdateOrderVariables {
if(status.state == OptionalState.set) {
json['status'] = status.toJson();
}
if(date.state == OptionalState.set) {
json['date'] = date.toJson();
}
if(startDate.state == OptionalState.set) {
json['startDate'] = startDate.toJson();
}
@@ -364,6 +378,7 @@ class UpdateOrderVariables {
required this.businessId,
required this.location,
required this.status,
required this.date,
required this.startDate,
required this.endDate,
required this.total,

View File

@@ -48,6 +48,7 @@ class OrderRepositoryMock {
return <OrderItem>[
OrderItem(
id: '1',
orderId: 'order_1',
title: 'Server - Wedding',
clientName: 'Grand Plaza Hotel',
status: 'filled',
@@ -75,6 +76,7 @@ class OrderRepositoryMock {
),
OrderItem(
id: '2',
orderId: 'order_2',
title: 'Bartender - Private Event',
clientName: 'Taste of the Town',
status: 'open',
@@ -101,6 +103,7 @@ class OrderRepositoryMock {
),
OrderItem(
id: '3',
orderId: 'order_3',
title: 'Event Staff',
clientName: 'City Center',
status: 'in_progress',
@@ -125,6 +128,7 @@ class OrderRepositoryMock {
),
OrderItem(
id: '4',
orderId: 'order_4',
title: 'Coat Check',
clientName: 'The Met Museum',
status: 'completed',