From 4e09d21beb1a0268721bf539deeccf13366a266c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Salazar?= <73718835+joshrs23@users.noreply.github.com> Date: Tue, 20 Jan 2026 14:23:04 -0500 Subject: [PATCH] modifications queries, mutations of contact, recentPayment, shiftRole, teamhub --- .../mutations.gql | 0 .../{contact => emergencyContact}/queries.gql | 0 .../connector/recentPayment/queries.gql | 67 ++++++++++++++++++ .../connector/requiredDoc/mutations.gql | 39 ----------- .../connector/requiredDoc/queries.gql | 61 ----------------- .../connector/shiftRole/queries.gql | 68 +++++++++++++++++++ .../dataconnect/connector/teamHub/queries.gql | 27 ++++++++ backend/dataconnect/schema/requiredDoc.gql | 21 ------ backend/dataconnect/schema/teamHub.gql | 2 + 9 files changed, 164 insertions(+), 121 deletions(-) rename backend/dataconnect/connector/{contact => emergencyContact}/mutations.gql (100%) rename backend/dataconnect/connector/{contact => emergencyContact}/queries.gql (100%) delete mode 100644 backend/dataconnect/connector/requiredDoc/mutations.gql delete mode 100644 backend/dataconnect/connector/requiredDoc/queries.gql delete mode 100644 backend/dataconnect/schema/requiredDoc.gql diff --git a/backend/dataconnect/connector/contact/mutations.gql b/backend/dataconnect/connector/emergencyContact/mutations.gql similarity index 100% rename from backend/dataconnect/connector/contact/mutations.gql rename to backend/dataconnect/connector/emergencyContact/mutations.gql diff --git a/backend/dataconnect/connector/contact/queries.gql b/backend/dataconnect/connector/emergencyContact/queries.gql similarity index 100% rename from backend/dataconnect/connector/contact/queries.gql rename to backend/dataconnect/connector/emergencyContact/queries.gql diff --git a/backend/dataconnect/connector/recentPayment/queries.gql b/backend/dataconnect/connector/recentPayment/queries.gql index 50bb8ca8..2e4487f5 100644 --- a/backend/dataconnect/connector/recentPayment/queries.gql +++ b/backend/dataconnect/connector/recentPayment/queries.gql @@ -348,3 +348,70 @@ query listRecentPaymentsByInvoiceIds( } } } + +# ------------------------------------------------------------ +# LIST BY BUSINESS ID (direct) +# ------------------------------------------------------------ +query listRecentPaymentsByBusinessId( + $businessId: UUID! + $offset: Int + $limit: Int +) @auth(level: USER) { + recentPayments( + where: { + invoice: { + businessId: { eq: $businessId } + } + } + offset: $offset + limit: $limit + orderBy: { createdAt: DESC } + ) { + id + workedTime + status + staffId + applicationId + invoiceId + createdAt + updatedAt + createdBy + + application { + id + staffId + checkInTime + checkOutTime + shiftRole { + startTime + endTime + hours + totalValue + + role { id name costPerHour } + + shift { + id + title + date + location + locationAddress + description + } + } + } + + invoice { + id + invoiceNumber + status + issueDate + dueDate + amount + + business { id businessName } + vendor { id companyName } + order { id eventName location } + } + } +} diff --git a/backend/dataconnect/connector/requiredDoc/mutations.gql b/backend/dataconnect/connector/requiredDoc/mutations.gql deleted file mode 100644 index 188aa838..00000000 --- a/backend/dataconnect/connector/requiredDoc/mutations.gql +++ /dev/null @@ -1,39 +0,0 @@ -mutation createRequiredDoc( - $name: String! - $description: String - $status: ReqDocumentStatus - $staffId: UUID! - $fileUrl: String -) @auth(level: USER) { - requiredDoc_insert( - data: { - name: $name - description: $description - status: $status - staffId: $staffId - fileUrl: $fileUrl - } - ) -} - -mutation updateRequiredDoc( - $id: UUID! - $name: String - $description: String - $status: ReqDocumentStatus - $fileUrl: String -) @auth(level: USER) { - requiredDoc_update( - id: $id - data: { - name: $name - description: $description - status: $status - fileUrl: $fileUrl - } - ) -} - -mutation deleteRequiredDoc($id: UUID!) @auth(level: USER) { - requiredDoc_delete(id: $id) -} diff --git a/backend/dataconnect/connector/requiredDoc/queries.gql b/backend/dataconnect/connector/requiredDoc/queries.gql deleted file mode 100644 index 7c0fe73b..00000000 --- a/backend/dataconnect/connector/requiredDoc/queries.gql +++ /dev/null @@ -1,61 +0,0 @@ -query listRequiredDocs @auth(level: USER) { - requiredDocs { - id - name - description - status - staffId - fileUrl - createdAt - updatedAt - createdBy - } -} - -query getRequiredDocById($id: UUID!) @auth(level: USER) { - requiredDoc(id: $id) { - id - name - description - status - staffId - fileUrl - createdAt - updatedAt - createdBy - } -} - -query getRequiredDocsByStaffId($staffId: UUID!) @auth(level: USER) { - requiredDocs(where: { staffId: { eq: $staffId } }) { - id - name - description - status - staffId - fileUrl - createdAt - updatedAt - createdBy - } -} - -query filterRequiredDocs( - $staffId: UUID - $status: ReqDocumentStatus - $name: String -) @auth(level: USER) { - requiredDocs( - where: { - staffId: { eq: $staffId } - status: { eq: $status } - name: { eq: $name } - } - ) { - id - name - status - staffId - fileUrl - } -} diff --git a/backend/dataconnect/connector/shiftRole/queries.gql b/backend/dataconnect/connector/shiftRole/queries.gql index 3084315d..9dabe0cb 100644 --- a/backend/dataconnect/connector/shiftRole/queries.gql +++ b/backend/dataconnect/connector/shiftRole/queries.gql @@ -225,3 +225,71 @@ query listShiftRolesByShiftIdAndTimeRange( } } + +# ------------------------------------------------------------ +# LIST SHIFT ROLES BY VENDOR (via Shift -> Order) +# ------------------------------------------------------------ +query listShiftRolesByVendorId( + $vendorId: UUID! + $offset: Int + $limit: Int +) @auth(level: USER) { + shiftRoles( + where: { + shift: { + order: { + vendorId: { eq: $vendorId } + } + } + } + offset: $offset + limit: $limit + orderBy: { createdAt: DESC } + ) { + id + shiftId + roleId + count + assigned + startTime + endTime + hours + department + uniform + breakType + totalValue + createdAt + + role { + id + name + costPerHour + } + + shift { + id + title + date + location + locationAddress + description + orderId + + order { + id + eventName + vendorId + businessId + orderType + status + date + recurringDays + permanentDays + notes + + business { id businessName } + vendor { id companyName } + } + } + } +} diff --git a/backend/dataconnect/connector/teamHub/queries.gql b/backend/dataconnect/connector/teamHub/queries.gql index 0c01c63a..240a17b1 100644 --- a/backend/dataconnect/connector/teamHub/queries.gql +++ b/backend/dataconnect/connector/teamHub/queries.gql @@ -51,3 +51,30 @@ query getTeamHubsByTeamId($teamId: UUID!) @auth(level: USER) { createdBy } } + +# ------------------------------------------------------------ +# LIST TEAM HUBS BY OWNER (Vendor/Business) +# ------------------------------------------------------------ +query listTeamHubsByOwnerId( + $ownerId: String! +) @auth(level: USER) { + teamHubs( + where: { + team: { + ownerId: { eq: $ownerId } + } + } + ) { + id + teamId + hubName + address + city + state + zipCode + managerName + isActive + departments + createdAt + } +} \ No newline at end of file diff --git a/backend/dataconnect/schema/requiredDoc.gql b/backend/dataconnect/schema/requiredDoc.gql deleted file mode 100644 index 0d9b4933..00000000 --- a/backend/dataconnect/schema/requiredDoc.gql +++ /dev/null @@ -1,21 +0,0 @@ -enum ReqDocumentStatus { - VERIFIED - PENDING - MISSING - REJECTED -} - -type RequiredDoc @table(name: "required_docs") { - id: UUID! @default(expr: "uuidV4()") - - name: String! - description: String - status: ReqDocumentStatus! - - staffId: UUID! - fileUrl: String - - createdAt: Timestamp @default(expr: "request.time") - updatedAt: Timestamp @default(expr: "request.time") - createdBy: String -} diff --git a/backend/dataconnect/schema/teamHub.gql b/backend/dataconnect/schema/teamHub.gql index 13540e5f..fada65a5 100644 --- a/backend/dataconnect/schema/teamHub.gql +++ b/backend/dataconnect/schema/teamHub.gql @@ -2,6 +2,8 @@ type TeamHub @table(name: "team_hubs") { id: UUID! @default(expr: "uuidV4()") teamId: UUID! + team: Team! @ref(fields: "teamId", references: "id") + hubName: String! address: String! city: String!