check in status solved

This commit is contained in:
José Salazar
2026-02-02 21:46:12 +09:00
parent b1ad6f118a
commit 33ad8e2f17
2 changed files with 9 additions and 1 deletions

View File

@@ -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,

View File

@@ -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;