# seeds/cms/seed.yaml
#
# Headless CMS POC — Seed Manifest
#
# Standard seeder contract:
#   - admin user: password Admin123!, role admin, verified
#   - role-specific demo users: password Demo123!, verified
#   - predictable data with stable slugs for deterministic tests
#   - idempotent: safe to run on every server start
#
# Execution order (four phases):
#   Phase 1 — Roles
#   Phase 2 — Users
#   Phase 3 — Assignments
#   Phase 4 — Domain data (media, categories, articles, site settings)
#
# Note on media uploads:
#   The seeder uses inline base64 or file:// references for media items.
#   If the seeder does not support inline media, these items will need
#   to be uploaded via POST /media/upload after boot.

# ─── Phase 1: Roles ─────────────────────────────────────────────

roles:
  - name: admin
    description: "Full system access. Manages site settings, can delete articles."

  - name: editor
    description: "Can publish and schedule articles. Manages all content."

  - name: author
    description: "Can create and edit own articles. Cannot publish or manage settings."

  - name: reader
    description: "Read-only access. Demonstrates public/authenticated boundaries."

# ─── Phase 2: Users ─────────────────────────────────────────────

users:
  - username: admin
    email: admin@cms.example.com
    password: "Admin123!"
    verified: true

  - username: alice
    email: alice@cms.example.com
    password: "Demo123!"
    verified: true

  - username: bob
    email: bob@cms.example.com
    password: "Demo123!"
    verified: true

  - username: carol
    email: carol@cms.example.com
    password: "Demo123!"
    verified: true

# ─── Phase 3: Assignments ───────────────────────────────────────

assignments:
  - username: admin
    roles: [admin]

  - username: alice
    roles: [editor]

  - username: bob
    roles: [author]

  - username: carol
    roles: [reader]

# ─── Phase 4: Domain data ───────────────────────────────────────

