check in status solved
This commit is contained in:
@@ -194,6 +194,10 @@ class ShiftsRepositoryImpl implements ShiftsRepositoryInterface {
|
||||
final DateTime? createdDt = _toDateTime(app.createdAt);
|
||||
|
||||
// Override status to reflect the application state (e.g., CHECKED_OUT, ACCEPTED)
|
||||
final bool hasCheckIn = app.checkInTime != null;
|
||||
final bool hasCheckOut = app.checkOutTime != null;
|
||||
final String mappedStatus =
|
||||
hasCheckOut ? 'completed' : hasCheckIn ? 'checked_in' : _mapStatus(status);
|
||||
shifts.add(
|
||||
Shift(
|
||||
id: app.shift.id,
|
||||
@@ -208,7 +212,7 @@ class ShiftsRepositoryImpl implements ShiftsRepositoryInterface {
|
||||
startTime: startDt != null ? DateFormat('HH:mm').format(startDt) : '',
|
||||
endTime: endDt != null ? DateFormat('HH:mm').format(endDt) : '',
|
||||
createdDate: createdDt?.toIso8601String() ?? '',
|
||||
status: _mapStatus(status),
|
||||
status: mappedStatus,
|
||||
description: app.shift.description,
|
||||
durationDays: app.shift.durationDays,
|
||||
requiredSlots: app.shiftRole.count,
|
||||
|
||||
@@ -90,6 +90,10 @@ class _MyShiftCardState extends State<MyShiftCard> {
|
||||
statusText = t.staff_shifts.status.confirmed;
|
||||
statusColor = UiColors.textLink;
|
||||
statusBg = UiColors.primary;
|
||||
} else if (status == 'checked_in') {
|
||||
statusText = 'Checked in';
|
||||
statusColor = UiColors.textSuccess;
|
||||
statusBg = UiColors.iconSuccess;
|
||||
} else if (status == 'pending' || status == 'open') {
|
||||
statusText = t.staff_shifts.status.act_now;
|
||||
statusColor = UiColors.destructive;
|
||||
|
||||
Reference in New Issue
Block a user