import { z, defineCollection } from 'astro:content'

const taInfo = defineCollection({
  type: 'data',
  schema: z.object({
    info: z.object({
      title: z.string(),
      questReleaseDate: z.string().transform((str) => new Date(str)),
      shortdescription: z.string(),
      description: z.string(),
      fightNumber: z.number().default(1),
    }),
    data: z.array(
      z.object({
        title: z.string(),
        link: z.string().url(),
        date: z.string().transform((str) => new Date(str)),
        servant: z.string(),
        turns: z.string(),
        runner: z.string(),
      })
    ),
  }),
})

export const collections = {
  taInfoData: taInfo,
}
