Repository navigation
refactor(contract): move crm_contract and its items from revenue into the app package - #2323
Conversation
…he app package The object, its hook, views, the three contract flows, the payment_terms picklist, the contract seed family, the two contract notification templates and the Contracts navigation entry now live in src/sales/ and register with app.objectstack.hotcrm (module-split-plan item 11). The object name is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAmYwnaiFvuRyfAwh1e
… the move The guide moves from content/docs/revenue/ to content/docs/sales/ in all three languages with its navigation entry and every link. The ownership test, the Sales navigation pins, the seed-family roster and the module-split inventory read the new owner; a changeset records the move. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAmYwnaiFvuRyfAwh1e
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAmYwnaiFvuRyfAwh1e
…adline figure Contracts is the app's own Sales entry now, so it precedes the revenue module's Quotes and Products in all three quick-tour pages. The sales package's business semantics grew by the contract's object, hook and flows: the gate measures 64,038, so the README banner reads ~64k. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAmYwnaiFvuRyfAwh1e
…ct in comments Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAmYwnaiFvuRyfAwh1e
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Upgrade-path reading for #2310 (review round 1). The section below is written to be appended to this PR's Verification section; os-dev.md has the dev write the PR body once, at create, so the seat applies it. Upgrade path: main 1f3f888 to this branch 7c1385f, same databaseOne worktree, one persistent dev database (
What carries the move: on this deployment shape the package registry is built from the artifact at boot, not stored. Generated by Claude Code |
席位核对Verdict: ACCEPT ·
Generated by Claude Code |
Bring in #2323, which moves crm_contract into the app package. Conflicts resolved additively: the revenue module keeps the price book objects, hooks, seed and nav item and drops the contract; the Sales and revenue docs, quick tour, composition seed order and ownership tests carry both. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAjytvJfaG4gci9s7at
Requested by Irene · project thread
Fixes #2310
Clause-②: no
Metadata-protocol: none
维护者速读
crm_contract连同它的 hook、视图、三条流程(到期、续约、激活后交财务)、payment_terms选项列表、合同种子数据、两封合同通知邮件模板和侧边栏的「合同」入口,从 revenue 模块搬进 HotCRM 本体(app.objectstack.hotcrm)。对象名、字段、记录都不变。objectstack.composition.ts(种子与 hook、流程的注册)、src/revenue/index.ts(revenue 不再注册合同)、src/sales/apps/crm.app.ts(合同入口改为本体自己的导航项)。pnpm dev后打开「销售 → 合同」,列表有 4 条演示合同;把一张「已呈送」报价改为「已接受」,合同列表多出一条草稿合同,付款条件随报价带过来。What changes
module-split-plan.mditem 11 (ruled 2026-10-26, decision text in #2309):crm_contractmoves fromapp.objectstack.hotcrm.revenuetoapp.objectstack.hotcrm. Object name unchanged (ADR-0129).src/revenue/objects/contract.{object,hook}.tssrc/sales/objects/src/revenue/views/contract.view.tssrc/sales/views/contract_renewal,contract_expiration,billing_handoff_contract_activatedsrc/revenue/flows/src/sales/flows/(imports now from their own directory)payment_termspicklistsrc/revenue/picklists/(directory retired)src/sales/picklists/;crm_quote.payment_termsnow references it along the revenue -> app edgesrc/revenue/data/revenue.seed.tssrc/sales/data/contract.seed.ts; replay order inCrmSeedDataunchangedcrm.contract_expired,crm.contract_renewalemail templates (4 locales)src/revenue/email-templates/src/sales/email-templates/; revenue keepscrm.quote_creatednav_contractnavigationContributionsgroup_saleschildrencontent/docs/revenue/contracts*content/docs/sales/contracts*, bothmeta*.jsonand every linkRegistration:
appObjects,appPicklists,appViewspick the new exports up from the sales barrels by export name;contractHookjoinsappHooksaftercontactHook(source-file-name order); the three flows joinappFlowsin the order revenue registered them.createHotCrmRevenueStackregisters four objects, no picklist, one flow (quote_expiration), and keepsrequires: ['automation', 'triggers'](measured: droppingtriggersfailspnpm validateonquote_expiration's schedule trigger).Two items the card did not list moved because the repo's own rules require it, not by choice:
test/package-ownership.test.ts's assignment sweep reports a seed family registered by a package that does not own its object;quote_accepted_contract_draftstays insrc/revenue/objects/quote.hook.ts; it now writes along the revenue -> app edge (R1 accepted). The activated-contract counts inaccount.hook.ts/contact.hook.tsare now reads of the app package's own object; the inventory's hand-edit log records them for #2311's ledger.Changeset:
.changeset/2310-contract-in-app-package.md(minor: the contract's owning package and one sidebar position change).Tests
test/package-ownership.test.ts: revenue owns four objects, the app nine; a new case pinscrm_contractandpayment_termsin the app package, no module picklist and no module nav entry oncrm_contract.test/docs-sales-index-navigation.test.ts: authored Sales children end withnav_contract; the served group ends withnav_quote,nav_product.test/saas-composition.test.ts,test/territory-seed-coverage.test.ts,test/seed-replay-user-edits.test.ts: seed family moved and enrolled.test/helpers/composed-stack.ts.test/docs-readme-token-figures.test.ts's docstring row is restated from it. The growth is the contract's object, hook and flows arriving insrc/sales; every ceiling still holds.Acceptance notes
AGENTS.md(tree line and thesrc/revenue/objects/contract.object.tsexample) is a governed path, so this PR leaves it; the stale lines are reported to the seat.docs/architecture/module-split-plan.mddecision 5's revenue object list is amended by item 11 in docs: record the 2026-10-26 split decisions and file REQ-0008 and REQ-0009 #2309. Dated planning documents (docs/architecture/psa-module-plan.md,order-to-cash-module-plan.md,docs/requirements/0002,0007) keep the paths they were written against.docs/architecture/module-split-inventory.json: fivefiles[].pathrows re-pointed, figures left as measured, entry added to$hand_edits.origin/mainat 1f3f888 (chore(deps): upgrade the ObjectStack platform to 18.2.0, translate what it opens, and update the five drifted tests #2322, ObjectStack 18.2.0) before opening;pnpm verifyre-ran on the merged head. No new label class: the moved templates carry all four locales andnav_contractkeeps its existing translations.Verification
Browser, Chromium at /opt/pw-browsers/chromium,
pnpm devon this branch (18.2.0 merged), fresh DB, dev admin, 1440x900. Screenshots are in the project thread (sidebar, contract list, record, activated, drafted).PATCH 200;signed_datestamped 2026-10-27 bycontract_on_activation; outbox rowcrm.contract.activatedenqueued bysend_contract_activated_handoffclosed_won),payment_termsnet_60 carried from the quoteDELETE crm_contactfor John Smith and Robert Wilson: 409DELETE_RESTRICTED, "referenced by 1 active contract"GET /api/v1/packagescrm_contractunderapp.objectstack.hotcrm(9 objects); revenue holds 4contract_renewalandcontract_expirationamong them, as on main)pnpm verify on 7c1385f (shared verify lock)
Generated by Claude Code