// Acuity Scheduling API Types

export interface AcuityCredentials {
  userId: string;
  apiKey: string;
  oauth2Token?: string;
}

export interface Appointment {
  id: number;
  firstName: string;
  lastName: string;
  phone?: string;
  email: string;
  date: string;
  time: string;
  endTime: string;
  dateCreated: string;
  datetimeCreated: string;
  datetime: string;
  price?: string;
  priceSold?: string;
  paid?: string;
  amountPaid?: string;
  type: string;
  appointmentTypeID: number;
  classID?: number;
  addonIDs?: number[];
  category?: string;
  duration: string;
  calendar: string;
  calendarID: number;
  certificate?: string;
  confirmationPage?: string;
  formsText?: string;
  forms?: AppointmentForm[];
  notes?: string;
  timezone?: string;
  calendarTimezone?: string;
  canceled?: boolean;
  canClientCancel?: boolean;
  canClientReschedule?: boolean;
  labels?: Label[];
  location?: string;
}

export interface AppointmentType {
  id: number;
  active: boolean;
  name: string;
  description?: string;
  duration: number;
  price?: string;
  category?: string;
  color?: string;
  private?: boolean;
  type?: string;
  calendarIDs?: number[];
  classSize?: number;
  paddingBefore?: number;
  paddingAfter?: number;
}

export interface AvailabilityDate {
  date: string;
  times?: AvailabilityTime[];
}

export interface AvailabilityTime {
  time: string;
  slotsAvailable?: number;
}

export interface Client {
  id: number;
  firstName: string;
  lastName: string;
  phone?: string;
  email: string;
  notes?: string;
}

export interface Calendar {
  id: number;
  name: string;
  email?: string;
  location?: string;
  thumbnail?: string;
  timezone?: string;
  description?: string;
}

export interface Product {
  id: number;
  name: string;
  description?: string;
  price?: string;
  category?: string;
}

export interface Form {
  id: number;
  name: string;
  description?: string;
  fields?: FormField[];
}

export interface FormField {
  id: number;
  name: string;
  type: string;
  required?: boolean;
  options?: string[];
}

export interface AppointmentForm {
  id: number;
  name: string;
  values?: FormValue[];
}

export interface FormValue {
  id: number;
  fieldID: number;
  value: string;
  name?: string;
}

export interface Label {
  id: number;
  name: string;
  color?: string;
}

export interface Webhook {
  id: number;
  event: string;
  url: string;
}

export interface Coupon {
  id: number;
  code: string;
  name?: string;
  discount?: string;
  amountOff?: number;
  percentageOff?: number;
  validFrom?: string;
  validTo?: string;
  maxUses?: number;
  timesUsed?: number;
}

export interface Block {
  id: number;
  calendarID: number;
  start: string;
  end: string;
  notes?: string;
}

export interface PaginatedResponse<T> {
  data: T[];
  count?: number;
  hasMore?: boolean;
}

export interface ErrorResponse {
  status_code: number;
  error: string;
  message: string;
}
