Skip to content

feat(cms): add staging collection seed import #514

@lumberman

Description

@lumberman

Background

apps/cms is intended to be the canonical source for manager data, but staging and local development need a way to seed a limited slice of gateway media data into CMS without running a full import. The current gateway-sync flow supports full sync phases, but it does not accept operator-selected collection IDs or resolve them automatically into concrete video IDs.

Expected outcome

Admins can trigger a staging-safe limited seed import that accepts coverage-style collection IDs and/or explicit video IDs, resolves collection IDs automatically to child/self video IDs, and imports only that selected media graph into Strapi CMS.

Acceptance criteria

  • POST /api/gateway-sync/trigger accepts optional collectionIds, videoIds, and dryRun
  • Empty selection inputs preserve the existing full sync behavior
  • Coverage-style collection IDs resolve automatically to concrete child/self video IDs
  • Limited imports skip global soft-delete behavior and remain additive/idempotent
  • Dry run returns resolved IDs and missing collection IDs without writing CMS data

Possible solution(s)

  1. Extend the existing apps/cms/src/api/gateway-sync/ service layer with a reusable collection-to-video transformer.
  2. Infer full vs limited sync from whether collectionIds / videoIds are empty.
  3. Keep full sync behavior intact, but add a selected-video query path for limited imports.
  4. Reuse existing video and variant upsert helpers, while skipping softDeleteUnseen() in limited runs.

References

  • docs/plans/2026-03-23-001-feat-staging-cms-collection-seed-import-plan.md
  • docs/plans/2026-03-19-001-feat-cms-gateway-data-sync-plan.md
  • apps/cms/src/api/gateway-sync/services/gateway-sync.ts
  • apps/cms/src/api/gateway-sync/services/sync-videos.ts
  • apps/cms/src/api/gateway-sync/services/sync-video-variants.ts

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions