mutation CreateEvent(
  $eventName: String!,
  $isRapid: Boolean,
  $isRecurring: Boolean,
  $isMultiDay: Boolean,
  $recurrenceType: RecurrenceType,
  $recurrenceStartDate: Timestamp,
  $recurrenceEndDate: Timestamp,
  $scatterDates: Any,
  $multiDayStartDate: Timestamp,
  $multiDayEndDate: Timestamp,
  $bufferTimeBefore: Float,
  $bufferTimeAfter: Float,
  $conflictDetectionEnabled: Boolean,
  $detectedConflicts: Any,
  $businessId: UUID!,
  $businessName: String,
  $vendorId: String,
  $vendorName: String,
  $hub: String,
  $eventLocation: String,
  $contractType: ContractType,
  $poReference: String,
  $status: EventStatus!,
  $date: String!,
  $shifts: Any,
  $addons: Any,
  $total: Float,
  $clientName: String,
  $clientEmail: String,
  $clientPhone: String,
  $invoiceId: UUID,
  $notes: String,
  $requested: Int,
  $assignedStaff: Any,
  $department: String,
  $createdBy: String,
  $orderType: String,
  $recurringStartDate: String,
  $recurringEndDate: String,
  $recurringDays: Any, 
  $permanentStartDate: String,
  $permanentDays: Any,
  $includeBackup: Boolean,
  $backupStaffCount: Int,
  $recurringTime: String,
  $permanentTime: String
) @auth(level: USER) {
  event_insert(
    data: {
      eventName: $eventName
      isRapid: $isRapid
      isRecurring: $isRecurring
      isMultiDay: $isMultiDay
      recurrenceType: $recurrenceType
      recurrenceStartDate: $recurrenceStartDate
      recurrenceEndDate: $recurrenceEndDate
      scatterDates: $scatterDates
      multiDayStartDate: $multiDayStartDate
      multiDayEndDate: $multiDayEndDate
      bufferTimeBefore: $bufferTimeBefore
      bufferTimeAfter: $bufferTimeAfter
      conflictDetectionEnabled: $conflictDetectionEnabled
      detectedConflicts: $detectedConflicts
      businessId: $businessId
      businessName: $businessName
      vendorId: $vendorId
      vendorName: $vendorName
      hub: $hub
      eventLocation: $eventLocation
      contractType: $contractType
      poReference: $poReference
      status: $status
      date: $date
      shifts: $shifts
      addons: $addons
      total: $total
      clientName: $clientName
      clientEmail: $clientEmail
      clientPhone: $clientPhone
      invoiceId: $invoiceId
      notes: $notes
      orderType: $orderType 
      requested: $requested
      assignedStaff: $assignedStaff
      department: $department
      createdBy: $createdBy
      recurringStartDate: $recurringStartDate
      recurringEndDate: $recurringEndDate
      recurringDays: $recurringDays
      permanentStartDate: $permanentStartDate
      permanentDays: $permanentDays
      includeBackup: $includeBackup
      backupStaffCount: $backupStaffCount
      recurringTime: $recurringTime
      permanentTime: $permanentTime
    }
  )
}


mutation UpdateEvent(
  $id: UUID!,
  $eventName: String,
  $isRapid: Boolean,
  $isRecurring: Boolean,
  $isMultiDay: Boolean,
  $recurrenceType: RecurrenceType,
  $recurrenceStartDate: Timestamp,
  $recurrenceEndDate: Timestamp,
  $scatterDates: Any,
  $multiDayStartDate: Timestamp,
  $multiDayEndDate: Timestamp,
  $bufferTimeBefore: Float,
  $bufferTimeAfter: Float,
  $conflictDetectionEnabled: Boolean,
  $detectedConflicts: Any,
  $businessId: UUID,
  $businessName: String,
  $vendorId: String,
  $vendorName: String,
  $hub: String,
  $eventLocation: String,
  $contractType: ContractType,
  $poReference: String,
  $status: EventStatus,
  $date: String,
  $shifts: Any,
  $addons: Any,
  $total: Float,
  $clientName: String,
  $clientEmail: String,
  $clientPhone: String,
  $invoiceId: UUID,
  $notes: String,
  $requested: Int,
  $orderType: String, 
  $department: String,
  $assignedStaff: Any,
  $createdBy: String,
  $recurringStartDate: String,
  $recurringEndDate: String,
  $recurringDays: Any,
  $permanentStartDate: String,
  $permanentDays: Any,
  $includeBackup: Boolean,
  $backupStaffCount: Int,
  $recurringTime: String,
  $permanentTime: String
) @auth(level: USER) {
  event_update(
    id: $id,
    data: {
      eventName: $eventName
      isRapid: $isRapid
      isRecurring: $isRecurring
      isMultiDay: $isMultiDay
      recurrenceType: $recurrenceType
      recurrenceStartDate: $recurrenceStartDate
      recurrenceEndDate: $recurrenceEndDate
      scatterDates: $scatterDates
      multiDayStartDate: $multiDayStartDate
      multiDayEndDate: $multiDayEndDate
      bufferTimeBefore: $bufferTimeBefore
      bufferTimeAfter: $bufferTimeAfter
      conflictDetectionEnabled: $conflictDetectionEnabled
      detectedConflicts: $detectedConflicts
      businessId: $businessId
      businessName: $businessName
      vendorId: $vendorId
      vendorName: $vendorName
      hub: $hub
      eventLocation: $eventLocation
      contractType: $contractType
      poReference: $poReference
      status: $status
      date: $date
      shifts: $shifts
      addons: $addons
      total: $total
      clientName: $clientName
      clientEmail: $clientEmail
      clientPhone: $clientPhone
      invoiceId: $invoiceId
      notes: $notes
      orderType: $orderType 
      requested: $requested
      assignedStaff: $assignedStaff
      department: $department
      createdBy: $createdBy
      recurringStartDate: $recurringStartDate
      recurringEndDate: $recurringEndDate
      recurringDays: $recurringDays
      permanentStartDate: $permanentStartDate
      permanentDays: $permanentDays
      includeBackup: $includeBackup
      backupStaffCount: $backupStaffCount
      recurringTime: $recurringTime
      permanentTime: $permanentTime
    }
  )
}

mutation DeleteEvent(
  $id: UUID!
) @auth(level: USER) {
  event_delete(id: $id)
}
