@fantastic.dev/better-stripe 0.41.0 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +1 -1
  3. package/dist/client/balanceFundingWorkflow/client.d.ts +172 -0
  4. package/dist/client/balanceFundingWorkflow/client.d.ts.map +1 -0
  5. package/dist/client/balanceFundingWorkflow/client.js +289 -0
  6. package/dist/client/balanceFundingWorkflow/client.js.map +1 -0
  7. package/dist/client/billing/balanceFunding.d.ts +5 -0
  8. package/dist/client/billing/balanceFunding.d.ts.map +1 -1
  9. package/dist/client/billing/balanceFunding.js +30 -0
  10. package/dist/client/billing/balanceFunding.js.map +1 -1
  11. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +1388 -2
  12. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
  13. package/dist/client/connect/payoutExecutionTestHelpers.d.ts +710 -17
  14. package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
  15. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +1420 -34
  16. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
  17. package/dist/client/connect/payoutSyncTestHelpers.d.ts +694 -1
  18. package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
  19. package/dist/client/costRecovery-invoices.d.ts +3 -2
  20. package/dist/client/costRecovery-invoices.d.ts.map +1 -1
  21. package/dist/client/costRecovery-invoices.js +10 -5
  22. package/dist/client/costRecovery-invoices.js.map +1 -1
  23. package/dist/client/costRecovery.d.ts +4 -2
  24. package/dist/client/costRecovery.d.ts.map +1 -1
  25. package/dist/client/costRecovery.js +2 -2
  26. package/dist/client/costRecovery.js.map +1 -1
  27. package/dist/client/index.d.ts +3 -0
  28. package/dist/client/index.d.ts.map +1 -1
  29. package/dist/client/index.js +4 -0
  30. package/dist/client/index.js.map +1 -1
  31. package/dist/client/processingCostReconciliation/client.d.ts +14 -0
  32. package/dist/client/processingCostReconciliation/client.d.ts.map +1 -0
  33. package/dist/client/processingCostReconciliation/client.js +35 -0
  34. package/dist/client/processingCostReconciliation/client.js.map +1 -0
  35. package/dist/client/processingCostReconciliation/contracts.d.ts +172 -0
  36. package/dist/client/processingCostReconciliation/contracts.d.ts.map +1 -0
  37. package/dist/client/processingCostReconciliation/contracts.js +55 -0
  38. package/dist/client/processingCostReconciliation/contracts.js.map +1 -0
  39. package/dist/client/processingCostReconciliation/invoiceFunding.d.ts +15 -0
  40. package/dist/client/processingCostReconciliation/invoiceFunding.d.ts.map +1 -0
  41. package/dist/client/processingCostReconciliation/invoiceFunding.js +195 -0
  42. package/dist/client/processingCostReconciliation/invoiceFunding.js.map +1 -0
  43. package/dist/client/processingCostReconciliation/provider.d.ts +9 -0
  44. package/dist/client/processingCostReconciliation/provider.d.ts.map +1 -0
  45. package/dist/client/processingCostReconciliation/provider.js +148 -0
  46. package/dist/client/processingCostReconciliation/provider.js.map +1 -0
  47. package/dist/client/settlement/processingCostHistory.d.ts +12 -0
  48. package/dist/client/settlement/processingCostHistory.d.ts.map +1 -0
  49. package/dist/client/settlement/processingCostHistory.js +20 -0
  50. package/dist/client/settlement/processingCostHistory.js.map +1 -0
  51. package/dist/client/settlement/processingCosts.d.ts +3 -0
  52. package/dist/client/settlement/processingCosts.d.ts.map +1 -1
  53. package/dist/client/settlement/processingCosts.js +27 -7
  54. package/dist/client/settlement/processingCosts.js.map +1 -1
  55. package/dist/component/_generated/api.d.ts +36 -0
  56. package/dist/component/_generated/api.d.ts.map +1 -1
  57. package/dist/component/_generated/api.js.map +1 -1
  58. package/dist/component/_generated/component.d.ts +988 -0
  59. package/dist/component/_generated/component.d.ts.map +1 -1
  60. package/dist/component/balanceFunding/helpers.d.ts +42 -0
  61. package/dist/component/balanceFunding/helpers.d.ts.map +1 -1
  62. package/dist/component/balanceFunding/internal/actions.d.ts +39 -0
  63. package/dist/component/balanceFunding/internal/actions.d.ts.map +1 -0
  64. package/dist/component/balanceFunding/internal/actions.js +80 -0
  65. package/dist/component/balanceFunding/internal/actions.js.map +1 -0
  66. package/dist/component/balanceFunding/internal/mutations.d.ts +55 -0
  67. package/dist/component/balanceFunding/internal/mutations.d.ts.map +1 -0
  68. package/dist/component/balanceFunding/internal/mutations.js +54 -0
  69. package/dist/component/balanceFunding/internal/mutations.js.map +1 -0
  70. package/dist/component/balanceFunding/internal/queries.d.ts +116 -0
  71. package/dist/component/balanceFunding/internal/queries.d.ts.map +1 -0
  72. package/dist/component/balanceFunding/internal/queries.js +35 -0
  73. package/dist/component/balanceFunding/internal/queries.js.map +1 -0
  74. package/dist/component/balanceFunding/internal/workflow.d.ts +10 -0
  75. package/dist/component/balanceFunding/internal/workflow.d.ts.map +1 -0
  76. package/dist/component/balanceFunding/internal/workflow.js +31 -0
  77. package/dist/component/balanceFunding/internal/workflow.js.map +1 -0
  78. package/dist/component/balanceFunding/lifecycleHandlers.d.ts +126 -0
  79. package/dist/component/balanceFunding/lifecycleHandlers.d.ts.map +1 -1
  80. package/dist/component/balanceFunding/mutations.d.ts +419 -16
  81. package/dist/component/balanceFunding/mutations.d.ts.map +1 -1
  82. package/dist/component/balanceFunding/mutations.js +24 -0
  83. package/dist/component/balanceFunding/mutations.js.map +1 -1
  84. package/dist/component/balanceFunding/preparationHandlers.d.ts +42 -0
  85. package/dist/component/balanceFunding/preparationHandlers.d.ts.map +1 -1
  86. package/dist/component/balanceFunding/queries.d.ts +78 -0
  87. package/dist/component/balanceFunding/queries.d.ts.map +1 -1
  88. package/dist/component/balanceFunding/queries.js +35 -0
  89. package/dist/component/balanceFunding/queries.js.map +1 -1
  90. package/dist/component/balanceFunding/receipt.d.ts +5 -0
  91. package/dist/component/balanceFunding/receipt.d.ts.map +1 -0
  92. package/dist/component/balanceFunding/receipt.js +37 -0
  93. package/dist/component/balanceFunding/receipt.js.map +1 -0
  94. package/dist/component/balanceFunding/schema.d.ts +506 -2
  95. package/dist/component/balanceFunding/schema.d.ts.map +1 -1
  96. package/dist/component/balanceFunding/schema.js +2 -0
  97. package/dist/component/balanceFunding/schema.js.map +1 -1
  98. package/dist/component/balanceFunding/stateHandlers.d.ts +42 -0
  99. package/dist/component/balanceFunding/stateHandlers.d.ts.map +1 -1
  100. package/dist/component/balanceFunding/workflowControl.d.ts +19 -0
  101. package/dist/component/balanceFunding/workflowControl.d.ts.map +1 -0
  102. package/dist/component/balanceFunding/workflowControl.js +149 -0
  103. package/dist/component/balanceFunding/workflowControl.js.map +1 -0
  104. package/dist/component/balanceFunding/workflowSchema.d.ts +356 -0
  105. package/dist/component/balanceFunding/workflowSchema.d.ts.map +1 -0
  106. package/dist/component/balanceFunding/workflowSchema.js +48 -0
  107. package/dist/component/balanceFunding/workflowSchema.js.map +1 -0
  108. package/dist/component/balanceFunding/workflowState.d.ts +157 -0
  109. package/dist/component/balanceFunding/workflowState.d.ts.map +1 -0
  110. package/dist/component/balanceFunding/workflowState.js +194 -0
  111. package/dist/component/balanceFunding/workflowState.js.map +1 -0
  112. package/dist/component/balanceFunding/workflowValidators.d.ts +306 -0
  113. package/dist/component/balanceFunding/workflowValidators.d.ts.map +1 -0
  114. package/dist/component/balanceFunding/workflowValidators.js +27 -0
  115. package/dist/component/balanceFunding/workflowValidators.js.map +1 -0
  116. package/dist/component/earnings/triggers.d.ts +388 -2
  117. package/dist/component/earnings/triggers.d.ts.map +1 -1
  118. package/dist/component/payoutRelease/queries.d.ts +2 -2
  119. package/dist/component/payoutRelease/queries.d.ts.map +1 -1
  120. package/dist/component/processingCostReconciliation/adoption.d.ts +29 -0
  121. package/dist/component/processingCostReconciliation/adoption.d.ts.map +1 -0
  122. package/dist/component/processingCostReconciliation/adoption.js +58 -0
  123. package/dist/component/processingCostReconciliation/adoption.js.map +1 -0
  124. package/dist/component/processingCostReconciliation/bridge.d.ts +45 -0
  125. package/dist/component/processingCostReconciliation/bridge.d.ts.map +1 -0
  126. package/dist/component/processingCostReconciliation/bridge.js +41 -0
  127. package/dist/component/processingCostReconciliation/bridge.js.map +1 -0
  128. package/dist/component/processingCostReconciliation/helpers.d.ts +327 -0
  129. package/dist/component/processingCostReconciliation/helpers.d.ts.map +1 -0
  130. package/dist/component/processingCostReconciliation/helpers.js +39 -0
  131. package/dist/component/processingCostReconciliation/helpers.js.map +1 -0
  132. package/dist/component/processingCostReconciliation/mutations.d.ts +303 -0
  133. package/dist/component/processingCostReconciliation/mutations.d.ts.map +1 -0
  134. package/dist/component/processingCostReconciliation/mutations.js +121 -0
  135. package/dist/component/processingCostReconciliation/mutations.js.map +1 -0
  136. package/dist/component/processingCostReconciliation/queries.d.ts +422 -0
  137. package/dist/component/processingCostReconciliation/queries.d.ts.map +1 -0
  138. package/dist/component/processingCostReconciliation/queries.js +19 -0
  139. package/dist/component/processingCostReconciliation/queries.js.map +1 -0
  140. package/dist/component/processingCostReconciliation/rollback.d.ts +21 -0
  141. package/dist/component/processingCostReconciliation/rollback.d.ts.map +1 -0
  142. package/dist/component/processingCostReconciliation/rollback.js +54 -0
  143. package/dist/component/processingCostReconciliation/rollback.js.map +1 -0
  144. package/dist/component/processingCostReconciliation/schema.d.ts +2460 -0
  145. package/dist/component/processingCostReconciliation/schema.d.ts.map +1 -0
  146. package/dist/component/processingCostReconciliation/schema.js +137 -0
  147. package/dist/component/processingCostReconciliation/schema.js.map +1 -0
  148. package/dist/component/processingCostReconciliation/steps.d.ts +306 -0
  149. package/dist/component/processingCostReconciliation/steps.d.ts.map +1 -0
  150. package/dist/component/processingCostReconciliation/steps.js +149 -0
  151. package/dist/component/processingCostReconciliation/steps.js.map +1 -0
  152. package/dist/component/processingCostReconciliation/validation.d.ts +13 -0
  153. package/dist/component/processingCostReconciliation/validation.d.ts.map +1 -0
  154. package/dist/component/processingCostReconciliation/validation.js +61 -0
  155. package/dist/component/processingCostReconciliation/validation.js.map +1 -0
  156. package/dist/component/processingCostReconciliation/workflow.d.ts +105 -0
  157. package/dist/component/processingCostReconciliation/workflow.d.ts.map +1 -0
  158. package/dist/component/processingCostReconciliation/workflow.js +33 -0
  159. package/dist/component/processingCostReconciliation/workflow.js.map +1 -0
  160. package/dist/component/schema.d.ts +694 -1
  161. package/dist/component/schema.js +2 -0
  162. package/dist/component/schema.js.map +1 -1
  163. package/package.json +1 -1
  164. package/src/client/balanceFundingWorkflow/capture.test.ts +144 -0
  165. package/src/client/balanceFundingWorkflow/client.ts +419 -0
  166. package/src/client/billing/balanceFunding.ts +50 -0
  167. package/src/client/costRecovery-invoices.ts +19 -4
  168. package/src/client/costRecovery.ts +4 -2
  169. package/src/client/index.ts +15 -0
  170. package/src/client/processingCostReconciliation/client.ts +75 -0
  171. package/src/client/processingCostReconciliation/contracts.ts +176 -0
  172. package/src/client/processingCostReconciliation/invoiceFunding.ts +270 -0
  173. package/src/client/processingCostReconciliation/invoiceProvider.test.ts +353 -0
  174. package/src/client/processingCostReconciliation/provider.test.ts +324 -0
  175. package/src/client/processingCostReconciliation/provider.ts +178 -0
  176. package/src/client/settlement/processingCostHistory.ts +31 -0
  177. package/src/client/settlement/processingCosts.ts +50 -15
  178. package/src/component/_generated/api.ts +36 -0
  179. package/src/component/_generated/component.ts +1094 -0
  180. package/src/component/balanceFunding/internal/actions.ts +107 -0
  181. package/src/component/balanceFunding/internal/mutations.ts +66 -0
  182. package/src/component/balanceFunding/internal/queries.ts +34 -0
  183. package/src/component/balanceFunding/internal/workflow.ts +49 -0
  184. package/src/component/balanceFunding/mutations.ts +34 -0
  185. package/src/component/balanceFunding/queries.ts +38 -0
  186. package/src/component/balanceFunding/receipt.ts +48 -0
  187. package/src/component/balanceFunding/schema.ts +2 -0
  188. package/src/component/balanceFunding/scopeLookup.test.ts +94 -0
  189. package/src/component/balanceFunding/workflow.fixtures.ts +366 -0
  190. package/src/component/balanceFunding/workflow.test.ts +552 -0
  191. package/src/component/balanceFunding/workflowControl.ts +198 -0
  192. package/src/component/balanceFunding/workflowSchema.ts +78 -0
  193. package/src/component/balanceFunding/workflowState.ts +285 -0
  194. package/src/component/balanceFunding/workflowValidators.ts +40 -0
  195. package/src/component/processingCostReconciliation/adoption.test.ts +206 -0
  196. package/src/component/processingCostReconciliation/adoption.ts +77 -0
  197. package/src/component/processingCostReconciliation/bridge.ts +50 -0
  198. package/src/component/processingCostReconciliation/helpers.ts +55 -0
  199. package/src/component/processingCostReconciliation/invoice.test.ts +152 -0
  200. package/src/component/processingCostReconciliation/mutations.ts +148 -0
  201. package/src/component/processingCostReconciliation/queries.ts +18 -0
  202. package/src/component/processingCostReconciliation/rollback.ts +72 -0
  203. package/src/component/processingCostReconciliation/schema.ts +191 -0
  204. package/src/component/processingCostReconciliation/state.test.ts +407 -0
  205. package/src/component/processingCostReconciliation/steps.ts +168 -0
  206. package/src/component/processingCostReconciliation/validation.ts +79 -0
  207. package/src/component/processingCostReconciliation/workflow.test.ts +329 -0
  208. package/src/component/processingCostReconciliation/workflow.ts +50 -0
  209. package/src/component/schema.ts +2 -0
