Skip to content

feat(core): v0.2 M2 supplier bank account - #16

Merged
marchtian merged 2 commits into
mainfrom
claude/project-thread-87ix8k
Oct 23, 2026
Merged

marchtian merged 2 commits into
mainfrom
claude/project-thread-87ix8k

Conversation

@marchtian

Copy link
Copy Markdown
Collaborator

Requested by 田騏 · project thread

Closes #11 (overview #7).

改了什么

对象 srm_supplier_bank_account(master_detail → 供应商,OWD controlled_by_parent):字段按 02 §4.1。

  • status(pending_verify / active / inactive)与 verified_by 只读,只由 flow 写入;状态机 pending_verify → active ⇄ inactive,active 作为初始状态留给 M4 变更单 flow 以系统身份直接建出已审批的新账户。
  • 开户行、支行、户名、账号、SWIFT、币种 readonlyWhen 在任何状态下只读(新建时可填):待核验期间整条锁定,有效后的修改走 M4 信息变更单。
  • 校验:中国供应商户名必须等于供应商全称;只有 active 账户能设为默认;每家至多一个默认账户(读新增的 srm_supplier.default_bank_account_count 汇总)。

核验 screen flow srm_bank_verify + 详情页/列表的「核验」按钮:拒绝非应付会计、非待核验、新建人自己核验(双人原则),通过后置 active 并写 verified_by。

字段级权限(BR-20):account_no 用 maskingRule: 'bank_account' + requiredPermissions: ['srm_view_bank_account_no']。新能力由 srm_finance 与 srm_supplier_admin 的 systemPermissions 授予,其他岗位读到只留后 4 位的脱敏值。没有任何权限集给银行账户 allowExport。

权限集:srm_internal_base 读;srm_supplier_admin 读、新建、编辑;srm_finance 读。

其他:列表视图(全部 / 待核验)、工作台导航、英文翻译、设计 02 §4.1、03 §5、04 §4.2 同步。

平台缺口(按项目规则提给平台)

怎么验证的

  • 新增 test/bank-account.test.ts(13 条):新建 → 核验 → 有效全流程;同一人核验被拒;非应付会计被拒;待核验记录改不动;有效账户关键字段改不动但可设默认;默认账户唯一;户名校验(境内 / 境外);应付会计与品类经理读到完整账号、采购员读到脱敏值;应付会计不能直接改;无导出权限。
  • test/permissions.test.ts 岗位可见性快照更新(应付会计 R、采购主管 RCE)。
  • 本地 pnpm verify(validate、lint、typecheck、i18n:check --strict、test 46/46、build)与 governance/scripts/build.py --check 全部通过。

Generated by Claude Code

Add srm_supplier_bank_account (master_detail to supplier) with the
pending_verify -> active verification flow:

- buyer-side create lands pending_verify (status/verified_by read-only);
  key fields are read-only in every state, changes go through M4
- srm_bank_verify screen flow: AP accountants only, pending accounts
  only, creator cannot verify their own account (four-eyes)
- account_no masked to last 4 digits unless the caller holds the new
  srm_view_bank_account_no capability (srm_finance, srm_supplier_admin)
- account name must match the supplier name for domestic suppliers;
  only active accounts can be default, at most one default per supplier
  (via new srm_supplier.default_bank_account_count)
- views, workbench nav, verify action, en translations, design 02/03/04

The in-flow position gate is a documented stopgap for
objectstack-ai/objectstack#25481.

Closes #11

Claude-Session: https://claude.ai/code/session_01HeASGpomzEjdVxEzMMXKTR
Co-authored-by: Claude <noreply@anthropic.com>
@marchtian marchtian self-assigned this Oct 23, 2026
@marchtian
marchtian merged commit 202a16d into main Oct 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v0.2 M2:银行账户 srm_supplier_bank_account

2 participants