adding staff schema

This commit is contained in:
José Salazar
2025-11-21 13:28:04 -05:00
parent 4562fa62db
commit 85cfad0f2c
3 changed files with 70 additions and 0 deletions

View File

@@ -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
}
)
}

View File

@@ -0,0 +1,14 @@
query listStaff @auth(level: USER) {
staff {
id
employeeName
vendorId
email
position
employmentType
rating
reliabilityScore
backgroundCheckStatus
certifications
}
}

View File

@@ -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")
}