Files
website/SCHEMA-REST.md
T
2026-04-23 01:08:18 +08:00

17 KiB

Payload Schema — Remaining Collections and Globals (Final)

Purpose

Final schema for every Payload collection and global used on the new Eversolo site, excluding Product (see SCHEMA-PRODUCT.md). This document is the source of truth for the Payload config.

Shared Conventions

Locales

  • en, zh
  • Field-level localization is used (not document-level).
  • **localized** below means the field is per-locale.
  • **shared** means a single value across locales.

Status Workflow

All content-bearing collections share:

  • status: draft | review | published | archived
  • publishedAt: auto-set on first publish
  • createdAt, updatedAt: auto

Access Control

  • Public read: only status = published.
  • Write: authenticated editors and above.
  • Admin-only fields are marked inline.

SEO Group

Used on all public-facing documents:

  • titlelocalized — text, max 70.
  • descriptionlocalized — textarea, max 160.
  • ogImageshared — upload.
  • canonicalshared — text, optional.
  • noIndexshared — checkbox, admin-only, default false.

Revalidation

Every collection that renders on the public site triggers on-demand revalidation of the affected route paths in its afterChange hook.


Collections

1. Product Categories

Slug: productCategories

  • slugshared — text, required, URL-safe, unique.
  • namelocalized — text, required.
  • descriptionlocalized — rich text.
  • heroImageshared — upload.
  • ordershared — number, default 0.
  • seo — group (see SEO group).

Validation

  • slug unique.
  • name required per locale if that locale is published.

Admin UI Tabs

  1. Overview: slug, name, description, order.
  2. Media: heroImage.
  3. SEO: seo.

2. FAQ

Slug: faqs

  • groupshared — select, required. Suggested values: setup | streaming | connectivity | hardware | warranty | other. Editable at admin level.
  • questionlocalized — text, required.
  • answerlocalized — rich text, required.
  • relatedProductsshared — relationship to products, multi-select, optional.
  • relatedDownloadsshared — relationship to downloads, multi-select, optional.
  • ordershared — number, default 0.
  • statusshared — select (see status workflow).

Listing

  • Grouped by group, ordered by order ascending.
  • Support page shows curated groups; dedicated FAQ page shows all published entries.

Validation

  • question and answer required for any locale being published.

3. Downloads

Slug: downloads

  • titlelocalized — text, required.
  • typeshared — select, required. Values: firmware | manual | software | other.
  • productshared — relationship to products, required.
  • versionshared — text, optional.
  • releaseDateshared — date, optional.
  • fileshared — upload, required.
  • checksumshared — text, optional.
  • changeloglocalized — rich text, optional.
  • noteslocalized — rich text, optional.
  • visibility — group.
    • showInProductPageshared — checkbox, default true.
    • showInDownloadsCentershared — checkbox, default true.
  • statusshared — select (see status workflow).

Rules

  • Firmware display on product pages also requires the product's firmware.showOnProductPage toggle to be on.
  • Firmware display in the Downloads center also requires the product's firmware.showInDownloadsCenter toggle to be on.
  • showInProductPage and showInDownloadsCenter are download-level overrides: they can hide a specific file even when the product-level toggle is on.

Validation

  • title required per published locale.
  • file required.
  • product required.
  • type required.

Admin UI Tabs

  1. Overview: title, type, product, version, releaseDate, status.
  2. File: file, checksum.
  3. Content: changelog, notes.
  4. Visibility: visibility group.

4. Product Videos

Slug: productVideos

  • titleshared — text, required.
  • productshared — relationship to products, required.
  • providershared — select, required. Values: youtube | vimeo | bilibili | other.
  • videoUrlshared — text, required.
  • embedUrlshared — text, optional.
  • thumbnailshared — relationship to media, optional.
  • descriptionlocalized — rich text, optional.
  • publishedAtshared — date, optional.
  • sortOrdershared — number, default 0.
  • legacySourceUrlshared — text, optional.
  • statusshared — select (see status workflow).

Rules

  • Product detail pages render all published videos related to the current product, ordered by sortOrder, then newest first.
  • Seed import may create draft records first; editors can refine descriptions later.

5. Product Reviews

Slug: productReviews

  • titleshared — text, required.
  • productshared — relationship to products, required.
  • sourceNameshared — text, optional.
  • reviewUrlshared — text, required.
  • thumbnailshared — relationship to media, optional.
  • excerptlocalized — text, optional.
  • quotelocalized — text, optional.
  • publishedAtshared — date, optional.
  • sortOrdershared — number, default 0.
  • legacySourceUrlshared — text, optional.
  • statusshared — select (see status workflow).