@@ -1,5 +1,516 @@
1
1
  export declare function large(count?: number, amount?: number): Promise<{
2
2
  t: import("convex-test").TestConvex<import("convex/server").SchemaDefinition<{
3
+ processingCostReconciliationOperations: import("convex/server").TableDefinition<import("convex/values").VObject<{
4
+ accountId: string;
5
+ claimKey: string;
6
+ currency: string;
7
+ definitionVersion: number;
8
+ expectedRevision: number;
9
+ failure?: {
10
+ reason: "fee_pending" | "history_incomplete" | "provider_pending";
11
+ retryable: true;
12
+ status: "not_ready";
13
+ } | {
14
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
15
+ retryable: false;
16
+ status: "conflict";
17
+ } | {
18
+ reason: "currency_mismatch" | "invalid_scope" | "payment_not_payable" | "policy_invalid" | "unsupported_source";
19
+ retryable: false;
20
+ status: "rejected";
21
+ } | {
22
+ reason: "history_incomplete" | "provider_outcome_unknown";
23
+ retryable: false;
24
+ status: "unknown";
25
+ } | undefined;
26
+ importHook?: string | undefined;
27
+ maxAttempts: number;
28
+ policy: {
29
+ liability: {
30
+ disputeCosts: "all" | "none";
31
+ processingCosts: "all" | "none" | "uncovered";
32
+ };
33
+ rounding: "ceil" | "floor" | "nearest";
34
+ sellingFee: number;
35
+ };
36
+ projection?: string | undefined;
37
+ provider: string;
38
+ providerApiVersion: string;
39
+ requestKey: string;
40
+ result?: {
41
+ claim: {
42
+ _creationTime: number;
43
+ _id: import("convex/values").GenericId<"recoveryClaims">;
44
+ accountId: string;
45
+ amountDue: number;
46
+ claimKey: string;
47
+ collectedAmount: number;
48
+ currency: string;
49
+ openingCollection?: {
50
+ amountDue: number;
51
+ collectedAmount: number;
52
+ operationKey: string;
53
+ revision: number;
54
+ } | undefined;
55
+ outstanding: number;
56
+ reservedAmount: number;
57
+ revision: number;
58
+ scopeKey: string;
59
+ sign: "negative" | "positive" | "zero";
60
+ sourceChargeId: string;
61
+ sourceGross: number;
62
+ sourceProcessingFee: number;
63
+ };
64
+ deficit: {
65
+ amountDue: number;
66
+ currency: string;
67
+ disputeLiability: number;
68
+ processingLiability: number;
69
+ retainedFee: number;
70
+ };
71
+ observation: {
72
+ currency: string;
73
+ disputeFees: number;
74
+ gross: number;
75
+ originalProcessingFee: number;
76
+ paymentIntentId: string;
77
+ principalReturned: number;
78
+ processingFee: number;
79
+ provenance: {
80
+ customerAccountId: string;
81
+ invoiceId: string;
82
+ invoicePaymentId: string;
83
+ recoveryInvoiceItemId?: string | undefined;
84
+ stripePriceId?: string | undefined;
85
+ stripeProductId?: string | undefined;
86
+ subscriptionId?: string | undefined;
87
+ };
88
+ sourceChargeId: string;
89
+ };
90
+ rollbackClaim?: {
91
+ _creationTime: number;
92
+ _id: import("convex/values").GenericId<"recoveryClaims">;
93
+ accountId: string;
94
+ amountDue: number;
95
+ claimKey: string;
96
+ collectedAmount: number;
97
+ currency: string;
98
+ openingCollection?: {
99
+ amountDue: number;
100
+ collectedAmount: number;
101
+ operationKey: string;
102
+ revision: number;
103
+ } | undefined;
104
+ outstanding: number;
105
+ reservedAmount: number;
106
+ revision: number;
107
+ scopeKey: string;
108
+ sign: "negative" | "positive" | "zero";
109
+ sourceChargeId: string;
110
+ sourceGross: number;
111
+ sourceProcessingFee: number;
112
+ } | undefined;
113
+ } | undefined;
114
+ retryDelayMs: number;
115
+ rollback?: {
116
+ expectedRevision: number;
117
+ groupKey: string;
118
+ } | undefined;
119
+ scopeKey: string;
120
+ source: {
121
+ customerAccountId: string;
122
+ gross: number;
123
+ invoiceId?: string | undefined;
124
+ kind: "sale";
125
+ paymentIntentId: string;
126
+ stripeAccountId?: string | undefined;
127
+ stripePriceId?: string | undefined;
128
+ stripeProductId?: string | undefined;
129
+ subscriptionId?: string | undefined;
130
+ } | {
131
+ gross: number;
132
+ groupKey: string;
133
+ kind: "invoice_recovery";
134
+ paymentIntentId: string;
135
+ };
136
+ status: "completed" | "conflict" | "queued" | "rejected" | "running" | "unknown" | "waiting";
137
+ version: number;
138
+ workflowId?: string | undefined;
139
+ }, {
140
+ accountId: import("convex/values").VString<string, "required">;
141
+ scopeKey: import("convex/values").VString<string, "required">;
142
+ currency: import("convex/values").VString<string, "required">;
143
+ claimKey: import("convex/values").VString<string, "required">;
144
+ source: import("convex/values").VUnion<{
145
+ customerAccountId: string;
146
+ gross: number;
147
+ invoiceId?: string | undefined;
148
+ kind: "sale";
149
+ paymentIntentId: string;
150
+ stripeAccountId?: string | undefined;
151
+ stripePriceId?: string | undefined;
152
+ stripeProductId?: string | undefined;
153
+ subscriptionId?: string | undefined;
154
+ } | {
155
+ gross: number;
156
+ groupKey: string;
157
+ kind: "invoice_recovery";
158
+ paymentIntentId: string;
159
+ }, [import("convex/values").VObject<{
160
+ customerAccountId: string;
161
+ gross: number;
162
+ invoiceId?: string | undefined;
163
+ kind: "sale";
164
+ paymentIntentId: string;
165
+ stripeAccountId?: string | undefined;
166
+ stripePriceId?: string | undefined;
167
+ stripeProductId?: string | undefined;
168
+ subscriptionId?: string | undefined;
169
+ }, {
170
+ kind: import("convex/values").VLiteral<"sale", "required">;
171
+ paymentIntentId: import("convex/values").VString<string, "required">;
172
+ gross: import("convex/values").VFloat64<number, "required">;
173
+ customerAccountId: import("convex/values").VString<string, "required">;
174
+ invoiceId: import("convex/values").VString<string | undefined, "optional">;
175
+ subscriptionId: import("convex/values").VString<string | undefined, "optional">;
176
+ stripeAccountId: import("convex/values").VString<string | undefined, "optional">;
177
+ stripePriceId: import("convex/values").VString<string | undefined, "optional">;
178
+ stripeProductId: import("convex/values").VString<string | undefined, "optional">;
179
+ }, "required", "customerAccountId" | "gross" | "invoiceId" | "kind" | "paymentIntentId" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId">, import("convex/values").VObject<{
180
+ gross: number;
181
+ groupKey: string;
182
+ kind: "invoice_recovery";
183
+ paymentIntentId: string;
184
+ }, {
185
+ kind: import("convex/values").VLiteral<"invoice_recovery", "required">;
186
+ paymentIntentId: import("convex/values").VString<string, "required">;
187
+ gross: import("convex/values").VFloat64<number, "required">;
188
+ groupKey: import("convex/values").VString<string, "required">;
189
+ }, "required", "gross" | "groupKey" | "kind" | "paymentIntentId">], "required", "customerAccountId" | "gross" | "groupKey" | "invoiceId" | "kind" | "paymentIntentId" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId">;
190
+ policy: import("convex/values").VObject<{
191
+ liability: {
192
+ disputeCosts: "all" | "none";
193
+ processingCosts: "all" | "none" | "uncovered";
194
+ };
195
+ rounding: "ceil" | "floor" | "nearest";
196
+ sellingFee: number;
197
+ }, {
198
+ sellingFee: import("convex/values").VFloat64<number, "required">;
199
+ liability: import("convex/values").VObject<{
200
+ disputeCosts: "all" | "none";
201
+ processingCosts: "all" | "none" | "uncovered";
202
+ }, {
203
+ processingCosts: import("convex/values").VUnion<"all" | "none" | "uncovered", [import("convex/values").VLiteral<"uncovered", "required">, import("convex/values").VLiteral<"all", "required">, import("convex/values").VLiteral<"none", "required">], "required", never>;
204
+ disputeCosts: import("convex/values").VUnion<"all" | "none", [import("convex/values").VLiteral<"all", "required">, import("convex/values").VLiteral<"none", "required">], "required", never>;
205
+ }, "required", "disputeCosts" | "processingCosts">;
206
+ rounding: import("convex/values").VUnion<"ceil" | "floor" | "nearest", [import("convex/values").VLiteral<"nearest", "required">, import("convex/values").VLiteral<"floor", "required">, import("convex/values").VLiteral<"ceil", "required">], "required", never>;
207
+ }, "required", "liability" | "liability.disputeCosts" | "liability.processingCosts" | "rounding" | "sellingFee">;
208
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
209
+ rollback: import("convex/values").VObject<{
210
+ expectedRevision: number;
211
+ groupKey: string;
212
+ } | undefined, {
213
+ groupKey: import("convex/values").VString<string, "required">;
214
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
215
+ }, "optional", "expectedRevision" | "groupKey">;
216
+ provider: import("convex/values").VString<string, "required">;
217
+ projection: import("convex/values").VString<string | undefined, "optional">;
218
+ importHook: import("convex/values").VString<string | undefined, "optional">;
219
+ providerApiVersion: import("convex/values").VString<string, "required">;
220
+ definitionVersion: import("convex/values").VFloat64<number, "required">;
221
+ maxAttempts: import("convex/values").VFloat64<number, "required">;
222
+ retryDelayMs: import("convex/values").VFloat64<number, "required">;
223
+ requestKey: import("convex/values").VString<string, "required">;
224
+ version: import("convex/values").VFloat64<number, "required">;
225
+ workflowId: import("convex/values").VString<string | undefined, "optional">;
226
+ status: import("convex/values").VUnion<"completed" | "conflict" | "queued" | "rejected" | "running" | "unknown" | "waiting", [import("convex/values").VLiteral<"queued", "required">, import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"waiting", "required">, import("convex/values").VLiteral<"completed", "required">, import("convex/values").VLiteral<"conflict", "required">, import("convex/values").VLiteral<"rejected", "required">, import("convex/values").VLiteral<"unknown", "required">], "required", never>;
227
+ failure: import("convex/values").VUnion<{
228
+ reason: "fee_pending" | "history_incomplete" | "provider_pending";
229
+ retryable: true;
230
+ status: "not_ready";
231
+ } | {
232
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
233
+ retryable: false;
234
+ status: "conflict";
235
+ } | {
236
+ reason: "currency_mismatch" | "invalid_scope" | "payment_not_payable" | "policy_invalid" | "unsupported_source";
237
+ retryable: false;
238
+ status: "rejected";
239
+ } | {
240
+ reason: "history_incomplete" | "provider_outcome_unknown";
241
+ retryable: false;
242
+ status: "unknown";
243
+ } | undefined, [import("convex/values").VObject<{
244
+ reason: "fee_pending" | "history_incomplete" | "provider_pending";
245
+ retryable: true;
246
+ status: "not_ready";
247
+ }, {
248
+ status: import("convex/values").VLiteral<"not_ready", "required">;
249
+ reason: import("convex/values").VUnion<"fee_pending" | "history_incomplete" | "provider_pending", [import("convex/values").VLiteral<"provider_pending", "required">, import("convex/values").VLiteral<"fee_pending", "required">, import("convex/values").VLiteral<"history_incomplete", "required">], "required", never>;
250
+ retryable: import("convex/values").VLiteral<true, "required">;
251
+ }, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
252
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
253
+ retryable: false;
254
+ status: "conflict";
255
+ }, {
256
+ status: import("convex/values").VLiteral<"conflict", "required">;
257
+ reason: import("convex/values").VUnion<"identity_changed" | "revision_changed" | "scope_busy", [import("convex/values").VLiteral<"scope_busy", "required">, import("convex/values").VLiteral<"revision_changed", "required">, import("convex/values").VLiteral<"identity_changed", "required">], "required", never>;
258
+ retryable: import("convex/values").VLiteral<false, "required">;
259
+ }, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
260
+ reason: "currency_mismatch" | "invalid_scope" | "payment_not_payable" | "policy_invalid" | "unsupported_source";
261
+ retryable: false;
262
+ status: "rejected";
263
+ }, {
264
+ status: import("convex/values").VLiteral<"rejected", "required">;
265
+ reason: import("convex/values").VUnion<"currency_mismatch" | "invalid_scope" | "payment_not_payable" | "policy_invalid" | "unsupported_source", [import("convex/values").VLiteral<"invalid_scope", "required">, import("convex/values").VLiteral<"unsupported_source", "required">, import("convex/values").VLiteral<"policy_invalid", "required">, import("convex/values").VLiteral<"payment_not_payable", "required">, import("convex/values").VLiteral<"currency_mismatch", "required">], "required", never>;
266
+ retryable: import("convex/values").VLiteral<false, "required">;
267
+ }, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
268
+ reason: "history_incomplete" | "provider_outcome_unknown";
269
+ retryable: false;
270
+ status: "unknown";
271
+ }, {
272
+ status: import("convex/values").VLiteral<"unknown", "required">;
273
+ reason: import("convex/values").VUnion<"history_incomplete" | "provider_outcome_unknown", [import("convex/values").VLiteral<"provider_outcome_unknown", "required">, import("convex/values").VLiteral<"history_incomplete", "required">], "required", never>;
274
+ retryable: import("convex/values").VLiteral<false, "required">;
275
+ }, "required", "reason" | "retryable" | "status">], "optional", "reason" | "retryable" | "status">;
276
+ result: import("convex/values").VObject<{
277
+ claim: {
278
+ _creationTime: number;
279
+ _id: import("convex/values").GenericId<"recoveryClaims">;
280
+ accountId: string;
281
+ amountDue: number;
282
+ claimKey: string;
283
+ collectedAmount: number;
284
+ currency: string;
285
+ openingCollection?: {
286
+ amountDue: number;
287
+ collectedAmount: number;
288
+ operationKey: string;
289
+ revision: number;
290
+ } | undefined;
291
+ outstanding: number;
292
+ reservedAmount: number;
293
+ revision: number;
294
+ scopeKey: string;
295
+ sign: "negative" | "positive" | "zero";
296
+ sourceChargeId: string;
297
+ sourceGross: number;
298
+ sourceProcessingFee: number;
299
+ };
300
+ deficit: {
301
+ amountDue: number;
302
+ currency: string;
303
+ disputeLiability: number;
304
+ processingLiability: number;
305
+ retainedFee: number;
306
+ };
307
+ observation: {
308
+ currency: string;
309
+ disputeFees: number;
310
+ gross: number;
311
+ originalProcessingFee: number;
312
+ paymentIntentId: string;
313
+ principalReturned: number;
314
+ processingFee: number;
315
+ provenance: {
316
+ customerAccountId: string;
317
+ invoiceId: string;
318
+ invoicePaymentId: string;
319
+ recoveryInvoiceItemId?: string | undefined;
320
+ stripePriceId?: string | undefined;
321
+ stripeProductId?: string | undefined;
322
+ subscriptionId?: string | undefined;
323
+ };
324
+ sourceChargeId: string;
325
+ };
326
+ rollbackClaim?: {
327
+ _creationTime: number;
328
+ _id: import("convex/values").GenericId<"recoveryClaims">;
329
+ accountId: string;
330
+ amountDue: number;
331
+ claimKey: string;
332
+ collectedAmount: number;
333
+ currency: string;
334
+ openingCollection?: {
335
+ amountDue: number;
336
+ collectedAmount: number;
337
+ operationKey: string;
338
+ revision: number;
339
+ } | undefined;
340
+ outstanding: number;
341
+ reservedAmount: number;
342
+ revision: number;
343
+ scopeKey: string;
344
+ sign: "negative" | "positive" | "zero";
345
+ sourceChargeId: string;
346
+ sourceGross: number;
347
+ sourceProcessingFee: number;
348
+ } | undefined;
349
+ } | undefined, {
350
+ claim: import("convex/values").VObject<{
351
+ _creationTime: number;
352
+ _id: import("convex/values").GenericId<"recoveryClaims">;
353
+ accountId: string;
354
+ amountDue: number;
355
+ claimKey: string;
356
+ collectedAmount: number;
357
+ currency: string;
358
+ openingCollection?: {
359
+ amountDue: number;
360
+ collectedAmount: number;
361
+ operationKey: string;
362
+ revision: number;
363
+ } | undefined;
364
+ outstanding: number;
365
+ reservedAmount: number;
366
+ revision: number;
367
+ scopeKey: string;
368
+ sign: "negative" | "positive" | "zero";
369
+ sourceChargeId: string;
370
+ sourceGross: number;
371
+ sourceProcessingFee: number;
372
+ }, {
373
+ accountId: import("convex/values").VString<string, "required">;
374
+ scopeKey: import("convex/values").VString<string, "required">;
375
+ currency: import("convex/values").VString<string, "required">;
376
+ claimKey: import("convex/values").VString<string, "required">;
377
+ sourceChargeId: import("convex/values").VString<string, "required">;
378
+ sourceGross: import("convex/values").VFloat64<number, "required">;
379
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
380
+ amountDue: import("convex/values").VFloat64<number, "required">;
381
+ revision: import("convex/values").VFloat64<number, "required">;
382
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
383
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
384
+ outstanding: import("convex/values").VFloat64<number, "required">;
385
+ sign: import("convex/values").VUnion<"negative" | "positive" | "zero", [import("convex/values").VLiteral<"positive", "required">, import("convex/values").VLiteral<"negative", "required">, import("convex/values").VLiteral<"zero", "required">], "required", never>;
386
+ openingCollection: import("convex/values").VObject<{
387
+ amountDue: number;
388
+ collectedAmount: number;
389
+ operationKey: string;
390
+ revision: number;
391
+ } | undefined, {
392
+ operationKey: import("convex/values").VString<string, "required">;
393
+ amountDue: import("convex/values").VFloat64<number, "required">;
394
+ revision: import("convex/values").VFloat64<number, "required">;
395
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
396
+ }, "optional", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
397
+ _id: import("convex/values").VId<import("convex/values").GenericId<"recoveryClaims">, "required">;
398
+ _creationTime: import("convex/values").VFloat64<number, "required">;
399
+ }, "required", "_creationTime" | "_id" | "accountId" | "amountDue" | "claimKey" | "collectedAmount" | "currency" | "openingCollection" | "openingCollection.amountDue" | "openingCollection.collectedAmount" | "openingCollection.operationKey" | "openingCollection.revision" | "outstanding" | "reservedAmount" | "revision" | "scopeKey" | "sign" | "sourceChargeId" | "sourceGross" | "sourceProcessingFee">;
400
+ rollbackClaim: import("convex/values").VObject<{
401
+ _creationTime: number;
402
+ _id: import("convex/values").GenericId<"recoveryClaims">;
403
+ accountId: string;
404
+ amountDue: number;
405
+ claimKey: string;
406
+ collectedAmount: number;
407
+ currency: string;
408
+ openingCollection?: {
409
+ amountDue: number;
410
+ collectedAmount: number;
411
+ operationKey: string;
412
+ revision: number;
413
+ } | undefined;
414
+ outstanding: number;
415
+ reservedAmount: number;
416
+ revision: number;
417
+ scopeKey: string;
418
+ sign: "negative" | "positive" | "zero";
419
+ sourceChargeId: string;
420
+ sourceGross: number;
421
+ sourceProcessingFee: number;
422
+ } | undefined, {
423
+ accountId: import("convex/values").VString<string, "required">;
424
+ scopeKey: import("convex/values").VString<string, "required">;
425
+ currency: import("convex/values").VString<string, "required">;
426
+ claimKey: import("convex/values").VString<string, "required">;
427
+ sourceChargeId: import("convex/values").VString<string, "required">;
428
+ sourceGross: import("convex/values").VFloat64<number, "required">;
429
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
430
+ amountDue: import("convex/values").VFloat64<number, "required">;
431
+ revision: import("convex/values").VFloat64<number, "required">;
432
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
433
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
434
+ outstanding: import("convex/values").VFloat64<number, "required">;
435
+ sign: import("convex/values").VUnion<"negative" | "positive" | "zero", [import("convex/values").VLiteral<"positive", "required">, import("convex/values").VLiteral<"negative", "required">, import("convex/values").VLiteral<"zero", "required">], "required", never>;
436
+ openingCollection: import("convex/values").VObject<{
437
+ amountDue: number;
438
+ collectedAmount: number;
439
+ operationKey: string;
440
+ revision: number;
441
+ } | undefined, {
442
+ operationKey: import("convex/values").VString<string, "required">;
443
+ amountDue: import("convex/values").VFloat64<number, "required">;
444
+ revision: import("convex/values").VFloat64<number, "required">;
445
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
446
+ }, "optional", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
447
+ _id: import("convex/values").VId<import("convex/values").GenericId<"recoveryClaims">, "required">;
448
+ _creationTime: import("convex/values").VFloat64<number, "required">;
449
+ }, "optional", "_creationTime" | "_id" | "accountId" | "amountDue" | "claimKey" | "collectedAmount" | "currency" | "openingCollection" | "openingCollection.amountDue" | "openingCollection.collectedAmount" | "openingCollection.operationKey" | "openingCollection.revision" | "outstanding" | "reservedAmount" | "revision" | "scopeKey" | "sign" | "sourceChargeId" | "sourceGross" | "sourceProcessingFee">;
450
+ deficit: import("convex/values").VObject<{
451
+ amountDue: number;
452
+ currency: string;
453
+ disputeLiability: number;
454
+ processingLiability: number;
455
+ retainedFee: number;
456
+ }, {
457
+ currency: import("convex/values").VString<string, "required">;
458
+ retainedFee: import("convex/values").VFloat64<number, "required">;
459
+ processingLiability: import("convex/values").VFloat64<number, "required">;
460
+ disputeLiability: import("convex/values").VFloat64<number, "required">;
461
+ amountDue: import("convex/values").VFloat64<number, "required">;
462
+ }, "required", "amountDue" | "currency" | "disputeLiability" | "processingLiability" | "retainedFee">;
463
+ observation: import("convex/values").VObject<{
464
+ currency: string;
465
+ disputeFees: number;
466
+ gross: number;
467
+ originalProcessingFee: number;
468
+ paymentIntentId: string;
469
+ principalReturned: number;
470
+ processingFee: number;
471
+ provenance: {
472
+ customerAccountId: string;
473
+ invoiceId: string;
474
+ invoicePaymentId: string;
475
+ recoveryInvoiceItemId?: string | undefined;
476
+ stripePriceId?: string | undefined;
477
+ stripeProductId?: string | undefined;
478
+ subscriptionId?: string | undefined;
479
+ };
480
+ sourceChargeId: string;
481
+ }, {
482
+ paymentIntentId: import("convex/values").VString<string, "required">;
483
+ sourceChargeId: import("convex/values").VString<string, "required">;
484
+ currency: import("convex/values").VString<string, "required">;
485
+ gross: import("convex/values").VFloat64<number, "required">;
486
+ originalProcessingFee: import("convex/values").VFloat64<number, "required">;
487
+ processingFee: import("convex/values").VFloat64<number, "required">;
488
+ disputeFees: import("convex/values").VFloat64<number, "required">;
489
+ principalReturned: import("convex/values").VFloat64<number, "required">;
490
+ provenance: import("convex/values").VObject<{
491
+ customerAccountId: string;
492
+ invoiceId: string;
493
+ invoicePaymentId: string;
494
+ recoveryInvoiceItemId?: string | undefined;
495
+ stripePriceId?: string | undefined;
496
+ stripeProductId?: string | undefined;
497
+ subscriptionId?: string | undefined;
498
+ }, {
499
+ invoiceId: import("convex/values").VString<string, "required">;
500
+ invoicePaymentId: import("convex/values").VString<string, "required">;
501
+ recoveryInvoiceItemId: import("convex/values").VString<string | undefined, "optional">;
502
+ customerAccountId: import("convex/values").VString<string, "required">;
503
+ subscriptionId: import("convex/values").VString<string | undefined, "optional">;
504
+ stripePriceId: import("convex/values").VString<string | undefined, "optional">;
505
+ stripeProductId: import("convex/values").VString<string | undefined, "optional">;
506
+ }, "required", "customerAccountId" | "invoiceId" | "invoicePaymentId" | "recoveryInvoiceItemId" | "stripePriceId" | "stripeProductId" | "subscriptionId">;
507
+ }, "required", "currency" | "disputeFees" | "gross" | "originalProcessingFee" | "paymentIntentId" | "principalReturned" | "processingFee" | "provenance" | "provenance.customerAccountId" | "provenance.invoiceId" | "provenance.invoicePaymentId" | "provenance.recoveryInvoiceItemId" | "provenance.stripePriceId" | "provenance.stripeProductId" | "provenance.subscriptionId" | "sourceChargeId">;
508
+ }, "optional", "claim" | "claim._creationTime" | "claim._id" | "claim.accountId" | "claim.amountDue" | "claim.claimKey" | "claim.collectedAmount" | "claim.currency" | "claim.openingCollection" | "claim.openingCollection.amountDue" | "claim.openingCollection.collectedAmount" | "claim.openingCollection.operationKey" | "claim.openingCollection.revision" | "claim.outstanding" | "claim.reservedAmount" | "claim.revision" | "claim.scopeKey" | "claim.sign" | "claim.sourceChargeId" | "claim.sourceGross" | "claim.sourceProcessingFee" | "deficit" | "deficit.amountDue" | "deficit.currency" | "deficit.disputeLiability" | "deficit.processingLiability" | "deficit.retainedFee" | "observation" | "observation.currency" | "observation.disputeFees" | "observation.gross" | "observation.originalProcessingFee" | "observation.paymentIntentId" | "observation.principalReturned" | "observation.processingFee" | "observation.provenance" | "observation.provenance.customerAccountId" | "observation.provenance.invoiceId" | "observation.provenance.invoicePaymentId" | "observation.provenance.recoveryInvoiceItemId" | "observation.provenance.stripePriceId" | "observation.provenance.stripeProductId" | "observation.provenance.subscriptionId" | "observation.sourceChargeId" | "rollbackClaim" | "rollbackClaim._creationTime" | "rollbackClaim._id" | "rollbackClaim.accountId" | "rollbackClaim.amountDue" | "rollbackClaim.claimKey" | "rollbackClaim.collectedAmount" | "rollbackClaim.currency" | "rollbackClaim.openingCollection" | "rollbackClaim.openingCollection.amountDue" | "rollbackClaim.openingCollection.collectedAmount" | "rollbackClaim.openingCollection.operationKey" | "rollbackClaim.openingCollection.revision" | "rollbackClaim.outstanding" | "rollbackClaim.reservedAmount" | "rollbackClaim.revision" | "rollbackClaim.scopeKey" | "rollbackClaim.sign" | "rollbackClaim.sourceChargeId" | "rollbackClaim.sourceGross" | "rollbackClaim.sourceProcessingFee">;
509
+ }, "required", "accountId" | "claimKey" | "currency" | "definitionVersion" | "expectedRevision" | "failure" | "failure.reason" | "failure.retryable" | "failure.status" | "importHook" | "maxAttempts" | "policy" | "policy.liability" | "policy.liability.disputeCosts" | "policy.liability.processingCosts" | "policy.rounding" | "policy.sellingFee" | "projection" | "provider" | "providerApiVersion" | "requestKey" | "result" | "result.claim" | "result.claim._creationTime" | "result.claim._id" | "result.claim.accountId" | "result.claim.amountDue" | "result.claim.claimKey" | "result.claim.collectedAmount" | "result.claim.currency" | "result.claim.openingCollection" | "result.claim.openingCollection.amountDue" | "result.claim.openingCollection.collectedAmount" | "result.claim.openingCollection.operationKey" | "result.claim.openingCollection.revision" | "result.claim.outstanding" | "result.claim.reservedAmount" | "result.claim.revision" | "result.claim.scopeKey" | "result.claim.sign" | "result.claim.sourceChargeId" | "result.claim.sourceGross" | "result.claim.sourceProcessingFee" | "result.deficit" | "result.deficit.amountDue" | "result.deficit.currency" | "result.deficit.disputeLiability" | "result.deficit.processingLiability" | "result.deficit.retainedFee" | "result.observation" | "result.observation.currency" | "result.observation.disputeFees" | "result.observation.gross" | "result.observation.originalProcessingFee" | "result.observation.paymentIntentId" | "result.observation.principalReturned" | "result.observation.processingFee" | "result.observation.provenance" | "result.observation.provenance.customerAccountId" | "result.observation.provenance.invoiceId" | "result.observation.provenance.invoicePaymentId" | "result.observation.provenance.recoveryInvoiceItemId" | "result.observation.provenance.stripePriceId" | "result.observation.provenance.stripeProductId" | "result.observation.provenance.subscriptionId" | "result.observation.sourceChargeId" | "result.rollbackClaim" | "result.rollbackClaim._creationTime" | "result.rollbackClaim._id" | "result.rollbackClaim.accountId" | "result.rollbackClaim.amountDue" | "result.rollbackClaim.claimKey" | "result.rollbackClaim.collectedAmount" | "result.rollbackClaim.currency" | "result.rollbackClaim.openingCollection" | "result.rollbackClaim.openingCollection.amountDue" | "result.rollbackClaim.openingCollection.collectedAmount" | "result.rollbackClaim.openingCollection.operationKey" | "result.rollbackClaim.openingCollection.revision" | "result.rollbackClaim.outstanding" | "result.rollbackClaim.reservedAmount" | "result.rollbackClaim.revision" | "result.rollbackClaim.scopeKey" | "result.rollbackClaim.sign" | "result.rollbackClaim.sourceChargeId" | "result.rollbackClaim.sourceGross" | "result.rollbackClaim.sourceProcessingFee" | "retryDelayMs" | "rollback" | "rollback.expectedRevision" | "rollback.groupKey" | "scopeKey" | "source" | "source.customerAccountId" | "source.gross" | "source.groupKey" | "source.invoiceId" | "source.kind" | "source.paymentIntentId" | "source.stripeAccountId" | "source.stripePriceId" | "source.stripeProductId" | "source.subscriptionId" | "status" | "version" | "workflowId">, {
510
+ by_claim_status: ["claimKey", "status", "_creationTime"];
511
+ by_payment_scope: ["accountId", "scopeKey", "currency", "source.paymentIntentId", "_creationTime"];
512
+ by_request: ["requestKey", "_creationTime"];
513
+ }, {}, {}>;
3
514
  recoveryWorkflowOperations: import("convex/server").TableDefinition<import("convex/values").VObject<{
4
515
  accountId: string;
5
516
  activePhase?: "execute" | "reconcile" | undefined;
@@ -272,6 +783,48 @@ export declare function large(count?: number, amount?: number): Promise<{
272
783
  accountId: string;
273
784
  cancelRequested: boolean;
274
785
  enabled: boolean;
786
+ execution?: {
787
+ apply?: {
788
+ receipt?: {
789
+ customerAccount: string;
790
+ enabled?: boolean | undefined;
791
+ paymentMethodId: string | null;
792
+ paymentMethodTypes?: string[] | null | undefined;
793
+ phase: "apply" | "attach" | "create";
794
+ providerApiVersion: string;
795
+ stripeSubscriptionId: string;
796
+ } | undefined;
797
+ state: "running" | "succeeded" | "unknown";
798
+ } | undefined;
799
+ attach?: {
800
+ receipt?: {
801
+ customerAccount: string;
802
+ enabled?: boolean | undefined;
803
+ paymentMethodId: string | null;
804
+ paymentMethodTypes?: string[] | null | undefined;
805
+ phase: "apply" | "attach" | "create";
806
+ providerApiVersion: string;
807
+ stripeSubscriptionId: string;
808
+ } | undefined;
809
+ state: "running" | "succeeded" | "unknown";
810
+ } | undefined;
811
+ create?: {
812
+ receipt?: {
813
+ customerAccount: string;
814
+ enabled?: boolean | undefined;
815
+ paymentMethodId: string | null;
816
+ paymentMethodTypes?: string[] | null | undefined;
817
+ phase: "apply" | "attach" | "create";
818
+ providerApiVersion: string;
819
+ stripeSubscriptionId: string;
820
+ } | undefined;
821
+ state: "running" | "succeeded" | "unknown";
822
+ } | undefined;
823
+ definitionVersion: string;
824
+ providerAction: string;
825
+ providerApiVersion: string;
826
+ workflowId?: string | undefined;
827
+ } | undefined;
275
828
  failureCode?: "invalid_scope" | "policy_invalid" | "unsupported_source" | undefined;
276
829
  kind: "apply" | "prepare";
277
830
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
@@ -327,7 +880,147 @@ export declare function large(count?: number, amount?: number): Promise<{
327
880
  paymentMethodTypes: import("convex/values").VUnion<string[] | null, [import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VNull<null, "required">], "required", never>;
328
881
  providerApiVersion: import("convex/values").VString<string, "required">;
329
882
  }, "optional", "customerAccount" | "paymentMethodId" | "paymentMethodTypes" | "providerApiVersion" | "stripeSubscriptionId">;
330
- }, "required", "accountId" | "cancelRequested" | "enabled" | "failureCode" | "kind" | "preparationId" | "providerKey" | "providerKeys" | "providerKeys.attach" | "providerKeys.create" | "providerKeys.disable" | "providerKeys.enable" | "receipt" | "receipt.customerAccount" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "scopeKey" | "state" | "version">, {
883
+ execution: import("convex/values").VObject<{
884
+ apply?: {
885
+ receipt?: {
886
+ customerAccount: string;
887
+ enabled?: boolean | undefined;
888
+ paymentMethodId: string | null;
889
+ paymentMethodTypes?: string[] | null | undefined;
890
+ phase: "apply" | "attach" | "create";
891
+ providerApiVersion: string;
892
+ stripeSubscriptionId: string;
893
+ } | undefined;
894
+ state: "running" | "succeeded" | "unknown";
895
+ } | undefined;
896
+ attach?: {
897
+ receipt?: {
898
+ customerAccount: string;
899
+ enabled?: boolean | undefined;
900
+ paymentMethodId: string | null;
901
+ paymentMethodTypes?: string[] | null | undefined;
902
+ phase: "apply" | "attach" | "create";
903
+ providerApiVersion: string;
904
+ stripeSubscriptionId: string;
905
+ } | undefined;
906
+ state: "running" | "succeeded" | "unknown";
907
+ } | undefined;
908
+ create?: {
909
+ receipt?: {
910
+ customerAccount: string;
911
+ enabled?: boolean | undefined;
912
+ paymentMethodId: string | null;
913
+ paymentMethodTypes?: string[] | null | undefined;
914
+ phase: "apply" | "attach" | "create";
915
+ providerApiVersion: string;
916
+ stripeSubscriptionId: string;
917
+ } | undefined;
918
+ state: "running" | "succeeded" | "unknown";
919
+ } | undefined;
920
+ definitionVersion: string;
921
+ providerAction: string;
922
+ providerApiVersion: string;
923
+ workflowId?: string | undefined;
924
+ } | undefined, {
925
+ workflowId: import("convex/values").VString<string | undefined, "optional">;
926
+ definitionVersion: import("convex/values").VString<string, "required">;
927
+ providerApiVersion: import("convex/values").VString<string, "required">;
928
+ providerAction: import("convex/values").VString<string, "required">;
929
+ create: import("convex/values").VObject<{
930
+ receipt?: {
931
+ customerAccount: string;
932
+ enabled?: boolean | undefined;
933
+ paymentMethodId: string | null;
934
+ paymentMethodTypes?: string[] | null | undefined;
935
+ phase: "apply" | "attach" | "create";
936
+ providerApiVersion: string;
937
+ stripeSubscriptionId: string;
938
+ } | undefined;
939
+ state: "running" | "succeeded" | "unknown";
940
+ } | undefined, {
941
+ state: import("convex/values").VUnion<"running" | "succeeded" | "unknown", [import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"succeeded", "required">], "required", never>;
942
+ receipt: import("convex/values").VObject<{
943
+ customerAccount: string;
944
+ enabled?: boolean | undefined;
945
+ paymentMethodId: string | null;
946
+ paymentMethodTypes?: string[] | null | undefined;
947
+ phase: "apply" | "attach" | "create";
948
+ providerApiVersion: string;
949
+ stripeSubscriptionId: string;
950
+ } | undefined, {
951
+ phase: import("convex/values").VUnion<"apply" | "attach" | "create", [import("convex/values").VLiteral<"create", "required">, import("convex/values").VLiteral<"attach", "required">, import("convex/values").VLiteral<"apply", "required">], "required", never>;
952
+ customerAccount: import("convex/values").VString<string, "required">;
953
+ stripeSubscriptionId: import("convex/values").VString<string, "required">;
954
+ paymentMethodId: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
955
+ paymentMethodTypes: import("convex/values").VUnion<string[] | null | undefined, [import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
956
+ enabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
957
+ providerApiVersion: import("convex/values").VString<string, "required">;
958
+ }, "optional", "customerAccount" | "enabled" | "paymentMethodId" | "paymentMethodTypes" | "phase" | "providerApiVersion" | "stripeSubscriptionId">;
959
+ }, "optional", "receipt" | "receipt.customerAccount" | "receipt.enabled" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.phase" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "state">;
960
+ attach: import("convex/values").VObject<{
961
+ receipt?: {
962
+ customerAccount: string;
963
+ enabled?: boolean | undefined;
964
+ paymentMethodId: string | null;
965
+ paymentMethodTypes?: string[] | null | undefined;
966
+ phase: "apply" | "attach" | "create";
967
+ providerApiVersion: string;
968
+ stripeSubscriptionId: string;
969
+ } | undefined;
970
+ state: "running" | "succeeded" | "unknown";
971
+ } | undefined, {
972
+ state: import("convex/values").VUnion<"running" | "succeeded" | "unknown", [import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"succeeded", "required">], "required", never>;
973
+ receipt: import("convex/values").VObject<{
974
+ customerAccount: string;
975
+ enabled?: boolean | undefined;
976
+ paymentMethodId: string | null;
977
+ paymentMethodTypes?: string[] | null | undefined;
978
+ phase: "apply" | "attach" | "create";
979
+ providerApiVersion: string;
980
+ stripeSubscriptionId: string;
981
+ } | undefined, {
982
+ phase: import("convex/values").VUnion<"apply" | "attach" | "create", [import("convex/values").VLiteral<"create", "required">, import("convex/values").VLiteral<"attach", "required">, import("convex/values").VLiteral<"apply", "required">], "required", never>;
983
+ customerAccount: import("convex/values").VString<string, "required">;
984
+ stripeSubscriptionId: import("convex/values").VString<string, "required">;
985
+ paymentMethodId: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
986
+ paymentMethodTypes: import("convex/values").VUnion<string[] | null | undefined, [import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
987
+ enabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
988
+ providerApiVersion: import("convex/values").VString<string, "required">;
989
+ }, "optional", "customerAccount" | "enabled" | "paymentMethodId" | "paymentMethodTypes" | "phase" | "providerApiVersion" | "stripeSubscriptionId">;
990
+ }, "optional", "receipt" | "receipt.customerAccount" | "receipt.enabled" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.phase" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "state">;
991
+ apply: import("convex/values").VObject<{
992
+ receipt?: {
993
+ customerAccount: string;
994
+ enabled?: boolean | undefined;
995
+ paymentMethodId: string | null;
996
+ paymentMethodTypes?: string[] | null | undefined;
997
+ phase: "apply" | "attach" | "create";
998
+ providerApiVersion: string;
999
+ stripeSubscriptionId: string;
1000
+ } | undefined;
1001
+ state: "running" | "succeeded" | "unknown";
1002
+ } | undefined, {
1003
+ state: import("convex/values").VUnion<"running" | "succeeded" | "unknown", [import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"succeeded", "required">], "required", never>;
1004
+ receipt: import("convex/values").VObject<{
1005
+ customerAccount: string;
1006
+ enabled?: boolean | undefined;
1007
+ paymentMethodId: string | null;
1008
+ paymentMethodTypes?: string[] | null | undefined;
1009
+ phase: "apply" | "attach" | "create";
1010
+ providerApiVersion: string;
1011
+ stripeSubscriptionId: string;
1012
+ } | undefined, {
1013
+ phase: import("convex/values").VUnion<"apply" | "attach" | "create", [import("convex/values").VLiteral<"create", "required">, import("convex/values").VLiteral<"attach", "required">, import("convex/values").VLiteral<"apply", "required">], "required", never>;
1014
+ customerAccount: import("convex/values").VString<string, "required">;
1015
+ stripeSubscriptionId: import("convex/values").VString<string, "required">;
1016
+ paymentMethodId: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
1017
+ paymentMethodTypes: import("convex/values").VUnion<string[] | null | undefined, [import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
1018
+ enabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
1019
+ providerApiVersion: import("convex/values").VString<string, "required">;
1020
+ }, "optional", "customerAccount" | "enabled" | "paymentMethodId" | "paymentMethodTypes" | "phase" | "providerApiVersion" | "stripeSubscriptionId">;
1021
+ }, "optional", "receipt" | "receipt.customerAccount" | "receipt.enabled" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.phase" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "state">;
1022
+ }, "optional", "apply" | "apply.receipt" | "apply.receipt.customerAccount" | "apply.receipt.enabled" | "apply.receipt.paymentMethodId" | "apply.receipt.paymentMethodTypes" | "apply.receipt.phase" | "apply.receipt.providerApiVersion" | "apply.receipt.stripeSubscriptionId" | "apply.state" | "attach" | "attach.receipt" | "attach.receipt.customerAccount" | "attach.receipt.enabled" | "attach.receipt.paymentMethodId" | "attach.receipt.paymentMethodTypes" | "attach.receipt.phase" | "attach.receipt.providerApiVersion" | "attach.receipt.stripeSubscriptionId" | "attach.state" | "create" | "create.receipt" | "create.receipt.customerAccount" | "create.receipt.enabled" | "create.receipt.paymentMethodId" | "create.receipt.paymentMethodTypes" | "create.receipt.phase" | "create.receipt.providerApiVersion" | "create.receipt.stripeSubscriptionId" | "create.state" | "definitionVersion" | "providerAction" | "providerApiVersion" | "workflowId">;
1023
+ }, "required", "accountId" | "cancelRequested" | "enabled" | "execution" | "execution.apply" | "execution.apply.receipt" | "execution.apply.receipt.customerAccount" | "execution.apply.receipt.enabled" | "execution.apply.receipt.paymentMethodId" | "execution.apply.receipt.paymentMethodTypes" | "execution.apply.receipt.phase" | "execution.apply.receipt.providerApiVersion" | "execution.apply.receipt.stripeSubscriptionId" | "execution.apply.state" | "execution.attach" | "execution.attach.receipt" | "execution.attach.receipt.customerAccount" | "execution.attach.receipt.enabled" | "execution.attach.receipt.paymentMethodId" | "execution.attach.receipt.paymentMethodTypes" | "execution.attach.receipt.phase" | "execution.attach.receipt.providerApiVersion" | "execution.attach.receipt.stripeSubscriptionId" | "execution.attach.state" | "execution.create" | "execution.create.receipt" | "execution.create.receipt.customerAccount" | "execution.create.receipt.enabled" | "execution.create.receipt.paymentMethodId" | "execution.create.receipt.paymentMethodTypes" | "execution.create.receipt.phase" | "execution.create.receipt.providerApiVersion" | "execution.create.receipt.stripeSubscriptionId" | "execution.create.state" | "execution.definitionVersion" | "execution.providerAction" | "execution.providerApiVersion" | "execution.workflowId" | "failureCode" | "kind" | "preparationId" | "providerKey" | "providerKeys" | "providerKeys.attach" | "providerKeys.create" | "providerKeys.disable" | "providerKeys.enable" | "receipt" | "receipt.customerAccount" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "scopeKey" | "state" | "version">, {
331
1024
  by_preparation_version: ["preparationId", "version", "_creationTime"];
332
1025
  }, {}, {}>;
333
1026
  balanceFundingRequests: import("convex/server").TableDefinition<import("convex/values").VObject<{
@@ -344,6 +1037,14 @@ export declare function large(count?: number, amount?: number): Promise<{
344
1037
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
345
1038
  requestKey: string;
346
1039
  result?: {
1040
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
1041
+ retryable: false;
1042
+ status: "conflict";
1043
+ } | {
1044
+ reason: "policy_invalid";
1045
+ retryable: false;
1046
+ status: "rejected";
1047
+ } | {
347
1048
  operation: {
348
1049
  accountId: string;
349
1050
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -354,14 +1055,6 @@ export declare function large(count?: number, amount?: number): Promise<{
354
1055
  } | {
355
1056
  enabled: boolean;
356
1057
  status: "unchanged";
357
- } | {
358
- reason: "identity_changed" | "revision_changed" | "scope_busy";
359
- retryable: false;
360
- status: "conflict";
361
- } | {
362
- reason: "policy_invalid";
363
- retryable: false;
364
- status: "rejected";
365
1058
  } | {
366
1059
  reason: "provider_pending";
367
1060
  retryable: true;
@@ -372,6 +1065,14 @@ export declare function large(count?: number, amount?: number): Promise<{
372
1065
  payload: import("convex/values").VString<string, "required">;
373
1066
  preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
374
1067
  result: import("convex/values").VUnion<{
1068
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
1069
+ retryable: false;
1070
+ status: "conflict";
1071
+ } | {
1072
+ reason: "policy_invalid";
1073
+ retryable: false;
1074
+ status: "rejected";
1075
+ } | {
375
1076
  operation: {
376
1077
  accountId: string;
377
1078
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -382,14 +1083,6 @@ export declare function large(count?: number, amount?: number): Promise<{
382
1083
  } | {
383
1084
  enabled: boolean;
384
1085
  status: "unchanged";
385
- } | {
386
- reason: "identity_changed" | "revision_changed" | "scope_busy";
387
- retryable: false;
388
- status: "conflict";
389
- } | {
390
- reason: "policy_invalid";
391
- retryable: false;
392
- status: "rejected";
393
1086
  } | {
394
1087
  reason: "provider_pending";
395
1088
  retryable: true;
@@ -2687,6 +3380,517 @@ export declare function large(count?: number, amount?: number): Promise<{
2687
3380
  export declare function withHistory(count?: number, amount?: number): Promise<{
2688
3381
  s: {
2689
3382
  t: import("convex-test").TestConvex<import("convex/server").SchemaDefinition<{
3383
+ processingCostReconciliationOperations: import("convex/server").TableDefinition<import("convex/values").VObject<{
3384
+ accountId: string;
3385
+ claimKey: string;
3386
+ currency: string;
3387
+ definitionVersion: number;
3388
+ expectedRevision: number;
3389
+ failure?: {
3390
+ reason: "fee_pending" | "history_incomplete" | "provider_pending";
3391
+ retryable: true;
3392
+ status: "not_ready";
3393
+ } | {
3394
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
3395
+ retryable: false;
3396
+ status: "conflict";
3397
+ } | {
3398
+ reason: "currency_mismatch" | "invalid_scope" | "payment_not_payable" | "policy_invalid" | "unsupported_source";
3399
+ retryable: false;
3400
+ status: "rejected";
3401
+ } | {
3402
+ reason: "history_incomplete" | "provider_outcome_unknown";
3403
+ retryable: false;
3404
+ status: "unknown";
3405
+ } | undefined;
3406
+ importHook?: string | undefined;
3407
+ maxAttempts: number;
3408
+ policy: {
3409
+ liability: {
3410
+ disputeCosts: "all" | "none";
3411
+ processingCosts: "all" | "none" | "uncovered";
3412
+ };
3413
+ rounding: "ceil" | "floor" | "nearest";
3414
+ sellingFee: number;
3415
+ };
3416
+ projection?: string | undefined;
3417
+ provider: string;
3418
+ providerApiVersion: string;
3419
+ requestKey: string;
3420
+ result?: {
3421
+ claim: {
3422
+ _creationTime: number;
3423
+ _id: import("convex/values").GenericId<"recoveryClaims">;
3424
+ accountId: string;
3425
+ amountDue: number;
3426
+ claimKey: string;
3427
+ collectedAmount: number;
3428
+ currency: string;
3429
+ openingCollection?: {
3430
+ amountDue: number;
3431
+ collectedAmount: number;
3432
+ operationKey: string;
3433
+ revision: number;
3434
+ } | undefined;
3435
+ outstanding: number;
3436
+ reservedAmount: number;
3437
+ revision: number;
3438
+ scopeKey: string;
3439
+ sign: "negative" | "positive" | "zero";
3440
+ sourceChargeId: string;
3441
+ sourceGross: number;
3442
+ sourceProcessingFee: number;
3443
+ };
3444
+ deficit: {
3445
+ amountDue: number;
3446
+ currency: string;
3447
+ disputeLiability: number;
3448
+ processingLiability: number;
3449
+ retainedFee: number;
3450
+ };
3451
+ observation: {
3452
+ currency: string;
3453
+ disputeFees: number;
3454
+ gross: number;
3455
+ originalProcessingFee: number;
3456
+ paymentIntentId: string;
3457
+ principalReturned: number;
3458
+ processingFee: number;
3459
+ provenance: {
3460
+ customerAccountId: string;
3461
+ invoiceId: string;
3462
+ invoicePaymentId: string;
3463
+ recoveryInvoiceItemId?: string | undefined;
3464
+ stripePriceId?: string | undefined;
3465
+ stripeProductId?: string | undefined;
3466
+ subscriptionId?: string | undefined;
3467
+ };
3468
+ sourceChargeId: string;
3469
+ };
3470
+ rollbackClaim?: {
3471
+ _creationTime: number;
3472
+ _id: import("convex/values").GenericId<"recoveryClaims">;
3473
+ accountId: string;
3474
+ amountDue: number;
3475
+ claimKey: string;
3476
+ collectedAmount: number;
3477
+ currency: string;
3478
+ openingCollection?: {
3479
+ amountDue: number;
3480
+ collectedAmount: number;
3481
+ operationKey: string;
3482
+ revision: number;
3483
+ } | undefined;
3484
+ outstanding: number;
3485
+ reservedAmount: number;
3486
+ revision: number;
3487
+ scopeKey: string;
3488
+ sign: "negative" | "positive" | "zero";
3489
+ sourceChargeId: string;
3490
+ sourceGross: number;
3491
+ sourceProcessingFee: number;
3492
+ } | undefined;
3493
+ } | undefined;
3494
+ retryDelayMs: number;
3495
+ rollback?: {
3496
+ expectedRevision: number;
3497
+ groupKey: string;
3498
+ } | undefined;
3499
+ scopeKey: string;
3500
+ source: {
3501
+ customerAccountId: string;
3502
+ gross: number;
3503
+ invoiceId?: string | undefined;
3504
+ kind: "sale";
3505
+ paymentIntentId: string;
3506
+ stripeAccountId?: string | undefined;
3507
+ stripePriceId?: string | undefined;
3508
+ stripeProductId?: string | undefined;
3509
+ subscriptionId?: string | undefined;
3510
+ } | {
3511
+ gross: number;
3512
+ groupKey: string;
3513
+ kind: "invoice_recovery";
3514
+ paymentIntentId: string;
3515
+ };
3516
+ status: "completed" | "conflict" | "queued" | "rejected" | "running" | "unknown" | "waiting";
3517
+ version: number;
3518
+ workflowId?: string | undefined;
3519
+ }, {
3520
+ accountId: import("convex/values").VString<string, "required">;
3521
+ scopeKey: import("convex/values").VString<string, "required">;
3522
+ currency: import("convex/values").VString<string, "required">;
3523
+ claimKey: import("convex/values").VString<string, "required">;
3524
+ source: import("convex/values").VUnion<{
3525
+ customerAccountId: string;
3526
+ gross: number;
3527
+ invoiceId?: string | undefined;
3528
+ kind: "sale";
3529
+ paymentIntentId: string;
3530
+ stripeAccountId?: string | undefined;
3531
+ stripePriceId?: string | undefined;
3532
+ stripeProductId?: string | undefined;
3533
+ subscriptionId?: string | undefined;
3534
+ } | {
3535
+ gross: number;
3536
+ groupKey: string;
3537
+ kind: "invoice_recovery";
3538
+ paymentIntentId: string;
3539
+ }, [import("convex/values").VObject<{
3540
+ customerAccountId: string;
3541
+ gross: number;
3542
+ invoiceId?: string | undefined;
3543
+ kind: "sale";
3544
+ paymentIntentId: string;
3545
+ stripeAccountId?: string | undefined;
3546
+ stripePriceId?: string | undefined;
3547
+ stripeProductId?: string | undefined;
3548
+ subscriptionId?: string | undefined;
3549
+ }, {
3550
+ kind: import("convex/values").VLiteral<"sale", "required">;
3551
+ paymentIntentId: import("convex/values").VString<string, "required">;
3552
+ gross: import("convex/values").VFloat64<number, "required">;
3553
+ customerAccountId: import("convex/values").VString<string, "required">;
3554
+ invoiceId: import("convex/values").VString<string | undefined, "optional">;
3555
+ subscriptionId: import("convex/values").VString<string | undefined, "optional">;
3556
+ stripeAccountId: import("convex/values").VString<string | undefined, "optional">;
3557
+ stripePriceId: import("convex/values").VString<string | undefined, "optional">;
3558
+ stripeProductId: import("convex/values").VString<string | undefined, "optional">;
3559
+ }, "required", "customerAccountId" | "gross" | "invoiceId" | "kind" | "paymentIntentId" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId">, import("convex/values").VObject<{
3560
+ gross: number;
3561
+ groupKey: string;
3562
+ kind: "invoice_recovery";
3563
+ paymentIntentId: string;
3564
+ }, {
3565
+ kind: import("convex/values").VLiteral<"invoice_recovery", "required">;
3566
+ paymentIntentId: import("convex/values").VString<string, "required">;
3567
+ gross: import("convex/values").VFloat64<number, "required">;
3568
+ groupKey: import("convex/values").VString<string, "required">;
3569
+ }, "required", "gross" | "groupKey" | "kind" | "paymentIntentId">], "required", "customerAccountId" | "gross" | "groupKey" | "invoiceId" | "kind" | "paymentIntentId" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId">;
3570
+ policy: import("convex/values").VObject<{
3571
+ liability: {
3572
+ disputeCosts: "all" | "none";
3573
+ processingCosts: "all" | "none" | "uncovered";
3574
+ };
3575
+ rounding: "ceil" | "floor" | "nearest";
3576
+ sellingFee: number;
3577
+ }, {
3578
+ sellingFee: import("convex/values").VFloat64<number, "required">;
3579
+ liability: import("convex/values").VObject<{
3580
+ disputeCosts: "all" | "none";
3581
+ processingCosts: "all" | "none" | "uncovered";
3582
+ }, {
3583
+ processingCosts: import("convex/values").VUnion<"all" | "none" | "uncovered", [import("convex/values").VLiteral<"uncovered", "required">, import("convex/values").VLiteral<"all", "required">, import("convex/values").VLiteral<"none", "required">], "required", never>;
3584
+ disputeCosts: import("convex/values").VUnion<"all" | "none", [import("convex/values").VLiteral<"all", "required">, import("convex/values").VLiteral<"none", "required">], "required", never>;
3585
+ }, "required", "disputeCosts" | "processingCosts">;
3586
+ rounding: import("convex/values").VUnion<"ceil" | "floor" | "nearest", [import("convex/values").VLiteral<"nearest", "required">, import("convex/values").VLiteral<"floor", "required">, import("convex/values").VLiteral<"ceil", "required">], "required", never>;
3587
+ }, "required", "liability" | "liability.disputeCosts" | "liability.processingCosts" | "rounding" | "sellingFee">;
3588
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
3589
+ rollback: import("convex/values").VObject<{
3590
+ expectedRevision: number;
3591
+ groupKey: string;
3592
+ } | undefined, {
3593
+ groupKey: import("convex/values").VString<string, "required">;
3594
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
3595
+ }, "optional", "expectedRevision" | "groupKey">;
3596
+ provider: import("convex/values").VString<string, "required">;
3597
+ projection: import("convex/values").VString<string | undefined, "optional">;
3598
+ importHook: import("convex/values").VString<string | undefined, "optional">;
3599
+ providerApiVersion: import("convex/values").VString<string, "required">;
3600
+ definitionVersion: import("convex/values").VFloat64<number, "required">;
3601
+ maxAttempts: import("convex/values").VFloat64<number, "required">;
3602
+ retryDelayMs: import("convex/values").VFloat64<number, "required">;
3603
+ requestKey: import("convex/values").VString<string, "required">;
3604
+ version: import("convex/values").VFloat64<number, "required">;
3605
+ workflowId: import("convex/values").VString<string | undefined, "optional">;
3606
+ status: import("convex/values").VUnion<"completed" | "conflict" | "queued" | "rejected" | "running" | "unknown" | "waiting", [import("convex/values").VLiteral<"queued", "required">, import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"waiting", "required">, import("convex/values").VLiteral<"completed", "required">, import("convex/values").VLiteral<"conflict", "required">, import("convex/values").VLiteral<"rejected", "required">, import("convex/values").VLiteral<"unknown", "required">], "required", never>;
3607
+ failure: import("convex/values").VUnion<{
3608
+ reason: "fee_pending" | "history_incomplete" | "provider_pending";
3609
+ retryable: true;
3610
+ status: "not_ready";
3611
+ } | {
3612
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
3613
+ retryable: false;
3614
+ status: "conflict";
3615
+ } | {
3616
+ reason: "currency_mismatch" | "invalid_scope" | "payment_not_payable" | "policy_invalid" | "unsupported_source";
3617
+ retryable: false;
3618
+ status: "rejected";
3619
+ } | {
3620
+ reason: "history_incomplete" | "provider_outcome_unknown";
3621
+ retryable: false;
3622
+ status: "unknown";
3623
+ } | undefined, [import("convex/values").VObject<{
3624
+ reason: "fee_pending" | "history_incomplete" | "provider_pending";
3625
+ retryable: true;
3626
+ status: "not_ready";
3627
+ }, {
3628
+ status: import("convex/values").VLiteral<"not_ready", "required">;
3629
+ reason: import("convex/values").VUnion<"fee_pending" | "history_incomplete" | "provider_pending", [import("convex/values").VLiteral<"provider_pending", "required">, import("convex/values").VLiteral<"fee_pending", "required">, import("convex/values").VLiteral<"history_incomplete", "required">], "required", never>;
3630
+ retryable: import("convex/values").VLiteral<true, "required">;
3631
+ }, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
3632
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
3633
+ retryable: false;
3634
+ status: "conflict";
3635
+ }, {
3636
+ status: import("convex/values").VLiteral<"conflict", "required">;
3637
+ reason: import("convex/values").VUnion<"identity_changed" | "revision_changed" | "scope_busy", [import("convex/values").VLiteral<"scope_busy", "required">, import("convex/values").VLiteral<"revision_changed", "required">, import("convex/values").VLiteral<"identity_changed", "required">], "required", never>;
3638
+ retryable: import("convex/values").VLiteral<false, "required">;
3639
+ }, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
3640
+ reason: "currency_mismatch" | "invalid_scope" | "payment_not_payable" | "policy_invalid" | "unsupported_source";
3641
+ retryable: false;
3642
+ status: "rejected";
3643
+ }, {
3644
+ status: import("convex/values").VLiteral<"rejected", "required">;
3645
+ reason: import("convex/values").VUnion<"currency_mismatch" | "invalid_scope" | "payment_not_payable" | "policy_invalid" | "unsupported_source", [import("convex/values").VLiteral<"invalid_scope", "required">, import("convex/values").VLiteral<"unsupported_source", "required">, import("convex/values").VLiteral<"policy_invalid", "required">, import("convex/values").VLiteral<"payment_not_payable", "required">, import("convex/values").VLiteral<"currency_mismatch", "required">], "required", never>;
3646
+ retryable: import("convex/values").VLiteral<false, "required">;
3647
+ }, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
3648
+ reason: "history_incomplete" | "provider_outcome_unknown";
3649
+ retryable: false;
3650
+ status: "unknown";
3651
+ }, {
3652
+ status: import("convex/values").VLiteral<"unknown", "required">;
3653
+ reason: import("convex/values").VUnion<"history_incomplete" | "provider_outcome_unknown", [import("convex/values").VLiteral<"provider_outcome_unknown", "required">, import("convex/values").VLiteral<"history_incomplete", "required">], "required", never>;
3654
+ retryable: import("convex/values").VLiteral<false, "required">;
3655
+ }, "required", "reason" | "retryable" | "status">], "optional", "reason" | "retryable" | "status">;
3656
+ result: import("convex/values").VObject<{
3657
+ claim: {
3658
+ _creationTime: number;
3659
+ _id: import("convex/values").GenericId<"recoveryClaims">;
3660
+ accountId: string;
3661
+ amountDue: number;
3662
+ claimKey: string;
3663
+ collectedAmount: number;
3664
+ currency: string;
3665
+ openingCollection?: {
3666
+ amountDue: number;
3667
+ collectedAmount: number;
3668
+ operationKey: string;
3669
+ revision: number;
3670
+ } | undefined;
3671
+ outstanding: number;
3672
+ reservedAmount: number;
3673
+ revision: number;
3674
+ scopeKey: string;
3675
+ sign: "negative" | "positive" | "zero";
3676
+ sourceChargeId: string;
3677
+ sourceGross: number;
3678
+ sourceProcessingFee: number;
3679
+ };
3680
+ deficit: {
3681
+ amountDue: number;
3682
+ currency: string;
3683
+ disputeLiability: number;
3684
+ processingLiability: number;
3685
+ retainedFee: number;
3686
+ };
3687
+ observation: {
3688
+ currency: string;
3689
+ disputeFees: number;
3690
+ gross: number;
3691
+ originalProcessingFee: number;
3692
+ paymentIntentId: string;
3693
+ principalReturned: number;
3694
+ processingFee: number;
3695
+ provenance: {
3696
+ customerAccountId: string;
3697
+ invoiceId: string;
3698
+ invoicePaymentId: string;
3699
+ recoveryInvoiceItemId?: string | undefined;
3700
+ stripePriceId?: string | undefined;
3701
+ stripeProductId?: string | undefined;
3702
+ subscriptionId?: string | undefined;
3703
+ };
3704
+ sourceChargeId: string;
3705
+ };
3706
+ rollbackClaim?: {
3707
+ _creationTime: number;
3708
+ _id: import("convex/values").GenericId<"recoveryClaims">;
3709
+ accountId: string;
3710
+ amountDue: number;
3711
+ claimKey: string;
3712
+ collectedAmount: number;
3713
+ currency: string;
3714
+ openingCollection?: {
3715
+ amountDue: number;
3716
+ collectedAmount: number;
3717
+ operationKey: string;
3718
+ revision: number;
3719
+ } | undefined;
3720
+ outstanding: number;
3721
+ reservedAmount: number;
3722
+ revision: number;
3723
+ scopeKey: string;
3724
+ sign: "negative" | "positive" | "zero";
3725
+ sourceChargeId: string;
3726
+ sourceGross: number;
3727
+ sourceProcessingFee: number;
3728
+ } | undefined;
3729
+ } | undefined, {
3730
+ claim: import("convex/values").VObject<{
3731
+ _creationTime: number;
3732
+ _id: import("convex/values").GenericId<"recoveryClaims">;
3733
+ accountId: string;
3734
+ amountDue: number;
3735
+ claimKey: string;
3736
+ collectedAmount: number;
3737
+ currency: string;
3738
+ openingCollection?: {
3739
+ amountDue: number;
3740
+ collectedAmount: number;
3741
+ operationKey: string;
3742
+ revision: number;
3743
+ } | undefined;
3744
+ outstanding: number;
3745
+ reservedAmount: number;
3746
+ revision: number;
3747
+ scopeKey: string;
3748
+ sign: "negative" | "positive" | "zero";
3749
+ sourceChargeId: string;
3750
+ sourceGross: number;
3751
+ sourceProcessingFee: number;
3752
+ }, {
3753
+ accountId: import("convex/values").VString<string, "required">;
3754
+ scopeKey: import("convex/values").VString<string, "required">;
3755
+ currency: import("convex/values").VString<string, "required">;
3756
+ claimKey: import("convex/values").VString<string, "required">;
3757
+ sourceChargeId: import("convex/values").VString<string, "required">;
3758
+ sourceGross: import("convex/values").VFloat64<number, "required">;
3759
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
3760
+ amountDue: import("convex/values").VFloat64<number, "required">;
3761
+ revision: import("convex/values").VFloat64<number, "required">;
3762
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
3763
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
3764
+ outstanding: import("convex/values").VFloat64<number, "required">;
3765
+ sign: import("convex/values").VUnion<"negative" | "positive" | "zero", [import("convex/values").VLiteral<"positive", "required">, import("convex/values").VLiteral<"negative", "required">, import("convex/values").VLiteral<"zero", "required">], "required", never>;
3766
+ openingCollection: import("convex/values").VObject<{
3767
+ amountDue: number;
3768
+ collectedAmount: number;
3769
+ operationKey: string;
3770
+ revision: number;
3771
+ } | undefined, {
3772
+ operationKey: import("convex/values").VString<string, "required">;
3773
+ amountDue: import("convex/values").VFloat64<number, "required">;
3774
+ revision: import("convex/values").VFloat64<number, "required">;
3775
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
3776
+ }, "optional", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
3777
+ _id: import("convex/values").VId<import("convex/values").GenericId<"recoveryClaims">, "required">;
3778
+ _creationTime: import("convex/values").VFloat64<number, "required">;
3779
+ }, "required", "_creationTime" | "_id" | "accountId" | "amountDue" | "claimKey" | "collectedAmount" | "currency" | "openingCollection" | "openingCollection.amountDue" | "openingCollection.collectedAmount" | "openingCollection.operationKey" | "openingCollection.revision" | "outstanding" | "reservedAmount" | "revision" | "scopeKey" | "sign" | "sourceChargeId" | "sourceGross" | "sourceProcessingFee">;
3780
+ rollbackClaim: import("convex/values").VObject<{
3781
+ _creationTime: number;
3782
+ _id: import("convex/values").GenericId<"recoveryClaims">;
3783
+ accountId: string;
3784
+ amountDue: number;
3785
+ claimKey: string;
3786
+ collectedAmount: number;
3787
+ currency: string;
3788
+ openingCollection?: {
3789
+ amountDue: number;
3790
+ collectedAmount: number;
3791
+ operationKey: string;
3792
+ revision: number;
3793
+ } | undefined;
3794
+ outstanding: number;
3795
+ reservedAmount: number;
3796
+ revision: number;
3797
+ scopeKey: string;
3798
+ sign: "negative" | "positive" | "zero";
3799
+ sourceChargeId: string;
3800
+ sourceGross: number;
3801
+ sourceProcessingFee: number;
3802
+ } | undefined, {
3803
+ accountId: import("convex/values").VString<string, "required">;
3804
+ scopeKey: import("convex/values").VString<string, "required">;
3805
+ currency: import("convex/values").VString<string, "required">;
3806
+ claimKey: import("convex/values").VString<string, "required">;
3807
+ sourceChargeId: import("convex/values").VString<string, "required">;
3808
+ sourceGross: import("convex/values").VFloat64<number, "required">;
3809
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
3810
+ amountDue: import("convex/values").VFloat64<number, "required">;
3811
+ revision: import("convex/values").VFloat64<number, "required">;
3812
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
3813
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
3814
+ outstanding: import("convex/values").VFloat64<number, "required">;
3815
+ sign: import("convex/values").VUnion<"negative" | "positive" | "zero", [import("convex/values").VLiteral<"positive", "required">, import("convex/values").VLiteral<"negative", "required">, import("convex/values").VLiteral<"zero", "required">], "required", never>;
3816
+ openingCollection: import("convex/values").VObject<{
3817
+ amountDue: number;
3818
+ collectedAmount: number;
3819
+ operationKey: string;
3820
+ revision: number;
3821
+ } | undefined, {
3822
+ operationKey: import("convex/values").VString<string, "required">;
3823
+ amountDue: import("convex/values").VFloat64<number, "required">;
3824
+ revision: import("convex/values").VFloat64<number, "required">;
3825
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
3826
+ }, "optional", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
3827
+ _id: import("convex/values").VId<import("convex/values").GenericId<"recoveryClaims">, "required">;
3828
+ _creationTime: import("convex/values").VFloat64<number, "required">;
3829
+ }, "optional", "_creationTime" | "_id" | "accountId" | "amountDue" | "claimKey" | "collectedAmount" | "currency" | "openingCollection" | "openingCollection.amountDue" | "openingCollection.collectedAmount" | "openingCollection.operationKey" | "openingCollection.revision" | "outstanding" | "reservedAmount" | "revision" | "scopeKey" | "sign" | "sourceChargeId" | "sourceGross" | "sourceProcessingFee">;
3830
+ deficit: import("convex/values").VObject<{
3831
+ amountDue: number;
3832
+ currency: string;
3833
+ disputeLiability: number;
3834
+ processingLiability: number;
3835
+ retainedFee: number;
3836
+ }, {
3837
+ currency: import("convex/values").VString<string, "required">;
3838
+ retainedFee: import("convex/values").VFloat64<number, "required">;
3839
+ processingLiability: import("convex/values").VFloat64<number, "required">;
3840
+ disputeLiability: import("convex/values").VFloat64<number, "required">;
3841
+ amountDue: import("convex/values").VFloat64<number, "required">;
3842
+ }, "required", "amountDue" | "currency" | "disputeLiability" | "processingLiability" | "retainedFee">;
3843
+ observation: import("convex/values").VObject<{
3844
+ currency: string;
3845
+ disputeFees: number;
3846
+ gross: number;
3847
+ originalProcessingFee: number;
3848
+ paymentIntentId: string;
3849
+ principalReturned: number;
3850
+ processingFee: number;
3851
+ provenance: {
3852
+ customerAccountId: string;
3853
+ invoiceId: string;
3854
+ invoicePaymentId: string;
3855
+ recoveryInvoiceItemId?: string | undefined;
3856
+ stripePriceId?: string | undefined;
3857
+ stripeProductId?: string | undefined;
3858
+ subscriptionId?: string | undefined;
3859
+ };
3860
+ sourceChargeId: string;
3861
+ }, {
3862
+ paymentIntentId: import("convex/values").VString<string, "required">;
3863
+ sourceChargeId: import("convex/values").VString<string, "required">;
3864
+ currency: import("convex/values").VString<string, "required">;
3865
+ gross: import("convex/values").VFloat64<number, "required">;
3866
+ originalProcessingFee: import("convex/values").VFloat64<number, "required">;
3867
+ processingFee: import("convex/values").VFloat64<number, "required">;
3868
+ disputeFees: import("convex/values").VFloat64<number, "required">;
3869
+ principalReturned: import("convex/values").VFloat64<number, "required">;
3870
+ provenance: import("convex/values").VObject<{
3871
+ customerAccountId: string;
3872
+ invoiceId: string;
3873
+ invoicePaymentId: string;
3874
+ recoveryInvoiceItemId?: string | undefined;
3875
+ stripePriceId?: string | undefined;
3876
+ stripeProductId?: string | undefined;
3877
+ subscriptionId?: string | undefined;
3878
+ }, {
3879
+ invoiceId: import("convex/values").VString<string, "required">;
3880
+ invoicePaymentId: import("convex/values").VString<string, "required">;
3881
+ recoveryInvoiceItemId: import("convex/values").VString<string | undefined, "optional">;
3882
+ customerAccountId: import("convex/values").VString<string, "required">;
3883
+ subscriptionId: import("convex/values").VString<string | undefined, "optional">;
3884
+ stripePriceId: import("convex/values").VString<string | undefined, "optional">;
3885
+ stripeProductId: import("convex/values").VString<string | undefined, "optional">;
3886
+ }, "required", "customerAccountId" | "invoiceId" | "invoicePaymentId" | "recoveryInvoiceItemId" | "stripePriceId" | "stripeProductId" | "subscriptionId">;
3887
+ }, "required", "currency" | "disputeFees" | "gross" | "originalProcessingFee" | "paymentIntentId" | "principalReturned" | "processingFee" | "provenance" | "provenance.customerAccountId" | "provenance.invoiceId" | "provenance.invoicePaymentId" | "provenance.recoveryInvoiceItemId" | "provenance.stripePriceId" | "provenance.stripeProductId" | "provenance.subscriptionId" | "sourceChargeId">;
3888
+ }, "optional", "claim" | "claim._creationTime" | "claim._id" | "claim.accountId" | "claim.amountDue" | "claim.claimKey" | "claim.collectedAmount" | "claim.currency" | "claim.openingCollection" | "claim.openingCollection.amountDue" | "claim.openingCollection.collectedAmount" | "claim.openingCollection.operationKey" | "claim.openingCollection.revision" | "claim.outstanding" | "claim.reservedAmount" | "claim.revision" | "claim.scopeKey" | "claim.sign" | "claim.sourceChargeId" | "claim.sourceGross" | "claim.sourceProcessingFee" | "deficit" | "deficit.amountDue" | "deficit.currency" | "deficit.disputeLiability" | "deficit.processingLiability" | "deficit.retainedFee" | "observation" | "observation.currency" | "observation.disputeFees" | "observation.gross" | "observation.originalProcessingFee" | "observation.paymentIntentId" | "observation.principalReturned" | "observation.processingFee" | "observation.provenance" | "observation.provenance.customerAccountId" | "observation.provenance.invoiceId" | "observation.provenance.invoicePaymentId" | "observation.provenance.recoveryInvoiceItemId" | "observation.provenance.stripePriceId" | "observation.provenance.stripeProductId" | "observation.provenance.subscriptionId" | "observation.sourceChargeId" | "rollbackClaim" | "rollbackClaim._creationTime" | "rollbackClaim._id" | "rollbackClaim.accountId" | "rollbackClaim.amountDue" | "rollbackClaim.claimKey" | "rollbackClaim.collectedAmount" | "rollbackClaim.currency" | "rollbackClaim.openingCollection" | "rollbackClaim.openingCollection.amountDue" | "rollbackClaim.openingCollection.collectedAmount" | "rollbackClaim.openingCollection.operationKey" | "rollbackClaim.openingCollection.revision" | "rollbackClaim.outstanding" | "rollbackClaim.reservedAmount" | "rollbackClaim.revision" | "rollbackClaim.scopeKey" | "rollbackClaim.sign" | "rollbackClaim.sourceChargeId" | "rollbackClaim.sourceGross" | "rollbackClaim.sourceProcessingFee">;
3889
+ }, "required", "accountId" | "claimKey" | "currency" | "definitionVersion" | "expectedRevision" | "failure" | "failure.reason" | "failure.retryable" | "failure.status" | "importHook" | "maxAttempts" | "policy" | "policy.liability" | "policy.liability.disputeCosts" | "policy.liability.processingCosts" | "policy.rounding" | "policy.sellingFee" | "projection" | "provider" | "providerApiVersion" | "requestKey" | "result" | "result.claim" | "result.claim._creationTime" | "result.claim._id" | "result.claim.accountId" | "result.claim.amountDue" | "result.claim.claimKey" | "result.claim.collectedAmount" | "result.claim.currency" | "result.claim.openingCollection" | "result.claim.openingCollection.amountDue" | "result.claim.openingCollection.collectedAmount" | "result.claim.openingCollection.operationKey" | "result.claim.openingCollection.revision" | "result.claim.outstanding" | "result.claim.reservedAmount" | "result.claim.revision" | "result.claim.scopeKey" | "result.claim.sign" | "result.claim.sourceChargeId" | "result.claim.sourceGross" | "result.claim.sourceProcessingFee" | "result.deficit" | "result.deficit.amountDue" | "result.deficit.currency" | "result.deficit.disputeLiability" | "result.deficit.processingLiability" | "result.deficit.retainedFee" | "result.observation" | "result.observation.currency" | "result.observation.disputeFees" | "result.observation.gross" | "result.observation.originalProcessingFee" | "result.observation.paymentIntentId" | "result.observation.principalReturned" | "result.observation.processingFee" | "result.observation.provenance" | "result.observation.provenance.customerAccountId" | "result.observation.provenance.invoiceId" | "result.observation.provenance.invoicePaymentId" | "result.observation.provenance.recoveryInvoiceItemId" | "result.observation.provenance.stripePriceId" | "result.observation.provenance.stripeProductId" | "result.observation.provenance.subscriptionId" | "result.observation.sourceChargeId" | "result.rollbackClaim" | "result.rollbackClaim._creationTime" | "result.rollbackClaim._id" | "result.rollbackClaim.accountId" | "result.rollbackClaim.amountDue" | "result.rollbackClaim.claimKey" | "result.rollbackClaim.collectedAmount" | "result.rollbackClaim.currency" | "result.rollbackClaim.openingCollection" | "result.rollbackClaim.openingCollection.amountDue" | "result.rollbackClaim.openingCollection.collectedAmount" | "result.rollbackClaim.openingCollection.operationKey" | "result.rollbackClaim.openingCollection.revision" | "result.rollbackClaim.outstanding" | "result.rollbackClaim.reservedAmount" | "result.rollbackClaim.revision" | "result.rollbackClaim.scopeKey" | "result.rollbackClaim.sign" | "result.rollbackClaim.sourceChargeId" | "result.rollbackClaim.sourceGross" | "result.rollbackClaim.sourceProcessingFee" | "retryDelayMs" | "rollback" | "rollback.expectedRevision" | "rollback.groupKey" | "scopeKey" | "source" | "source.customerAccountId" | "source.gross" | "source.groupKey" | "source.invoiceId" | "source.kind" | "source.paymentIntentId" | "source.stripeAccountId" | "source.stripePriceId" | "source.stripeProductId" | "source.subscriptionId" | "status" | "version" | "workflowId">, {
3890
+ by_claim_status: ["claimKey", "status", "_creationTime"];
3891
+ by_payment_scope: ["accountId", "scopeKey", "currency", "source.paymentIntentId", "_creationTime"];
3892
+ by_request: ["requestKey", "_creationTime"];
3893
+ }, {}, {}>;
2690
3894
  recoveryWorkflowOperations: import("convex/server").TableDefinition<import("convex/values").VObject<{
2691
3895
  accountId: string;
2692
3896
  activePhase?: "execute" | "reconcile" | undefined;
@@ -2959,6 +4163,48 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
2959
4163
  accountId: string;
2960
4164
  cancelRequested: boolean;
2961
4165
  enabled: boolean;
4166
+ execution?: {
4167
+ apply?: {
4168
+ receipt?: {
4169
+ customerAccount: string;
4170
+ enabled?: boolean | undefined;
4171
+ paymentMethodId: string | null;
4172
+ paymentMethodTypes?: string[] | null | undefined;
4173
+ phase: "apply" | "attach" | "create";
4174
+ providerApiVersion: string;
4175
+ stripeSubscriptionId: string;
4176
+ } | undefined;
4177
+ state: "running" | "succeeded" | "unknown";
4178
+ } | undefined;
4179
+ attach?: {
4180
+ receipt?: {
4181
+ customerAccount: string;
4182
+ enabled?: boolean | undefined;
4183
+ paymentMethodId: string | null;
4184
+ paymentMethodTypes?: string[] | null | undefined;
4185
+ phase: "apply" | "attach" | "create";
4186
+ providerApiVersion: string;
4187
+ stripeSubscriptionId: string;
4188
+ } | undefined;
4189
+ state: "running" | "succeeded" | "unknown";
4190
+ } | undefined;
4191
+ create?: {
4192
+ receipt?: {
4193
+ customerAccount: string;
4194
+ enabled?: boolean | undefined;
4195
+ paymentMethodId: string | null;
4196
+ paymentMethodTypes?: string[] | null | undefined;
4197
+ phase: "apply" | "attach" | "create";
4198
+ providerApiVersion: string;
4199
+ stripeSubscriptionId: string;
4200
+ } | undefined;
4201
+ state: "running" | "succeeded" | "unknown";
4202
+ } | undefined;
4203
+ definitionVersion: string;
4204
+ providerAction: string;
4205
+ providerApiVersion: string;
4206
+ workflowId?: string | undefined;
4207
+ } | undefined;
2962
4208
  failureCode?: "invalid_scope" | "policy_invalid" | "unsupported_source" | undefined;
2963
4209
  kind: "apply" | "prepare";
2964
4210
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
@@ -3014,7 +4260,147 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
3014
4260
  paymentMethodTypes: import("convex/values").VUnion<string[] | null, [import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VNull<null, "required">], "required", never>;
3015
4261
  providerApiVersion: import("convex/values").VString<string, "required">;
3016
4262
  }, "optional", "customerAccount" | "paymentMethodId" | "paymentMethodTypes" | "providerApiVersion" | "stripeSubscriptionId">;
3017
- }, "required", "accountId" | "cancelRequested" | "enabled" | "failureCode" | "kind" | "preparationId" | "providerKey" | "providerKeys" | "providerKeys.attach" | "providerKeys.create" | "providerKeys.disable" | "providerKeys.enable" | "receipt" | "receipt.customerAccount" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "scopeKey" | "state" | "version">, {
4263
+ execution: import("convex/values").VObject<{
4264
+ apply?: {
4265
+ receipt?: {
4266
+ customerAccount: string;
4267
+ enabled?: boolean | undefined;
4268
+ paymentMethodId: string | null;
4269
+ paymentMethodTypes?: string[] | null | undefined;
4270
+ phase: "apply" | "attach" | "create";
4271
+ providerApiVersion: string;
4272
+ stripeSubscriptionId: string;
4273
+ } | undefined;
4274
+ state: "running" | "succeeded" | "unknown";
4275
+ } | undefined;
4276
+ attach?: {
4277
+ receipt?: {
4278
+ customerAccount: string;
4279
+ enabled?: boolean | undefined;
4280
+ paymentMethodId: string | null;
4281
+ paymentMethodTypes?: string[] | null | undefined;
4282
+ phase: "apply" | "attach" | "create";
4283
+ providerApiVersion: string;
4284
+ stripeSubscriptionId: string;
4285
+ } | undefined;
4286
+ state: "running" | "succeeded" | "unknown";
4287
+ } | undefined;
4288
+ create?: {
4289
+ receipt?: {
4290
+ customerAccount: string;
4291
+ enabled?: boolean | undefined;
4292
+ paymentMethodId: string | null;
4293
+ paymentMethodTypes?: string[] | null | undefined;
4294
+ phase: "apply" | "attach" | "create";
4295
+ providerApiVersion: string;
4296
+ stripeSubscriptionId: string;
4297
+ } | undefined;
4298
+ state: "running" | "succeeded" | "unknown";
4299
+ } | undefined;
4300
+ definitionVersion: string;
4301
+ providerAction: string;
4302
+ providerApiVersion: string;
4303
+ workflowId?: string | undefined;
4304
+ } | undefined, {
4305
+ workflowId: import("convex/values").VString<string | undefined, "optional">;
4306
+ definitionVersion: import("convex/values").VString<string, "required">;
4307
+ providerApiVersion: import("convex/values").VString<string, "required">;
4308
+ providerAction: import("convex/values").VString<string, "required">;
4309
+ create: import("convex/values").VObject<{
4310
+ receipt?: {
4311
+ customerAccount: string;
4312
+ enabled?: boolean | undefined;
4313
+ paymentMethodId: string | null;
4314
+ paymentMethodTypes?: string[] | null | undefined;
4315
+ phase: "apply" | "attach" | "create";
4316
+ providerApiVersion: string;
4317
+ stripeSubscriptionId: string;
4318
+ } | undefined;
4319
+ state: "running" | "succeeded" | "unknown";
4320
+ } | undefined, {
4321
+ state: import("convex/values").VUnion<"running" | "succeeded" | "unknown", [import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"succeeded", "required">], "required", never>;
4322
+ receipt: import("convex/values").VObject<{
4323
+ customerAccount: string;
4324
+ enabled?: boolean | undefined;
4325
+ paymentMethodId: string | null;
4326
+ paymentMethodTypes?: string[] | null | undefined;
4327
+ phase: "apply" | "attach" | "create";
4328
+ providerApiVersion: string;
4329
+ stripeSubscriptionId: string;
4330
+ } | undefined, {
4331
+ phase: import("convex/values").VUnion<"apply" | "attach" | "create", [import("convex/values").VLiteral<"create", "required">, import("convex/values").VLiteral<"attach", "required">, import("convex/values").VLiteral<"apply", "required">], "required", never>;
4332
+ customerAccount: import("convex/values").VString<string, "required">;
4333
+ stripeSubscriptionId: import("convex/values").VString<string, "required">;
4334
+ paymentMethodId: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
4335
+ paymentMethodTypes: import("convex/values").VUnion<string[] | null | undefined, [import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
4336
+ enabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
4337
+ providerApiVersion: import("convex/values").VString<string, "required">;
4338
+ }, "optional", "customerAccount" | "enabled" | "paymentMethodId" | "paymentMethodTypes" | "phase" | "providerApiVersion" | "stripeSubscriptionId">;
4339
+ }, "optional", "receipt" | "receipt.customerAccount" | "receipt.enabled" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.phase" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "state">;
4340
+ attach: import("convex/values").VObject<{
4341
+ receipt?: {
4342
+ customerAccount: string;
4343
+ enabled?: boolean | undefined;
4344
+ paymentMethodId: string | null;
4345
+ paymentMethodTypes?: string[] | null | undefined;
4346
+ phase: "apply" | "attach" | "create";
4347
+ providerApiVersion: string;
4348
+ stripeSubscriptionId: string;
4349
+ } | undefined;
4350
+ state: "running" | "succeeded" | "unknown";
4351
+ } | undefined, {
4352
+ state: import("convex/values").VUnion<"running" | "succeeded" | "unknown", [import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"succeeded", "required">], "required", never>;
4353
+ receipt: import("convex/values").VObject<{
4354
+ customerAccount: string;
4355
+ enabled?: boolean | undefined;
4356
+ paymentMethodId: string | null;
4357
+ paymentMethodTypes?: string[] | null | undefined;
4358
+ phase: "apply" | "attach" | "create";
4359
+ providerApiVersion: string;
4360
+ stripeSubscriptionId: string;
4361
+ } | undefined, {
4362
+ phase: import("convex/values").VUnion<"apply" | "attach" | "create", [import("convex/values").VLiteral<"create", "required">, import("convex/values").VLiteral<"attach", "required">, import("convex/values").VLiteral<"apply", "required">], "required", never>;
4363
+ customerAccount: import("convex/values").VString<string, "required">;
4364
+ stripeSubscriptionId: import("convex/values").VString<string, "required">;
4365
+ paymentMethodId: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
4366
+ paymentMethodTypes: import("convex/values").VUnion<string[] | null | undefined, [import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
4367
+ enabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
4368
+ providerApiVersion: import("convex/values").VString<string, "required">;
4369
+ }, "optional", "customerAccount" | "enabled" | "paymentMethodId" | "paymentMethodTypes" | "phase" | "providerApiVersion" | "stripeSubscriptionId">;
4370
+ }, "optional", "receipt" | "receipt.customerAccount" | "receipt.enabled" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.phase" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "state">;
4371
+ apply: import("convex/values").VObject<{
4372
+ receipt?: {
4373
+ customerAccount: string;
4374
+ enabled?: boolean | undefined;
4375
+ paymentMethodId: string | null;
4376
+ paymentMethodTypes?: string[] | null | undefined;
4377
+ phase: "apply" | "attach" | "create";
4378
+ providerApiVersion: string;
4379
+ stripeSubscriptionId: string;
4380
+ } | undefined;
4381
+ state: "running" | "succeeded" | "unknown";
4382
+ } | undefined, {
4383
+ state: import("convex/values").VUnion<"running" | "succeeded" | "unknown", [import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"succeeded", "required">], "required", never>;
4384
+ receipt: import("convex/values").VObject<{
4385
+ customerAccount: string;
4386
+ enabled?: boolean | undefined;
4387
+ paymentMethodId: string | null;
4388
+ paymentMethodTypes?: string[] | null | undefined;
4389
+ phase: "apply" | "attach" | "create";
4390
+ providerApiVersion: string;
4391
+ stripeSubscriptionId: string;
4392
+ } | undefined, {
4393
+ phase: import("convex/values").VUnion<"apply" | "attach" | "create", [import("convex/values").VLiteral<"create", "required">, import("convex/values").VLiteral<"attach", "required">, import("convex/values").VLiteral<"apply", "required">], "required", never>;
4394
+ customerAccount: import("convex/values").VString<string, "required">;
4395
+ stripeSubscriptionId: import("convex/values").VString<string, "required">;
4396
+ paymentMethodId: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
4397
+ paymentMethodTypes: import("convex/values").VUnion<string[] | null | undefined, [import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
4398
+ enabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
4399
+ providerApiVersion: import("convex/values").VString<string, "required">;
4400
+ }, "optional", "customerAccount" | "enabled" | "paymentMethodId" | "paymentMethodTypes" | "phase" | "providerApiVersion" | "stripeSubscriptionId">;
4401
+ }, "optional", "receipt" | "receipt.customerAccount" | "receipt.enabled" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.phase" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "state">;
4402
+ }, "optional", "apply" | "apply.receipt" | "apply.receipt.customerAccount" | "apply.receipt.enabled" | "apply.receipt.paymentMethodId" | "apply.receipt.paymentMethodTypes" | "apply.receipt.phase" | "apply.receipt.providerApiVersion" | "apply.receipt.stripeSubscriptionId" | "apply.state" | "attach" | "attach.receipt" | "attach.receipt.customerAccount" | "attach.receipt.enabled" | "attach.receipt.paymentMethodId" | "attach.receipt.paymentMethodTypes" | "attach.receipt.phase" | "attach.receipt.providerApiVersion" | "attach.receipt.stripeSubscriptionId" | "attach.state" | "create" | "create.receipt" | "create.receipt.customerAccount" | "create.receipt.enabled" | "create.receipt.paymentMethodId" | "create.receipt.paymentMethodTypes" | "create.receipt.phase" | "create.receipt.providerApiVersion" | "create.receipt.stripeSubscriptionId" | "create.state" | "definitionVersion" | "providerAction" | "providerApiVersion" | "workflowId">;
4403
+ }, "required", "accountId" | "cancelRequested" | "enabled" | "execution" | "execution.apply" | "execution.apply.receipt" | "execution.apply.receipt.customerAccount" | "execution.apply.receipt.enabled" | "execution.apply.receipt.paymentMethodId" | "execution.apply.receipt.paymentMethodTypes" | "execution.apply.receipt.phase" | "execution.apply.receipt.providerApiVersion" | "execution.apply.receipt.stripeSubscriptionId" | "execution.apply.state" | "execution.attach" | "execution.attach.receipt" | "execution.attach.receipt.customerAccount" | "execution.attach.receipt.enabled" | "execution.attach.receipt.paymentMethodId" | "execution.attach.receipt.paymentMethodTypes" | "execution.attach.receipt.phase" | "execution.attach.receipt.providerApiVersion" | "execution.attach.receipt.stripeSubscriptionId" | "execution.attach.state" | "execution.create" | "execution.create.receipt" | "execution.create.receipt.customerAccount" | "execution.create.receipt.enabled" | "execution.create.receipt.paymentMethodId" | "execution.create.receipt.paymentMethodTypes" | "execution.create.receipt.phase" | "execution.create.receipt.providerApiVersion" | "execution.create.receipt.stripeSubscriptionId" | "execution.create.state" | "execution.definitionVersion" | "execution.providerAction" | "execution.providerApiVersion" | "execution.workflowId" | "failureCode" | "kind" | "preparationId" | "providerKey" | "providerKeys" | "providerKeys.attach" | "providerKeys.create" | "providerKeys.disable" | "providerKeys.enable" | "receipt" | "receipt.customerAccount" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "scopeKey" | "state" | "version">, {
3018
4404
  by_preparation_version: ["preparationId", "version", "_creationTime"];
3019
4405
  }, {}, {}>;
3020
4406
  balanceFundingRequests: import("convex/server").TableDefinition<import("convex/values").VObject<{
@@ -3031,6 +4417,14 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
3031
4417
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
3032
4418
  requestKey: string;
3033
4419
  result?: {
4420
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
4421
+ retryable: false;
4422
+ status: "conflict";
4423
+ } | {
4424
+ reason: "policy_invalid";
4425
+ retryable: false;
4426
+ status: "rejected";
4427
+ } | {
3034
4428
  operation: {
3035
4429
  accountId: string;
3036
4430
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -3041,14 +4435,6 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
3041
4435
  } | {
3042
4436
  enabled: boolean;
3043
4437
  status: "unchanged";
3044
- } | {
3045
- reason: "identity_changed" | "revision_changed" | "scope_busy";
3046
- retryable: false;
3047
- status: "conflict";
3048
- } | {
3049
- reason: "policy_invalid";
3050
- retryable: false;
3051
- status: "rejected";
3052
4438
  } | {
3053
4439
  reason: "provider_pending";
3054
4440
  retryable: true;
@@ -3059,6 +4445,14 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
3059
4445
  payload: import("convex/values").VString<string, "required">;
3060
4446
  preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
3061
4447
  result: import("convex/values").VUnion<{
4448
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
4449
+ retryable: false;
4450
+ status: "conflict";
4451
+ } | {
4452
+ reason: "policy_invalid";
4453
+ retryable: false;
4454
+ status: "rejected";
4455
+ } | {
3062
4456
  operation: {
3063
4457
  accountId: string;
3064
4458
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -3069,14 +4463,6 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
3069
4463
  } | {
3070
4464
  enabled: boolean;
3071
4465
  status: "unchanged";
3072
- } | {
3073
- reason: "identity_changed" | "revision_changed" | "scope_busy";
3074
- retryable: false;
3075
- status: "conflict";
3076
- } | {
3077
- reason: "policy_invalid";
3078
- retryable: false;
3079
- status: "rejected";
3080
4466
  } | {
3081
4467
  reason: "provider_pending";
3082
4468
  retryable: true;