Repository navigation
feat(core): v0.2 M3 legacy supplier import - #15
Merged
Merged
Conversation
Import existing suppliers, contacts and certificates with the platform spreadsheet import, idempotently: - srm_supplier: legacy_imported (settable only on create, srm_admin only), legacy_reviewed, primary_contact_count; status defaults to qualified for legacy imports so sheets never carry a status column and re-runs cannot revert frozen/eliminated suppliers; insert rule ties qualified to legacy. - srm_supplier_contact: at most one primary contact guard (single writes). - srm_supplier_certificate: legacy_imported; cert_no required and scan optional for legacy certificates. - Views: legacy review, duplicate primary contacts, legacy certificates missing a scan; "confirm review" action. - Permissions: srm_admin imports; supplier maintainers edit all suppliers. - Sample sheets under src/core/data/import, imported twice in CI. - Design 02/04/05/07, engineering rules and an import guide updated. Platform gaps filed: objectstack#25475, #25476, #25477. Closes #10 Claude-Session: https://claude.ai/code/session_01WD2qxFMbYUkbEnsSXW7PQj Co-authored-by: Claude <noreply@anthropic.com>
Keep both srm_admin duties (material import and legacy supplier import) and move the legacy sample sheets to data/samples/ next to the material sample, as M1 established. Claude-Session: https://claude.ai/code/session_01WD2qxFMbYUkbEnsSXW7PQj Co-authored-by: Claude <noreply@anthropic.com>
This was referenced Oct 23, 2026
marchtian
pushed a commit
that referenced
this pull request
Oct 23, 2026
#15 gave srm_supplier_admin and srm_admin modifyAllRecords on srm_supplier so category managers could review suppliers imported by an admin. The platform's modifyAllRecords also grants delete (objectstack#25470), so category managers and buyer leads could delete any supplier and cascade its contacts and certificates. Follow the srm_material workaround instead: srm_supplier OWD is public_read_write for now, modifyAllRecords is dropped, and srm_quality keeps its edit grant only for certificate writes with every supplier field read-only through FLS. Tests cover edit-not-delete for category managers and buyer leads, and read-only for SQE, buyers and AP. Claude-Session: https://claude.ai/code/session_01WD2qxFMbYUkbEnsSXW7PQj 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
Part of #10 (overview #7, plan §4 M3, design 07 R6). #10 stays open for the real-ledger trial run (see exit criteria).
改了什么
用平台对象列表自带的表格导入,把存量供应商、联系人、证书导进来,可重复执行。不写代码,全部元数据。
srm_supplierlegacy_imported(只能在新建时置为 true:readonlyWhen: previous.legacy_imported != true)、legacy_reviewed、primary_contact_count(带条件汇总)。status默认值改为legacy_imported ? 'qualified' : 'potential',initialStates加qualified,插入规则initial_status_by_source要求「合格」与「存量导入」同真同假srm_supplier_contactsrm_supplier_certificatelegacy_imported;存量证书cert_no必填、扫描件不必填(表格带不了文件)srm_confirm_legacy_review「确认复核」(声明式operation: 'update')srm_admin可导入(供应商 / 联系人 / 证书增改),是唯一能写「存量导入」标记的权限集;srm_supplier_admin与srm_admin对供应商modifyAllRecords(04 §2.3 的 RCE,供应商主数据集团共享;否则品类经理无法复核别人导入的供应商)data/samples/srm_supplier*.csv三张(全部「示例」虚构值,与 M1 的物料样例放在一起)docs/implementation/legacy-supplier-import.md(匹配规则、字段说明、重复导入、复核、常见错误);设计 02 §4.1 / §5.1、04 §2.2–2.3、05 §1.1、07 §4 R6 / §6.1 / §6.3、engineering §1、data/samples/README.md同步设计取舍
frozen → qualified),而treatAsHistorical只有系统身份能用。所以用表达式默认值在新建时算初始状态,表格根本不带状态列;证书状态同理由资质扫描计算。skipBlankMatchKey跳过另一类行。legacy_reviewed,不清掉legacy_imported,否则重复导入会把已复核的供应商重新标回待复核。平台限制(已提需求,变通为临时措施)
readonlyWhen已登记到 07 §6.3(PF8–PF10)。
验证
pnpm validate、lint、typecheck、i18n:check、test(合并 main 后 7 个文件全部通过)、build;governance/scripts/build.py --check通过;文档相对链接与锚点检查 0 问题。test/import-idempotency.test.ts(以srm_admin岗位用户走POST /data/:object/import):expired,供应商出现资质异常;非必备证书过期不报警;frozen、复核标记不回退、资质异常不被清掉;出口条件
expired,供应商出现资质异常os validate、os i18n check --strict通过;设计 02 / 07 与实现一致🤖 Generated with Claude Code
https://claude.ai/code/session_01WD2qxFMbYUkbEnsSXW7PQj