data:

  # ── Categories ─────────────────────────────────────────────────

  - action: adl.cms.category.create
    data:
      name: "Engineering"
      description: "Technical articles about software engineering and architecture"
      icon: "lucide:cog"
      color: "#3b82f6"

  - action: adl.cms.category.create
    data:
      name: "Design"
      description: "UI/UX design, design systems, and visual content"
      icon: "lucide:palette"
      color: "#ec4899"

  - action: adl.cms.category.create
    data:
      name: "Product"
      description: "Product updates, roadmaps, and announcements"
      icon: "lucide:package"
      color: "#f59e0b"

  - action: adl.cms.category.create
    data:
      name: "Culture"
      description: "Team culture, hiring, and company life"
      icon: "lucide:lightbulb"
      color: "#10b981"

  # ── SiteSettings (singleton) ───────────────────────────────────
  #
  # The seeder creates the single SiteSettings record. Subsequent
  # runs skip it if it already exists.

  - action: adl.cms.site_settings.create
    as: admin
    data:
      siteName: "Kalos Dev Blog"
      tagline: "Building the future of declarative APIs"
      baseUrl: "https://blog.kalos.dev"
      logo: "file://seeds/assets/logo.svg"
      typography:
        headingFont: "Inter"
        bodyFont: "Source Sans Pro"
        monoFont: "JetBrains Mono"
      brandColors:
        primary: "#1e293b"
        secondary: "#3b82f6"
        accent: "#f59e0b"
        background: "#ffffff"
        text: "#1e293b"
      defaultSeo:
        metaTitle: "Kalos Dev Blog"
        metaDescription: "Technical articles about building APIs with Kalos and ADL"
        noIndex: false
      analyticsId: "G-DEMO12345"
      maintenanceMode: false

  # ── Articles ───────────────────────────────────────────────────
  #
  # Articles use the blocks body type. Each block is a JSON object with
  # type, content, and optional props.

  - action: adl.cms.article.create
    as: alice
    data:
      title: "Welcome to Our Blog"
      excerpt: "An introduction to the Kalos Dev Blog and what you can expect."
      authorId: "alice"
      authorName: "Alice"
      status: "published"
      categoryId: "lookup:category:slug:product"
      featuredImage: "file://seeds/assets/placeholder-hero.svg"
      body:
        - type: paragraph
          content: "Welcome to the Kalos Dev Blog! This is where we share technical insights, product updates, and engineering best practices."
        - type: heading
          content: "What to Expect"
          props: { level: 2 }
        - type: paragraph
          content: "We will be publishing articles on a variety of topics including API design, ADL patterns, performance optimization, and team culture."
        - type: $ref:Callout
          content: "This blog is powered by Kalos + ADL. Every article you see here is served by a declarative API generated from a YAML domain definition."
          props:
            style: info
            title: "Fun Fact"
        - type: paragraph
          content: "Stay tuned for more content. We publish new articles every week."
      seo:
        metaTitle: "Welcome to Our Blog | Kalos Dev"
        metaDescription: "An introduction to the Kalos Dev Blog."
        noIndex: false

  - action: adl.cms.article.create
    as: alice
    data:
      title: "Building with ADL"
      excerpt: "A deep dive into the Architecture Definition Language that powers Kalos."
      authorId: "bob"
      authorName: "Bob"
      status: "published"
      categoryId: "lookup:category:slug:engineering"
      featuredImage: "file://seeds/assets/placeholder-hero.svg"
      gallery:
        - "file://seeds/assets/placeholder-hero.svg"
      body:
        - type: paragraph
          content: "ADL (Architecture Definition Language) is the declarative schema format at the heart of Kalos. A single YAML file defines your entire API."
        - type: heading
          content: "Core Concepts"
          props: { level: 2 }
        - type: paragraph
          content: "ADL organizes your API around resources, relationships, and features. Each resource generates a full set of CRUD endpoints with validation, permissions, and query capabilities."
        - type: code
          content: "domain:\n  name: blog\n  version: \"1.0.0\"\n  resources:\n    Post:\n      object:\n        title: { type: string, required: true }\n        body: { type: markdown }\n        status: { type: enum, values: [draft, published] }"
          props:
            language: yaml
        - type: heading
          content: "Advanced Features"
          props: { level: 2 }
        - type: list
          content: ""
          props:
            type: bullet
            items:
              - "State machines with transition guards"
              - "Computed fields (virtual, materialized, aggregation)"
              - "Media library with reference tracking"
              - "Block editor content types"
        - type: $ref:PromoCard
          props:
            heading: "Try Kalos Today"
            subtext: "Get started with our quick-start guide."
            ctaText: "Read the Docs"
            ctaUrl: "https://kalos.dev/docs"
            theme: dark
      seo:
        metaTitle: "Building with ADL | Kalos Dev"
        metaDescription: "A deep dive into the Architecture Definition Language."
        noIndex: false

  - action: adl.cms.article.create
    as: alice
    data:
      title: "Design System Notes"
      excerpt: "Documenting our evolving design system: tokens, components, and patterns."
      authorId: "alice"
      authorName: "Alice"
      status: "review"
      categoryId: "lookup:category:slug:design"
      featuredImage: "file://seeds/assets/placeholder-hero.svg"
      gallery:
        - "file://seeds/assets/placeholder-hero.svg"
      body:
        - type: paragraph
          content: "Our design system has been evolving rapidly. This article documents the current state of our design tokens, component library, and design patterns."
        - type: heading
          content: "Design Tokens"
          props: { level: 2 }
        - type: paragraph
          content: "We use a token-based approach for colors, spacing, typography, and shadows."
        - type: $ref:Callout
          content: "Design tokens are the foundation of our system. Change a token and the entire UI updates consistently."
          props:
            style: tip
            title: "Design Tip"
        - type: heading
          content: "Components"
          props: { level: 2 }
        - type: paragraph
          content: "Our component library is built on top of the token system. Every component references tokens rather than hardcoded values."
      seo:
        metaTitle: "Design System Notes | Kalos Dev"
        metaDescription: "Documenting our design system: tokens, components, and patterns."
        noIndex: false

  - action: adl.cms.article.create
    as: alice
    data:
      title: "Q1 Roadmap Preview"
      excerpt: "A sneak peek at what we are building in Q1 2026."
      authorId: "bob"
      authorName: "Bob"
      status: "draft"
      categoryId: "lookup:category:slug:product"
      body:
        - type: paragraph
          content: "Here is a preview of what the team is working on for Q1 2026."
        - type: heading
          content: "Major Initiatives"
          props: { level: 2 }
        - type: list
          content: ""
          props:
            type: numbered
            items:
              - "Media Library v2 with advanced image transforms"
              - "Block editor custom block marketplace"
              - "Real-time collaboration on article editing"
              - "Advanced analytics dashboard"
        - type: $ref:Callout
          content: "This roadmap is subject to change based on user feedback and priorities."
          props:
            style: warning
            title: "Disclaimer"

  - action: adl.cms.article.create
    as: alice
    data:
      title: "Team Offsite 2026"
      excerpt: "Highlights from our annual team offsite in Colorado."
      authorId: "alice"
      authorName: "Alice"
      status: "scheduled"
      scheduledFor: "2099-06-01T09:00:00Z"
      categoryId: "lookup:category:slug:culture"
      featuredImage: "file://seeds/assets/placeholder-hero.svg"
      gallery:
        - "file://seeds/assets/placeholder-hero.svg"
      body:
        - type: paragraph
          content: "Last week the team gathered in Colorado for our annual offsite. Three days of strategy, bonding, and hiking."
        - type: heading
          content: "Day 1: Strategy"
          props: { level: 2 }
        - type: paragraph
          content: "We kicked off with a full-day strategy session covering product direction, technical debt, and hiring plans."
        - type: heading
          content: "Day 2: Workshops"
          props: { level: 2 }
        - type: paragraph
          content: "Day two featured hands-on workshops: advanced ADL patterns, performance profiling, and design system contributions."
        - type: heading
          content: "Day 3: Adventure"
          props: { level: 2 }
        - type: paragraph
          content: "We wrapped up with a group hike in Rocky Mountain National Park. Nothing like 10,000 feet of elevation to put tech problems in perspective."
      seo:
        metaTitle: "Team Offsite 2026 | Kalos Dev"
        metaDescription: "Highlights from our annual team offsite in Colorado."
        noIndex: false
