From d510c5bc8506c298359a99669917b45c2c992796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Salazar?= <73718835+joshrs23@users.noreply.github.com> Date: Fri, 14 Nov 2025 18:34:53 -0500 Subject: [PATCH] adding mutation to event and deleting extra info --- firebase/dataconnect/schema/event.gpl | 52 +++++++++++++++++++-------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/firebase/dataconnect/schema/event.gpl b/firebase/dataconnect/schema/event.gpl index 718d852e..fed066c4 100644 --- a/firebase/dataconnect/schema/event.gpl +++ b/firebase/dataconnect/schema/event.gpl @@ -20,21 +20,43 @@ enum RecurrenceType { type Event @table(name: "events") { - id: UUID! @col(name: "id", primaryKey: true) @default(expr: "uuid_generate_v4()") - eventName: String! @col(name: "event_name") - isRecurring: Boolean! @col(name: "is_recurring") - recurrenceType: RecurrenceType @col(name: "recurrence_type") - businessId: UUID! @col(name: "business_id") - vendorId: UUID @col(name: "vendor_id") - status: EventStatus! @col(name: "status") - date: Timestamp @col(name: "date") - shifts: JSON @col(name: "shifts", dataType: "jsonb") - total: Float @col(name: "total") - requested: Int @col(name: "requested") - assignedStaff: JSON @col(name: "assigned_staff", dataType: "jsonb") - createdDate: Timestamp @col(name: "created_date") @default(expr: "now()") - updatedDate: Timestamp @col(name: "updated_date") @default(expr: "now()") - createdBy: String @col(name: "created_by") + 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 +} +