Merge pull request #289 from Oloodi/view_orders

view shits of ordes by date
This commit is contained in:
José Salazar
2026-01-23 21:15:35 -05:00
committed by GitHub
20 changed files with 20246 additions and 18735 deletions

View File

@@ -1,16 +1,16 @@
# Basic Usage
```dart
ExampleConnector.instance.createAccount(createAccountVariables).execute();
ExampleConnector.instance.updateAccount(updateAccountVariables).execute();
ExampleConnector.instance.deleteAccount(deleteAccountVariables).execute();
ExampleConnector.instance.listBenefitsData(listBenefitsDataVariables).execute();
ExampleConnector.instance.getBenefitsDataByKey(getBenefitsDataByKeyVariables).execute();
ExampleConnector.instance.listBenefitsDataByStaffId(listBenefitsDataByStaffIdVariables).execute();
ExampleConnector.instance.listBenefitsDataByVendorBenefitPlanId(listBenefitsDataByVendorBenefitPlanIdVariables).execute();
ExampleConnector.instance.listBenefitsDataByVendorBenefitPlanIds(listBenefitsDataByVendorBenefitPlanIdsVariables).execute();
ExampleConnector.instance.createConversation(createConversationVariables).execute();
ExampleConnector.instance.updateConversation(updateConversationVariables).execute();
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();
```
@@ -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.filterVendorBenefitPlans({ ... })
.vendorId(...)
await ExampleConnector.instance.updateMessage({ ... })
.conversationId(...)
.execute();
```

View File

@@ -0,0 +1,267 @@
part of 'generated.dart';
class ListAcceptedApplicationsByBusinessForDayVariablesBuilder {
String businessId;
Timestamp dayStart;
Timestamp dayEnd;
Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);
final FirebaseDataConnect _dataConnect; ListAcceptedApplicationsByBusinessForDayVariablesBuilder offset(int? t) {
_offset.value = t;
return this;
}
ListAcceptedApplicationsByBusinessForDayVariablesBuilder limit(int? t) {
_limit.value = t;
return this;
}
ListAcceptedApplicationsByBusinessForDayVariablesBuilder(this._dataConnect, {required this.businessId,required this.dayStart,required this.dayEnd,});
Deserializer<ListAcceptedApplicationsByBusinessForDayData> dataDeserializer = (dynamic json) => ListAcceptedApplicationsByBusinessForDayData.fromJson(jsonDecode(json));
Serializer<ListAcceptedApplicationsByBusinessForDayVariables> varsSerializer = (ListAcceptedApplicationsByBusinessForDayVariables vars) => jsonEncode(vars.toJson());
Future<QueryResult<ListAcceptedApplicationsByBusinessForDayData, ListAcceptedApplicationsByBusinessForDayVariables>> execute() {
return ref().execute();
}
QueryRef<ListAcceptedApplicationsByBusinessForDayData, ListAcceptedApplicationsByBusinessForDayVariables> ref() {
ListAcceptedApplicationsByBusinessForDayVariables vars= ListAcceptedApplicationsByBusinessForDayVariables(businessId: businessId,dayStart: dayStart,dayEnd: dayEnd,offset: _offset,limit: _limit,);
return _dataConnect.query("listAcceptedApplicationsByBusinessForDay", dataDeserializer, varsSerializer, vars);
}
}
@immutable
class ListAcceptedApplicationsByBusinessForDayApplications {
final String id;
final String shiftId;
final String roleId;
final Timestamp? checkInTime;
final Timestamp? checkOutTime;
final Timestamp? appliedAt;
final ListAcceptedApplicationsByBusinessForDayApplicationsStaff staff;
ListAcceptedApplicationsByBusinessForDayApplications.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']),
shiftId = nativeFromJson<String>(json['shiftId']),
roleId = nativeFromJson<String>(json['roleId']),
checkInTime = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']),
checkOutTime = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']),
appliedAt = json['appliedAt'] == null ? null : Timestamp.fromJson(json['appliedAt']),
staff = ListAcceptedApplicationsByBusinessForDayApplicationsStaff.fromJson(json['staff']);
@override
bool operator ==(Object other) {
if(identical(this, other)) {
return true;
}
if(other.runtimeType != runtimeType) {
return false;
}
final ListAcceptedApplicationsByBusinessForDayApplications otherTyped = other as ListAcceptedApplicationsByBusinessForDayApplications;
return id == otherTyped.id &&
shiftId == otherTyped.shiftId &&
roleId == otherTyped.roleId &&
checkInTime == otherTyped.checkInTime &&
checkOutTime == otherTyped.checkOutTime &&
appliedAt == otherTyped.appliedAt &&
staff == otherTyped.staff;
}
@override
int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, roleId.hashCode, checkInTime.hashCode, checkOutTime.hashCode, appliedAt.hashCode, staff.hashCode]);
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['id'] = nativeToJson<String>(id);
json['shiftId'] = nativeToJson<String>(shiftId);
json['roleId'] = nativeToJson<String>(roleId);
if (checkInTime != null) {
json['checkInTime'] = checkInTime!.toJson();
}
if (checkOutTime != null) {
json['checkOutTime'] = checkOutTime!.toJson();
}
if (appliedAt != null) {
json['appliedAt'] = appliedAt!.toJson();
}
json['staff'] = staff.toJson();
return json;
}
ListAcceptedApplicationsByBusinessForDayApplications({
required this.id,
required this.shiftId,
required this.roleId,
this.checkInTime,
this.checkOutTime,
this.appliedAt,
required this.staff,
});
}
@immutable
class ListAcceptedApplicationsByBusinessForDayApplicationsStaff {
final String id;
final String fullName;
final String? email;
final String? phone;
final String? photoUrl;
ListAcceptedApplicationsByBusinessForDayApplicationsStaff.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']),
fullName = nativeFromJson<String>(json['fullName']),
email = json['email'] == null ? null : nativeFromJson<String>(json['email']),
phone = json['phone'] == null ? null : nativeFromJson<String>(json['phone']),
photoUrl = json['photoUrl'] == null ? null : nativeFromJson<String>(json['photoUrl']);
@override
bool operator ==(Object other) {
if(identical(this, other)) {
return true;
}
if(other.runtimeType != runtimeType) {
return false;
}
final ListAcceptedApplicationsByBusinessForDayApplicationsStaff otherTyped = other as ListAcceptedApplicationsByBusinessForDayApplicationsStaff;
return id == otherTyped.id &&
fullName == otherTyped.fullName &&
email == otherTyped.email &&
phone == otherTyped.phone &&
photoUrl == otherTyped.photoUrl;
}
@override
int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode, email.hashCode, phone.hashCode, photoUrl.hashCode]);
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['id'] = nativeToJson<String>(id);
json['fullName'] = nativeToJson<String>(fullName);
if (email != null) {
json['email'] = nativeToJson<String?>(email);
}
if (phone != null) {
json['phone'] = nativeToJson<String?>(phone);
}
if (photoUrl != null) {
json['photoUrl'] = nativeToJson<String?>(photoUrl);
}
return json;
}
ListAcceptedApplicationsByBusinessForDayApplicationsStaff({
required this.id,
required this.fullName,
this.email,
this.phone,
this.photoUrl,
});
}
@immutable
class ListAcceptedApplicationsByBusinessForDayData {
final List<ListAcceptedApplicationsByBusinessForDayApplications> applications;
ListAcceptedApplicationsByBusinessForDayData.fromJson(dynamic json):
applications = (json['applications'] as List<dynamic>)
.map((e) => ListAcceptedApplicationsByBusinessForDayApplications.fromJson(e))
.toList();
@override
bool operator ==(Object other) {
if(identical(this, other)) {
return true;
}
if(other.runtimeType != runtimeType) {
return false;
}
final ListAcceptedApplicationsByBusinessForDayData otherTyped = other as ListAcceptedApplicationsByBusinessForDayData;
return applications == otherTyped.applications;
}
@override
int get hashCode => applications.hashCode;
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['applications'] = applications.map((e) => e.toJson()).toList();
return json;
}
ListAcceptedApplicationsByBusinessForDayData({
required this.applications,
});
}
@immutable
class ListAcceptedApplicationsByBusinessForDayVariables {
final String businessId;
final Timestamp dayStart;
final Timestamp dayEnd;
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.')
ListAcceptedApplicationsByBusinessForDayVariables.fromJson(Map<String, dynamic> json):
businessId = nativeFromJson<String>(json['businessId']),
dayStart = Timestamp.fromJson(json['dayStart']),
dayEnd = Timestamp.fromJson(json['dayEnd']) {
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 ListAcceptedApplicationsByBusinessForDayVariables otherTyped = other as ListAcceptedApplicationsByBusinessForDayVariables;
return businessId == otherTyped.businessId &&
dayStart == otherTyped.dayStart &&
dayEnd == otherTyped.dayEnd &&
offset == otherTyped.offset &&
limit == otherTyped.limit;
}
@override
int get hashCode => Object.hashAll([businessId.hashCode, dayStart.hashCode, dayEnd.hashCode, offset.hashCode, limit.hashCode]);
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['businessId'] = nativeToJson<String>(businessId);
json['dayStart'] = dayStart.toJson();
json['dayEnd'] = dayEnd.toJson();
if(offset.state == OptionalState.set) {
json['offset'] = offset.toJson();
}
if(limit.state == OptionalState.set) {
json['limit'] = limit.toJson();
}
return json;
}
ListAcceptedApplicationsByBusinessForDayVariables({
required this.businessId,
required this.dayStart,
required this.dayEnd,
required this.offset,
required this.limit,
});
}

View File

@@ -0,0 +1,243 @@
part of 'generated.dart';
class ListAcceptedApplicationsByShiftRoleKeyVariablesBuilder {
String shiftId;
String roleId;
Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);
final FirebaseDataConnect _dataConnect; ListAcceptedApplicationsByShiftRoleKeyVariablesBuilder offset(int? t) {
_offset.value = t;
return this;
}
ListAcceptedApplicationsByShiftRoleKeyVariablesBuilder limit(int? t) {
_limit.value = t;
return this;
}
ListAcceptedApplicationsByShiftRoleKeyVariablesBuilder(this._dataConnect, {required this.shiftId,required this.roleId,});
Deserializer<ListAcceptedApplicationsByShiftRoleKeyData> dataDeserializer = (dynamic json) => ListAcceptedApplicationsByShiftRoleKeyData.fromJson(jsonDecode(json));
Serializer<ListAcceptedApplicationsByShiftRoleKeyVariables> varsSerializer = (ListAcceptedApplicationsByShiftRoleKeyVariables vars) => jsonEncode(vars.toJson());
Future<QueryResult<ListAcceptedApplicationsByShiftRoleKeyData, ListAcceptedApplicationsByShiftRoleKeyVariables>> execute() {
return ref().execute();
}
QueryRef<ListAcceptedApplicationsByShiftRoleKeyData, ListAcceptedApplicationsByShiftRoleKeyVariables> ref() {
ListAcceptedApplicationsByShiftRoleKeyVariables vars= ListAcceptedApplicationsByShiftRoleKeyVariables(shiftId: shiftId,roleId: roleId,offset: _offset,limit: _limit,);
return _dataConnect.query("listAcceptedApplicationsByShiftRoleKey", dataDeserializer, varsSerializer, vars);
}
}
@immutable
class ListAcceptedApplicationsByShiftRoleKeyApplications {
final String id;
final Timestamp? checkInTime;
final Timestamp? checkOutTime;
final ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff staff;
ListAcceptedApplicationsByShiftRoleKeyApplications.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']),
checkInTime = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']),
checkOutTime = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']),
staff = ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff.fromJson(json['staff']);
@override
bool operator ==(Object other) {
if(identical(this, other)) {
return true;
}
if(other.runtimeType != runtimeType) {
return false;
}
final ListAcceptedApplicationsByShiftRoleKeyApplications otherTyped = other as ListAcceptedApplicationsByShiftRoleKeyApplications;
return id == otherTyped.id &&
checkInTime == otherTyped.checkInTime &&
checkOutTime == otherTyped.checkOutTime &&
staff == otherTyped.staff;
}
@override
int get hashCode => Object.hashAll([id.hashCode, checkInTime.hashCode, checkOutTime.hashCode, staff.hashCode]);
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['id'] = nativeToJson<String>(id);
if (checkInTime != null) {
json['checkInTime'] = checkInTime!.toJson();
}
if (checkOutTime != null) {
json['checkOutTime'] = checkOutTime!.toJson();
}
json['staff'] = staff.toJson();
return json;
}
ListAcceptedApplicationsByShiftRoleKeyApplications({
required this.id,
this.checkInTime,
this.checkOutTime,
required this.staff,
});
}
@immutable
class ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff {
final String id;
final String fullName;
final String? email;
final String? phone;
final String? photoUrl;
ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']),
fullName = nativeFromJson<String>(json['fullName']),
email = json['email'] == null ? null : nativeFromJson<String>(json['email']),
phone = json['phone'] == null ? null : nativeFromJson<String>(json['phone']),
photoUrl = json['photoUrl'] == null ? null : nativeFromJson<String>(json['photoUrl']);
@override
bool operator ==(Object other) {
if(identical(this, other)) {
return true;
}
if(other.runtimeType != runtimeType) {
return false;
}
final ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff otherTyped = other as ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff;
return id == otherTyped.id &&
fullName == otherTyped.fullName &&
email == otherTyped.email &&
phone == otherTyped.phone &&
photoUrl == otherTyped.photoUrl;
}
@override
int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode, email.hashCode, phone.hashCode, photoUrl.hashCode]);
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['id'] = nativeToJson<String>(id);
json['fullName'] = nativeToJson<String>(fullName);
if (email != null) {
json['email'] = nativeToJson<String?>(email);
}
if (phone != null) {
json['phone'] = nativeToJson<String?>(phone);
}
if (photoUrl != null) {
json['photoUrl'] = nativeToJson<String?>(photoUrl);
}
return json;
}
ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff({
required this.id,
required this.fullName,
this.email,
this.phone,
this.photoUrl,
});
}
@immutable
class ListAcceptedApplicationsByShiftRoleKeyData {
final List<ListAcceptedApplicationsByShiftRoleKeyApplications> applications;
ListAcceptedApplicationsByShiftRoleKeyData.fromJson(dynamic json):
applications = (json['applications'] as List<dynamic>)
.map((e) => ListAcceptedApplicationsByShiftRoleKeyApplications.fromJson(e))
.toList();
@override
bool operator ==(Object other) {
if(identical(this, other)) {
return true;
}
if(other.runtimeType != runtimeType) {
return false;
}
final ListAcceptedApplicationsByShiftRoleKeyData otherTyped = other as ListAcceptedApplicationsByShiftRoleKeyData;
return applications == otherTyped.applications;
}
@override
int get hashCode => applications.hashCode;
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['applications'] = applications.map((e) => e.toJson()).toList();
return json;
}
ListAcceptedApplicationsByShiftRoleKeyData({
required this.applications,
});
}
@immutable
class ListAcceptedApplicationsByShiftRoleKeyVariables {
final String shiftId;
final String roleId;
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.')
ListAcceptedApplicationsByShiftRoleKeyVariables.fromJson(Map<String, dynamic> json):
shiftId = nativeFromJson<String>(json['shiftId']),
roleId = nativeFromJson<String>(json['roleId']) {
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 ListAcceptedApplicationsByShiftRoleKeyVariables otherTyped = other as ListAcceptedApplicationsByShiftRoleKeyVariables;
return shiftId == otherTyped.shiftId &&
roleId == otherTyped.roleId &&
offset == otherTyped.offset &&
limit == otherTyped.limit;
}
@override
int get hashCode => Object.hashAll([shiftId.hashCode, roleId.hashCode, offset.hashCode, limit.hashCode]);
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['shiftId'] = nativeToJson<String>(shiftId);
json['roleId'] = nativeToJson<String>(roleId);
if(offset.state == OptionalState.set) {
json['offset'] = offset.toJson();
}
if(limit.state == OptionalState.set) {
json['limit'] = limit.toJson();
}
return json;
}
ListAcceptedApplicationsByShiftRoleKeyVariables({
required this.shiftId,
required this.roleId,
required this.offset,
required this.limit,
});
}

View File

@@ -0,0 +1,364 @@
part of 'generated.dart';
class ListShiftRolesByBusinessAndDateRangeVariablesBuilder {
String businessId;
Timestamp start;
Timestamp end;
Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);
final FirebaseDataConnect _dataConnect; ListShiftRolesByBusinessAndDateRangeVariablesBuilder offset(int? t) {
_offset.value = t;
return this;
}
ListShiftRolesByBusinessAndDateRangeVariablesBuilder limit(int? t) {
_limit.value = t;
return this;
}
ListShiftRolesByBusinessAndDateRangeVariablesBuilder(this._dataConnect, {required this.businessId,required this.start,required this.end,});
Deserializer<ListShiftRolesByBusinessAndDateRangeData> dataDeserializer = (dynamic json) => ListShiftRolesByBusinessAndDateRangeData.fromJson(jsonDecode(json));
Serializer<ListShiftRolesByBusinessAndDateRangeVariables> varsSerializer = (ListShiftRolesByBusinessAndDateRangeVariables vars) => jsonEncode(vars.toJson());
Future<QueryResult<ListShiftRolesByBusinessAndDateRangeData, ListShiftRolesByBusinessAndDateRangeVariables>> execute() {
return ref().execute();
}
QueryRef<ListShiftRolesByBusinessAndDateRangeData, ListShiftRolesByBusinessAndDateRangeVariables> ref() {
ListShiftRolesByBusinessAndDateRangeVariables vars= ListShiftRolesByBusinessAndDateRangeVariables(businessId: businessId,start: start,end: end,offset: _offset,limit: _limit,);
return _dataConnect.query("listShiftRolesByBusinessAndDateRange", dataDeserializer, varsSerializer, vars);
}
}
@immutable
class ListShiftRolesByBusinessAndDateRangeShiftRoles {
final String shiftId;
final String roleId;
final int count;
final int? assigned;
final double? hours;
final Timestamp? startTime;
final Timestamp? endTime;
final double? totalValue;
final ListShiftRolesByBusinessAndDateRangeShiftRolesRole role;
final ListShiftRolesByBusinessAndDateRangeShiftRolesShift shift;
ListShiftRolesByBusinessAndDateRangeShiftRoles.fromJson(dynamic json):
shiftId = nativeFromJson<String>(json['shiftId']),
roleId = nativeFromJson<String>(json['roleId']),
count = nativeFromJson<int>(json['count']),
assigned = json['assigned'] == null ? null : nativeFromJson<int>(json['assigned']),
hours = json['hours'] == null ? null : nativeFromJson<double>(json['hours']),
startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']),
endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']),
totalValue = json['totalValue'] == null ? null : nativeFromJson<double>(json['totalValue']),
role = ListShiftRolesByBusinessAndDateRangeShiftRolesRole.fromJson(json['role']),
shift = ListShiftRolesByBusinessAndDateRangeShiftRolesShift.fromJson(json['shift']);
@override
bool operator ==(Object other) {
if(identical(this, other)) {
return true;
}
if(other.runtimeType != runtimeType) {
return false;
}
final ListShiftRolesByBusinessAndDateRangeShiftRoles otherTyped = other as ListShiftRolesByBusinessAndDateRangeShiftRoles;
return shiftId == otherTyped.shiftId &&
roleId == otherTyped.roleId &&
count == otherTyped.count &&
assigned == otherTyped.assigned &&
hours == otherTyped.hours &&
startTime == otherTyped.startTime &&
endTime == otherTyped.endTime &&
totalValue == otherTyped.totalValue &&
role == otherTyped.role &&
shift == otherTyped.shift;
}
@override
int get hashCode => Object.hashAll([shiftId.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, hours.hashCode, startTime.hashCode, endTime.hashCode, totalValue.hashCode, role.hashCode, shift.hashCode]);
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['shiftId'] = nativeToJson<String>(shiftId);
json['roleId'] = nativeToJson<String>(roleId);
json['count'] = nativeToJson<int>(count);
if (assigned != null) {
json['assigned'] = nativeToJson<int?>(assigned);
}
if (hours != null) {
json['hours'] = nativeToJson<double?>(hours);
}
if (startTime != null) {
json['startTime'] = startTime!.toJson();
}
if (endTime != null) {
json['endTime'] = endTime!.toJson();
}
if (totalValue != null) {
json['totalValue'] = nativeToJson<double?>(totalValue);
}
json['role'] = role.toJson();
json['shift'] = shift.toJson();
return json;
}
ListShiftRolesByBusinessAndDateRangeShiftRoles({
required this.shiftId,
required this.roleId,
required this.count,
this.assigned,
this.hours,
this.startTime,
this.endTime,
this.totalValue,
required this.role,
required this.shift,
});
}
@immutable
class ListShiftRolesByBusinessAndDateRangeShiftRolesRole {
final String id;
final String name;
ListShiftRolesByBusinessAndDateRangeShiftRolesRole.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']),
name = nativeFromJson<String>(json['name']);
@override
bool operator ==(Object other) {
if(identical(this, other)) {
return true;
}
if(other.runtimeType != runtimeType) {
return false;
}
final ListShiftRolesByBusinessAndDateRangeShiftRolesRole otherTyped = other as ListShiftRolesByBusinessAndDateRangeShiftRolesRole;
return id == otherTyped.id &&
name == otherTyped.name;
}
@override
int get hashCode => Object.hashAll([id.hashCode, name.hashCode]);
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['id'] = nativeToJson<String>(id);
json['name'] = nativeToJson<String>(name);
return json;
}
ListShiftRolesByBusinessAndDateRangeShiftRolesRole({
required this.id,
required this.name,
});
}
@immutable
class ListShiftRolesByBusinessAndDateRangeShiftRolesShift {
final String id;
final Timestamp? date;
final String? location;
final String? locationAddress;
final String title;
final ListShiftRolesByBusinessAndDateRangeShiftRolesShiftOrder order;
ListShiftRolesByBusinessAndDateRangeShiftRolesShift.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']),
date = json['date'] == null ? null : Timestamp.fromJson(json['date']),
location = json['location'] == null ? null : nativeFromJson<String>(json['location']),
locationAddress = json['locationAddress'] == null ? null : nativeFromJson<String>(json['locationAddress']),
title = nativeFromJson<String>(json['title']),
order = ListShiftRolesByBusinessAndDateRangeShiftRolesShiftOrder.fromJson(json['order']);
@override
bool operator ==(Object other) {
if(identical(this, other)) {
return true;
}
if(other.runtimeType != runtimeType) {
return false;
}
final ListShiftRolesByBusinessAndDateRangeShiftRolesShift otherTyped = other as ListShiftRolesByBusinessAndDateRangeShiftRolesShift;
return id == otherTyped.id &&
date == otherTyped.date &&
location == otherTyped.location &&
locationAddress == otherTyped.locationAddress &&
title == otherTyped.title &&
order == otherTyped.order;
}
@override
int get hashCode => Object.hashAll([id.hashCode, date.hashCode, location.hashCode, locationAddress.hashCode, title.hashCode, order.hashCode]);
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['id'] = nativeToJson<String>(id);
if (date != null) {
json['date'] = date!.toJson();
}
if (location != null) {
json['location'] = nativeToJson<String?>(location);
}
if (locationAddress != null) {
json['locationAddress'] = nativeToJson<String?>(locationAddress);
}
json['title'] = nativeToJson<String>(title);
json['order'] = order.toJson();
return json;
}
ListShiftRolesByBusinessAndDateRangeShiftRolesShift({
required this.id,
this.date,
this.location,
this.locationAddress,
required this.title,
required this.order,
});
}
@immutable
class ListShiftRolesByBusinessAndDateRangeShiftRolesShiftOrder {
final String id;
ListShiftRolesByBusinessAndDateRangeShiftRolesShiftOrder.fromJson(dynamic json):
id = nativeFromJson<String>(json['id']);
@override
bool operator ==(Object other) {
if(identical(this, other)) {
return true;
}
if(other.runtimeType != runtimeType) {
return false;
}
final ListShiftRolesByBusinessAndDateRangeShiftRolesShiftOrder otherTyped = other as ListShiftRolesByBusinessAndDateRangeShiftRolesShiftOrder;
return id == otherTyped.id;
}
@override
int get hashCode => id.hashCode;
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['id'] = nativeToJson<String>(id);
return json;
}
ListShiftRolesByBusinessAndDateRangeShiftRolesShiftOrder({
required this.id,
});
}
@immutable
class ListShiftRolesByBusinessAndDateRangeData {
final List<ListShiftRolesByBusinessAndDateRangeShiftRoles> shiftRoles;
ListShiftRolesByBusinessAndDateRangeData.fromJson(dynamic json):
shiftRoles = (json['shiftRoles'] as List<dynamic>)
.map((e) => ListShiftRolesByBusinessAndDateRangeShiftRoles.fromJson(e))
.toList();
@override
bool operator ==(Object other) {
if(identical(this, other)) {
return true;
}
if(other.runtimeType != runtimeType) {
return false;
}
final ListShiftRolesByBusinessAndDateRangeData otherTyped = other as ListShiftRolesByBusinessAndDateRangeData;
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;
}
ListShiftRolesByBusinessAndDateRangeData({
required this.shiftRoles,
});
}
@immutable
class ListShiftRolesByBusinessAndDateRangeVariables {
final String businessId;
final Timestamp start;
final Timestamp end;
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.')
ListShiftRolesByBusinessAndDateRangeVariables.fromJson(Map<String, dynamic> json):
businessId = nativeFromJson<String>(json['businessId']),
start = Timestamp.fromJson(json['start']),
end = Timestamp.fromJson(json['end']) {
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 ListShiftRolesByBusinessAndDateRangeVariables otherTyped = other as ListShiftRolesByBusinessAndDateRangeVariables;
return businessId == otherTyped.businessId &&
start == otherTyped.start &&
end == otherTyped.end &&
offset == otherTyped.offset &&
limit == otherTyped.limit;
}
@override
int get hashCode => Object.hashAll([businessId.hashCode, start.hashCode, end.hashCode, offset.hashCode, limit.hashCode]);
Map<String, dynamic> toJson() {
Map<String, dynamic> json = {};
json['businessId'] = nativeToJson<String>(businessId);
json['start'] = start.toJson();
json['end'] = end.toJson();
if(offset.state == OptionalState.set) {
json['offset'] = offset.toJson();
}
if(limit.state == OptionalState.set) {
json['limit'] = limit.toJson();
}
return json;
}
ListShiftRolesByBusinessAndDateRangeVariables({
required this.businessId,
required this.start,
required this.end,
required this.offset,
required this.limit,
});
}

View File

@@ -19,6 +19,8 @@ class OrderItem extends Equatable {
required this.filled,
required this.workersNeeded,
required this.hourlyRate,
this.hours = 0,
this.totalValue = 0,
this.confirmedApps = const <Map<String, dynamic>>[],
});
@@ -58,6 +60,12 @@ class OrderItem extends Equatable {
/// Hourly pay rate.
final double hourlyRate;
/// Total hours for the shift role.
final double hours;
/// Total value for the shift role.
final double totalValue;
/// List of confirmed worker applications.
final List<Map<String, dynamic>> confirmedApps;
@@ -75,6 +83,8 @@ class OrderItem extends Equatable {
filled,
workersNeeded,
hourlyRate,
hours,
totalValue,
confirmedApps,
];
}

View File

@@ -107,7 +107,7 @@ class ClientCreateOrderRepositoryImpl
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;
final totalValue = rate * hours * position.count;
await _dataConnect
.createShiftRole(
@@ -143,7 +143,7 @@ class ClientCreateOrderRepositoryImpl
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;
total += rate * hours * position.count;
}
return total;
}

View File

@@ -1,17 +1,155 @@
import 'package:krow_data_connect/krow_data_connect.dart';
import 'package:krow_domain/krow_domain.dart';
import 'package:firebase_auth/firebase_auth.dart' as firebase;
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/i_view_orders_repository.dart';
/// Implementation of [IViewOrdersRepository] providing data from [OrderRepositoryMock].
/// Implementation of [IViewOrdersRepository] using Data Connect.
class ViewOrdersRepositoryImpl implements IViewOrdersRepository {
final OrderRepositoryMock _orderRepositoryMock;
final firebase.FirebaseAuth _firebaseAuth;
final dc.ExampleConnector _dataConnect;
/// Creates a [ViewOrdersRepositoryImpl] with the given [OrderRepositoryMock].
ViewOrdersRepositoryImpl({required OrderRepositoryMock orderRepositoryMock})
: _orderRepositoryMock = orderRepositoryMock;
ViewOrdersRepositoryImpl({
required firebase.FirebaseAuth firebaseAuth,
required dc.ExampleConnector dataConnect,
}) : _firebaseAuth = firebaseAuth,
_dataConnect = dataConnect;
@override
Future<List<OrderItem>> getOrders() {
return _orderRepositoryMock.getOrders();
Future<List<domain.OrderItem>> getOrdersForRange({
required DateTime start,
required DateTime end,
}) async {
final businessId = dc.ClientSessionStore.instance.session?.business?.id;
if (businessId == null || businessId.isEmpty) {
await _firebaseAuth.signOut();
throw Exception('Business is missing. Please sign in again.');
}
final startTimestamp = _toTimestamp(_startOfDay(start));
final endTimestamp = _toTimestamp(_endOfDay(end));
final result = await _dataConnect
.listShiftRolesByBusinessAndDateRange(
businessId: businessId,
start: startTimestamp,
end: endTimestamp,
)
.execute();
final businessName =
dc.ClientSessionStore.instance.session?.business?.businessName ??
'Your Company';
return result.data.shiftRoles.map((shiftRole) {
print(
'ViewOrders shiftRole: shiftId=${shiftRole.shiftId} roleId=${shiftRole.roleId} '
'startTime=${shiftRole.startTime?.toJson()} endTime=${shiftRole.endTime?.toJson()} '
'hours=${shiftRole.hours} totalValue=${shiftRole.totalValue}',
);
final shiftDate = shiftRole.shift.date?.toDateTime();
final dateStr = shiftDate == null
? ''
: DateFormat('yyyy-MM-dd').format(shiftDate);
final startTime = _formatTime(shiftRole.startTime);
final endTime = _formatTime(shiftRole.endTime);
final filled = shiftRole.assigned ?? 0;
final workersNeeded = shiftRole.count;
final hours = shiftRole.hours ?? 0;
final totalValue = shiftRole.totalValue ?? 0;
final hourlyRate = _hourlyRate(shiftRole.totalValue, shiftRole.hours);
final status = filled >= workersNeeded ? 'filled' : 'open';
return domain.OrderItem(
id: _shiftRoleKey(shiftRole.shiftId, shiftRole.roleId),
title: '${shiftRole.role.name} - ${shiftRole.shift.title}',
clientName: businessName,
status: status,
date: dateStr,
startTime: startTime,
endTime: endTime,
location: shiftRole.shift.location ?? '',
locationAddress: shiftRole.shift.locationAddress ?? '',
filled: filled,
workersNeeded: workersNeeded,
hourlyRate: hourlyRate,
hours: hours,
totalValue: totalValue,
confirmedApps: const <Map<String, dynamic>>[],
);
}).toList();
}
@override
Future<Map<String, List<Map<String, dynamic>>>> getAcceptedApplicationsForDay(
DateTime day,
) async {
final businessId = dc.ClientSessionStore.instance.session?.business?.id;
if (businessId == null || businessId.isEmpty) {
await _firebaseAuth.signOut();
throw Exception('Business is missing. Please sign in again.');
}
final dayStart = _toTimestamp(_startOfDay(day));
final dayEnd = _toTimestamp(_endOfDay(day));
final result = await _dataConnect
.listAcceptedApplicationsByBusinessForDay(
businessId: businessId,
dayStart: dayStart,
dayEnd: dayEnd,
)
.execute();
final Map<String, List<Map<String, dynamic>>> grouped = {};
for (final application in result.data.applications) {
print(
'ViewOrders app: shiftId=${application.shiftId} roleId=${application.roleId} '
'checkIn=${application.checkInTime?.toJson()} checkOut=${application.checkOutTime?.toJson()}',
);
final key = _shiftRoleKey(application.shiftId, application.roleId);
grouped.putIfAbsent(key, () => <Map<String, dynamic>>[]);
grouped[key]!.add(<String, dynamic>{
'id': application.id,
'worker_id': application.staff.id,
'worker_name': application.staff.fullName,
'status': 'confirmed',
'photo_url': application.staff.photoUrl,
});
}
return grouped;
}
String _shiftRoleKey(String shiftId, String roleId) {
return '$shiftId:$roleId';
}
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);
}
DateTime _startOfDay(DateTime dateTime) {
return DateTime(dateTime.year, dateTime.month, dateTime.day);
}
DateTime _endOfDay(DateTime dateTime) {
return DateTime(dateTime.year, dateTime.month, dateTime.day, 23, 59, 59);
}
String _formatTime(fdc.Timestamp? timestamp) {
if (timestamp == null) {
return '';
}
final dateTime = timestamp.toDateTime();
return DateFormat('HH:mm').format(dateTime);
}
double _hourlyRate(double? totalValue, double? hours) {
if (totalValue == null || hours == null || hours == 0) {
return 0;
}
return totalValue / hours;
}
}

View File

@@ -0,0 +1,10 @@
import 'package:krow_core/core.dart';
class OrdersDayArguments extends UseCaseArgument {
const OrdersDayArguments({required this.day});
final DateTime day;
@override
List<Object?> get props => <Object?>[day];
}

View File

@@ -0,0 +1,14 @@
import 'package:krow_core/core.dart';
class OrdersRangeArguments extends UseCaseArgument {
const OrdersRangeArguments({
required this.start,
required this.end,
});
final DateTime start;
final DateTime end;
@override
List<Object?> get props => <Object?>[start, end];
}

View File

@@ -3,5 +3,13 @@ import 'package:krow_domain/krow_domain.dart';
/// Repository interface for fetching and managing client orders.
abstract class IViewOrdersRepository {
/// Fetches a list of [OrderItem] for the client.
Future<List<OrderItem>> getOrders();
Future<List<OrderItem>> getOrdersForRange({
required DateTime start,
required DateTime end,
});
/// Fetches accepted staff applications for the given day, grouped by shift+role.
Future<Map<String, List<Map<String, dynamic>>>> getAcceptedApplicationsForDay(
DateTime day,
);
}

View File

@@ -0,0 +1,17 @@
import 'package:krow_core/core.dart';
import '../repositories/i_view_orders_repository.dart';
import '../arguments/orders_day_arguments.dart';
class GetAcceptedApplicationsForDayUseCase
implements UseCase<OrdersDayArguments, Map<String, List<Map<String, dynamic>>>> {
const GetAcceptedApplicationsForDayUseCase(this._repository);
final IViewOrdersRepository _repository;
@override
Future<Map<String, List<Map<String, dynamic>>>> call(
OrdersDayArguments input,
) {
return _repository.getAcceptedApplicationsForDay(input.day);
}
}

View File

@@ -1,19 +1,24 @@
import 'package:krow_core/core.dart';
import 'package:krow_domain/krow_domain.dart';
import '../repositories/i_view_orders_repository.dart';
import '../arguments/orders_range_arguments.dart';
/// Use case for retrieving the list of client orders.
///
/// This use case encapsulates the business rule of fetching orders
/// and delegates the data retrieval to the [IViewOrdersRepository].
class GetOrdersUseCase implements NoInputUseCase<List<OrderItem>> {
class GetOrdersUseCase
implements UseCase<OrdersRangeArguments, List<OrderItem>> {
final IViewOrdersRepository _repository;
/// Creates a [GetOrdersUseCase] with the required [IViewOrdersRepository].
GetOrdersUseCase(this._repository);
@override
Future<List<OrderItem>> call() {
return _repository.getOrders();
Future<List<OrderItem>> call(OrdersRangeArguments input) {
return _repository.getOrdersForRange(
start: input.start,
end: input.end,
);
}
}

View File

@@ -1,6 +1,9 @@
import 'package:intl/intl.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:krow_domain/krow_domain.dart';
import '../../domain/arguments/orders_day_arguments.dart';
import '../../domain/arguments/orders_range_arguments.dart';
import '../../domain/usecases/get_accepted_applications_for_day_use_case.dart';
import '../../domain/usecases/get_orders_use_case.dart';
import 'view_orders_state.dart';
@@ -8,25 +11,43 @@ import 'view_orders_state.dart';
///
/// This Cubit handles loading orders, date selection, and tab filtering.
class ViewOrdersCubit extends Cubit<ViewOrdersState> {
ViewOrdersCubit({required GetOrdersUseCase getOrdersUseCase})
ViewOrdersCubit({
required GetOrdersUseCase getOrdersUseCase,
required GetAcceptedApplicationsForDayUseCase getAcceptedAppsUseCase,
})
: _getOrdersUseCase = getOrdersUseCase,
_getAcceptedAppsUseCase = getAcceptedAppsUseCase,
super(ViewOrdersState(selectedDate: DateTime.now())) {
_init();
}
final GetOrdersUseCase _getOrdersUseCase;
final GetAcceptedApplicationsForDayUseCase _getAcceptedAppsUseCase;
void _init() {
updateWeekOffset(0); // Initialize calendar days
loadOrders();
}
/// Loads the list of orders using the [GetOrdersUseCase].
Future<void> loadOrders() async {
Future<void> _loadOrdersForRange({
required DateTime rangeStart,
required DateTime rangeEnd,
required DateTime dayForApps,
}) async {
emit(state.copyWith(status: ViewOrdersStatus.loading));
try {
final List<OrderItem> orders = await _getOrdersUseCase();
emit(state.copyWith(status: ViewOrdersStatus.success, orders: orders));
final List<OrderItem> orders = await _getOrdersUseCase(
OrdersRangeArguments(start: rangeStart, end: rangeEnd),
);
final apps = await _getAcceptedAppsUseCase(
OrdersDayArguments(day: dayForApps),
);
final List<OrderItem> updatedOrders = _applyApplications(orders, apps);
emit(
state.copyWith(
status: ViewOrdersStatus.success,
orders: updatedOrders,
),
);
_updateDerivedState();
} catch (_) {
emit(state.copyWith(status: ViewOrdersStatus.failure));
@@ -35,7 +56,7 @@ class ViewOrdersCubit extends Cubit<ViewOrdersState> {
void selectDate(DateTime date) {
emit(state.copyWith(selectedDate: date));
_updateDerivedState();
_refreshAcceptedApplications(date);
}
void selectFilterTab(String tabId) {
@@ -46,8 +67,25 @@ class ViewOrdersCubit extends Cubit<ViewOrdersState> {
void updateWeekOffset(int offset) {
final int newWeekOffset = state.weekOffset + offset;
final List<DateTime> calendarDays = _calculateCalendarDays(newWeekOffset);
emit(state.copyWith(weekOffset: newWeekOffset, calendarDays: calendarDays));
_updateDerivedState();
final DateTime? selectedDate = state.selectedDate;
final DateTime updatedSelectedDate =
selectedDate != null &&
calendarDays.any((day) => _isSameDay(day, selectedDate))
? selectedDate
: calendarDays.first;
emit(
state.copyWith(
weekOffset: newWeekOffset,
calendarDays: calendarDays,
selectedDate: updatedSelectedDate,
),
);
_loadOrdersForRange(
rangeStart: calendarDays.first,
rangeEnd: calendarDays.last,
dayForApps: updatedSelectedDate,
);
}
void _updateDerivedState() {
@@ -66,6 +104,57 @@ class ViewOrdersCubit extends Cubit<ViewOrdersState> {
);
}
Future<void> _refreshAcceptedApplications(DateTime day) async {
try {
final apps = await _getAcceptedAppsUseCase(
OrdersDayArguments(day: day),
);
final List<OrderItem> updatedOrders =
_applyApplications(state.orders, apps);
emit(state.copyWith(orders: updatedOrders));
_updateDerivedState();
} catch (_) {
// Keep existing data on failure.
}
}
List<OrderItem> _applyApplications(
List<OrderItem> orders,
Map<String, List<Map<String, dynamic>>> apps,
) {
return orders.map((order) {
final confirmed = apps[order.id] ?? const <Map<String, dynamic>>[];
if (confirmed.isEmpty) {
return order;
}
final filled = confirmed.length;
final status =
filled >= order.workersNeeded ? 'filled' : order.status;
return OrderItem(
id: order.id,
title: order.title,
clientName: order.clientName,
status: status,
date: order.date,
startTime: order.startTime,
endTime: order.endTime,
location: order.location,
locationAddress: order.locationAddress,
filled: filled,
workersNeeded: order.workersNeeded,
hourlyRate: order.hourlyRate,
hours: order.hours,
totalValue: order.totalValue,
confirmedApps: confirmed,
);
}).toList();
}
bool _isSameDay(DateTime a, DateTime b) {
return a.year == b.year && a.month == b.month && a.day == b.day;
}
List<DateTime> _calculateCalendarDays(int weekOffset) {
final DateTime now = DateTime.now();
final int jsDay = now.weekday == 7 ? 0 : now.weekday;

View File

@@ -112,12 +112,8 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
? ((order.filled / order.workersNeeded) * 100).round()
: 0;
// Simulation of cost/hours calculation
const double hours = 8.0;
final double cost =
order.hourlyRate *
hours *
(order.filled > 0 ? order.filled : order.workersNeeded);
final double hours = order.hours;
final double cost = order.totalValue;
return Container(
decoration: BoxDecoration(
@@ -730,25 +726,7 @@ class _OrderEditSheetState extends State<_OrderEditSheet> {
}
double _calculateTotalCost() {
double total = 0;
for (final Map<String, dynamic> pos in _positions) {
double hours = 8.0;
try {
final List<String> startParts = pos['start_time'].toString().split(':');
final List<String> endParts = pos['end_time'].toString().split(':');
final double startH =
int.parse(startParts[0]) + int.parse(startParts[1]) / 60;
final double endH =
int.parse(endParts[0]) + int.parse(endParts[1]) / 60;
hours = endH - startH;
if (hours < 0) hours += 24;
} catch (_) {}
final double rate =
_selectedVendor?.rates[pos['role']] ?? widget.order.hourlyRate;
total += hours * rate * (pos['count'] as int);
}
return total;
return widget.order.totalValue;
}
@override

View File

@@ -1,9 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:krow_data_connect/krow_data_connect.dart';
import 'package:firebase_auth/firebase_auth.dart' as firebase;
import 'data/repositories/view_orders_repository_impl.dart';
import 'domain/repositories/i_view_orders_repository.dart';
import 'domain/usecases/get_accepted_applications_for_day_use_case.dart';
import 'domain/usecases/get_orders_use_case.dart';
import 'presentation/blocs/view_orders_cubit.dart';
import 'presentation/pages/view_orders_page.dart';
@@ -21,15 +23,22 @@ class ViewOrdersModule extends Module {
// Repositories
i.addLazySingleton<IViewOrdersRepository>(
() => ViewOrdersRepositoryImpl(
orderRepositoryMock: i.get<OrderRepositoryMock>(),
firebaseAuth: firebase.FirebaseAuth.instance,
dataConnect: ExampleConnector.instance,
),
);
// UseCases
i.addLazySingleton(GetOrdersUseCase.new);
i.addLazySingleton(GetAcceptedApplicationsForDayUseCase.new);
// BLoCs
i.addSingleton(ViewOrdersCubit.new);
i.addSingleton(
() => ViewOrdersCubit(
getOrdersUseCase: i.get<GetOrdersUseCase>(),
getAcceptedAppsUseCase: i.get<GetAcceptedApplicationsForDayUseCase>(),
),
);
}
@override

View File

@@ -25,7 +25,6 @@ dependencies:
path: ../../../domain
krow_core:
path: ../../../core
# UI
lucide_icons: ^0.257.0
intl: ^0.20.1