mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
### 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>
184 lines
4.5 KiB
JSON
184 lines
4.5 KiB
JSON
{
|
||
"eslint.workingDirectories": [
|
||
{
|
||
"mode": "auto"
|
||
}
|
||
],
|
||
"typescript.tsdk": "node_modules/typescript/lib",
|
||
"editor.tabSize": 2,
|
||
"cSpell.words": [
|
||
"autoupdate",
|
||
"backlinks",
|
||
"Cancelation",
|
||
"Cdfc",
|
||
"checksummable",
|
||
"chinthakagodawita",
|
||
"Ciphertext",
|
||
"cjsx",
|
||
"Clickhouse",
|
||
"clsx",
|
||
"cmdk",
|
||
"codegen",
|
||
"crockford",
|
||
"Crudl",
|
||
"ctsx",
|
||
"datapoints",
|
||
"dbgenerated",
|
||
"deindent",
|
||
"Deindentable",
|
||
"deindented",
|
||
"doesntexist",
|
||
"EAUTH",
|
||
"EDNS",
|
||
"EENVELOPE",
|
||
"Elems",
|
||
"Emailable",
|
||
"EMESSAGE",
|
||
"Falsey",
|
||
"Featurebase",
|
||
"fkey",
|
||
"frontends",
|
||
"geoip",
|
||
"glassmorphic",
|
||
"healthcheck",
|
||
"hookform",
|
||
"hostable",
|
||
"INBUCKET",
|
||
"ipcountry",
|
||
"Jwks",
|
||
"JWTs",
|
||
"katex",
|
||
"localstack",
|
||
"ltree",
|
||
"lucide",
|
||
"Luma",
|
||
"midfix",
|
||
"Millis",
|
||
"mjsx",
|
||
"mtsx",
|
||
"neondatabase",
|
||
"nextjs",
|
||
"Nicifiable",
|
||
"nicification",
|
||
"nicified",
|
||
"nicify",
|
||
"oidc",
|
||
"onnotice",
|
||
"openapi",
|
||
"opentelemetry",
|
||
"otel",
|
||
"otlp",
|
||
"pageleave",
|
||
"pageview",
|
||
"pg_isready",
|
||
"pkcco",
|
||
"PKCE",
|
||
"pkey",
|
||
"pooler",
|
||
"posthog",
|
||
"preconfigured",
|
||
"Prefetcher",
|
||
"Prefetchers",
|
||
"Proxied",
|
||
"psql",
|
||
"pushable",
|
||
"qrcode",
|
||
"QSTASH",
|
||
"quetzallabs",
|
||
"rehype",
|
||
"reqs",
|
||
"retryable",
|
||
"RPID",
|
||
"simplewebauthn",
|
||
"sparkline",
|
||
"spoofable",
|
||
"stackable",
|
||
"stackauth",
|
||
"stackframe",
|
||
"sucky",
|
||
"supabase",
|
||
"Svix",
|
||
"swapy",
|
||
"tailwindcss",
|
||
"tanstack",
|
||
"totp",
|
||
"tsdown",
|
||
"typecheck",
|
||
"typehack",
|
||
"Uncapitalize",
|
||
"unhashed",
|
||
"unindexed",
|
||
"Unmigrated",
|
||
"unsubscribers",
|
||
"upsert",
|
||
"upserted",
|
||
"Upvotes",
|
||
"upvoting",
|
||
"webapi",
|
||
"webauthn",
|
||
"Whitespaces",
|
||
"wolfgunblood",
|
||
"xact",
|
||
"zustand"
|
||
],
|
||
"editor.codeActionsOnSave": {
|
||
"source.fixAll.eslint": "explicit",
|
||
"source.organizeImports": "explicit"
|
||
},
|
||
"terminal.integrated.wordSeparators": " (){}',\"`─‘’“”|",
|
||
"editor.formatOnSave": false,
|
||
"[prisma]": {
|
||
"editor.formatOnSave": true,
|
||
},
|
||
"prettier.enable": false,
|
||
"debug.javascript.autoAttachSmartPattern": [
|
||
"${workspaceFolder}/**",
|
||
"!**/node_modules/**",
|
||
"**/$KNOWN_TOOLS$/**",
|
||
"**/start-server.js",
|
||
"**/turbo/**"
|
||
],
|
||
"files.insertFinalNewline": true,
|
||
"highlight.regexes": {
|
||
"(import\\.meta\\.vitest\\?\\.test\\()[\"'`]([^\"'`]*)(.*)": [
|
||
{
|
||
"isWholeLine": true,
|
||
"before": {
|
||
"contentText": "test> ",
|
||
"color": "#008080",
|
||
"fontStyle": "italic"
|
||
},
|
||
}
|
||
],
|
||
"((?<=(?:import\\.meta\\.vitest\\?\\.test\\(.*\\n)(?:(?!(\\n\\}?\\);))[\\s\\S])*))\\n": [
|
||
{
|
||
"isWholeLine": true,
|
||
"before": {
|
||
"contentText": " ",
|
||
"color": "#008080",
|
||
"fontStyle": "italic"
|
||
},
|
||
},
|
||
],
|
||
"(import\\.meta\\.vitest\\?\\.test\\([\\s\\S]*?(\\n\\}?\\);))": [
|
||
{},
|
||
{
|
||
"isWholeLine": true,
|
||
"before": {
|
||
"contentText": " ",
|
||
"color": "#008080",
|
||
"fontStyle": "italic"
|
||
},
|
||
},
|
||
],
|
||
// disable the default TODO highlighting
|
||
"((?:<!-- *)?(?:#|// @|//|./\\*+|<!--|--|\\* @|{!|{{!--|{{!) *TODO(?:\\s*\\([^)]+\\))?:?)((?!\\w)(?: *-->| *\\*/| *!}| *--}}| *}}|(?= *(?:[^:]//|/\\*+|<!--|@|--|{!|{{!--|{{!))|(?: +[^\\n@]*?)(?= *(?:[^:]//|/\\*+|<!--|@|--(?!>)|{!|{{!--|{{!))|(?: +[^@\\n]+)?))": [],
|
||
"((?:<!-- *)?(?:#|// @|//|./\\*+|<!--|--|\\* @|{!|{{!--|{{!) *(?:FIXME|FIX|BUG|UGLY|DEBUG|HACK)(?:\\s*\\([^)]+\\))?:?)((?!\\w)(?: *-->| *\\*/| *!}| *--}}| *}}|(?= *(?:[^:]//|/\\*+|<!--|@|--|{!|{{!--|{{!))|(?: +[^\\n@]*?)(?= *(?:[^:]//|/\\*+|<!--|@|--(?!>)|{!|{{!--|{{!))|(?: +[^@\\n]+)?))": [],
|
||
"((?:<!-- *)?(?:#|// @|//|./\\*+|<!--|--|\\* @|{!|{{!--|{{!) *(?:REVIEW|OPTIMIZE|TSC)(?:\\s*\\([^)]+\\))?:?)((?!\\w)(?: *-->| *\\*/| *!}| *--}}| *}}|(?= *(?:[^:]//|/\\*+|<!--|@|--|{!|{{!--|{{!))|(?: +[^\\n@]*?)(?= *(?:[^:]//|/\\*+|<!--|@|--(?!>)|{!|{{!--|{{!))|(?: +[^@\\n]+)?))": [],
|
||
"((?:<!-- *)?(?:#|// @|//|./\\*+|<!--|--|\\* @|{!|{{!--|{{!) *(?:IDEA)(?:\\s*\\([^)]+\\))?:?)((?!\\w)(?: *-->| *\\*/| *!}| *--}}| *}}|(?= *(?:[^:]//|/\\*+|<!--|@|--|{!|{{!--|{{!))|(?: +[^\\n@]*?)(?= *(?:[^:]//|/\\*+|<!--|@|--(?!>)|{!|{{!--|{{!))|(?: +[^@\\n]+)?))": [],
|
||
},
|
||
"editor.formatOnSaveMode": "file",
|
||
"git.ignoreLimitWarning": true,
|
||
"chatgpt.commentCodeLensEnabled": false
|
||
}
|