Skip to content

fix(client/requests): hide draft quotes from the client-facing detail page#45

Open
AntoinePoindron wants to merge 1 commit intomainfrom
fix/client-hides-draft-quotes
Open

fix(client/requests): hide draft quotes from the client-facing detail page#45
AntoinePoindron wants to merge 1 commit intomainfrom
fix/client-hides-draft-quotes

Conversation

@AntoinePoindron
Copy link
Copy Markdown
Collaborator

Summary

A draft quote (the caterer's work-in-progress before they hit Envoyer) was leaking onto the client's /client/requests/<id> page — visible as a card with a "Brouillon" badge, complete with pricing and the caterer's identity. Filter it at the DB level so the row never reaches the template.

Reported by @AntoinePoindron with a screenshot showing a draft quote among the received list. Fix validated end-to-end manually before opening this PR.

What changed

  • blueprints/client/requests.py::request_detail adds Quote.status != QuoteStatus.draft to the SELECT. The companion display helpers (_derive_request_display_status, _request_quote_counts) already exclude drafts via _QUOTE_RECEIVED_STATUSES, so the count badges and tab buckets stay correct without further changes.

What is NOT changed

Test plan

  • 198 existing tests pass.
  • Manually validated by user: the "Brouillon" card on /client/requests/<id> disappears once the route is filtered, and the Devis reçu(s) count + tab bucketing still match the visible quotes.
  • Once merged: smoke on staging — confirm a real draft from a caterer never surfaces to its company.

🤖 Generated with Claude Code

… page

Drafts are caterer-only — they're work-in-progress quotes the
caterer hasn't sent yet. Surfacing them on the client side leaks
pricing + caterer identity before the caterer is ready to commit
(and the client sees a "Brouillon" badge they shouldn't even know
exists).

Filter at the DB level — `select(Quote).where(Quote.status !=
QuoteStatus.draft)` — so the row never reaches a Jinja context.
Templates aren't touched.

The companion route `client.quote_pdf` (PR #44) gets the same
filter in its own branch.

Co-Authored-By: Claude Opus 4.7 (1M context) <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.

1 participant