Repository navigation
v0.2 M4 信息变更单 srm_supplier_change_request - #18
Merged
Merged
Conversation
…est) - New object srm_supplier_change_request: typed new-value fields per change type (basic / address / bank_account / contact), before/after json snapshots (no bank account numbers), approvers, applied_at. - srm_change_approval: snapshot on create, srm_buyer_lead approval, extra srm_ap_accountant level for bank changes; approve / reject / send back; BR-11 checks against approval records (submitter and both levels must be different people; objectstack#25446). - srm_change_apply: writes back supplier, contact or bank account; bank change retires the old account and creates an active verified one that inherits the default flag. - Qualified suppliers' key information can only change through a change request (validation keyed on read-only last_change_request). - Level 2 cannot send back for now: plugin-approvals 18.0.0 records the level-1 decider as the level-2 submitter (objectstack#24817). - Permissions, views, navigation, English translations, design docs 02/03/04 and import guide updated; 15 new tests with generated sample data. Closes #12 Claude-Session: https://claude.ai/code/session_01HbSfcxJNF6t1vf6zwGotgG Co-authored-by: Claude <noreply@anthropic.com>
…F5/PF13 Claude-Session: https://claude.ai/code/session_01HbSfcxJNF6t1vf6zwGotgG Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HbSfcxJNF6t1vf6zwGotgG Co-authored-by: Claude <noreply@anthropic.com>
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 #12(v0.2 最后一项,总览 #7)。
改了什么
srm_supplier_change_request(第 10 个对象):按变更类型(基本信息 / 地址 / 银行账户 / 联系人)分组的新值字段;before_value/after_valuejson 快照(不含银行账号,BR-20);purchase_approver/finance_approver、reject_reason、applied_at、new_bank_account。新值只在新建时和退回修改期间可改。srm_change_approval(新建即触发):快照当前档案 → 第 1 级srm_buyer_lead→ 银行账户变更加第 2 级srm_ap_accountant→ 子 flow 写回。第 1 级覆盖通过、驳回、退回;驳回不改主记录、写入驳回意见并通知发起人。sys_approval_action比对,发起人自审或两级同一人时这次通过不算数,通知后重开同级审批(平台无此开关,objectstack#25446)。srm_change_apply:写回供应商 / 联系人;银行账户变更停用原账户(同时取消默认),建一个active新账户,核验人 = 财务复核人,继承默认标志。last_change_request;准入期间仍可直接改)。没用readonlyWhen:它连系统身份写入也挡。is_default去掉readonlyWhen,只靠已有的「只有有效账户能设默认」校验(停用原账户时要同时取消默认,readonlyWhen会让 flow 写不进去)。srm_buyer、srm_supplier_admin可新建、改本人发起的变更单;srm_finance、srm_executive只读。采购员没有完整账号能力,所以银行账户变更由品类经理 / 采购主管发起。为什么有偏离设计的地方
srm_change_submitscreen flow 发起:改为直接新建变更单(分类型字段带校验、退回后可直接改),screen flow 留给 v0.6 门户。怎么验证的
pnpm verify全过(validate、lint --strict、typecheck、i18n --strict、test 75/75、build)。test/change-request.test.ts15 个用例,数据全部在测试里生成:基本信息一级审批写回、驳回不改主记录、退回修改后重新提交、审批中不能改、地址 / 联系人写回、银行账户两级审批写回(旧账户停用、新账户有效且为默认、快照不含账号)、财务驳回保留原账户、财务不能退回(临时)、两级同一人与发起人自审不计入、跨供应商 / 非有效账户 / 户名不符 / 采购员填账号被拒、合格供应商不能直接改关键信息、准入中可直接改。Generated by Claude Code