Commit Graph
23 Commits
Author SHA1 Message Date
Gildas GarciaandAlaister Young 737b8595f2 Update API types (#50234)
## Problem

platform, v1 and v2 have been already completely migrated and introduced
some changes.

Some types have been renamed, some outputs and inputs updated.

## Solution

- Update the API types
- Fix the TS errors

## Update

Taking this over to unblock #50134, which needs the new scoped token
permission ids from the regenerated types.

- Merged `master`.
- Regenerated `api-v2.d.ts` from the production spec. The previous files
came from a local API that exposed a webhook events endpoint production
doesn't have yet. Production has since added standardized 400 error
responses on the v2 organization endpoints. `api-v1.d.ts` and
`platform.d.ts` already matched production.
- Fixed `verify-production-types`. It formatted the regenerated files in
a temp directory outside the repository, so Prettier fell back to its
defaults and the comparison could never match the committed files. It
now passes the repository config explicitly. `pnpm api:verify-types`
passes on this branch.
- Verified locally: `pnpm typecheck`, `pnpm api:verify-types`, Studio
unit tests.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Preserved descriptions when saving, sharing, moving, or unsharing
notebooks, reports, SQL snippets, and saved queries.
* Improved handling of empty or null values across notebook
descriptions, billing usage, pooler settings, and infrastructure fields.
* Improved read-replica connection handling, including read-only
connection strings.
* Updated storage configuration and capability handling to match current
settings.

* **API and Compatibility**
* Updated organization, project, storage, OAuth, billing, and
infrastructure data handling to match current API responses.
  * OAuth app creation and updates now require scopes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-09-11 12:17:49 +08:00
Ignacio DobronichandJoshen Lim 35478cf47b feat: expose tax in upcoming invoice (#44732)
Display tax information in the upcoming invoice breakdown.
- Show a "Tax" line item with amount and rate tooltip when tax is
successfully calculated
- Show a warning row when tax estimation fails, prompting users to
verify their billing address
- Update Current Costs and Projected Costs tooltips to indicate whether
tax is included or could not be estimated

## Test plan

- [ ]  Verify tax row appears with correct amount
when `tax_status` is `calculated`
- [ ]  Verify tax rate percentage shows in the tooltip (e.g., "Estimated
tax at 10%...")
- [ ]  Verify warning row appears when `tax_status` is `failed`
- [ ]  Verify no tax row appears when `tax_status` is `not_applicable`
- [ ]  Verify "Applicable tax included." appears in Current/Projected
Costs tooltips when tax is calculated
- [ ]  Verify "Tax could not be estimated and is not included." appears
in tooltips when tax fails

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
  * Upcoming invoices now include tax details and a tax status.
* Billing breakdown shows projected tax and conditionally displays
projected totals excluding tax when applicable.
* If tax estimation fails, a “Tax — Could not be estimated” row appears
and totals reflect the failure.
* Added "Stripe Projects" as a billing partner option and clarified that
projected amounts may be explicitly null.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-04-15 12:34:28 -03:00
Charis 3b7052b5a9 cleanup: fix import order and prefixes for studio/data (#44501) 2026-04-03 09:15:57 +02:00
Kanishk Dudeja 1e56ec7edd feat(billing): UI to download Orb receipts (#42083)
### Summary

This PR adds the ability to download payment receipts for paid Orb
invoices from the billing invoices page.

This depends on the backend PR that adds the receipt download endpoint.

### UI screenshot

The receipt button only appears for invoices with `status === 'paid'`.

<img width="738" height="276" alt="Screenshot 2026-01-22 at 8 53 06 PM"
src="https://github.com/user-attachments/assets/e4fa3f5f-0222-4787-9c7d-96ae99346808"
/>

### Testing

#### Manual testing

1. Navigate to Organization Settings → Billing → Invoices
2. Find a paid invoice in the list
3. Click the receipt icon button
4. Verify receipt PDF opens in new tab
5. Try with an unpaid invoice - button should not appear
6. Try invoice that has no receipt (paid with credit balance) → error
toast with "Receipt not available"

### Alternative design choices

#### Alternative option 1

<img width="712" height="266" alt="Screenshot 2026-01-22 at 8 46 24 PM"
src="https://github.com/user-attachments/assets/2eb7333c-cb19-4e6d-b495-72c43fb26475"
/>

#### Alternative option 2

<img width="723" height="264" alt="Screenshot 2026-01-22 at 8 56 30 PM"
src="https://github.com/user-attachments/assets/34b917b6-fc8c-4398-b372-ff467920fe69"
/>

#### Alternative option 3

<img width="702" height="265" alt="Screenshot 2026-01-22 at 8 47 58 PM"
src="https://github.com/user-attachments/assets/b3e15b1c-a804-4df9-981e-1ec578d7e4fe"
/>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

* **New Features**
* Added invoice receipt viewing and download functionality. Paid
invoices with outstanding amounts now include a Receipt action, enabling
users to access detailed payment documentation through the billing
interface. Error handling ensures a seamless experience when retrieving
receipts.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-05 16:09:08 +05:30
Ivan Vasilov 8b657165b5 chore: Migrate to use custom type for ReactQuery queries and mutations (#40073)
* Add custom types for queries, mutations and infinite queries.

* Migrate all queries to use the new type.

* Migrate all infinite queries to useCustomInfiniteQueryOptions.

* Migrate all mutations to use useCustomMutationOptions.

* Add type to all imports in `types` folder.
2025-11-03 13:18:13 +01:00
Ivan Vasilov da4a40e308 chore: Migrate RQ functions to use object syntax style (#39895)
* Migrate all uses of invalidateQueries to use object syntax.

* Migrate the remainder of useInfiniteQuery.

* Migrate all setQueriesData.

* Migrate all fetchQuery uses.

* Migrate some leftover functions from RQ.

* Fix issues found by Charis.
2025-10-28 10:43:14 +01:00
Alaister YoungandJoshen Lim 8855d05803 chore(studio): swap react-query to object syntax (#39842)
* chore(studio): swap react-query to object syntax

* Fix small issues found

* Fix realtime settings

* Nit

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-10-27 09:38:27 +01:00
Kevin Grüneberg 15c9a6ced3 perf: pass org slug / project ref to resource warnings endpoint (#39471)
Based on https://github.com/supabase/infrastructure/pull/26483 - pass in project ref / org slug to ensure we filter down and not query across all orgs unnecessarily
2025-10-14 18:27:34 +08:00
Ivan Vasilov b93e9dfe0a chore: Only fetch overdue invoices if the user is logged in (#35545)
* Only fetch overdue invoices if the user is logged in.

* Remove ProjectList case.

* Move the check in the query. Use isLoggedIn.
2025-05-08 10:05:02 +02:00
Kevin Grüneberg 12ba4da4a5 feat: groundwork for larger instance sizes (#35373) 2025-05-02 15:45:03 +07:00
Kevin Grüneberg 3ce7e400a1 feat: revamped invoice breakdown (#34861)
- Read Replica and Branching Compute is now explicitly listed (previously Read Replica compute was not distinguishable)
- All usage items have a link to their respective docs
- Branching Compute is aggregated into a single line item to avoid listing dozens of branches (they are listed in the tooltip still)
- Displays basic discounts with a strike-through price
- For Replica+Compute, it specifically lists the projects as sub line items, whereas other line items are not broken down, it's shown on the tooltip
- Compute credits are a sub line item under compute, rather than having it separate 
- Pricing is displayed on the tooltip
- Breakdown focuses on costs, rather than mixing cost, usage and line item pricing descriptions
- Avoid confusing users in the breakdown with hourly usage (for add-ons)
- Fixed number formatting to properly work with negative number and 0 (use 2 decimals)
- Upcoming Invoice Section is hidden for Free Plan users
2025-04-11 12:40:59 +08:00
Kevin Grüneberg 2ab40e48fd chore: increase stale times for a few common queries (#34643) 2025-04-02 13:57:36 +08:00
Alaister Young 8c72360707 chore: update invoice pay now redirect (#30565) 2024-11-22 12:07:50 +08:00
Joshen Lim b5daa7e0e6 chore: prevent deploying new replicas with outstanding invoices (#29682) 2024-10-09 16:48:42 +08:00
Kevin Grüneberg f6fe8238d8 chore: switch to new slug based invoice endpoints (#26693) 2024-05-23 18:51:31 +08:00
Joshen LimandIvan Vasilov 163263c3c5 First round of wrapping RQ errors with handleError (#26384)
* First round of wrapping RQ errors with handleError

* Remove the throw before the handleError usage.

* Make the handling of an API error more versatile. Add logging in Sentry if the error is of unknown type.

* Remove throwing of the handleError function.

* Add return type to the handleError function to be never so that we're sure it always throws.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-05-17 16:30:55 +08:00
Kevin Grüneberg f9a55935f5 chore: use type imports for types/interfaces (#21738) 2024-03-04 20:48:22 +08:00
ThomasandKevin Grüneberg 43cc703ce8 Improve Billing Breakdown section (#20498)
* Displays current costs

* Displays Compute Credits

* Adds tooltips for Compute Hours, Compute Credits, Current Costs and Projected Costs

* Formats amounts properly

---------

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
2024-01-22 13:18:51 +01:00
1fb755bfc7 chore: use data/fetchers and API spec (#20196)
* chore: use data/fetchers and API spec

* Remove unused imports

---------

Co-authored-by: Thomas Eckl <31189692+ecktoteckto@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-01-08 14:39:32 +08:00
Kevin Grüneberg c1dda1b66a feat: project breakdown for subscription preview (#19410) 2023-12-05 11:39:53 +01:00
Kevin Grüneberg 8a70f199de feat: better insights for upcoming invoice (#19409) 2023-12-05 11:10:53 +01:00
Kevin Grüneberg 598c1ef866 chore: remove unused billing page/queries (#19412) 2023-12-04 15:54:57 +01:00
Ivan Vasilov 436bdb10ae chore: Move the studio app to apps/studio (#18915)
* Move all studio files from /studio to /apps/studio.

* Move studio specific prettier ignores.

* Fix the ui references from studio.

* Fix the css imports.

* Fix all package.json issues.

* Fix the prettier setup for the studio app.

* Add .turbo folder to prettierignore.

* Fix the github workflows.
2023-11-15 12:38:55 +01:00