stack/apps/e2e/tests/backend/endpoints/api/v1
Aman Ganapathy 1de8a17183
Payments bulldozer txn rework (#1315)
### Object of this PR
This PR is NOT a monolithic series of fixes for the payments suite + a
complete rework. Its aims were
a) introducing and robustly testing the bulldozer db system 
b) reworking the payments underlying architecture to use bulldozer for
correctness and scalability
c) Achieving parity with the old payments system excepting a few changes
like ensuring correctness of the ledger algo
There may still be some work to do with handling refunds, decoupling the
concepts of purchases from that of products, and some other things.

### Ledger Algorithm
This has been tuned and fixed. Item removals i.e negative item quantity
changes will apply to the soonest expiring item grant i.e positive item
quantity change. This is what is best for the user. Item grants can also
expire, and when they expire we obviate whatever is left of their
original capacity (meaning after all the removals that were applied to
it). Our ledger algo is applied via Bulldozer, so automatic
re-computation is handled when a new grant/ removal is inserted in the
middle of the existing ones.

### Things we got rid of 
* No more automatic support for default products. You can use $0 plan
provisions to accomplish the same effect but it's manual
* Negative item quantity changes (i.e item removals) no longer can have
expiries



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

* **New Features**
* Enhanced payment processing pipeline with improved data consistency
and state management.
  * Advanced refund handling with comprehensive transaction tracking.
* Better tracking and management of customer item quantities and owned
products.
* Improved subscription lifecycle management including period-end
handling.

* **Bug Fixes**
  * Fixed payment data integrity verification.
  * Improved handling of edge cases in refund scenarios.

* **Chores**
  * Updated cSpell configuration with additional words.
  * Expanded developer documentation for linting workflows.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Konstantin Wohlwend <n2d4xc@gmail.com>
Co-authored-by: Aadesh Kheria <kheriaaadesh@gmail.com>
Co-authored-by: Mantra <87142457+mantrakp04@users.noreply.github.com>
2026-04-17 22:11:21 +00:00
..
__snapshots__ Overview revamp (#1238) 2026-04-15 09:36:00 -07:00
auth feat: add anonRefreshToken to CLI auth flow and enhance session management (#1303) 2026-04-14 02:09:35 +00:00
contact-channels Sign up rules (#1138) 2026-02-03 11:08:24 -08:00
emails More lenient email processing pause 2026-04-12 15:37:33 -07:00
integrations Add onboarding status to Project model and implement related database… (#1246) 2026-03-13 12:00:40 -07:00
internal Payments bulldozer txn rework (#1315) 2026-04-17 22:11:21 +00:00
payments Payments bulldozer txn rework (#1315) 2026-04-17 22:11:21 +00:00
ai-query.test.ts Overview revamp (#1238) 2026-04-15 09:36:00 -07:00
analytics-config.test.ts Queries view (#1145) 2026-02-16 11:39:21 -08:00
analytics-events-batch.test.ts fix clickhouse surrogate pair bug (#1270) 2026-03-23 10:09:04 -07:00
analytics-events.test.ts clickhouse user sync (#1159) 2026-02-12 16:52:20 -08:00
analytics-query.test.ts clickhouse new syncs and verify-data (#1304) 2026-04-08 14:43:22 -07:00
api-keys.test.ts Email outbox backend (#1030) 2025-12-12 10:26:38 -08:00
auth-flows.test.ts Fix tests 2025-07-16 11:42:25 -07:00
check-feature-support.test.ts More backend endpoint implementations (#126) 2024-07-13 22:04:53 -07:00
connected-accounts.test.ts More connected accounts (#1165) 2026-02-18 15:19:35 -08:00
data-vault.test.ts Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
email-themes.test.ts [Refactor][Feat][Fix] Rework Email Section With New Sent Page, Better Drafts Page, and Settings Page (#1221) 2026-03-11 12:01:36 -07:00
external-db-sync-advanced.test.ts Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
external-db-sync-basics.test.ts Sync engine should ignore missing tenancies 2026-04-09 23:31:21 -07:00
external-db-sync-high-volume.test.ts Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
external-db-sync-race.test.ts Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
external-db-sync-utils.ts clickhouse new syncs and verify-data (#1304) 2026-04-08 14:43:22 -07:00
index.test.ts "Require publishable client key" toggle (#1158) 2026-02-19 10:23:16 -08:00
internal-metrics.test.ts Overview revamp (#1238) 2026-04-15 09:36:00 -07:00
notification-preferences.test.ts Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
oauth-providers.test.ts Fix OAuth provider disablement 2026-02-24 12:43:41 -08:00
project-permission-definitions.test.ts Config DB migration step 2 (#629) 2025-04-29 14:52:45 -07:00
project-permissions.test.ts Add onboarding status to Project model and implement related database… (#1246) 2026-03-13 12:00:40 -07:00
projects.test.ts Add onboarding status to Project model and implement related database… (#1246) 2026-03-13 12:00:40 -07:00
render-email.test.ts [Refactor] [Fix] Email Rendering Pipeline Refactor, Error Handling, and Bug Fixes (#1140) 2026-02-02 17:35:51 -08:00
restricted-users.test.ts Sign up rules (#1138) 2026-02-03 11:08:24 -08:00
risk-scores.test.ts private files n sm build shit (#1276) 2026-03-23 12:31:36 -07:00
send-email.test.ts Email outbox backend (#1030) 2025-12-12 10:26:38 -08:00
session-replays.test.ts analytics replay filters (#1213) 2026-02-24 13:00:45 -08:00
stripe-webhooks.test.ts fix product route access (#1134) 2026-01-27 18:30:14 +00:00
team-invitations.test.ts Payments bulldozer txn rework (#1315) 2026-04-17 22:11:21 +00:00
team-member-profiles.test.ts Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
team-memberships.test.ts Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
team-permission-definitions.test.ts Fix error where deleting a team creator default permission would make the dashboard crash 2025-08-11 17:42:54 -07:00
team-permissions.test.ts Add onboarding status to Project model and implement related database… (#1246) 2026-03-13 12:00:40 -07:00
teams.test.ts Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
token-refresh-events.test.ts Reduce number of token refresh events 2026-01-28 14:56:11 -08:00
unsubscribe-link.test.ts Emails redesign (#1076) 2026-02-16 14:57:17 -08:00
users-primary-email.test.ts Onboarding app & restricted users (#1069) 2026-01-11 17:22:14 -08:00
users.test.ts Add server-side flags for anonymous users 2026-04-03 10:43:34 -07:00