feat(notifications): add auto top-up notification for organization owners#970
Merged
jobrietbergen merged 1 commit intomainfrom Mar 10, 2026
Merged
Conversation
|
|
||
| async function generateAutoTopUpOrgsNotification(user: User): Promise<KiloNotification[]> { | ||
| const orgs = await getUserOrganizationsWithSeats(user.id); | ||
| const isOwnerOrAdmin = orgs.some(org => org.role === 'owner'); |
Contributor
Author
There was a problem hiding this comment.
WARNING: Billing managers are excluded from the org auto-top-up notification
organizationOwnerProcedure allows both owner and billing_manager to configure organization auto top-ups, but this check only matches owner. Billing managers therefore never see the CTA even though they have permission to act on it.
Suggested change
| const isOwnerOrAdmin = orgs.some(org => org.role === 'owner'); | |
| const isOwnerOrAdmin = orgs.some(org => org.role === 'owner' || org.role === 'billing_manager'); |
Contributor
Author
Code Review SummaryStatus: 1 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Other Observations (not in diff)None. Files Reviewed (1 files)
|
jeanduplessis
approved these changes
Mar 10, 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.
Summary
Adds a new
generateAutoTopUpOrgsNotificationnotification generator that promotes the auto top-up feature to organization owners. The notification is only shown to users who have'owner'role in at least one organization, using the existinggetUserOrganizationsWithSeatsfunction to check membership roles. Wired into the existinggenerateUserNotificationsaggregation alongside the other conditional generators.Verification
pnpm typecheck— passes cleanly, no type errorsVisual Changes
N/A
Reviewer Notes
OrganizationRoletype is'owner' | 'member' | 'billing_manager'— there is no'admin'role in the schema, so the check filters onrole === 'owner'only, which is the admin-equivalent role for organizations.getUserOrganizationsWithSeatsimport already present in the file (used bygenerateAutoTopUpNotificationandgenerateKiloPassNotification).Built for jobrietbergen by Kilo for Slack