From 869ece91a286bf2bf257b0092ae16258fcc601e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Salazar?= <73718835+joshrs23@users.noreply.github.com> Date: Tue, 17 Feb 2026 10:06:32 -0500 Subject: [PATCH] solving problems of validations and adding query of application --- .../connector/application/queries.gql | 30 +++++++++++++++++++ backend/dataconnect/dataconnect.yaml | 4 +-- internal/launchpad/package-lock.json | 6 ++++ 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 internal/launchpad/package-lock.json diff --git a/backend/dataconnect/connector/application/queries.gql b/backend/dataconnect/connector/application/queries.gql index 4b7db9af..4a6d6396 100644 --- a/backend/dataconnect/connector/application/queries.gql +++ b/backend/dataconnect/connector/application/queries.gql @@ -543,6 +543,36 @@ query listAcceptedApplicationsByShiftRoleKey( } } +query listOverlappingAcceptedApplicationsByStaff( + $staffId: UUID! + $newStart: Timestamp! + $newEnd: Timestamp! + $offset: Int + $limit: Int +) @auth(level: USER) { + applications( + where: { + staffId: { eq: $staffId } + status: { in: [ CONFIRMED, CHECKED_IN, CHECKED_OUT, LATE ] } + shiftRole: { + startTime: { lt: $newEnd } + endTime: { gt: $newStart } + } + } + offset: $offset + limit: $limit + orderBy: { appliedAt: ASC } + ) { + id + shiftId + roleId + checkInTime + checkOutTime + staff { id fullName email phone photoUrl } + shiftRole { startTime endTime } + } +} + #getting staffs of an shiftrole status for orders of the day view client query listAcceptedApplicationsByBusinessForDay( $businessId: UUID! diff --git a/backend/dataconnect/dataconnect.yaml b/backend/dataconnect/dataconnect.yaml index 39e01fdb..9e1775d6 100644 --- a/backend/dataconnect/dataconnect.yaml +++ b/backend/dataconnect/dataconnect.yaml @@ -1,5 +1,5 @@ specVersion: "v1" -serviceId: "krow-workforce-db" +serviceId: "krow-workforce-db-validation" location: "us-central1" schema: source: "./schema" @@ -7,7 +7,7 @@ schema: postgresql: database: "krow_db" cloudSql: - instanceId: "krow-sql" + instanceId: "krow-sql-validation" # schemaValidation: "STRICT" # STRICT mode makes Postgres schema match Data Connect exactly. # schemaValidation: "COMPATIBLE" # COMPATIBLE mode makes Postgres schema compatible with Data Connect. connectorDirs: ["./connector"] diff --git a/internal/launchpad/package-lock.json b/internal/launchpad/package-lock.json new file mode 100644 index 00000000..86416bc9 --- /dev/null +++ b/internal/launchpad/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "launchpad", + "lockfileVersion": 3, + "requires": true, + "packages": {} +}