feat(#259): id-based reconcile for schedule-items replace (backend + DTO)

Add optional `int? Id` to ScheduleItemRequest/ReplaceProgramScheduleItem so
a client can round-trip each existing item's server id. When ids are present,
ReplaceProgramScheduleItemsHandler reconciles by id (not array position), so an
item's persisted fill-group/shuffle state (PlayoutScheduleItemFillGroupIndex,
FK OnDelete Cascade) follows the logical item across reorders/inserts instead of
being inherited by whatever previously occupied its new slot (#259, split from
#252/#253). A fully id-less payload keeps the verbatim positional fallback.

Guards (inside PersistItems, after CheckVersion so 412 precedes 422): duplicate
id -> 422; id not in this schedule -> 422 (a stale id under Phase-1 force-write is
a live lost-update signal, not a new item). Index stays array-position derived.

Regenerated v1.json + TS client.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-11 21:43:52 +02:00
co-authored by Claude Opus 4.8
parent 78262ea4cb
commit 02a493e95e
7 changed files with 133 additions and 32 deletions
+1
View File
@@ -1279,6 +1279,7 @@ export interface components {
"deepScan"?: boolean;
};
"ScheduleItemRequest": {
"id": null | number;
"startType": components["schemas"]["StartType"];
"startTime": null | string;
"fixedStartTimeBehavior": null | components["schemas"]["FixedStartTimeBehavior"];