From 85cfad0f2c4b18cd856fde69f9598c1c7ce012f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Salazar?= <73718835+joshrs23@users.noreply.github.com> Date: Fri, 21 Nov 2025 13:28:04 -0500 Subject: [PATCH] adding staff schema --- dataconnect/connector/staff/mutations.gql | 25 ++++++++++++++++++ dataconnect/connector/staff/queries.gql | 14 ++++++++++ dataconnect/schema/staff.gql | 31 +++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 dataconnect/connector/staff/mutations.gql create mode 100644 dataconnect/connector/staff/queries.gql create mode 100644 dataconnect/schema/staff.gql diff --git a/dataconnect/connector/staff/mutations.gql b/dataconnect/connector/staff/mutations.gql new file mode 100644 index 00000000..c75b085a --- /dev/null +++ b/dataconnect/connector/staff/mutations.gql @@ -0,0 +1,25 @@ +mutation CreateStaff( + $employeeName: String!, + $vendorId: UUID, + $email: String, + $position: String, + $employmentType: EmploymentType!, + $rating: Float, + $reliabilityScore: Int, + $backgroundCheckStatus: BackgroundCheckStatus!, + $certifications: JSON +) @auth(level: USER) { + staff_insert( + data: { + employeeName: $employeeName + vendorId: $vendorId + email: $email + position: $position + employmentType: $employmentType + rating: $rating + reliabilityScore: $reliabilityScore + backgroundCheckStatus: $backgroundCheckStatus + certifications: $certifications + } + ) +} diff --git a/dataconnect/connector/staff/queries.gql b/dataconnect/connector/staff/queries.gql new file mode 100644 index 00000000..c12698d0 --- /dev/null +++ b/dataconnect/connector/staff/queries.gql @@ -0,0 +1,14 @@ +query listStaff @auth(level: USER) { + staff { + id + employeeName + vendorId + email + position + employmentType + rating + reliabilityScore + backgroundCheckStatus + certifications + } +} diff --git a/dataconnect/schema/staff.gql b/dataconnect/schema/staff.gql new file mode 100644 index 00000000..d2c640bc --- /dev/null +++ b/dataconnect/schema/staff.gql @@ -0,0 +1,31 @@ +# firebase/dataconnect/schema/staff.gql + +enum EmploymentType { + FULL_TIME + PART_TIME + ON_CALL + CONTRACT +} + +enum BackgroundCheckStatus { + PENDING + CLEARED + FAILED + EXPIRED +} + +type Staff @table(name: "staff") { + id: UUID! @default(expr: "uuidV4()") + employeeName: String! + vendorId: UUID + email: String + position: String + employmentType: EmploymentType! + rating: Float + reliabilityScore: Int + backgroundCheckStatus: BackgroundCheckStatus! + certifications: JSON + createdDate: Timestamp @default(expr: "request.time") + updatedDate: Timestamp @default(expr: "request.time") + createdBy: String @default(expr: "auth.uid") +}