From caec0d859b5f64cc048430c0685a9bcbe6b1ae1c Mon Sep 17 00:00:00 2001 From: Gokulraj Date: Tue, 17 Feb 2026 19:25:47 +0530 Subject: [PATCH] shift mutation file --- .../dataconnect/connector/shift/mutations.gql | 134 ++++++++++++++++++ internal/api-harness/src/api/krowSDK.js | 13 +- 2 files changed, 143 insertions(+), 4 deletions(-) create mode 100644 backend/dataconnect/connector/shift/mutations.gql diff --git a/backend/dataconnect/connector/shift/mutations.gql b/backend/dataconnect/connector/shift/mutations.gql new file mode 100644 index 00000000..0a81f9bc --- /dev/null +++ b/backend/dataconnect/connector/shift/mutations.gql @@ -0,0 +1,134 @@ + +mutation createShift( + $title: String! + $orderId: UUID! + + $date: Timestamp + $startTime: Timestamp + $endTime: Timestamp + $hours: Float + $cost: Float + + $location: String + $locationAddress: String + $latitude: Float + $longitude: Float + $placeId: String + $city: String + $state: String + $street: String + $country: String + $description: String + + $status: ShiftStatus + $workersNeeded: Int + $filled: Int + $filledAt: Timestamp + + $managers: [Any!] + $durationDays: Int + + $createdBy: String +) @auth(level: USER) { + shift_insert( + data: { + title: $title + orderId: $orderId + + date: $date + startTime: $startTime + endTime: $endTime + hours: $hours + cost: $cost + + location: $location + locationAddress: $locationAddress + latitude: $latitude + longitude: $longitude + placeId: $placeId + city: $city + state: $state + street: $street + country: $country + description: $description + + status: $status + workersNeeded: $workersNeeded + filled: $filled + filledAt: $filledAt + + managers: $managers + durationDays: $durationDays + } + ) +} + +mutation updateShift( + $id: UUID! + $title: String + $orderId: UUID + + $date: Timestamp + $startTime: Timestamp + $endTime: Timestamp + $hours: Float + $cost: Float + + $location: String + $locationAddress: String + $latitude: Float + $longitude: Float + $placeId: String + $city: String + $state: String + $street: String + $country: String + $description: String + + $status: ShiftStatus + $workersNeeded: Int + $filled: Int + $filledAt: Timestamp + + $managers: [Any!] + $durationDays: Int + +) @auth(level: USER) { + shift_update( + id: $id + data: { + title: $title + orderId: $orderId + + date: $date + startTime: $startTime + endTime: $endTime + hours: $hours + cost: $cost + + location: $location + locationAddress: $locationAddress + latitude: $latitude + longitude: $longitude + placeId: $placeId + city: $city + state: $state + street: $street + country: $country + description: $description + + status: $status + workersNeeded: $workersNeeded + filled: $filled + filledAt: $filledAt + + managers: $managers + durationDays: $durationDays + + } + ) +} + +mutation deleteShift($id: UUID!) @auth(level: USER) { + shift_delete(id: $id) +} diff --git a/internal/api-harness/src/api/krowSDK.js b/internal/api-harness/src/api/krowSDK.js index 7c9ec177..c47392ed 100644 --- a/internal/api-harness/src/api/krowSDK.js +++ b/internal/api-harness/src/api/krowSDK.js @@ -303,14 +303,19 @@ const dataconnectEntityConfig = { Order:{ list: 'listOrder', get: 'getOrderById', - create: 'UpdateOrder', - update: 'updateEnterprise', - delete: 'deleteEnterprise', + create: 'createOrder', + update: 'updateOrder', + delete: 'deleteOrder', filter: 'filterOrder', }, Shift:{ - + list: 'listShifts', + get: 'getShiftById', + create: 'createShift', + update: 'updateShift', + delete: 'deleteShift', + filter: 'filterShifts', } };