Skip to content

feat(revenue): hide Mark Presented, Reject and Revise while a quote discount approval is pending (#2850) - #2861

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-2850-hide-pending-quote-actions
Nov 29, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-2850-hide-pending-quote-actions

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #2850

Metadata-impact: reviewer
Clause-②: no
Metadata-protocol: none

维护者速读

  • 销售代表在报价单记录页上:折扣审批“待审批”期间,“标记为已提交”“拒绝”“修订”三个按钮不再显示;审批结束后照常显示。
  • 属于报价折扣审批(上一张卡已上线的审批锁)的配套体验:提交人不再看到点了必被拒的按钮。
  • 若出错,最坏是按钮该显示时没显示或反之;真正的拦截仍是审批锁,未改动,可直接撤回本 PR。
  • 无

What changes

  • src/revenue/actions/quote.actions.ts: Mark Presented, Reject and Revise each gain one total term on their visible predicate, (!has(record.discount_approval_status) || record.discount_approval_status != "pending"), so they are hidden while Discount Approval reads Pending and offered otherwise (an absent verdict counts as not pending). The header comment says the hiding is the courtesy half and the approval lock is the control. This is the code PR feat(revenue): a quote discounted above 30% goes to a sales manager for approval (#2751) #2848 carried before its L1 round (72326bed), unchanged on today's main.
  • The action key is visible: the platform Action schema has no action-level visibleWhen (that key exists only on param options), so the card's "visibleWhen" is read as this predicate.
  • Docs: content/docs/(product)/sales/quotes.mdx (+ .zh-Hans, .zh-Hant), the in-app Revenue manual src/revenue/docs/crm_revenue_quotes.md (+ .zh.md) and REQ-0013 now say the three are not shown while Pending and are refused if called (through the API, for instance).
  • New changeset .changeset/2850-hide-pending-quote-actions.md (patch). The unreleased [decision] 报价「提交审核」没有审核人:状态变成审核中,但没人审批、自己就能放行、审核期间还能改价 #2751 changeset is left as is: its "are refused" stays true, and the new note adds the hiding.

Tests

  • test/quote-discount-approval.test.ts: the existing it.each that the submitter's Mark Presented, Reject and Revise are refused RECORD_LOCKED through the action door while Pending is unchanged. A new case evaluates each action's visible the way the console does over every verdict the field declares (read off the object: not_required, pending, approved, rejected) plus an absent one: hidden only for pending.
  • Ablation: removing the new term from Mark Presented on disk turned the new case red (mark_quote_presented / pending: expected true to be false), then restored.

Acceptance notes

  • No permission set, sharing rule or field changed; the refusal still comes from the approval's record lock.

Verification

Two-minute check: pnpm exec vitest run test/quote-discount-approval.test.ts -t "does not offer" shows 1 passed.

Read first: src/revenue/actions/quote.actions.ts (the three visible lines), then test/quote-discount-approval.test.ts (the new case).

Local gates on 4fca576
  • pnpm validate exit 0, ✓ Validation passed
  • pnpm typecheck exit 0
  • pnpm lint (os lint --strict) exit 0, 54 suggestions, 0 warnings
  • pnpm hygiene exit 0, ✓ source hygiene clean
  • vitest run test/quote-discount-approval.test.ts test/quote-lifecycle-actions.test.ts test/docs-drift.test.ts test/docs-lifecycle-diagrams.test.ts: Test Files 4 passed (4), Tests 73 passed (73)

Generated by Claude Code

… discount approval is pending (#2850)

Each action's `visible` gains a total term on `discount_approval_status`
that hides it while the verdict is Pending. The approval's record lock stays
the control and is still pinned through the action door; the new test pins
the visibility over every declared verdict plus an absent one. Docs (en,
zh-Hans, zh-Hant), the in-app Revenue manual (en, zh) and REQ-0013 say the
three are hidden while Pending and refused if called.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xRBcV3h25dAMNWki8e1ns
@vercel

vercel Bot commented Nov 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
hotcrm Ignored Ignored Nov 29, 2026 1:26pm UTC

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation ci/cd CI plumbing and the verification pipeline backend Server-side behaviour — hooks, flows, actions labels Nov 29, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:hotcrm#2 · sunhaolin · session_017xRBcV3h25dAMNWki8e1ns

维护者速读

  • 报价折扣审批进行中时,「标记已提交」「拒绝」「修订」三个按钮不再显示;审批结束(通过、驳回或撤回)后照常出现。
  • 真正的拦截仍是平台行锁:就算通过接口强行调用,审批中也会被拒绝,这条测试原样保留。
  • 这是 feat(revenue): a quote discounted above 30% goes to a sales manager for approval (#2751) #2848 拆出来的「体验那一半」,独立评审通过,CI 全绿。
  • 席位意见:可以落地。

席位核对 — ACCEPT · repo:hotcrm#2 · head 4fca576

  1. Shape.
    • One extra term on each of three actions' visible predicate: (!has(record.discount_approval_status) || record.discount_approval_status != "pending").
    • One new test, plus docs in 3 locales, the in-app manual, REQ-0013 and a changeset.
    • 9 files, all on the claimed surface. No governed path (get_files read by the seat). Reviewer class.
  2. Premise measured.
    • @objectstack/spec@19.0.0-next.2's ActionSchema has visible at top level. visibleWhen exists only under params[].options[], so visible is the right key (L1).
    • The option value is 'pending' (quote.object.ts:364).
    • The predicate is total: a missing status and a null status both show the actions (L1 probed it).
  3. Gate check-runs on 4fca5766. 19 of 19 succeed, read by the seat.
  4. Accepted deviations.
    • The RECORD_LOCKED test is unchanged; only its comment moved.
    • Ablations by the dev and by L1 each turn the new test red.
    • Nit, left as is: the changeset carries a Metadata-impact: line, which customerText() does not strip. Two changesets on main do the same; this is noted for the release seat.
    • Nit, left as is: the new test drives only in_review.
  5. Out of scope. None. Skills-docs: not owed.
  6. Landing. Reviewer class. The seat marks it ready, turns on auto-merge, and the merge queue squashes it. Fixes #2850.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 29, 2026 13:35
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit 62c5e24 Nov 29, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Server-side behaviour — hooks, flows, actions ci/cd CI plumbing and the verification pipeline documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quote: hide Mark Presented, Reject and Revise while the discount approval is Pending (the courtesy half split out of PR #2848)

2 participants