import type { GlobalConfig } from "payload";

export const Resume: GlobalConfig = {
  slug: "resume",
  access: { read: () => true },
  fields: [
    { name: "summary", type: "textarea" },
    {
      name: "experience",
      type: "array",
      fields: [
        { name: "company", type: "text", required: true },
        { name: "role", type: "text", required: true },
        { name: "startDate", type: "date" },
        { name: "endDate", type: "date" },
        { name: "current", type: "checkbox", defaultValue: false },
        {
          name: "bullets",
          type: "array",
          fields: [{ name: "text", type: "textarea" }],
        },
      ],
    },
    {
      name: "skills",
      type: "array",
      fields: [
        { name: "category", type: "text", required: true },
        {
          name: "items",
          type: "array",
          fields: [{ name: "name", type: "text" }],
        },
      ],
    },
    {
      name: "education",
      type: "array",
      fields: [
        { name: "institution", type: "text", required: true },
        { name: "credential", type: "text" },
        { name: "year", type: "text" },
      ],
    },
  ],
};
