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
}