Rules

  • Product detail pages render all published reviews related to the current product, ordered by sortOrder, then newest first.
  • Reviews may be imported from the legacy site with minimal metadata and enriched later in CMS.

6. Dealers

Slug: dealers

  • nameshared — text, required.
  • regionshared — select, required. Values mirror the Dealers page region filter.
  • countryshared — text, required.
  • cityshared — text, optional.
  • addresslocalized — textarea, optional.
  • emailshared — email, optional.
  • phoneshared — text, optional.
  • websiteshared — URL, optional.
  • logoshared — upload, optional.
  • isAuthorizedshared — checkbox, default true.
  • ordershared — number, default 0.
  • statusshared — select (see status workflow).

Listing

  • Grouped by region, then country, then name.
  • Only isAuthorized = true are shown in public lists.

7. News Articles

Slug: news

  • sluglocalized — text, required, unique per locale.
  • categoryshared — select, required. Values: announcement | press | review | event.
  • titlelocalized — text, required.
  • excerptlocalized — textarea, optional.
  • coverImageshared — upload, required.
  • bodylocalized — rich text, required.
  • authorshared — text, optional.
  • sourceshared — text, optional (for press / review entries).
  • sourceUrlshared — URL, optional.
  • publishedAtshared — date, required on publish.
  • relatedProductsshared — relationship to products, multi-select, optional.
  • statusshared — select (see status workflow).
  • seo — group.

Listing Rules

  • News list: all published, newest first.
  • Homepage news highlights: manually selected via Homepage global.
  • Articles may exist in a single locale; the UI surfaces only locales with published content.

8. Media

Slug: media

Generic upload collection for images used across the site.

  • file — upload, required.
  • altlocalized — text, required.
  • captionlocalized — text, optional.
  • creditshared — text, optional.
  • tagsshared — array of text.

Usage

Every image field in other collections references media. Editors upload once, reuse everywhere.


9. Videos

Slug: videos

Dedicated upload collection for video assets (hero videos, product showcase).

  • file — upload, required.
  • poster — relationship to media, required.
  • durationSecondsshared — number, optional.
  • altlocalized — text, required.
  • tagsshared — array of text.

10. Files

Slug: files

Upload collection for firmware, manuals, software binaries, and other downloadable files. Used as the file reference on the downloads collection.

  • file — upload, required.
  • sizeBytesshared — number (auto).
  • mimeTypeshared — text (auto).

11. Redirects

Slug: redirects

Source of truth for 301 redirects from the legacy site, including the entries documented in REDIRECTS.md.

  • fromshared — text, required. Matches a path or pattern on the legacy URL space.
  • toshared — text, required. Destination path on the new site, locale-prefixed.
  • statusCodeshared — select, required. Values: 301 | 302 | 307 | 308. Default 301.
  • matchTypeshared — select, required. Values: exact | prefix | regex. Default exact.
  • localeshared — select, optional. Values: any | en | zh. Controls whether the redirect applies only to a locale-scoped target.
  • notesshared — text, optional.
  • enabledshared — checkbox, default true.

Rules

  • Redirects are resolved at the edge in priority order: exact > prefix > regex.
  • External links (Amazon, JD, Tmall, forum.zidoo, shop.zidoo, blog.eversolo) are not managed here.
  • The APP header link points directly to https://www.eversolo.com/controlapp/index.html and is not stored as a redirect.

Globals

1. Homepage

Slug: homepage

  • hero — group.
    • modeshared — select, required. Values: image | video. Default image.
    • imageshared — relationship to media, required when mode = image.
    • videoshared — relationship to videos, required when mode = video.
    • headlinelocalized — text, required.
    • supportingLinelocalized — text, optional.
    • primaryCta — group.
      • labellocalized — text.
      • hrefshared — text (internal path or URL).
    • secondaryCta — group.
      • labellocalized — text.
      • hrefshared — text.
  • featuredProductsshared — relationship to products, required, exactly 4.
  • statement — group.
    • titlelocalized — text.
    • bodylocalized — rich text.
    • imageshared — relationship to media.
    • cta — optional group of { label, href }.
  • supportShortcuts — array, 3 to 4 items.
    • labellocalized — text, required.
    • descriptionlocalized — text.
    • hrefshared — text, required.
  • recognition — group.
    • awardsshared — array of { logo: media, label (localized), year, url }.
    • reviewsshared — array of { sourceLogo: media, sourceName (localized), quote (localized), url }.
  • newsHighlightsshared — relationship to news, up to 3, optional.
  • seo — group.

