Repository navigation
feat(core): notify supplier portal users directly (v0.6 U6) - #93
Merged
Merged
Conversation
Supplier-side notices now go to the supplier's own portal users instead of only to the internal handler. Recipients are read from the roster of the triggering record's supplier (active contacts with portal_user, the same condition as the membership key), so a notice can never reach another supplier (ADR-0010, red line 2). Suppliers without a portal get nothing new; the internal handler path is unchanged. - 21 email templates (zh-CN / en-US) rendered per recipient locale; bodies carry the record number and event only, no amounts, accounts or scores. - New record-change / schedule flows: SCAR new / returned / reopened / overdue, certificate expiring (30/15/7 days) and expired, application accepted / returned / approved, performance published and appeal result, bank account verified, change request applied / rejected / returned, freeze / unfreeze, portal opened. - Rejection, elimination and blacklisting notify before the roster is cleared. Internal notices that used to reach the portal user themselves (portal-submitted change requests and appeals) are skipped. - srm_supplier_application.contact records the applicant contact. - Docs 02/03/04/05/07; PF20 = objectstack#29095 (no base URL in the email template context). Closes #82 Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2fexWhTMqS1KFBnTPG
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 #82 (v0.6 U6, overview #75). Builds on U3 #92, U4 #90, U5 #91 and GL-10 #89, all merged.
改了什么
收件人规则(ADR-0010 红线 2):供应商侧通知一律从「触发记录所属供应商」的名册取人:在职、
portal_user有值的联系人,与成员键portal_supplier_ids同一条件;供应商取触发记录自己的supplier,不接受外部传入。公共节点在src/core/flows/portal/supplier-notice.ts:quality职能的事件发质量联系人,没有时发主账号(admin)联系人;srm_portal_admin的门户账号;srm_supplier_application.contact,门户提交时由srm_application_submit写入)。模板:
src/core/notifications/,21 个平台emailTemplates,每个 zh-CN / en-US 两份,按收件人sys_user.locale渲染(未设取部署默认 zh-CN,en落到 en-US)。同一份内容发邮件和站内信,站内信经sourceObject/sourceId跳到单据。正文只写单号、供应商名称、事件和期限,不写金额、账号、分数、等级、处置原因(R5)。新 flow(全部 record_change / schedule,系统身份;门户用户启动不了,不需要 PF18 的自查)
srm_scar_supplier_noticesrm_certificate_expiry_noticesrm_certificate_expired_noticesrm_application_supplier_noticesrm_review_supplier_noticesrm_bank_supplier_noticesrm_change_supplier_noticesrm_disposition_supplier_noticesrm_portal_opened_notice改动的既有 flow
srm_admission_rejection:清名册之前先发「未通过」给申请联系人(回收后名册上就没人了)。srm_disposition_apply:淘汰 / 拉入黑名单同理,回收前通知 admin 联系人。srm_change_approval、srm_appeal_resolve:发起人 / 申诉人本人是门户用户时跳过内部措辞的通知,由供应商侧通知代替,不重复。srm_scar_create、srm_scar_overdue_sweep:只改注释。文档:02(申请
contact)、03(§3 第 4/7/8 步、§5、整改单、§10、§11 证书提醒、flow 表)、04 §3.3(开通通知、回收前通知)、05 §5(收件人规则、通知表、模板)、07(notify 能力行、PF3、新 PF20 = objectstack#29095:邮件模板上下文没有部署地址,邮件拼不出完整链接,暂写「登录门户查看」+ 单号,模板数据给相对路径path)。怎么验证的
test/portal-notifications.test.ts,13 个用例:supplier+active+portal_user != null;这些 flow 都不是门户可启动的类型。test/portal-isolation.test.ts未改动,全部通过。pnpm verify通过:validate、lint(16 条既有 warning,无新增)、typecheck、i18n:check、test(354 通过,1 跳过)、build;governance/scripts/build.py --check(含--packs bulk,hazmat,soe)通过。留给后续
Generated by Claude Code