modifications for hub in create one time order
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
# Basic Usage
|
||||
|
||||
```dart
|
||||
ExampleConnector.instance.getMyTasks(getMyTasksVariables).execute();
|
||||
ExampleConnector.instance.getMemberTaskByIdKey(getMemberTaskByIdKeyVariables).execute();
|
||||
ExampleConnector.instance.getMemberTasksByTaskId(getMemberTasksByTaskIdVariables).execute();
|
||||
ExampleConnector.instance.CreateCertificate(createCertificateVariables).execute();
|
||||
ExampleConnector.instance.UpdateCertificate(updateCertificateVariables).execute();
|
||||
ExampleConnector.instance.DeleteCertificate(deleteCertificateVariables).execute();
|
||||
ExampleConnector.instance.listOrders(listOrdersVariables).execute();
|
||||
ExampleConnector.instance.getOrderById(getOrderByIdVariables).execute();
|
||||
ExampleConnector.instance.getOrdersByBusinessId(getOrdersByBusinessIdVariables).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.updateLevel({ ... })
|
||||
.name(...)
|
||||
await ExampleConnector.instance.listTeamHubsByOwnerId({ ... })
|
||||
.offset(...)
|
||||
.execute();
|
||||
```
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,6 +12,11 @@ class CreateShiftVariablesBuilder {
|
||||
Optional<String> _locationAddress = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<double> _latitude = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<double> _longitude = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<String> _placeId = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<String> _city = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<String> _state = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<String> _street = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<String> _country = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<String> _description = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<ShiftStatus> _status = Optional.optional((data) => ShiftStatus.values.byName(data), enumSerializer);
|
||||
Optional<int> _workersNeeded = Optional.optional(nativeFromJson, nativeToJson);
|
||||
@@ -57,6 +62,26 @@ class CreateShiftVariablesBuilder {
|
||||
_longitude.value = t;
|
||||
return this;
|
||||
}
|
||||
CreateShiftVariablesBuilder placeId(String? t) {
|
||||
_placeId.value = t;
|
||||
return this;
|
||||
}
|
||||
CreateShiftVariablesBuilder city(String? t) {
|
||||
_city.value = t;
|
||||
return this;
|
||||
}
|
||||
CreateShiftVariablesBuilder state(String? t) {
|
||||
_state.value = t;
|
||||
return this;
|
||||
}
|
||||
CreateShiftVariablesBuilder street(String? t) {
|
||||
_street.value = t;
|
||||
return this;
|
||||
}
|
||||
CreateShiftVariablesBuilder country(String? t) {
|
||||
_country.value = t;
|
||||
return this;
|
||||
}
|
||||
CreateShiftVariablesBuilder description(String? t) {
|
||||
_description.value = t;
|
||||
return this;
|
||||
@@ -98,7 +123,7 @@ class CreateShiftVariablesBuilder {
|
||||
}
|
||||
|
||||
MutationRef<CreateShiftData, CreateShiftVariables> ref() {
|
||||
CreateShiftVariables vars= CreateShiftVariables(title: title,orderId: orderId,date: _date,startTime: _startTime,endTime: _endTime,hours: _hours,cost: _cost,location: _location,locationAddress: _locationAddress,latitude: _latitude,longitude: _longitude,description: _description,status: _status,workersNeeded: _workersNeeded,filled: _filled,filledAt: _filledAt,managers: _managers,durationDays: _durationDays,createdBy: _createdBy,);
|
||||
CreateShiftVariables vars= CreateShiftVariables(title: title,orderId: orderId,date: _date,startTime: _startTime,endTime: _endTime,hours: _hours,cost: _cost,location: _location,locationAddress: _locationAddress,latitude: _latitude,longitude: _longitude,placeId: _placeId,city: _city,state: _state,street: _street,country: _country,description: _description,status: _status,workersNeeded: _workersNeeded,filled: _filled,filledAt: _filledAt,managers: _managers,durationDays: _durationDays,createdBy: _createdBy,);
|
||||
return _dataConnect.mutation("createShift", dataDeserializer, varsSerializer, vars);
|
||||
}
|
||||
}
|
||||
@@ -184,6 +209,11 @@ class CreateShiftVariables {
|
||||
late final Optional<String>locationAddress;
|
||||
late final Optional<double>latitude;
|
||||
late final Optional<double>longitude;
|
||||
late final Optional<String>placeId;
|
||||
late final Optional<String>city;
|
||||
late final Optional<String>state;
|
||||
late final Optional<String>street;
|
||||
late final Optional<String>country;
|
||||
late final Optional<String>description;
|
||||
late final Optional<ShiftStatus>status;
|
||||
late final Optional<int>workersNeeded;
|
||||
@@ -237,6 +267,26 @@ class CreateShiftVariables {
|
||||
longitude.value = json['longitude'] == null ? null : nativeFromJson<double>(json['longitude']);
|
||||
|
||||
|
||||
placeId = Optional.optional(nativeFromJson, nativeToJson);
|
||||
placeId.value = json['placeId'] == null ? null : nativeFromJson<String>(json['placeId']);
|
||||
|
||||
|
||||
city = Optional.optional(nativeFromJson, nativeToJson);
|
||||
city.value = json['city'] == null ? null : nativeFromJson<String>(json['city']);
|
||||
|
||||
|
||||
state = Optional.optional(nativeFromJson, nativeToJson);
|
||||
state.value = json['state'] == null ? null : nativeFromJson<String>(json['state']);
|
||||
|
||||
|
||||
street = Optional.optional(nativeFromJson, nativeToJson);
|
||||
street.value = json['street'] == null ? null : nativeFromJson<String>(json['street']);
|
||||
|
||||
|
||||
country = Optional.optional(nativeFromJson, nativeToJson);
|
||||
country.value = json['country'] == null ? null : nativeFromJson<String>(json['country']);
|
||||
|
||||
|
||||
description = Optional.optional(nativeFromJson, nativeToJson);
|
||||
description.value = json['description'] == null ? null : nativeFromJson<String>(json['description']);
|
||||
|
||||
@@ -292,6 +342,11 @@ class CreateShiftVariables {
|
||||
locationAddress == otherTyped.locationAddress &&
|
||||
latitude == otherTyped.latitude &&
|
||||
longitude == otherTyped.longitude &&
|
||||
placeId == otherTyped.placeId &&
|
||||
city == otherTyped.city &&
|
||||
state == otherTyped.state &&
|
||||
street == otherTyped.street &&
|
||||
country == otherTyped.country &&
|
||||
description == otherTyped.description &&
|
||||
status == otherTyped.status &&
|
||||
workersNeeded == otherTyped.workersNeeded &&
|
||||
@@ -303,7 +358,7 @@ class CreateShiftVariables {
|
||||
|
||||
}
|
||||
@override
|
||||
int get hashCode => Object.hashAll([title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdBy.hashCode]);
|
||||
int get hashCode => Object.hashAll([title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, placeId.hashCode, city.hashCode, state.hashCode, street.hashCode, country.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdBy.hashCode]);
|
||||
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -337,6 +392,21 @@ class CreateShiftVariables {
|
||||
if(longitude.state == OptionalState.set) {
|
||||
json['longitude'] = longitude.toJson();
|
||||
}
|
||||
if(placeId.state == OptionalState.set) {
|
||||
json['placeId'] = placeId.toJson();
|
||||
}
|
||||
if(city.state == OptionalState.set) {
|
||||
json['city'] = city.toJson();
|
||||
}
|
||||
if(state.state == OptionalState.set) {
|
||||
json['state'] = state.toJson();
|
||||
}
|
||||
if(street.state == OptionalState.set) {
|
||||
json['street'] = street.toJson();
|
||||
}
|
||||
if(country.state == OptionalState.set) {
|
||||
json['country'] = country.toJson();
|
||||
}
|
||||
if(description.state == OptionalState.set) {
|
||||
json['description'] = description.toJson();
|
||||
}
|
||||
@@ -376,6 +446,11 @@ class CreateShiftVariables {
|
||||
required this.locationAddress,
|
||||
required this.latitude,
|
||||
required this.longitude,
|
||||
required this.placeId,
|
||||
required this.city,
|
||||
required this.state,
|
||||
required this.street,
|
||||
required this.country,
|
||||
required this.description,
|
||||
required this.status,
|
||||
required this.workersNeeded,
|
||||
|
||||
@@ -61,6 +61,11 @@ class FilterShiftsShifts {
|
||||
final String? locationAddress;
|
||||
final double? latitude;
|
||||
final double? longitude;
|
||||
final String? placeId;
|
||||
final String? city;
|
||||
final String? state;
|
||||
final String? street;
|
||||
final String? country;
|
||||
final String? description;
|
||||
final EnumValue<ShiftStatus>? status;
|
||||
final int? workersNeeded;
|
||||
@@ -86,6 +91,11 @@ class FilterShiftsShifts {
|
||||
locationAddress = json['locationAddress'] == null ? null : nativeFromJson<String>(json['locationAddress']),
|
||||
latitude = json['latitude'] == null ? null : nativeFromJson<double>(json['latitude']),
|
||||
longitude = json['longitude'] == null ? null : nativeFromJson<double>(json['longitude']),
|
||||
placeId = json['placeId'] == null ? null : nativeFromJson<String>(json['placeId']),
|
||||
city = json['city'] == null ? null : nativeFromJson<String>(json['city']),
|
||||
state = json['state'] == null ? null : nativeFromJson<String>(json['state']),
|
||||
street = json['street'] == null ? null : nativeFromJson<String>(json['street']),
|
||||
country = json['country'] == null ? null : nativeFromJson<String>(json['country']),
|
||||
description = json['description'] == null ? null : nativeFromJson<String>(json['description']),
|
||||
status = json['status'] == null ? null : shiftStatusDeserializer(json['status']),
|
||||
workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson<int>(json['workersNeeded']),
|
||||
@@ -121,6 +131,11 @@ class FilterShiftsShifts {
|
||||
locationAddress == otherTyped.locationAddress &&
|
||||
latitude == otherTyped.latitude &&
|
||||
longitude == otherTyped.longitude &&
|
||||
placeId == otherTyped.placeId &&
|
||||
city == otherTyped.city &&
|
||||
state == otherTyped.state &&
|
||||
street == otherTyped.street &&
|
||||
country == otherTyped.country &&
|
||||
description == otherTyped.description &&
|
||||
status == otherTyped.status &&
|
||||
workersNeeded == otherTyped.workersNeeded &&
|
||||
@@ -135,7 +150,7 @@ class FilterShiftsShifts {
|
||||
|
||||
}
|
||||
@override
|
||||
int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, order.hashCode]);
|
||||
int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, placeId.hashCode, city.hashCode, state.hashCode, street.hashCode, country.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, order.hashCode]);
|
||||
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -170,6 +185,21 @@ class FilterShiftsShifts {
|
||||
if (longitude != null) {
|
||||
json['longitude'] = nativeToJson<double?>(longitude);
|
||||
}
|
||||
if (placeId != null) {
|
||||
json['placeId'] = nativeToJson<String?>(placeId);
|
||||
}
|
||||
if (city != null) {
|
||||
json['city'] = nativeToJson<String?>(city);
|
||||
}
|
||||
if (state != null) {
|
||||
json['state'] = nativeToJson<String?>(state);
|
||||
}
|
||||
if (street != null) {
|
||||
json['street'] = nativeToJson<String?>(street);
|
||||
}
|
||||
if (country != null) {
|
||||
json['country'] = nativeToJson<String?>(country);
|
||||
}
|
||||
if (description != null) {
|
||||
json['description'] = nativeToJson<String?>(description);
|
||||
}
|
||||
@@ -219,6 +249,11 @@ class FilterShiftsShifts {
|
||||
this.locationAddress,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.placeId,
|
||||
this.city,
|
||||
this.state,
|
||||
this.street,
|
||||
this.country,
|
||||
this.description,
|
||||
this.status,
|
||||
this.workersNeeded,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -31,6 +31,11 @@ class GetShiftByIdShift {
|
||||
final String? locationAddress;
|
||||
final double? latitude;
|
||||
final double? longitude;
|
||||
final String? placeId;
|
||||
final String? city;
|
||||
final String? state;
|
||||
final String? street;
|
||||
final String? country;
|
||||
final String? description;
|
||||
final EnumValue<ShiftStatus>? status;
|
||||
final int? workersNeeded;
|
||||
@@ -56,6 +61,11 @@ class GetShiftByIdShift {
|
||||
locationAddress = json['locationAddress'] == null ? null : nativeFromJson<String>(json['locationAddress']),
|
||||
latitude = json['latitude'] == null ? null : nativeFromJson<double>(json['latitude']),
|
||||
longitude = json['longitude'] == null ? null : nativeFromJson<double>(json['longitude']),
|
||||
placeId = json['placeId'] == null ? null : nativeFromJson<String>(json['placeId']),
|
||||
city = json['city'] == null ? null : nativeFromJson<String>(json['city']),
|
||||
state = json['state'] == null ? null : nativeFromJson<String>(json['state']),
|
||||
street = json['street'] == null ? null : nativeFromJson<String>(json['street']),
|
||||
country = json['country'] == null ? null : nativeFromJson<String>(json['country']),
|
||||
description = json['description'] == null ? null : nativeFromJson<String>(json['description']),
|
||||
status = json['status'] == null ? null : shiftStatusDeserializer(json['status']),
|
||||
workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson<int>(json['workersNeeded']),
|
||||
@@ -91,6 +101,11 @@ class GetShiftByIdShift {
|
||||
locationAddress == otherTyped.locationAddress &&
|
||||
latitude == otherTyped.latitude &&
|
||||
longitude == otherTyped.longitude &&
|
||||
placeId == otherTyped.placeId &&
|
||||
city == otherTyped.city &&
|
||||
state == otherTyped.state &&
|
||||
street == otherTyped.street &&
|
||||
country == otherTyped.country &&
|
||||
description == otherTyped.description &&
|
||||
status == otherTyped.status &&
|
||||
workersNeeded == otherTyped.workersNeeded &&
|
||||
@@ -105,7 +120,7 @@ class GetShiftByIdShift {
|
||||
|
||||
}
|
||||
@override
|
||||
int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, order.hashCode]);
|
||||
int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, placeId.hashCode, city.hashCode, state.hashCode, street.hashCode, country.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, order.hashCode]);
|
||||
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -140,6 +155,21 @@ class GetShiftByIdShift {
|
||||
if (longitude != null) {
|
||||
json['longitude'] = nativeToJson<double?>(longitude);
|
||||
}
|
||||
if (placeId != null) {
|
||||
json['placeId'] = nativeToJson<String?>(placeId);
|
||||
}
|
||||
if (city != null) {
|
||||
json['city'] = nativeToJson<String?>(city);
|
||||
}
|
||||
if (state != null) {
|
||||
json['state'] = nativeToJson<String?>(state);
|
||||
}
|
||||
if (street != null) {
|
||||
json['street'] = nativeToJson<String?>(street);
|
||||
}
|
||||
if (country != null) {
|
||||
json['country'] = nativeToJson<String?>(country);
|
||||
}
|
||||
if (description != null) {
|
||||
json['description'] = nativeToJson<String?>(description);
|
||||
}
|
||||
@@ -189,6 +219,11 @@ class GetShiftByIdShift {
|
||||
this.locationAddress,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.placeId,
|
||||
this.city,
|
||||
this.state,
|
||||
this.street,
|
||||
this.country,
|
||||
this.description,
|
||||
this.status,
|
||||
this.workersNeeded,
|
||||
|
||||
@@ -51,6 +51,11 @@ class GetShiftsByBusinessIdShifts {
|
||||
final String? locationAddress;
|
||||
final double? latitude;
|
||||
final double? longitude;
|
||||
final String? placeId;
|
||||
final String? city;
|
||||
final String? state;
|
||||
final String? street;
|
||||
final String? country;
|
||||
final String? description;
|
||||
final EnumValue<ShiftStatus>? status;
|
||||
final int? workersNeeded;
|
||||
@@ -76,6 +81,11 @@ class GetShiftsByBusinessIdShifts {
|
||||
locationAddress = json['locationAddress'] == null ? null : nativeFromJson<String>(json['locationAddress']),
|
||||
latitude = json['latitude'] == null ? null : nativeFromJson<double>(json['latitude']),
|
||||
longitude = json['longitude'] == null ? null : nativeFromJson<double>(json['longitude']),
|
||||
placeId = json['placeId'] == null ? null : nativeFromJson<String>(json['placeId']),
|
||||
city = json['city'] == null ? null : nativeFromJson<String>(json['city']),
|
||||
state = json['state'] == null ? null : nativeFromJson<String>(json['state']),
|
||||
street = json['street'] == null ? null : nativeFromJson<String>(json['street']),
|
||||
country = json['country'] == null ? null : nativeFromJson<String>(json['country']),
|
||||
description = json['description'] == null ? null : nativeFromJson<String>(json['description']),
|
||||
status = json['status'] == null ? null : shiftStatusDeserializer(json['status']),
|
||||
workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson<int>(json['workersNeeded']),
|
||||
@@ -111,6 +121,11 @@ class GetShiftsByBusinessIdShifts {
|
||||
locationAddress == otherTyped.locationAddress &&
|
||||
latitude == otherTyped.latitude &&
|
||||
longitude == otherTyped.longitude &&
|
||||
placeId == otherTyped.placeId &&
|
||||
city == otherTyped.city &&
|
||||
state == otherTyped.state &&
|
||||
street == otherTyped.street &&
|
||||
country == otherTyped.country &&
|
||||
description == otherTyped.description &&
|
||||
status == otherTyped.status &&
|
||||
workersNeeded == otherTyped.workersNeeded &&
|
||||
@@ -125,7 +140,7 @@ class GetShiftsByBusinessIdShifts {
|
||||
|
||||
}
|
||||
@override
|
||||
int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, order.hashCode]);
|
||||
int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, placeId.hashCode, city.hashCode, state.hashCode, street.hashCode, country.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, order.hashCode]);
|
||||
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -160,6 +175,21 @@ class GetShiftsByBusinessIdShifts {
|
||||
if (longitude != null) {
|
||||
json['longitude'] = nativeToJson<double?>(longitude);
|
||||
}
|
||||
if (placeId != null) {
|
||||
json['placeId'] = nativeToJson<String?>(placeId);
|
||||
}
|
||||
if (city != null) {
|
||||
json['city'] = nativeToJson<String?>(city);
|
||||
}
|
||||
if (state != null) {
|
||||
json['state'] = nativeToJson<String?>(state);
|
||||
}
|
||||
if (street != null) {
|
||||
json['street'] = nativeToJson<String?>(street);
|
||||
}
|
||||
if (country != null) {
|
||||
json['country'] = nativeToJson<String?>(country);
|
||||
}
|
||||
if (description != null) {
|
||||
json['description'] = nativeToJson<String?>(description);
|
||||
}
|
||||
@@ -209,6 +239,11 @@ class GetShiftsByBusinessIdShifts {
|
||||
this.locationAddress,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.placeId,
|
||||
this.city,
|
||||
this.state,
|
||||
this.street,
|
||||
this.country,
|
||||
this.description,
|
||||
this.status,
|
||||
this.workersNeeded,
|
||||
|
||||
@@ -51,6 +51,11 @@ class GetShiftsByVendorIdShifts {
|
||||
final String? locationAddress;
|
||||
final double? latitude;
|
||||
final double? longitude;
|
||||
final String? placeId;
|
||||
final String? city;
|
||||
final String? state;
|
||||
final String? street;
|
||||
final String? country;
|
||||
final String? description;
|
||||
final EnumValue<ShiftStatus>? status;
|
||||
final int? workersNeeded;
|
||||
@@ -76,6 +81,11 @@ class GetShiftsByVendorIdShifts {
|
||||
locationAddress = json['locationAddress'] == null ? null : nativeFromJson<String>(json['locationAddress']),
|
||||
latitude = json['latitude'] == null ? null : nativeFromJson<double>(json['latitude']),
|
||||
longitude = json['longitude'] == null ? null : nativeFromJson<double>(json['longitude']),
|
||||
placeId = json['placeId'] == null ? null : nativeFromJson<String>(json['placeId']),
|
||||
city = json['city'] == null ? null : nativeFromJson<String>(json['city']),
|
||||
state = json['state'] == null ? null : nativeFromJson<String>(json['state']),
|
||||
street = json['street'] == null ? null : nativeFromJson<String>(json['street']),
|
||||
country = json['country'] == null ? null : nativeFromJson<String>(json['country']),
|
||||
description = json['description'] == null ? null : nativeFromJson<String>(json['description']),
|
||||
status = json['status'] == null ? null : shiftStatusDeserializer(json['status']),
|
||||
workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson<int>(json['workersNeeded']),
|
||||
@@ -111,6 +121,11 @@ class GetShiftsByVendorIdShifts {
|
||||
locationAddress == otherTyped.locationAddress &&
|
||||
latitude == otherTyped.latitude &&
|
||||
longitude == otherTyped.longitude &&
|
||||
placeId == otherTyped.placeId &&
|
||||
city == otherTyped.city &&
|
||||
state == otherTyped.state &&
|
||||
street == otherTyped.street &&
|
||||
country == otherTyped.country &&
|
||||
description == otherTyped.description &&
|
||||
status == otherTyped.status &&
|
||||
workersNeeded == otherTyped.workersNeeded &&
|
||||
@@ -125,7 +140,7 @@ class GetShiftsByVendorIdShifts {
|
||||
|
||||
}
|
||||
@override
|
||||
int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, order.hashCode]);
|
||||
int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, placeId.hashCode, city.hashCode, state.hashCode, street.hashCode, country.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, order.hashCode]);
|
||||
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -160,6 +175,21 @@ class GetShiftsByVendorIdShifts {
|
||||
if (longitude != null) {
|
||||
json['longitude'] = nativeToJson<double?>(longitude);
|
||||
}
|
||||
if (placeId != null) {
|
||||
json['placeId'] = nativeToJson<String?>(placeId);
|
||||
}
|
||||
if (city != null) {
|
||||
json['city'] = nativeToJson<String?>(city);
|
||||
}
|
||||
if (state != null) {
|
||||
json['state'] = nativeToJson<String?>(state);
|
||||
}
|
||||
if (street != null) {
|
||||
json['street'] = nativeToJson<String?>(street);
|
||||
}
|
||||
if (country != null) {
|
||||
json['country'] = nativeToJson<String?>(country);
|
||||
}
|
||||
if (description != null) {
|
||||
json['description'] = nativeToJson<String?>(description);
|
||||
}
|
||||
@@ -209,6 +239,11 @@ class GetShiftsByVendorIdShifts {
|
||||
this.locationAddress,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.placeId,
|
||||
this.city,
|
||||
this.state,
|
||||
this.street,
|
||||
this.country,
|
||||
this.description,
|
||||
this.status,
|
||||
this.workersNeeded,
|
||||
|
||||
@@ -41,6 +41,11 @@ class ListShiftsShifts {
|
||||
final String? locationAddress;
|
||||
final double? latitude;
|
||||
final double? longitude;
|
||||
final String? placeId;
|
||||
final String? city;
|
||||
final String? state;
|
||||
final String? street;
|
||||
final String? country;
|
||||
final String? description;
|
||||
final EnumValue<ShiftStatus>? status;
|
||||
final int? workersNeeded;
|
||||
@@ -66,6 +71,11 @@ class ListShiftsShifts {
|
||||
locationAddress = json['locationAddress'] == null ? null : nativeFromJson<String>(json['locationAddress']),
|
||||
latitude = json['latitude'] == null ? null : nativeFromJson<double>(json['latitude']),
|
||||
longitude = json['longitude'] == null ? null : nativeFromJson<double>(json['longitude']),
|
||||
placeId = json['placeId'] == null ? null : nativeFromJson<String>(json['placeId']),
|
||||
city = json['city'] == null ? null : nativeFromJson<String>(json['city']),
|
||||
state = json['state'] == null ? null : nativeFromJson<String>(json['state']),
|
||||
street = json['street'] == null ? null : nativeFromJson<String>(json['street']),
|
||||
country = json['country'] == null ? null : nativeFromJson<String>(json['country']),
|
||||
description = json['description'] == null ? null : nativeFromJson<String>(json['description']),
|
||||
status = json['status'] == null ? null : shiftStatusDeserializer(json['status']),
|
||||
workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson<int>(json['workersNeeded']),
|
||||
@@ -101,6 +111,11 @@ class ListShiftsShifts {
|
||||
locationAddress == otherTyped.locationAddress &&
|
||||
latitude == otherTyped.latitude &&
|
||||
longitude == otherTyped.longitude &&
|
||||
placeId == otherTyped.placeId &&
|
||||
city == otherTyped.city &&
|
||||
state == otherTyped.state &&
|
||||
street == otherTyped.street &&
|
||||
country == otherTyped.country &&
|
||||
description == otherTyped.description &&
|
||||
status == otherTyped.status &&
|
||||
workersNeeded == otherTyped.workersNeeded &&
|
||||
@@ -115,7 +130,7 @@ class ListShiftsShifts {
|
||||
|
||||
}
|
||||
@override
|
||||
int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, order.hashCode]);
|
||||
int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, placeId.hashCode, city.hashCode, state.hashCode, street.hashCode, country.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, order.hashCode]);
|
||||
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -150,6 +165,21 @@ class ListShiftsShifts {
|
||||
if (longitude != null) {
|
||||
json['longitude'] = nativeToJson<double?>(longitude);
|
||||
}
|
||||
if (placeId != null) {
|
||||
json['placeId'] = nativeToJson<String?>(placeId);
|
||||
}
|
||||
if (city != null) {
|
||||
json['city'] = nativeToJson<String?>(city);
|
||||
}
|
||||
if (state != null) {
|
||||
json['state'] = nativeToJson<String?>(state);
|
||||
}
|
||||
if (street != null) {
|
||||
json['street'] = nativeToJson<String?>(street);
|
||||
}
|
||||
if (country != null) {
|
||||
json['country'] = nativeToJson<String?>(country);
|
||||
}
|
||||
if (description != null) {
|
||||
json['description'] = nativeToJson<String?>(description);
|
||||
}
|
||||
@@ -199,6 +229,11 @@ class ListShiftsShifts {
|
||||
this.locationAddress,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.placeId,
|
||||
this.city,
|
||||
this.state,
|
||||
this.street,
|
||||
this.country,
|
||||
this.description,
|
||||
this.status,
|
||||
this.workersNeeded,
|
||||
|
||||
@@ -13,6 +13,11 @@ class UpdateShiftVariablesBuilder {
|
||||
Optional<String> _locationAddress = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<double> _latitude = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<double> _longitude = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<String> _placeId = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<String> _city = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<String> _state = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<String> _street = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<String> _country = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<String> _description = Optional.optional(nativeFromJson, nativeToJson);
|
||||
Optional<ShiftStatus> _status = Optional.optional((data) => ShiftStatus.values.byName(data), enumSerializer);
|
||||
Optional<int> _workersNeeded = Optional.optional(nativeFromJson, nativeToJson);
|
||||
@@ -65,6 +70,26 @@ class UpdateShiftVariablesBuilder {
|
||||
_longitude.value = t;
|
||||
return this;
|
||||
}
|
||||
UpdateShiftVariablesBuilder placeId(String? t) {
|
||||
_placeId.value = t;
|
||||
return this;
|
||||
}
|
||||
UpdateShiftVariablesBuilder city(String? t) {
|
||||
_city.value = t;
|
||||
return this;
|
||||
}
|
||||
UpdateShiftVariablesBuilder state(String? t) {
|
||||
_state.value = t;
|
||||
return this;
|
||||
}
|
||||
UpdateShiftVariablesBuilder street(String? t) {
|
||||
_street.value = t;
|
||||
return this;
|
||||
}
|
||||
UpdateShiftVariablesBuilder country(String? t) {
|
||||
_country.value = t;
|
||||
return this;
|
||||
}
|
||||
UpdateShiftVariablesBuilder description(String? t) {
|
||||
_description.value = t;
|
||||
return this;
|
||||
@@ -102,7 +127,7 @@ class UpdateShiftVariablesBuilder {
|
||||
}
|
||||
|
||||
MutationRef<UpdateShiftData, UpdateShiftVariables> ref() {
|
||||
UpdateShiftVariables vars= UpdateShiftVariables(id: id,title: _title,orderId: _orderId,date: _date,startTime: _startTime,endTime: _endTime,hours: _hours,cost: _cost,location: _location,locationAddress: _locationAddress,latitude: _latitude,longitude: _longitude,description: _description,status: _status,workersNeeded: _workersNeeded,filled: _filled,filledAt: _filledAt,managers: _managers,durationDays: _durationDays,);
|
||||
UpdateShiftVariables vars= UpdateShiftVariables(id: id,title: _title,orderId: _orderId,date: _date,startTime: _startTime,endTime: _endTime,hours: _hours,cost: _cost,location: _location,locationAddress: _locationAddress,latitude: _latitude,longitude: _longitude,placeId: _placeId,city: _city,state: _state,street: _street,country: _country,description: _description,status: _status,workersNeeded: _workersNeeded,filled: _filled,filledAt: _filledAt,managers: _managers,durationDays: _durationDays,);
|
||||
return _dataConnect.mutation("updateShift", dataDeserializer, varsSerializer, vars);
|
||||
}
|
||||
}
|
||||
@@ -191,6 +216,11 @@ class UpdateShiftVariables {
|
||||
late final Optional<String>locationAddress;
|
||||
late final Optional<double>latitude;
|
||||
late final Optional<double>longitude;
|
||||
late final Optional<String>placeId;
|
||||
late final Optional<String>city;
|
||||
late final Optional<String>state;
|
||||
late final Optional<String>street;
|
||||
late final Optional<String>country;
|
||||
late final Optional<String>description;
|
||||
late final Optional<ShiftStatus>status;
|
||||
late final Optional<int>workersNeeded;
|
||||
@@ -249,6 +279,26 @@ class UpdateShiftVariables {
|
||||
longitude.value = json['longitude'] == null ? null : nativeFromJson<double>(json['longitude']);
|
||||
|
||||
|
||||
placeId = Optional.optional(nativeFromJson, nativeToJson);
|
||||
placeId.value = json['placeId'] == null ? null : nativeFromJson<String>(json['placeId']);
|
||||
|
||||
|
||||
city = Optional.optional(nativeFromJson, nativeToJson);
|
||||
city.value = json['city'] == null ? null : nativeFromJson<String>(json['city']);
|
||||
|
||||
|
||||
state = Optional.optional(nativeFromJson, nativeToJson);
|
||||
state.value = json['state'] == null ? null : nativeFromJson<String>(json['state']);
|
||||
|
||||
|
||||
street = Optional.optional(nativeFromJson, nativeToJson);
|
||||
street.value = json['street'] == null ? null : nativeFromJson<String>(json['street']);
|
||||
|
||||
|
||||
country = Optional.optional(nativeFromJson, nativeToJson);
|
||||
country.value = json['country'] == null ? null : nativeFromJson<String>(json['country']);
|
||||
|
||||
|
||||
description = Optional.optional(nativeFromJson, nativeToJson);
|
||||
description.value = json['description'] == null ? null : nativeFromJson<String>(json['description']);
|
||||
|
||||
@@ -301,6 +351,11 @@ class UpdateShiftVariables {
|
||||
locationAddress == otherTyped.locationAddress &&
|
||||
latitude == otherTyped.latitude &&
|
||||
longitude == otherTyped.longitude &&
|
||||
placeId == otherTyped.placeId &&
|
||||
city == otherTyped.city &&
|
||||
state == otherTyped.state &&
|
||||
street == otherTyped.street &&
|
||||
country == otherTyped.country &&
|
||||
description == otherTyped.description &&
|
||||
status == otherTyped.status &&
|
||||
workersNeeded == otherTyped.workersNeeded &&
|
||||
@@ -311,7 +366,7 @@ class UpdateShiftVariables {
|
||||
|
||||
}
|
||||
@override
|
||||
int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode]);
|
||||
int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, placeId.hashCode, city.hashCode, state.hashCode, street.hashCode, country.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode]);
|
||||
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -350,6 +405,21 @@ class UpdateShiftVariables {
|
||||
if(longitude.state == OptionalState.set) {
|
||||
json['longitude'] = longitude.toJson();
|
||||
}
|
||||
if(placeId.state == OptionalState.set) {
|
||||
json['placeId'] = placeId.toJson();
|
||||
}
|
||||
if(city.state == OptionalState.set) {
|
||||
json['city'] = city.toJson();
|
||||
}
|
||||
if(state.state == OptionalState.set) {
|
||||
json['state'] = state.toJson();
|
||||
}
|
||||
if(street.state == OptionalState.set) {
|
||||
json['street'] = street.toJson();
|
||||
}
|
||||
if(country.state == OptionalState.set) {
|
||||
json['country'] = country.toJson();
|
||||
}
|
||||
if(description.state == OptionalState.set) {
|
||||
json['description'] = description.toJson();
|
||||
}
|
||||
@@ -387,6 +457,11 @@ class UpdateShiftVariables {
|
||||
required this.locationAddress,
|
||||
required this.latitude,
|
||||
required this.longitude,
|
||||
required this.placeId,
|
||||
required this.city,
|
||||
required this.state,
|
||||
required this.street,
|
||||
required this.country,
|
||||
required this.description,
|
||||
required this.status,
|
||||
required this.workersNeeded,
|
||||
|
||||
@@ -10,6 +10,7 @@ class OneTimeOrder extends Equatable {
|
||||
required this.date,
|
||||
required this.location,
|
||||
required this.positions,
|
||||
this.hub,
|
||||
this.vendorId,
|
||||
this.roleRates = const <String, double>{},
|
||||
});
|
||||
@@ -22,6 +23,9 @@ class OneTimeOrder extends Equatable {
|
||||
/// The list of positions and headcounts required for this order.
|
||||
final List<OneTimeOrderPosition> positions;
|
||||
|
||||
/// Selected hub details for this order.
|
||||
final OneTimeOrderHubDetails? hub;
|
||||
|
||||
/// Selected vendor id for this order.
|
||||
final String? vendorId;
|
||||
|
||||
@@ -33,7 +37,52 @@ class OneTimeOrder extends Equatable {
|
||||
date,
|
||||
location,
|
||||
positions,
|
||||
hub,
|
||||
vendorId,
|
||||
roleRates,
|
||||
];
|
||||
}
|
||||
|
||||
/// Minimal hub details used during order creation.
|
||||
class OneTimeOrderHubDetails extends Equatable {
|
||||
const OneTimeOrderHubDetails({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.address,
|
||||
this.placeId,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.city,
|
||||
this.state,
|
||||
this.street,
|
||||
this.country,
|
||||
this.zipCode,
|
||||
});
|
||||
|
||||
final String id;
|
||||
final String name;
|
||||
final String address;
|
||||
final String? placeId;
|
||||
final double? latitude;
|
||||
final double? longitude;
|
||||
final String? city;
|
||||
final String? state;
|
||||
final String? street;
|
||||
final String? country;
|
||||
final String? zipCode;
|
||||
|
||||
@override
|
||||
List<Object?> get props => <Object?>[
|
||||
id,
|
||||
name,
|
||||
address,
|
||||
placeId,
|
||||
latitude,
|
||||
longitude,
|
||||
city,
|
||||
state,
|
||||
street,
|
||||
country,
|
||||
zipCode,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -61,6 +61,10 @@ class ClientCreateOrderRepositoryImpl
|
||||
if (vendorId == null || vendorId.isEmpty) {
|
||||
throw Exception('Vendor is missing.');
|
||||
}
|
||||
final domain.OneTimeOrderHubDetails? hub = order.hub;
|
||||
if (hub == null || hub.id.isEmpty) {
|
||||
throw Exception('Hub is missing.');
|
||||
}
|
||||
|
||||
final DateTime orderDateOnly = DateTime(
|
||||
order.date.year,
|
||||
@@ -69,9 +73,12 @@ class ClientCreateOrderRepositoryImpl
|
||||
);
|
||||
final fdc.Timestamp orderTimestamp = _toTimestamp(orderDateOnly);
|
||||
final fdc.OperationResult<dc.CreateOrderData, dc.CreateOrderVariables> orderResult = await _dataConnect
|
||||
.createOrder(businessId: businessId, orderType: dc.OrderType.ONE_TIME)
|
||||
.createOrder(
|
||||
businessId: businessId,
|
||||
orderType: dc.OrderType.ONE_TIME,
|
||||
teamHubId: hub.id,
|
||||
)
|
||||
.vendorId(vendorId)
|
||||
.location(order.location)
|
||||
.status(dc.OrderStatus.POSTED)
|
||||
.date(orderTimestamp)
|
||||
.execute();
|
||||
@@ -91,8 +98,15 @@ class ClientCreateOrderRepositoryImpl
|
||||
final fdc.OperationResult<dc.CreateShiftData, dc.CreateShiftVariables> shiftResult = await _dataConnect
|
||||
.createShift(title: shiftTitle, orderId: orderId)
|
||||
.date(orderTimestamp)
|
||||
.location(order.location)
|
||||
.locationAddress(order.location)
|
||||
.location(hub.name)
|
||||
.locationAddress(hub.address)
|
||||
.latitude(hub.latitude)
|
||||
.longitude(hub.longitude)
|
||||
.placeId(hub.placeId)
|
||||
.city(hub.city)
|
||||
.state(hub.state)
|
||||
.street(hub.street)
|
||||
.country(hub.country)
|
||||
.status(dc.ShiftStatus.PENDING)
|
||||
.workersNeeded(workersNeeded)
|
||||
.filled(0)
|
||||
|
||||
@@ -13,14 +13,16 @@ class OneTimeOrderBloc extends Bloc<OneTimeOrderEvent, OneTimeOrderState> {
|
||||
: super(OneTimeOrderState.initial()) {
|
||||
on<OneTimeOrderVendorsLoaded>(_onVendorsLoaded);
|
||||
on<OneTimeOrderVendorChanged>(_onVendorChanged);
|
||||
on<OneTimeOrderHubsLoaded>(_onHubsLoaded);
|
||||
on<OneTimeOrderHubChanged>(_onHubChanged);
|
||||
on<OneTimeOrderDateChanged>(_onDateChanged);
|
||||
on<OneTimeOrderLocationChanged>(_onLocationChanged);
|
||||
on<OneTimeOrderPositionAdded>(_onPositionAdded);
|
||||
on<OneTimeOrderPositionRemoved>(_onPositionRemoved);
|
||||
on<OneTimeOrderPositionUpdated>(_onPositionUpdated);
|
||||
on<OneTimeOrderSubmitted>(_onSubmitted);
|
||||
|
||||
_loadVendors();
|
||||
_loadHubs();
|
||||
}
|
||||
final CreateOneTimeOrderUseCase _createOneTimeOrderUseCase;
|
||||
final dc.ExampleConnector _dataConnect;
|
||||
@@ -63,6 +65,38 @@ class OneTimeOrderBloc extends Bloc<OneTimeOrderEvent, OneTimeOrderState> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _loadHubs() async {
|
||||
try {
|
||||
final String? businessId = dc.ClientSessionStore.instance.session?.business?.id;
|
||||
if (businessId == null || businessId.isEmpty) {
|
||||
add(const OneTimeOrderHubsLoaded(<OneTimeOrderHubOption>[]));
|
||||
return;
|
||||
}
|
||||
final QueryResult<dc.ListTeamHubsByOwnerIdData, dc.ListTeamHubsByOwnerIdVariables>
|
||||
result = await _dataConnect.listTeamHubsByOwnerId(ownerId: businessId).execute();
|
||||
final List<OneTimeOrderHubOption> hubs = result.data.teamHubs
|
||||
.map(
|
||||
(dc.ListTeamHubsByOwnerIdTeamHubs hub) => OneTimeOrderHubOption(
|
||||
id: hub.id,
|
||||
name: hub.hubName,
|
||||
address: hub.address,
|
||||
placeId: hub.placeId,
|
||||
latitude: hub.latitude,
|
||||
longitude: hub.longitude,
|
||||
city: hub.city,
|
||||
state: hub.state,
|
||||
street: hub.street,
|
||||
country: hub.country,
|
||||
zipCode: hub.zipCode,
|
||||
),
|
||||
)
|
||||
.toList();
|
||||
add(OneTimeOrderHubsLoaded(hubs));
|
||||
} catch (_) {
|
||||
add(const OneTimeOrderHubsLoaded(<OneTimeOrderHubOption>[]));
|
||||
}
|
||||
}
|
||||
|
||||
void _onVendorsLoaded(
|
||||
OneTimeOrderVendorsLoaded event,
|
||||
Emitter<OneTimeOrderState> emit,
|
||||
@@ -88,6 +122,33 @@ class OneTimeOrderBloc extends Bloc<OneTimeOrderEvent, OneTimeOrderState> {
|
||||
_loadRolesForVendor(event.vendor.id);
|
||||
}
|
||||
|
||||
void _onHubsLoaded(
|
||||
OneTimeOrderHubsLoaded event,
|
||||
Emitter<OneTimeOrderState> emit,
|
||||
) {
|
||||
final OneTimeOrderHubOption? selectedHub =
|
||||
event.hubs.isNotEmpty ? event.hubs.first : null;
|
||||
emit(
|
||||
state.copyWith(
|
||||
hubs: event.hubs,
|
||||
selectedHub: selectedHub,
|
||||
location: selectedHub?.name ?? '',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _onHubChanged(
|
||||
OneTimeOrderHubChanged event,
|
||||
Emitter<OneTimeOrderState> emit,
|
||||
) {
|
||||
emit(
|
||||
state.copyWith(
|
||||
selectedHub: event.hub,
|
||||
location: event.hub.name,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _onDateChanged(
|
||||
OneTimeOrderDateChanged event,
|
||||
Emitter<OneTimeOrderState> emit,
|
||||
@@ -95,13 +156,6 @@ class OneTimeOrderBloc extends Bloc<OneTimeOrderEvent, OneTimeOrderState> {
|
||||
emit(state.copyWith(date: event.date));
|
||||
}
|
||||
|
||||
void _onLocationChanged(
|
||||
OneTimeOrderLocationChanged event,
|
||||
Emitter<OneTimeOrderState> emit,
|
||||
) {
|
||||
emit(state.copyWith(location: event.location));
|
||||
}
|
||||
|
||||
void _onPositionAdded(
|
||||
OneTimeOrderPositionAdded event,
|
||||
Emitter<OneTimeOrderState> emit,
|
||||
@@ -149,10 +203,27 @@ class OneTimeOrderBloc extends Bloc<OneTimeOrderEvent, OneTimeOrderState> {
|
||||
final Map<String, double> roleRates = <String, double>{
|
||||
for (final OneTimeOrderRoleOption role in state.roles) role.id: role.costPerHour,
|
||||
};
|
||||
final OneTimeOrderHubOption? selectedHub = state.selectedHub;
|
||||
if (selectedHub == null) {
|
||||
throw Exception('Hub is missing.');
|
||||
}
|
||||
final OneTimeOrder order = OneTimeOrder(
|
||||
date: state.date,
|
||||
location: state.location,
|
||||
location: selectedHub.name,
|
||||
positions: state.positions,
|
||||
hub: OneTimeOrderHubDetails(
|
||||
id: selectedHub.id,
|
||||
name: selectedHub.name,
|
||||
address: selectedHub.address,
|
||||
placeId: selectedHub.placeId,
|
||||
latitude: selectedHub.latitude,
|
||||
longitude: selectedHub.longitude,
|
||||
city: selectedHub.city,
|
||||
state: selectedHub.state,
|
||||
street: selectedHub.street,
|
||||
country: selectedHub.country,
|
||||
zipCode: selectedHub.zipCode,
|
||||
),
|
||||
vendorId: state.selectedVendor?.id,
|
||||
roleRates: roleRates,
|
||||
);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
import 'one_time_order_state.dart';
|
||||
|
||||
abstract class OneTimeOrderEvent extends Equatable {
|
||||
const OneTimeOrderEvent();
|
||||
@@ -24,6 +25,22 @@ class OneTimeOrderVendorChanged extends OneTimeOrderEvent {
|
||||
List<Object?> get props => <Object?>[vendor];
|
||||
}
|
||||
|
||||
class OneTimeOrderHubsLoaded extends OneTimeOrderEvent {
|
||||
const OneTimeOrderHubsLoaded(this.hubs);
|
||||
final List<OneTimeOrderHubOption> hubs;
|
||||
|
||||
@override
|
||||
List<Object?> get props => <Object?>[hubs];
|
||||
}
|
||||
|
||||
class OneTimeOrderHubChanged extends OneTimeOrderEvent {
|
||||
const OneTimeOrderHubChanged(this.hub);
|
||||
final OneTimeOrderHubOption hub;
|
||||
|
||||
@override
|
||||
List<Object?> get props => <Object?>[hub];
|
||||
}
|
||||
|
||||
class OneTimeOrderDateChanged extends OneTimeOrderEvent {
|
||||
const OneTimeOrderDateChanged(this.date);
|
||||
final DateTime date;
|
||||
@@ -32,14 +49,6 @@ class OneTimeOrderDateChanged extends OneTimeOrderEvent {
|
||||
List<Object?> get props => <Object?>[date];
|
||||
}
|
||||
|
||||
class OneTimeOrderLocationChanged extends OneTimeOrderEvent {
|
||||
const OneTimeOrderLocationChanged(this.location);
|
||||
final String location;
|
||||
|
||||
@override
|
||||
List<Object?> get props => <Object?>[location];
|
||||
}
|
||||
|
||||
class OneTimeOrderPositionAdded extends OneTimeOrderEvent {
|
||||
const OneTimeOrderPositionAdded();
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ class OneTimeOrderState extends Equatable {
|
||||
this.errorMessage,
|
||||
this.vendors = const <Vendor>[],
|
||||
this.selectedVendor,
|
||||
this.hubs = const <OneTimeOrderHubOption>[],
|
||||
this.selectedHub,
|
||||
this.roles = const <OneTimeOrderRoleOption>[],
|
||||
});
|
||||
|
||||
@@ -23,6 +25,7 @@ class OneTimeOrderState extends Equatable {
|
||||
OneTimeOrderPosition(role: '', count: 1, startTime: '', endTime: ''),
|
||||
],
|
||||
vendors: const <Vendor>[],
|
||||
hubs: const <OneTimeOrderHubOption>[],
|
||||
roles: const <OneTimeOrderRoleOption>[],
|
||||
);
|
||||
}
|
||||
@@ -33,6 +36,8 @@ class OneTimeOrderState extends Equatable {
|
||||
final String? errorMessage;
|
||||
final List<Vendor> vendors;
|
||||
final Vendor? selectedVendor;
|
||||
final List<OneTimeOrderHubOption> hubs;
|
||||
final OneTimeOrderHubOption? selectedHub;
|
||||
final List<OneTimeOrderRoleOption> roles;
|
||||
|
||||
OneTimeOrderState copyWith({
|
||||
@@ -43,6 +48,8 @@ class OneTimeOrderState extends Equatable {
|
||||
String? errorMessage,
|
||||
List<Vendor>? vendors,
|
||||
Vendor? selectedVendor,
|
||||
List<OneTimeOrderHubOption>? hubs,
|
||||
OneTimeOrderHubOption? selectedHub,
|
||||
List<OneTimeOrderRoleOption>? roles,
|
||||
}) {
|
||||
return OneTimeOrderState(
|
||||
@@ -53,6 +60,8 @@ class OneTimeOrderState extends Equatable {
|
||||
errorMessage: errorMessage ?? this.errorMessage,
|
||||
vendors: vendors ?? this.vendors,
|
||||
selectedVendor: selectedVendor ?? this.selectedVendor,
|
||||
hubs: hubs ?? this.hubs,
|
||||
selectedHub: selectedHub ?? this.selectedHub,
|
||||
roles: roles ?? this.roles,
|
||||
);
|
||||
}
|
||||
@@ -66,10 +75,55 @@ class OneTimeOrderState extends Equatable {
|
||||
errorMessage,
|
||||
vendors,
|
||||
selectedVendor,
|
||||
hubs,
|
||||
selectedHub,
|
||||
roles,
|
||||
];
|
||||
}
|
||||
|
||||
class OneTimeOrderHubOption extends Equatable {
|
||||
const OneTimeOrderHubOption({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.address,
|
||||
this.placeId,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.city,
|
||||
this.state,
|
||||
this.street,
|
||||
this.country,
|
||||
this.zipCode,
|
||||
});
|
||||
|
||||
final String id;
|
||||
final String name;
|
||||
final String address;
|
||||
final String? placeId;
|
||||
final double? latitude;
|
||||
final double? longitude;
|
||||
final String? city;
|
||||
final String? state;
|
||||
final String? street;
|
||||
final String? country;
|
||||
final String? zipCode;
|
||||
|
||||
@override
|
||||
List<Object?> get props => <Object?>[
|
||||
id,
|
||||
name,
|
||||
address,
|
||||
placeId,
|
||||
latitude,
|
||||
longitude,
|
||||
city,
|
||||
state,
|
||||
street,
|
||||
country,
|
||||
zipCode,
|
||||
];
|
||||
}
|
||||
|
||||
class OneTimeOrderRoleOption extends Equatable {
|
||||
const OneTimeOrderRoleOption({
|
||||
required this.id,
|
||||
|
||||
@@ -9,7 +9,6 @@ import '../../blocs/one_time_order_event.dart';
|
||||
import '../../blocs/one_time_order_state.dart';
|
||||
import 'one_time_order_date_picker.dart';
|
||||
import 'one_time_order_header.dart';
|
||||
import 'one_time_order_location_input.dart';
|
||||
import 'one_time_order_position_card.dart';
|
||||
import 'one_time_order_section_header.dart';
|
||||
import 'one_time_order_success_view.dart';
|
||||
@@ -184,12 +183,43 @@ class _OneTimeOrderForm extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: UiConstants.space4),
|
||||
|
||||
OneTimeOrderLocationInput(
|
||||
label: labels.location_label,
|
||||
value: state.location,
|
||||
onChanged: (String location) => BlocProvider.of<OneTimeOrderBloc>(
|
||||
context,
|
||||
).add(OneTimeOrderLocationChanged(location)),
|
||||
Text('HUB', style: UiTypography.footnote2r.textSecondary),
|
||||
const SizedBox(height: 8),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: UiConstants.space3),
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
color: UiColors.white,
|
||||
borderRadius: UiConstants.radiusMd,
|
||||
border: Border.all(color: UiColors.border),
|
||||
),
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButton<OneTimeOrderHubOption>(
|
||||
isExpanded: true,
|
||||
value: state.selectedHub,
|
||||
icon: const Icon(
|
||||
UiIcons.chevronDown,
|
||||
size: 18,
|
||||
color: UiColors.iconSecondary,
|
||||
),
|
||||
onChanged: (OneTimeOrderHubOption? hub) {
|
||||
if (hub != null) {
|
||||
BlocProvider.of<OneTimeOrderBloc>(
|
||||
context,
|
||||
).add(OneTimeOrderHubChanged(hub));
|
||||
}
|
||||
},
|
||||
items: state.hubs.map((OneTimeOrderHubOption hub) {
|
||||
return DropdownMenuItem<OneTimeOrderHubOption>(
|
||||
value: hub,
|
||||
child: Text(
|
||||
hub.name,
|
||||
style: UiTypography.body2m.textPrimary,
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: UiConstants.space6),
|
||||
|
||||
|
||||
@@ -13,6 +13,11 @@ mutation createShift(
|
||||
$locationAddress: String
|
||||
$latitude: Float
|
||||
$longitude: Float
|
||||
$placeId: String
|
||||
$city: String
|
||||
$state: String
|
||||
$street: String
|
||||
$country: String
|
||||
$description: String
|
||||
|
||||
$status: ShiftStatus
|
||||
@@ -40,6 +45,11 @@ mutation createShift(
|
||||
locationAddress: $locationAddress
|
||||
latitude: $latitude
|
||||
longitude: $longitude
|
||||
placeId: $placeId
|
||||
city: $city
|
||||
state: $state
|
||||
street: $street
|
||||
country: $country
|
||||
description: $description
|
||||
|
||||
status: $status
|
||||
@@ -68,6 +78,11 @@ mutation updateShift(
|
||||
$locationAddress: String
|
||||
$latitude: Float
|
||||
$longitude: Float
|
||||
$placeId: String
|
||||
$city: String
|
||||
$state: String
|
||||
$street: String
|
||||
$country: String
|
||||
$description: String
|
||||
|
||||
$status: ShiftStatus
|
||||
@@ -95,6 +110,11 @@ mutation updateShift(
|
||||
locationAddress: $locationAddress
|
||||
latitude: $latitude
|
||||
longitude: $longitude
|
||||
placeId: $placeId
|
||||
city: $city
|
||||
state: $state
|
||||
street: $street
|
||||
country: $country
|
||||
description: $description
|
||||
|
||||
status: $status
|
||||
|
||||
@@ -22,6 +22,11 @@ query listShifts(
|
||||
locationAddress
|
||||
latitude
|
||||
longitude
|
||||
placeId
|
||||
city
|
||||
state
|
||||
street
|
||||
country
|
||||
description
|
||||
|
||||
status
|
||||
@@ -69,6 +74,11 @@ query getShiftById($id: UUID!) @auth(level: USER) {
|
||||
locationAddress
|
||||
latitude
|
||||
longitude
|
||||
placeId
|
||||
city
|
||||
state
|
||||
street
|
||||
country
|
||||
description
|
||||
|
||||
status
|
||||
@@ -134,6 +144,11 @@ query filterShifts(
|
||||
locationAddress
|
||||
latitude
|
||||
longitude
|
||||
placeId
|
||||
city
|
||||
state
|
||||
street
|
||||
country
|
||||
description
|
||||
|
||||
status
|
||||
@@ -194,6 +209,11 @@ query getShiftsByBusinessId(
|
||||
locationAddress
|
||||
latitude
|
||||
longitude
|
||||
placeId
|
||||
city
|
||||
state
|
||||
street
|
||||
country
|
||||
description
|
||||
|
||||
status
|
||||
@@ -254,6 +274,11 @@ query getShiftsByVendorId(
|
||||
locationAddress
|
||||
latitude
|
||||
longitude
|
||||
placeId
|
||||
city
|
||||
state
|
||||
street
|
||||
country
|
||||
description
|
||||
|
||||
status
|
||||
|
||||
@@ -28,6 +28,12 @@ type Shift @table(name: "shifts") {
|
||||
locationAddress: String
|
||||
latitude: Float
|
||||
longitude: Float
|
||||
placeId: String
|
||||
city: String
|
||||
state: String
|
||||
street: String
|
||||
country: String
|
||||
|
||||
description: String
|
||||
|
||||
status: ShiftStatus
|
||||
|
||||
Reference in New Issue
Block a user