import z from 'zod';

export const LocationSchema = z.object({
  syncId: z.number(),
  name: z.string(),
  address: z.string().nullable(),
});
export type Location = z.infer<typeof LocationSchema>;

export const ServiceSchema = z.object({
  name: z.string(),
  id: z.number(),
});
export type Service = z.infer<typeof ServiceSchema>;

export const ServiceProviderSchema = z.object({
  id: z.number(),
  name: z.string(),
  jobTitleEt: z.string().nullable(),
  jobTitleEn: z.string().nullable(),
  jobTitleRu: z.string().nullable(),
  spokenLanguages: z.array(z.string()).nullable(),
});
export type ServiceProvider = z.infer<typeof ServiceProviderSchema>;

export const ReservationSchema = z.object({
  startTime: z.string(),
  service: ServiceSchema.optional(),
  location: LocationSchema.optional(),
  serviceProvider: ServiceProviderSchema.optional(),
  medusaCartLineItemId: z.string(),
  id: z.number(),
  countryCode: z.string().optional(),
});
export type Reservation = z.infer<typeof ReservationSchema>;
