filled problem solved
This commit is contained in:
@@ -36,6 +36,9 @@ class ViewOrdersRepositoryImpl implements IViewOrdersRepository {
|
|||||||
end: endTimestamp,
|
end: endTimestamp,
|
||||||
)
|
)
|
||||||
.execute();
|
.execute();
|
||||||
|
print(
|
||||||
|
'ViewOrders range start=${start.toIso8601String()} end=${end.toIso8601String()} shiftRoles=${result.data.shiftRoles.length}',
|
||||||
|
);
|
||||||
|
|
||||||
final String businessName =
|
final String businessName =
|
||||||
dc.ClientSessionStore.instance.session?.business?.businessName ??
|
dc.ClientSessionStore.instance.session?.business?.businessName ??
|
||||||
@@ -106,6 +109,10 @@ class ViewOrdersRepositoryImpl implements IViewOrdersRepository {
|
|||||||
)
|
)
|
||||||
.execute();
|
.execute();
|
||||||
|
|
||||||
|
print(
|
||||||
|
'ViewOrders day=${day.toIso8601String()} applications=${result.data.applications.length}',
|
||||||
|
);
|
||||||
|
|
||||||
final Map<String, List<Map<String, dynamic>>> grouped = <String, List<Map<String, dynamic>>>{};
|
final Map<String, List<Map<String, dynamic>>> grouped = <String, List<Map<String, dynamic>>>{};
|
||||||
for (final dc.ListAcceptedApplicationsByBusinessForDayApplications application in result.data.applications) {
|
for (final dc.ListAcceptedApplicationsByBusinessForDayApplications application in result.data.applications) {
|
||||||
print(
|
print(
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ class ViewOrdersCubit extends Cubit<ViewOrdersState> {
|
|||||||
|
|
||||||
final int filled = confirmed.length;
|
final int filled = confirmed.length;
|
||||||
final String status =
|
final String status =
|
||||||
filled >= order.workersNeeded ? 'filled' : order.status;
|
filled >= order.workersNeeded ? 'FILLED' : order.status;
|
||||||
return OrderItem(
|
return OrderItem(
|
||||||
id: order.id,
|
id: order.id,
|
||||||
orderId: order.orderId,
|
orderId: order.orderId,
|
||||||
@@ -212,6 +212,9 @@ class ViewOrdersCubit extends Cubit<ViewOrdersState> {
|
|||||||
final List<OrderItem> ordersOnDate = state.orders
|
final List<OrderItem> ordersOnDate = state.orders
|
||||||
.where((OrderItem s) => s.date == selectedDateStr)
|
.where((OrderItem s) => s.date == selectedDateStr)
|
||||||
.toList();
|
.toList();
|
||||||
|
print(
|
||||||
|
'ViewOrders selectedDate=$selectedDateStr ordersOnDate=${ordersOnDate.length}',
|
||||||
|
);
|
||||||
|
|
||||||
// Sort by start time
|
// Sort by start time
|
||||||
ordersOnDate.sort(
|
ordersOnDate.sort(
|
||||||
@@ -219,22 +222,34 @@ class ViewOrdersCubit extends Cubit<ViewOrdersState> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (state.filterTab == 'all') {
|
if (state.filterTab == 'all') {
|
||||||
return ordersOnDate
|
final List<OrderItem> filtered = ordersOnDate
|
||||||
.where(
|
.where(
|
||||||
(OrderItem s) =>
|
(OrderItem s) =>
|
||||||
// TODO(orders): move PENDING to its own tab once available.
|
// TODO(orders): move PENDING to its own tab once available.
|
||||||
<String>['OPEN', 'FILLED', 'CONFIRMED', 'PENDING']
|
<String>['OPEN', 'FILLED', 'CONFIRMED', 'PENDING', 'ASSIGNED']
|
||||||
.contains(s.status),
|
.contains(s.status),
|
||||||
)
|
)
|
||||||
.toList();
|
.toList();
|
||||||
|
print(
|
||||||
|
'ViewOrders tab=all statuses=${ordersOnDate.map((OrderItem s) => s.status).toList()} filtered=${filtered.length}',
|
||||||
|
);
|
||||||
|
return filtered;
|
||||||
} else if (state.filterTab == 'active') {
|
} else if (state.filterTab == 'active') {
|
||||||
return ordersOnDate
|
final List<OrderItem> filtered = ordersOnDate
|
||||||
.where((OrderItem s) => s.status == 'IN_PROGRESS')
|
.where((OrderItem s) => s.status == 'IN_PROGRESS')
|
||||||
.toList();
|
.toList();
|
||||||
|
print(
|
||||||
|
'ViewOrders tab=active statuses=${ordersOnDate.map((OrderItem s) => s.status).toList()} filtered=${filtered.length}',
|
||||||
|
);
|
||||||
|
return filtered;
|
||||||
} else if (state.filterTab == 'completed') {
|
} else if (state.filterTab == 'completed') {
|
||||||
return ordersOnDate
|
final List<OrderItem> filtered = ordersOnDate
|
||||||
.where((OrderItem s) => s.status == 'COMPLETED')
|
.where((OrderItem s) => s.status == 'COMPLETED')
|
||||||
.toList();
|
.toList();
|
||||||
|
print(
|
||||||
|
'ViewOrders tab=completed statuses=${ordersOnDate.map((OrderItem s) => s.status).toList()} filtered=${filtered.length}',
|
||||||
|
);
|
||||||
|
return filtered;
|
||||||
}
|
}
|
||||||
return <OrderItem>[];
|
return <OrderItem>[];
|
||||||
}
|
}
|
||||||
@@ -272,7 +287,7 @@ class ViewOrdersCubit extends Cubit<ViewOrdersState> {
|
|||||||
.where(
|
.where(
|
||||||
(OrderItem s) =>
|
(OrderItem s) =>
|
||||||
// TODO(orders): move PENDING to its own tab once available.
|
// TODO(orders): move PENDING to its own tab once available.
|
||||||
<String>['OPEN', 'FILLED', 'CONFIRMED', 'PENDING']
|
<String>['OPEN', 'FILLED', 'CONFIRMED', 'PENDING', 'ASSIGNED']
|
||||||
.contains(s.status),
|
.contains(s.status),
|
||||||
)
|
)
|
||||||
.length;
|
.length;
|
||||||
|
|||||||
Reference in New Issue
Block a user