Validation

  • featuredProducts length must equal 4.
  • recognition.awards should contain at least 1 item if the module is shown; otherwise leave empty.

2. Support Page

Slug: supportPage

  • intro — group.
    • titlelocalized — text.
    • bodylocalized — rich text.
  • primaryEntries — array, required, exactly 3.
    • keyshared — select, required. Values: faq | warranty | contact.
    • labellocalized — text, required.
    • descriptionlocalized — text.
    • hrefshared — text, required.
  • secondaryEntries — array, 0 to 3 items.
    • keyshared — select. Values: downloads | manuals | firmware.
    • labellocalized — text, required.
    • descriptionlocalized — text.
    • hrefshared — text, required.
  • seo — group.

3. Warranty Page

Slug: warrantyPage

  • intro — group.
    • titlelocalized — text.
    • bodylocalized — rich text.
  • policyBodylocalized — rich text, required.
  • regionalNotes — array.
    • regionshared — select.
    • bodylocalized — rich text.
  • registrationCta — optional group of { label, href }.
  • seo — group.

4. Contact Page

Slug: contactPage

  • intro — group.
    • titlelocalized — text.
    • bodylocalized — rich text.
  • regions — array.
    • regionshared — select.
    • emailshared — email.
    • phoneshared — text.
    • addresslocalized — textarea.
    • hourslocalized — text.
  • formEnabledshared — checkbox, default true.
  • formSuccessMessagelocalized — rich text.
  • seo — group.

5. About Page

Slug: aboutPage

  • intro — group.
    • titlelocalized — text.
    • bodylocalized — rich text.
  • brandStorylocalized — rich text.
  • philosophylocalized — rich text.
  • milestones — array.
    • yearshared — number.
    • titlelocalized — text.
    • descriptionlocalized — rich text.
    • imageshared — relationship to media, optional.
  • seo — group.

6. Global Settings

Slug: globalSettings

  • site — group.

    • namelocalized — text.
    • logoLightshared — relationship to media.
    • logoDarkshared — relationship to media.
    • faviconshared — relationship to media.
  • navigation — group.

    • primary — array, required. Each item:
      • labellocalized — text.
      • hrefshared — text.
      • externalshared — checkbox, default false.
      • openInNewTabshared — checkbox, default false.
      • iconKeyshared — text, optional (for future icon support).
    • app — group (singleton inside navigation).
      • labellocalized — text, default APP.
      • hrefshared — text, required, default https://www.eversolo.com/controlapp/index.html.
      • openInNewTabshared — checkbox, default true.
      • showOnDesktopshared — checkbox, default true.
      • showOnMobileshared — checkbox, default true.
  • footer — group.

    • columns — array.
      • titlelocalized — text.
      • items — array of { label (localized), href, external, openInNewTab }.
    • legalLinks — array of { label (localized), href }.
    • copyrightlocalized — text.
  • social — array of { platform, url, iconKey }.

  • languageSwitcher — group.

    • labels — per-locale { en: "English", zh: "简体中文" }.
  • analytics — group.

    • provider — select: plausible | ga4 | none.
    • domain — text.
    • measurementId — text.
  • seoDefaults — group.

    • titleSuffixlocalized — text.
    • descriptionlocalized — textarea.
    • ogImageshared — relationship to media.
  • cookieBanner — group.

    • enabledshared — checkbox, default true.
    • bodylocalized — rich text.
    • acceptLabellocalized — text.
    • declineLabellocalized — text.

Notes

  • The header APP entry is driven by navigation.app so editors can update the label, URL, and visibility without a code change.
  • openInNewTab defaults to true for external items.

Hooks (cross-collection)

  • afterChange on any publishable document:
    • Revalidate affected public routes.
    • Revalidate Homepage if the document is referenced in Homepage fields.
  • beforeValidate on any slug field:
    • Normalize (lowercase, trim, dashes, ASCII fallback).
  • beforeChange on status:
    • Set publishedAt on first transition to published.

Admin UX Principles

  • Use tabs per collection to separate structural, content, media, and SEO fields.
  • Globals use grouped sections rather than tabs to stay editor-friendly.
  • Every relationship field is labeled with its expected content type and any filters applied.
  • Locale selector is persistent across the admin UI.

Open Items

  • Whether Redirects are managed in CMS or in a versioned file; current plan: CMS-managed for editor control.
  • Whether News articles should support per-locale status separately.
  • Whether the Dealers region list should be a CMS-managed enum or hardcoded.
  • Whether the Homepage recognition module should allow a layout choice (logo wall vs quote strip) per locale.