Repository navigation
feat(revenue): hide Mark Presented, Reject and Revise while a quote discount approval is pending (#2850) - #2861
Merged
objectstack-fleet[bot] merged 1 commit intoNov 29, 2026
Conversation
… 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
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Author
|
repo:hotcrm#2 · sunhaolin · session_017xRBcV3h25dAMNWki8e1ns 维护者速读
席位核对 — ACCEPT · repo:hotcrm#2 · head 4fca576
|
This was referenced Nov 29, 2026
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.
Fixes #2850
Metadata-impact: reviewer
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
src/revenue/actions/quote.actions.ts: Mark Presented, Reject and Revise each gain one total term on theirvisiblepredicate,(!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.visible: the platformActionschema has no action-levelvisibleWhen(that key exists only on param options), so the card's "visibleWhen" is read as this predicate.content/docs/(product)/sales/quotes.mdx(+.zh-Hans,.zh-Hant), the in-app Revenue manualsrc/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)..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 existingit.eachthat the submitter's Mark Presented, Reject and Revise are refusedRECORD_LOCKEDthrough the action door while Pending is unchanged. A new case evaluates each action'svisiblethe 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.mark_quote_presented / pending: expected true to be false), then restored.Acceptance notes
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 threevisiblelines), thentest/quote-discount-approval.test.ts(the new case).Local gates on 4fca576
pnpm validateexit 0,✓ Validation passedpnpm typecheckexit 0pnpm lint(os lint --strict) exit 0, 54 suggestions, 0 warningspnpm hygieneexit 0,✓ source hygiene cleanvitest 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