scheduling: withdrawing supply cancels the bookings it displaces, with a reason, and notifies their owners

未关闭
#2,730 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
postgresql, rust

调研方向

Read the scheduling guide at docs/site/src/content/docs/operate/scheduling.mdx and the authorization and cancellation paths in crates/registry-scheduling/src/store.rs. Then trace records apply, preview impacts, capacity transactions, cancellation intents, observer events, and audit handling to understand the scope. Done means meeting the acceptance criteria, including idempotency and the security page update; the issue requires delivery in the same PR as #2729.

由索引模型根据 Issue 内容生成。

描述

area:scheduling criticality:p2 enhancement triage:needs-implementation

Use case

Offices close, staff fall ill, and sessions or activities are cancelled. When supply goes, the bookings on it must end in a way the person hears about. Today nobody can clear them reliably, and once people book for themselves (#2729) an institution has no path at all.

Current evidence

  • Absences and closures block new admissions, but "Existing bookings and holds are not cancelled or reassigned." The operator is told to arrange an authorised cancellation.
  • Only the booking's owner, or its retained manager, may cancel (is_managed_by), and nobody may once the cancellation cutoff has passed (cancel_appointment).
  • records apply refuses to move, remove or shrink a window below its live holds and appointments. That stops silent loss, but leaves no supported way to withdraw the window.

Proposed behaviour

  • The authority that publishes supply may withdraw it explicitly. An operator does so through records apply with a named option, never as a side effect. A source system does so through its source profile (a later issue).
  • Withdrawal cancels each affected appointment and releases each affected hold in the same capacity transaction, with a reason, whatever the cancellation cutoff. It records which authority displaced them.
  • Each displaced appointment produces the ordinary cancellation intent, which carries the reason, and the appointment.cancelled observer event. The existing notification journey (#2339) then tells the owner.
  • Without the explicit option, today's refusal stays.
  • Preview lists the bookings a withdrawal would displace, with counts and identifiers and no owner identity, in the style of resourceImpacts.

Acceptance criteria

  • An operator withdraws a window, or adds a closure, over live bookings inside the cutoff. The affected appointments are cancelled with the reason, and each emits one cancellation intent and one observer event.
  • The same apply without the option is refused as today.
  • Preview reports what would be displaced and changes nothing.
  • Replaying the same withdrawal is idempotent.
  • The audit records the displacing authority and the number of bookings displaced.
  • The Scheduling security page records the displacement power and who holds it.

Delivery

Implemented in the same PR as #2729.

主要语言
Rust
星标
2
派生
0
平均合并
9 小时 48 分钟
30 天内合并 PR
151

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

registrystack/registry-stack 的其他 Issue

查看 registrystack/registry-stack 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。