diff --git a/apps/mobile/packages/features/client/create_order/lib/src/data/repositories_impl/client_create_order_repository_impl.dart b/apps/mobile/packages/features/client/create_order/lib/src/data/repositories_impl/client_create_order_repository_impl.dart index 757aff1f..d808ff3d 100644 --- a/apps/mobile/packages/features/client/create_order/lib/src/data/repositories_impl/client_create_order_repository_impl.dart +++ b/apps/mobile/packages/features/client/create_order/lib/src/data/repositories_impl/client_create_order_repository_impl.dart @@ -105,7 +105,7 @@ class ClientCreateOrderRepositoryImpl implements ClientCreateOrderRepositoryInte .state(hub.state) .street(hub.street) .country(hub.country) - .status(dc.ShiftStatus.CONFIRMED) + .status(dc.ShiftStatus.OPEN) .workersNeeded(workersNeeded) .filled(0) .durationDays(1) @@ -224,7 +224,7 @@ class ClientCreateOrderRepositoryImpl implements ClientCreateOrderRepositoryInte .state(hub.state) .street(hub.street) .country(hub.country) - .status(dc.ShiftStatus.CONFIRMED) + .status(dc.ShiftStatus.OPEN) .workersNeeded(workersNeeded) .filled(0) .durationDays(1) @@ -342,7 +342,7 @@ class ClientCreateOrderRepositoryImpl implements ClientCreateOrderRepositoryInte .state(hub.state) .street(hub.street) .country(hub.country) - .status(dc.ShiftStatus.CONFIRMED) + .status(dc.ShiftStatus.OPEN) .workersNeeded(workersNeeded) .filled(0) .durationDays(1) diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/shift_order_form_sheet.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/shift_order_form_sheet.dart index 15bdac09..593a267a 100644 --- a/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/shift_order_form_sheet.dart +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/shift_order_form_sheet.dart @@ -265,7 +265,7 @@ class _ShiftOrderFormSheetState extends State { .state(selectedHub.state) .street(selectedHub.street) .country(selectedHub.country) - .status(dc.ShiftStatus.PENDING) + .status(dc.ShiftStatus.OPEN) .workersNeeded(workersNeeded) .filled(0) .durationDays(1) diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/data/repositories_impl/shifts_repository_impl.dart b/apps/mobile/packages/features/staff/shifts/lib/src/data/repositories_impl/shifts_repository_impl.dart index b1ada599..7d39b3c2 100644 --- a/apps/mobile/packages/features/staff/shifts/lib/src/data/repositories_impl/shifts_repository_impl.dart +++ b/apps/mobile/packages/features/staff/shifts/lib/src/data/repositories_impl/shifts_repository_impl.dart @@ -95,11 +95,12 @@ class ShiftsRepositoryImpl DateTime? end, }) async { final staffId = await _service.getStaffId(); - var query = _service.connector.getApplicationsByStaffId(staffId: staffId); + var query = _service.connector.getMyApplicationsByStaffId(staffId: staffId); if (start != null && end != null) { query = query.dayStart(_service.toTimestamp(start)).dayEnd(_service.toTimestamp(end)); } - final fdc.QueryResult response = await _service.executeProtected(() => query.execute()); + final fdc.QueryResult response = + await _service.executeProtected(() => query.execute()); final apps = response.data.applications; final List shifts = []; diff --git a/backend/dataconnect/connector/application/queries.gql b/backend/dataconnect/connector/application/queries.gql index 4a6d6396..e08aca4c 100644 --- a/backend/dataconnect/connector/application/queries.gql +++ b/backend/dataconnect/connector/application/queries.gql @@ -356,6 +356,95 @@ query getApplicationsByStaffId( } } +query getMyApplicationsByStaffId( + $staffId: UUID! + $offset: Int + $limit: Int + $dayStart: Timestamp + $dayEnd: Timestamp +) @auth(level: USER) { + applications( + where: { + staffId: { eq: $staffId } + status: { in: [ CONFIRMED, CHECKED_IN, CHECKED_OUT, LATE, PENDING] } + shift: { + date: { ge: $dayStart, le: $dayEnd } + } + + } + offset: $offset + limit: $limit + ) { + id + shiftId + staffId + status + appliedAt + checkInTime + checkOutTime + origin + createdAt + + shift { + id + title + date + startTime + endTime + location + status + durationDays + description + latitude + longitude + + order { + id + eventName + #location + + teamHub { + address + placeId + hubName + } + + business { + id + businessName + email + contactName + companyLogoUrl + } + vendor { + id + companyName + } + } + + } + + shiftRole { + id + roleId + count + assigned + startTime + endTime + hours + breakType + isBreakPaid + totalValue + role { + id + name + costPerHour + } + } + + } +} + query vaidateDayStaffApplication( $staffId: UUID! $offset: Int