feat: show DueInvoiceBanner to all team/org members when invoiceUrl is mailto#28670
Draft
sean-brydon wants to merge 2 commits intomainfrom
Draft
feat: show DueInvoiceBanner to all team/org members when invoiceUrl is mailto#28670sean-brydon wants to merge 2 commits intomainfrom
sean-brydon wants to merge 2 commits intomainfrom
Conversation
…s a mailto link Co-Authored-By: sean@cal.com <Sean@brydon.io>
Co-Authored-By: sean@cal.com <Sean@brydon.io>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
What does this PR do?
When a team/org dunning record has a
mailto:link as itsinvoiceUrl(i.e. not a Stripe payment URL), theDueInvoiceBanneris now shown to every member of that team/org — not just users with billing permission.Previously: Only ADMIN/OWNER users with
manageBillingpermission saw the due invoice banner.Now: The existing behavior is preserved for Stripe invoice URLs. Additionally, for
mailto:invoice URLs, all accepted team/org members will also see the banner so they are aware of the outstanding invoice.Implementation
In
DueInvoiceService.getBannerDataForUser:invoiceUrlstarts withmailto:Also migrated the proration queries from
includetoselectper project conventions.Important Review Points
findAllMemberTeamIdshelper intentionally queries ALL memberships (no role filter) — this is needed so regular MEMBER-role users see the mailto bannersif (teamsWithBillingPermission.length === 0) return []was removed so users with no billing permission can still see mailto-based bannersinvoiceUrl: { startsWith: "mailto:" }Prisma filter is the gating mechanism that limits which prorations non-billing members can seeMandatory Tasks (DO NOT REMOVE)
How should this be tested?
MonthlyProrationrecord that hasstatus: "INVOICE_CREATED"andinvoiceUrlset to amailto:link (e.g.mailto:billing@org.com)invoiceUrl, non-billing members still do NOT see the banner (existing behavior preserved)Checklist
Link to Devin session: https://app.devin.ai/sessions/b745fa9d22fc439ab38bade8514d4af8
Requested by: @sean-brydon