Files
Krow-workspace/firebase/dataconnect/schema/event.gpl
2025-11-14 18:34:53 -05:00

63 lines
1.0 KiB
Plaintext

scalar UUID
scalar Timestamp
scalar JSON
enum EventStatus {
DRAFT
ACTIVE
PENDING
ASSIGNED
CONFIRMED
COMPLETED
CANCELED
}
enum RecurrenceType {
SINGLE
DATE_RANGE
SCATTER
}
type Event @table(name: "events") {
id: UUID! @col(name: "id", primaryKey: true) @default(expr: "uuidV4()")
eventName: String!
isRecurring: Boolean!
recurrenceType: RecurrenceType
businessId: UUID!
vendorId: UUID
status: EventStatus!
date: Timestamp!
shifts: JSON @col(dataType: "jsonb")
total: Float
requested: Int
assignedStaff: JSON @col(dataType: "jsonb")
createdDate: Timestamp @default(expr: "now()")
updatedDate: Timestamp @updateAt
createdBy: String
}
input CreateEventInput {
eventName: String!
isRecurring: Boolean!
recurrenceType: RecurrenceType
businessId: UUID!
vendorId: UUID
status: EventStatus!
date: Timestamp!
shifts: JSON
total: Float
requested: Int
assignedStaff: JSON
}
type Mutation {
createEvent(input: CreateEventInput!): Event @auth
}
type Query {
listEvents: [Event!] @auth
}