From 29d5c7871545bbb99a251f0f11bcb5827423986a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Salazar?= <73718835+joshrs23@users.noreply.github.com> Date: Wed, 26 Nov 2025 09:29:33 -0500 Subject: [PATCH] new team entity --- dataconnect/connector/team/mutations.gql | 47 ++++++++++++++++++++++++ dataconnect/connector/team/queries.gql | 47 ++++++++++++++++++++++++ dataconnect/schema/team.gql | 22 +++++++++++ 3 files changed, 116 insertions(+) create mode 100644 dataconnect/connector/team/mutations.gql create mode 100644 dataconnect/connector/team/queries.gql create mode 100644 dataconnect/schema/team.gql diff --git a/dataconnect/connector/team/mutations.gql b/dataconnect/connector/team/mutations.gql new file mode 100644 index 00000000..239b90d1 --- /dev/null +++ b/dataconnect/connector/team/mutations.gql @@ -0,0 +1,47 @@ +mutation CreateTeam( + $teamName: String!, + $ownerId: UUID!, + $ownerName: String!, + $ownerRole: TeamOwnerRole!, + $favoriteStaff: String, + $blockedStaff: String +) @auth(level: USER) { + team_insert( + data: { + teamName: $teamName + ownerId: $ownerId + ownerName: $ownerName + ownerRole: $ownerRole + favoriteStaff: $favoriteStaff + blockedStaff: $blockedStaff + } + ) +} + +mutation UpdateTeam( + $id: UUID!, + $teamName: String, + $ownerId: UUID, + $ownerName: String, + $ownerRole: TeamOwnerRole, + $favoriteStaff: String, + $blockedStaff: String +) @auth(level: USER) { + team_update( + id: $id, + data: { + teamName: $teamName + ownerId: $ownerId + ownerName: $ownerName + ownerRole: $ownerRole + favoriteStaff: $favoriteStaff + blockedStaff: $blockedStaff + } + ) +} + +mutation DeleteTeam( + $id: UUID! +) @auth(level: USER) { + team_delete(id: $id) +} diff --git a/dataconnect/connector/team/queries.gql b/dataconnect/connector/team/queries.gql new file mode 100644 index 00000000..430b98c5 --- /dev/null +++ b/dataconnect/connector/team/queries.gql @@ -0,0 +1,47 @@ +query listTeam @auth(level: USER) { + teams { + id + teamName + ownerId + ownerName + ownerRole + favoriteStaff + blockedStaff + } +} + +query getTeamById( + $id: UUID! +) @auth(level: USER) { + team(id: $id) { + id + teamName + ownerId + ownerName + ownerRole + favoriteStaff + blockedStaff + } +} + +query filterTeam( + $teamName: String, + $ownerId: UUID, + $ownerRole: TeamOwnerRole +) @auth(level: USER) { + teams( + where: { + teamName: { eq: $teamName } + ownerId: { eq: $ownerId } + ownerRole: { eq: $ownerRole } + } + ) { + id + teamName + ownerId + ownerName + ownerRole + favoriteStaff + blockedStaff + } +} diff --git a/dataconnect/schema/team.gql b/dataconnect/schema/team.gql new file mode 100644 index 00000000..92b214ec --- /dev/null +++ b/dataconnect/schema/team.gql @@ -0,0 +1,22 @@ +enum TeamOwnerRole { + ADMIN + PROCUREMENT + OPERATOR + SECTOR + CLIENT + VENDOR + WORKFORCE +} + +type Team @table(name: "team") { + id: UUID! @default(expr: "uuidV4()") + teamName: String! + ownerId: UUID! + ownerName: String! + ownerRole: TeamOwnerRole! + favoriteStaff: String + blockedStaff: String + createdDate: Timestamp @default(expr: "request.time") + updatedDate: Timestamp @default(expr: "request.time") + createdBy: String @default(expr: "auth.uid") +}