-
Notifications
You must be signed in to change notification settings - Fork 2
feat(cms): add staging collection seed import #514
Copy link
Copy link
Open
Description
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/triggeraccepts optionalcollectionIds,videoIds, anddryRun - 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)
- Extend the existing
apps/cms/src/api/gateway-sync/service layer with a reusable collection-to-video transformer. - Infer full vs limited sync from whether
collectionIds/videoIdsare empty. - Keep full sync behavior intact, but add a selected-video query path for limited imports.
- 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.mddocs/plans/2026-03-19-001-feat-cms-gateway-data-sync-plan.mdapps/cms/src/api/gateway-sync/services/gateway-sync.tsapps/cms/src/api/gateway-sync/services/sync-videos.tsapps/cms/src/api/gateway-sync/services/sync-video-variants.ts
Reactions are currently unavailable