feat(db,contracts): W5-C subscription units migration 0025, contracts and mapping
- subscription: status pending (TMDB not ready: searchable/evaluable, not completable), last_searched_at / next_search_at - content_unit (season): episode_total ledger with source / lock / timestamp - acquisition_plan: unit_keys (Slot × unit reservation) and file_selection; drop the one-in-flight-per-slot unique index (checked under slot row lock per unit instead) - new tables slot_deferral, slot_unit (per-unit quality ledger), subscription_history - contracts: SubscriptionParams, SubscriptionHistory, SlotDeferral, SlotUnit, SubscriptionProgress, EpisodeTotalSet, CandidateEvaluation pri/trace/unitKeys and decision deferred; endpoints subscriptions.search/progress/setEpisodeTotal and subscription-history - mapping: evaluation messages via describeViolation, pri/trace passthrough Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
d162d464c4
commit
1dd460d359
9 files changed
+405
-34
No files matched your search
@@ -569,20 +569,56 @@ export const Api = {
|
||||
),
|
||||
|
||||
// ── 规则 ──
|
||||
subscriptions: crud(
|
||||
"/subscriptions",
|
||||
"订阅",
|
||||
{
|
||||
row: policy.Subscription,
|
||||
create: policy.SubscriptionCreate,
|
||||
update: policy.SubscriptionUpdate,
|
||||
filters: {
|
||||
status: policy.SubscriptionStatus.optional(),
|
||||
mediaEntityId: Id.optional(),
|
||||
mediaKind: policy.SubscriptionMediaKind.optional(),
|
||||
/** 作品标题 / 原名 / 别名 / 未建档检索词,模糊匹配 */
|
||||
q: z.string().max(200).optional(),
|
||||
subscriptions: {
|
||||
...crud(
|
||||
"/subscriptions",
|
||||
"订阅",
|
||||
{
|
||||
row: policy.Subscription,
|
||||
create: policy.SubscriptionCreate,
|
||||
update: policy.SubscriptionUpdate,
|
||||
filters: {
|
||||
status: policy.SubscriptionStatus.optional(),
|
||||
mediaEntityId: Id.optional(),
|
||||
mediaKind: policy.SubscriptionMediaKind.optional(),
|
||||
/** 作品标题 / 原名 / 别名 / 未建档检索词,模糊匹配 */
|
||||
q: z.string().max(200).optional(),
|
||||
},
|
||||
},
|
||||
R,
|
||||
),
|
||||
search: ep({
|
||||
method: "post",
|
||||
path: "/subscriptions/{id}/search",
|
||||
scope: "admin",
|
||||
summary: "手动主动搜索(按标题/别名在已开启站点搜索,结果走同一识别评估链)",
|
||||
params: IdParam,
|
||||
response: z.object({ runId: z.string(), deduplicated: z.boolean() }),
|
||||
}),
|
||||
progress: ep({
|
||||
method: "get",
|
||||
path: "/subscriptions/{id}/progress",
|
||||
scope: "read",
|
||||
summary: "订阅进度:季总集数账本、每集状态(已覆盖/在途/缺失/疑似缺集)、Slot 在途与延后",
|
||||
params: IdParam,
|
||||
response: policy.SubscriptionProgress,
|
||||
}),
|
||||
setEpisodeTotal: ep({
|
||||
method: "post",
|
||||
path: "/subscriptions/{id}/episode-total",
|
||||
scope: "admin",
|
||||
summary: "手动设置季总集数(只升;locked 锁定后刷新不再改写)",
|
||||
params: IdParam,
|
||||
body: policy.EpisodeTotalSet,
|
||||
response: policy.SubscriptionProgress,
|
||||
}),
|
||||
},
|
||||
subscriptionHistory: crud(
|
||||
"/subscription-history",
|
||||
"订阅完成历史",
|
||||
{
|
||||
row: policy.SubscriptionHistory,
|
||||
filters: { mediaEntityId: Id.optional(), subscriptionId: Id.optional() },
|
||||
},
|
||||
R,
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user