Repository navigation
feat(core): v0.5 R1 risk events and the blacklist register - #59
Merged
Merged
Conversation
- srm_risk_event (risk_type picklist, severity, source system/manual, certificate link, status open/mitigating/closed with a required conclusion on close); internal read, CM/SQE create and edit - qualification recalc opens a system qualification event when a mandatory certificate expires (once per certificate while open) and closes those events when the alert clears - srm_risk_event_apply: a high-severity event drafts a freeze disposition (or joins the open draft) and notifies the category managers - dispositions gain draft / cancelled, submitted_by, and the submit / cancel screen flows; approval starts on create or on draft submission with the submitter as initiator - blacklist register fields on the supplier, the register view and srm_blacklist_expiry_notice (30 days before and on the ban end date) - supplier dashboard with lifecycle, alert, blacklist and open-risk cards - docs 02/03/04/05 and GL-08 control table synced; tests added Refs #54 Claude-Session: https://claude.ai/code/session_012bYgpNwJq1cQtSUv9r8uuy Co-authored-by: Claude <noreply@anthropic.com>
…read + edit sharing rules Follow the engineering rule from #58 (objectstack#25470 ruling): OWD public_read with per-position edit sharing rules instead of the public_read_write workaround. Risk events join the 绩效与风险 nav group. Claude-Session: https://claude.ai/code/session_012bYgpNwJq1cQtSUv9r8uuy Co-authored-by: Claude <noreply@anthropic.com>
This was referenced Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by 田騏 · project thread
Closes #54 (overview #49).
改了什么
srm_risk_event(02 §4.9,FR-903):event_no(RSK{YYYY}{00000})、supplier、risk_type(新共享选项列表srm_risk_type)、severity、source(只读,手工为manual,system只由 flow 写)、certificate(只读,资质事件指回证书,设计之外新增,用于「同一证书不重复建」)、description、status(open / mitigating / closed,state_machine,closed → open 可重开)、mitigation_plan、owner_note(处理结论,关闭时必填)、disposition(只读)、external_ref(只读,预留)。OWDpublic_read+ 按岗位授 edit 的共享规则srm_risk_event_edit_*(品类经理、采购主管、SQE、质量经理可改别人登记和系统生成的事件、不能删,照 feat(core): v0.5 P1 KPI library srm_kpi #58 引入的工程规范「可改不可删用共享规则」);其余内部岗位只读,门户不可见。srm_supplier_qualification_recalc在必备证书变为已过期时新建系统来源的qualification事件(这张证书已有未关闭事件时不建);资质异常解除时关闭该供应商未关闭的系统资质事件并写处理结论,手工登记的不动。srm_risk_event_apply:事件新建为高风险或改为高风险时,合格且没有审批中处置单的供应商生成冻结(全部品类)处置单草稿并回填;已有冻结草稿就并入那张;其他情况只通知。通知供应商各品类的品类经理(都没有时通知全部品类经理)。status加draft、cancelled两个选项(只加不改),新增只读submitted_by;screen flowsrm_disposition_submit(提交审批,提交人接管所有权)和srm_disposition_cancel(作废,理由写入reject_reason),草稿上两个按钮。srm_disposition_approval触发改为record-after-write(新建为审批中,或草稿变为审批中),发起人口径改为「submitted_by有值取它,否则created_by」,处置单审批:非品类经理发起时缺少品类经理一级 #47 / PR feat(core): category manager level for dispositions raised by a non-CM (#47) #56 的品类经理一级判断和 BR-11 比对都按这个口径。动作与状态、「只能一张审批中」两条校验在提交时再跑一次(*_on_submit)。v0.5 P4:绩效结果应用(改善、处置、淘汰评审) #53 绩效结果应用可直接复用。blacklisted_on、blacklist_until(+blacklist_years,常量与 params 同步)、blacklist_disposition、blacklist_reason,由srm_disposition_apply拉黑时写入;供应商视图「黑名单名录」「有未关闭风险」;srm_blacklist_expiry_notice(time_relative,期满前 30 天和当天)通知拉黑发起人和品类经理,只提醒。为什么
v0.5 R1:门槛 1 第 8 步(证书过期 → 次日扫描后资质异常并生成风险事件)和「高风险事件生成冻结处置单草稿」。草稿状态是把设计里已有的「生成处置单草稿」落到处置单上,没有改变已有决定。
怎么验证的
pnpm validate、pnpm lint(--strict 无警告)、pnpm typecheck、pnpm i18n:check、pnpm test(19 个文件 190 条全过)、pnpm build全部通过;governance/scripts/build.py --check及--packs bulk,hazmat,soe通过。test/risk-event.test.ts10 条:手工登记与关闭需结论、采购员不能登记、必备证书过期生成事件 → 品类经理接手系统事件 → 重复扫描不重复 → 延期后自动关闭、非必备证书不生成且手工事件不被关闭、高风险生成草稿 → 第二个高风险并入 → 采购员不能提交 → 品类经理提交后审批冻结、采购主管提交先经品类经理、作废与中改高再生成、冻结供应商只通知、草稿期间已有审批中处置单时提交被拒、拉黑写名录字段并在期满前 30 天提醒。srm_risk_event)。原有处置单测试全部通过(手工新建行为不变)。🤖 Generated with Claude Code
https://claude.ai/code/session_012bYgpNwJq1cQtSUv9r8uuy