Skip to content

feat(core): hotsrm v0.1 — internal workbench for supplier master data, admission and qualification alerts - #5

Merged
marchtian merged 10 commits into
mainfrom
claude/project-thread-u5q2n8
Oct 23, 2026
Merged

marchtian merged 10 commits into
mainfrom
claude/project-thread-u5q2n8

Conversation

@marchtian

@marchtian marchtian commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by 田騏 · project thread

改了什么

hotsrm v0.1:内部工作台上的供应商主数据、准入审批和资质到期预警(范围见 design 07 §1.1)。每个工作项一个提交。

W1 工程骨架与 CI(结构对齐 HotCRM)

  • src/core/index.ts:核心应用(type: app,id app.objectstack.hotsrm,命名空间 srm,默认 zh-CN,另有 en);requires 声明 auth、ui、automation、triggers、job、approvals、messaging、audit。
  • objectstack.composition.ts 选模块,objectstack.config.ts 用 composeStacks(..., { manifest: 'preserve' }) 合成(ADR-0002);objectstack.manifest.json。
  • @objectstack/* 固定 18.0.0;pnpm verify 跑全部检查;CI 跑 validate、lint --strict、typecheck、i18n check --strict、test、build 和体系文件检查。

W2 供应商主数据(02 §4.1)

  • srm_category、srm_plant、srm_supplier、srm_supplier_contact、srm_supplier_certificate、srm_supplier_category;共享选项列表 srm_country、srm_cert_type。
  • 境内信用代码唯一 + 格式校验,境外「国家 / 地区 + 注册号」唯一(BR-01);供应商状态机(02 §5.1);证书日期校验;联系人数、过期证书数汇总。
  • contact_role 改名 contact_function(平台保留 role 一词),02 同步。

W3 准入申请与审批(02 §4.2、03 §3)

  • srm_supplier_application(v0.1 内部代录子集,02 已加说明)。
  • flow:srm_application_intake(受理)、srm_admission_approval(两级审批:初审人 → srm_procurement_director;批准后申请通过、供应商合格、按申请品类建供货品类资格;驳回退回资料审核)、srm_admission_rejection(未通过:供应商回到潜在)。
  • ⚠️ 审批链待定:设计 03 §12(品类经理 → 采购总监)与体系文件 ZC-02(按物料 A/B/C 类分级:采购负责人 → 质量负责人 → 分管副总)不一致,等决定后再调整审批人。另外平台审批不会自动排除提交人,防自审随审批链一起处理。

W4 资质到期扫描(03 §11)

  • srm_certificate_expire_sweep:每日追赶式扫描,证书状态对齐到已过期 / 即将到期(30 天)/ 有效(延期后恢复),可重复运行。
  • srm_supplier_qualification_recalc:证书状态或「必备」标志变化后重算 qualification_alert。
  • ⚠️ 部署前提:定时 flow 受 OS_AUTOMATION_SCHEDULED_WORK_ENABLED 控制,平台默认关闭(托管云同样)。不打开时扫描不会运行,托管云的打开方式待与平台确认(README 已注明)。
  • 到期提醒通知、按品类自动写 is_mandatory、「经 SQE 核验才解除」随门户版本加入(03 已加说明)。

W5 岗位与权限集(04 §2)

  • 5 个岗位、5 个权限集(v0.1 子集),都不设 isDefault;flow 维护的状态字段在所有权限集里只读。

暂不包含:门户与公开注册表单(v0.2)、寻源(v0.3)、ERP / 物料 / 银行账户(v0.4)、首页看板。

为什么

先交付一个能独立使用的内部闭环:登记供应商 → 准入两级审批 → 合格;证书过期自动标记资质异常。不含面向供应商的对象和报价,隔离与封标两条红线随 v0.2 / v0.3 的对象与测试一起落地。

怎么验证的

本地 pnpm verify 全部通过:validate、lint --strict、typecheck、i18n(zh-CN / en 171/171)、build,以及 28 个端到端测试(启动 3、主数据 9、准入 5、资质 6、权限 5),体系文件两项检查通过。

🤖 Generated with Claude Code

https://claude.ai/code/session_01V33WdUYdE8Qfx121Ngt8Lt

Add the package skeleton for v0.1: src/core as the type: app stack
(namespace srm) with the srm_workbench app shell and the srm_category
object, objectstack.config.ts composing it per ADR-0002, a boot test on
@objectstack/verify, and a CI workflow running validate, lint,
typecheck, i18n check, test, build and the governance template checks.

Claude-Session: https://claude.ai/code/session_01V33WdUYdE8Qfx121Ngt8Lt
Co-authored-by: Claude <noreply@anthropic.com>
@marchtian marchtian self-assigned this Oct 23, 2026
Use the app.objectstack.<name> manifest id, pin @objectstack/* to
18.0.0 with a packageManager field, run lint --strict, add the
objectstack.composition.ts / objectstack.manifest.json pair the README
already planned, declare auth and ui so pnpm dev serves the console,
and add a verify script running the full local check list.

Claude-Session: https://claude.ai/code/session_01V33WdUYdE8Qfx121Ngt8Lt
Co-authored-by: Claude <noreply@anthropic.com>
Add srm_plant, srm_supplier, srm_supplier_contact,
srm_supplier_certificate and srm_supplier_category per design 02 §4.1,
the shared srm_country and srm_cert_type picklists, list views, workbench
navigation, full English translations and example seed data. Supplier
identity is deduplicated by credit code or country + registration number,
status follows the 02 §5.1 state machine. contact_role is renamed
contact_function because the platform reserves "role". Design 07 now
records how phase 1 is split into v0.1–v0.4.

Claude-Session: https://claude.ai/code/session_01V33WdUYdE8Qfx121Ngt8Lt
Co-authored-by: Claude <noreply@anthropic.com>
@marchtian marchtian changed the title chore(core): scaffold the ObjectStack app package and CI feat(core): v0.1 app skeleton, CI and supplier master data Oct 23, 2026
Add srm_supplier_application (internal v0.1 subset of design 02 §4.2)
with its state machine and guards, and three record-change flows for
P1 (design 03 §3): intake moves the supplier to qualifying and the
application to document review; admission review runs two approvals
(the reviewer, then the srm_procurement_director position) and on
approval qualifies the supplier and grants each applied category;
rejection returns the supplier to potential. The app now requires
automation, triggers and approvals.

Claude-Session: https://claude.ai/code/session_01V33WdUYdE8Qfx121Ngt8Lt
Co-authored-by: Claude <noreply@anthropic.com>
Add the daily srm_certificate_expire_sweep, a catch-up and idempotent
sweep that aligns certificate status with valid_to (expired, expiring
within 30 days, or valid again after renewal), and
srm_supplier_qualification_recalc, which raises or clears the supplier's
qualification_alert whenever a certificate's status or mandatory flag
changes (design 03 §11, FR-902). Notifications and SQE verification
gating are deferred to the portal version, as noted in design 03.

Claude-Session: https://claude.ai/code/session_01V33WdUYdE8Qfx121Ngt8Lt
Co-authored-by: Claude <noreply@anthropic.com>
Add the v0.1 subset of design 04 §2: five positions (procurement
director, category manager, buyer, SQE, SRM admin) and five permission
sets (internal base, supplier admin, quality, executive, admin), none of
them default. Flow-owned status fields are read-only in every set. Tests
cover read-only buyers, category managers registering suppliers and
applying for admission, and the status field being closed to direct
edits.

Claude-Session: https://claude.ai/code/session_01V33WdUYdE8Qfx121Ngt8Lt
Co-authored-by: Claude <noreply@anthropic.com>
@marchtian marchtian changed the title feat(core): v0.1 app skeleton, CI and supplier master data feat(core): hotsrm v0.1 — internal workbench for supplier master data, admission and qualification alerts Oct 23, 2026
Without them the stack boots but scheduled flows, notifications and
field history (trackHistory) silently do nothing. Also note in the
README that scheduled flows need OS_AUTOMATION_SCHEDULED_WORK_ENABLED,
which the platform turns off by default.

Claude-Session: https://claude.ai/code/session_01V33WdUYdE8Qfx121Ngt8Lt
Co-authored-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V33WdUYdE8Qfx121Ngt8Lt
Seeds replay on every boot; upsert reset a seeded supplier's status back to
potential after it had been approved. Use ignore so seeds only fill gaps.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V33WdUYdE8Qfx121Ngt8Lt
@marchtian
marchtian merged commit 10f2477 into main Oct 23, 2026
2 checks passed
marchtian pushed a commit that referenced this pull request Oct 23, 2026
Resolve README, 02 and 07 against the 2026-10-23 route: keep the
v0.1–v0.7 table, drop the superseded 07 §1.1 split (portal at v0.2,
sourcing at v0.3), keep the v0.1 subset notes from #5 with versions
re-pointed.

Claude-Session: https://claude.ai/code/session_011FUtVGdJNj6NEXtstKJDNQ
Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants