# Decap CMS config for the Next.js spike. Same collections as the Astro
# spike's public/admin/config.yml, pointed at the same shared data — the
# whole point of testing this a second time is confirming the CMS config
# shape carries over to a different SSG almost unchanged, per
# SPECIFICATION.md's "Progress so far" note. See spikes/astro/public/admin/config.yml
# for the field-by-field rationale; not re-explained here.
#
# Local testing (same as the Astro spike):
#   1. From the repo root (hdc_v2/):        npx decap-server
#   2. From spikes/nextjs/:                 npm run dev
#   3. Visit:                               http://localhost:3000/admin/
backend:
  name: github
  repo: HDRUK/hdc_v2 # placeholder — replace once a real repo/org is confirmed
  branch: main

local_backend: true

media_folder: "spikes/nextjs/public/images/uploads"
public_folder: "/images/uploads"

collections:
  # A second "drop a file, get a page" folder collection, alongside `pages`
  # below — pointed at the shared /markdown folder (not this project's own
  # content-pages/) and rendered through a completely independent root
  # layout (src/app/(articles)/layout.tsx, not (site)/layout.tsx) — tests
  # SPECIFICATION.md's "Demonstrate alternative layouts and images" section.
  - name: articles
    label: Articles
    label_singular: Article
    folder: "markdown"
    create: true
    format: "md"
    slug: "{{slug}}"
    media_folder: "/images"
    public_folder: "/images"
    fields:
      - { label: "Body", name: "body", widget: "markdown" }
  - name: settings
    label: Site Settings
    files:
      - name: banner
        label: Banner
        file: "data/site-settings.yaml"
        fields:
          - { label: "Enabled", name: "bannerEnabled", widget: "boolean" }
          - { label: "Text", name: "bannerText", widget: "string", required: false }
          - { label: "Link", name: "bannerLink", widget: "string", required: false }
  - name: pages
    label: Site Pages
    label_singular: Page
    folder: "spikes/nextjs/content-pages"
    create: true
    format: "md"
    slug: "{{slug}}"
    fields:
      - { label: "Body", name: "body", widget: "markdown" }
  - name: entries
    label: HDC Entries
    label_singular: HDC Entry
    folder: "data/entries"
    create: true
    slug: "{{fields.id}}"
    extension: yaml
    format: yaml
    identifier_field: name
    summary: "{{name}} — {{readinessTier}}"
    fields:
      - { label: "ID (slug, must match filename)", name: "id", widget: "string" }
      - { label: "Name", name: "name", widget: "string" }
      - { label: "Description", name: "description", widget: "text" }
      - label: "Categories"
        name: "categories"
        widget: "select"
        multiple: true
        options:
          [
            "Service",
            "Product",
            "Template",
            "Training Product",
            "Framework",
            "Pathway",
            "Standard",
            "Template Standard Pathway Guidance",
          ]
      - label: "Readiness tier"
        name: "readinessTier"
        widget: "select"
        options: ["Exploratory", "Emerging", "Established"]
      - { label: "Primary purpose", name: "primaryPurpose", widget: "list", required: false }
      - { label: "Intended users", name: "intendedUsers", widget: "list", required: false }
      - label: "Primary contact route"
        name: "primaryContactRoute"
        widget: "select"
        options: ["URL", "Email"]
        required: false
      - { label: "Primary contact detail", name: "primaryContactDetail", widget: "string", required: false }
      - { label: "Contact team/person", name: "contactTeamPerson", widget: "string", required: false }
      - { label: "Adoption pack link", name: "adoptionPackLink", widget: "string", required: false }
      - { label: "Originator orgs", name: "originatorOrgs", widget: "list", required: false }
      - { label: "Links", name: "links", widget: "list", required: false }
      - { label: "DOI link", name: "doiLink", widget: "string", required: false }
      - { label: "Context of use", name: "contextOfUse", widget: "text", required: false }
      - label: "Maturity - TFS"
        name: "maturityTfs"
        widget: "select"
        options: ["Prototype", "Pilot", "Growth", "Productisation"]
        required: false
      - { label: "Primary use case", name: "primaryUseCase", widget: "list", required: false }
      - { label: "Intended outcomes", name: "intendedOutcomes", widget: "text", required: false }
      - { label: "What it is not", name: "whatItIsNot", widget: "text", required: false }
      - { label: "Number adopting", name: "numberAdopting", widget: "number", required: false }
      - { label: "Adoption evidence", name: "adoptionEvidence", widget: "text", required: false }
      - { label: "Registered users (2025)", name: "registeredUsers2025", widget: "string", required: false }
      - { label: "Preconditions", name: "preconditions", widget: "text", required: false }
      - { label: "Constraints", name: "constraints", widget: "text", required: false }
      - { label: "Dependencies", name: "dependencies", widget: "list", required: false }
      - label: "Cost model"
        name: "costModel"
        widget: "select"
        options: ["Free", "Cost recovery"]
        required: false
      - { label: "Cost model details", name: "costModelDetails", widget: "string", required: false }
      - label: "License"
        name: "license"
        widget: "select"
        options: ["Open Source", "Not Applicable", "CC-BY", "Custom Terms"]
        required: false
      - label: "Support level"
        name: "supportLevel"
        widget: "select"
        options: ["Supported service", "Light-touch"]
        required: false
      - { label: "Engagement pathway", name: "engagementPathway", widget: "list", required: false }
      - { label: "Response expectations", name: "responseExpectations", widget: "text", required: false }
      - { label: "Ownership boundary", name: "ownershipBoundary", widget: "text", required: false }
      - { label: "Related or alternative capability", name: "relatedOrAlternativeCapability", widget: "text", required: false }
