Repository navigation
feat(core): v0.2 M1 material read-only copy (srm_material) - #14
Merged
Merged
Conversation
- New object srm_material: ERP material master copy keyed by erp_material_no (unique per organization), with list views, a "without category" view and a workbench nav entry. - New permission set srm_buyer (on buyer and procurement director): edit only the category link; other fields read-only via FLS; no create/delete. srm_admin imports and maintains materials. - OWD is public_read_write: under public_read a buyer needs modifyAllRecords to edit an imported row, which also grants delete. - Sample sheet data/samples/srm_material.csv with an import guide; test/material.test.ts imports it twice through the platform import API and checks counts and values are unchanged. - Design 02 §4.1 and 04 §2.2 updated to match; en translations added. Closes #9 Claude-Session: https://claude.ai/code/session_01EGdBSEBg7Sy4QhBKoLqR1H Co-authored-by: Claude <noreply@anthropic.com>
…bjectstack#25470 Claude-Session: https://claude.ai/code/session_01EGdBSEBg7Sy4QhBKoLqR1H Co-authored-by: Claude <noreply@anthropic.com>
Mount srm_buyer on srm_buyer_lead as design 04 §2.1 says; snapshots now include srm_material. Claude-Session: https://claude.ai/code/session_01EGdBSEBg7Sy4QhBKoLqR1H 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 #9(总览 #7)。
改了什么
srm_material(设计 02 §4.1):erp_material_no(组织内唯一,导入匹配键)、material_code、name、specification、uom、category(lookup →srm_category)、active。字段名按设计文档用erp_material_no(issue 正文写的是erp_material_id,以 02 / ADR-0008 / 工程规范为准)。srm_buyer(04 §2.2),挂在采购员和采购总监岗位上:物料只能改category,其余字段 FLS 只读,不能新建、删除。srm_admin负责导入与维护;srm_internal_base、srm_executive加物料只读。public_read_write,目标仍是public_read:物料归执行导入的管理员所有,public_read下采购员要改别人的记录只能给modifyAllRecords,而平台的modifyAllRecords同时放开删除(测试实测)。已向平台提需求 Permission sets: no way to grant "edit any record" without also granting delete (modifyAllRecords implies allowDelete) objectstack#25470;平台支持「可改不可删」后改回public_read。设计 02 §4.1 和对象源码注释都标明了这是临时做法。data/samples/srm_material.csv(8 行虚构示例)和导入说明data/samples/README.md:按erp_material_noupsert;日常重复导入不带category列,避免覆盖采购员维护的关联。srm_buyer、srm_admin说明同步。怎么验证的
新增
test/material.test.ts(进入 CI 的pnpm test):POST /data/srm_material/import(upsert)导入两遍:第一遍新建 8 条,第二遍 0 新建,记录数与字段值完全一致;erp_material_no被唯一约束拒绝。本地
pnpm validate、pnpm lint、pnpm typecheck、pnpm i18n:check(185/185)、pnpm test(33 通过)、pnpm build全部通过。lint 唯一的提示是 v0.1 既有的审批流空审批人建议,与本 PR 无关。🤖 Generated with Claude Code
https://claude.ai/code/session_01EGdBSEBg7Sy4QhBKoLqR1H