feat: add Premium Geo DB addon to project settings#2981
feat: add Premium Geo DB addon to project settings#2981lohanidamodar wants to merge 8 commits intomainfrom
Conversation
Adds a Premium Geo DB section to the project settings page so users can enable and disable the premium geolocation addon per-project on cloud. The section supports the full addon lifecycle: - Upgrade prompt when the current plan does not support the addon - Enable flow with optional 3DS payment authentication - Pending state with cancel & retry option - Active state with disable action - Scheduled-for-removal state with re-enable action Uses the new project-scoped SDK methods: listAddons, createPremiumGeoDBAddon, and deleteAddon. Bumps the @appwrite.io/console SDK pin accordingly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR adds a Premium Geo DB addon section to the project settings page, mirroring the existing BAA pattern at the organization level. The enable modal correctly handles 3DS branching and 409 conflicts; the disable modal and page loader are straightforward. The The per-project addon row label falls back to the bare Confidence Score: 4/5Safe to merge once the 3DS handling gaps in premiumGeoDB.svelte from prior review are confirmed addressed New findings in this round are P2 only (label fallback inconsistency in planSummary.svelte). However, the code in premiumGeoDB.svelte still shows no onMount 3DS-return handler and handleReEnable discards the PaymentAuthentication result — both P1 issues flagged in prior review that appear unresolved in the current diff, keeping the score at 4. src/routes/(console)/project-[region]-[project]/settings/premiumGeoDB.svelte — verify the two 3DS handling gaps from the prior review round are addressed Important Files Changed
Reviews (7): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile |
| async function handleReEnable() { | ||
| reEnabling = true; | ||
| try { | ||
| await sdk.forConsoleIn(page.params.region).projects.createPremiumGeoDBAddon({ | ||
| projectId: page.params.project | ||
| }); | ||
| await Promise.all([invalidate(Dependencies.ADDONS), invalidate(Dependencies.PROJECT)]); | ||
| addNotification({ | ||
| message: 'Premium Geo DB addon has been re-enabled', | ||
| type: 'success' | ||
| }); | ||
| } catch (e) { | ||
| addNotification({ | ||
| message: e.message, | ||
| type: 'error' | ||
| }); | ||
| } finally { | ||
| reEnabling = false; | ||
| } | ||
| } |
There was a problem hiding this comment.
handleReEnable silently drops 3DS response
createPremiumGeoDBAddon can return either a Models.Addon (immediate success) or a Models.PaymentAuthentication (3DS required). handleReEnable discards the return value entirely, so if re-enabling requires 3DS the payment challenge is never initiated — the notification fires as "re-enabled" while the addon actually sits in pending state waiting for a payment that will never complete.
The enable modal handles this correctly via the 'clientSecret' in result check and subsequent confirmPayment call. handleReEnable should mirror that same pattern, exactly as BAA.svelte's handleReEnable does.
Mirrors the BAA addon UX by fetching the addon price via organizations.getAddonPrice(Addon.Premiumgeodb) from the settings page loader, passing it through to the Premium Geo DB card and enable modal, and rendering the monthly/prorated breakdown with formatCurrency alongside the Enable CTA. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…name - Each project row in the organization billing breakdown now iterates its resources for addon_* entries (amount > 0) and renders them as child rows (e.g. Premium Geo DB under the project it was enabled on). The backend already filters project-scoped addons out of the team-level resources response, so the org "Addons" section shows only org-scoped addons (BAA, premiumGeoDBOrg) while project-scoped ones surface where they belong. - Org-level addon labels now read addon.name from the UsageResource payload that the getAggregation endpoint populates from billingAddons config. Dropped the hard-coded billingAddonNames map so new addons surface with their proper name without a console update. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| : addon.name || | ||
| `${addon.resourceId} overage (${formatNum(addon.value)})`, |
There was a problem hiding this comment.
BAA label regression if API omits
name
The hardcoded billingAddonNames map (addon_baa → 'HIPAA BAA') has been removed in favour of addon.name. If the billing-aggregation API response doesn't populate name on existing BAA resources, BAA will display as addon_baa overage (1) in the plan summary for current BAA subscribers. Make sure the cloud API (and the new SDK pin) actually includes name on billing resource objects, or keep a fallback map alongside the API-provided name as a safety net.
…geo-db-addon # Conflicts: # bun.lock # package.json # src/routes/(console)/project-[region]-[project]/settings/+page.svelte
Summary
Adds a Premium Geo DB section to the project settings page so users can enable and disable the premium geolocation addon per-project on cloud.
The section supports the full addon lifecycle, mirroring the BAA pattern at the organization level:
Uses the new project-scoped SDK methods shipped with the cloud update:
listAddons,createPremiumGeoDBAddon, anddeleteAddon. Bumps the@appwrite.io/consoleSDK pin accordingly.Test plan
🤖 Generated with Claude Code