import { z } from 'zod';

export const ExperienceSchema = z.object({
  id: z.string(),
  company: z.string(),
  logo: z.string().optional(),
  role: z.string(),
  period: z.string(),
  duration: z.string(),
  description: z.string(),
  missions: z.array(z.string()).default([]),
  stack: z.array(z.string()).default([]),
  type: z.enum(['cdi', 'cdd', 'stage', 'alternance', 'freelance']).default('cdi'),
  current: z.boolean().default(false),
});

export const ExperiencesSchema = z.object({
  items: z.array(ExperienceSchema),
  skills: z
    .object({
      technical: z.array(z.string()).default([]),
      soft: z.array(z.string()).default([]),
    })
    .default({ technical: [], soft: [] }),
});

export type Experience = z.infer<typeof ExperienceSchema>;
export type Experiences = z.infer<typeof ExperiencesSchema>;
