@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,4 +1,515 @@
1
1
  declare const _default: import("convex/server").SchemaDefinition<{
2
+ processingCostReconciliationOperations: import("convex/server").TableDefinition<import("convex/values").VObject<{
3
+ accountId: string;
4
+ claimKey: string;
5
+ currency: string;
6
+ definitionVersion: number;
7
+ expectedRevision: number;
8
+ failure?: {
9
+ reason: "fee_pending" | "history_incomplete" | "provider_pending";
10
+ retryable: true;
11
+ status: "not_ready";
12
+ } | {
13
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
14
+ retryable: false;
15
+ status: "conflict";
16
+ } | {
17
+ reason: "currency_mismatch" | "invalid_scope" | "payment_not_payable" | "policy_invalid" | "unsupported_source";
18
+ retryable: false;
19
+ status: "rejected";
20
+ } | {
21
+ reason: "history_incomplete" | "provider_outcome_unknown";
22
+ retryable: false;
23
+ status: "unknown";
24
+ } | undefined;
25
+ importHook?: string | undefined;
26
+ maxAttempts: number;
27
+ policy: {
28
+ liability: {
29
+ disputeCosts: "all" | "none";
30
+ processingCosts: "all" | "none" | "uncovered";
31
+ };
32
+ rounding: "ceil" | "floor" | "nearest";
33
+ sellingFee: number;
34
+ };
35
+ projection?: string | undefined;
36
+ provider: string;
37
+ providerApiVersion: string;
38
+ requestKey: string;
39
+ result?: {
40
+ claim: {
41
+ _creationTime: number;
42
+ _id: import("convex/values").GenericId<"recoveryClaims">;
43
+ accountId: string;
44
+ amountDue: number;
45
+ claimKey: string;
46
+ collectedAmount: number;
47
+ currency: string;
48
+ openingCollection?: {
49
+ amountDue: number;
50
+ collectedAmount: number;
51
+ operationKey: string;
52
+ revision: number;
53
+ } | undefined;
54
+ outstanding: number;
55
+ reservedAmount: number;
56
+ revision: number;
57
+ scopeKey: string;
58
+ sign: "negative" | "positive" | "zero";
59
+ sourceChargeId: string;
60
+ sourceGross: number;
61
+ sourceProcessingFee: number;
62
+ };
63
+ deficit: {
64
+ amountDue: number;
65
+ currency: string;
66
+ disputeLiability: number;
67
+ processingLiability: number;
68
+ retainedFee: number;
69
+ };
70
+ observation: {
71
+ currency: string;
72
+ disputeFees: number;
73
+ gross: number;
74
+ originalProcessingFee: number;
75
+ paymentIntentId: string;
76
+ principalReturned: number;
77
+ processingFee: number;
78
+ provenance: {
79
+ customerAccountId: string;
80
+ invoiceId: string;
81
+ invoicePaymentId: string;
82
+ recoveryInvoiceItemId?: string | undefined;
83
+ stripePriceId?: string | undefined;
84
+ stripeProductId?: string | undefined;
85
+ subscriptionId?: string | undefined;
86
+ };
87
+ sourceChargeId: string;
88
+ };
89
+ rollbackClaim?: {
90
+ _creationTime: number;
91
+ _id: import("convex/values").GenericId<"recoveryClaims">;
92
+ accountId: string;
93
+ amountDue: number;
94
+ claimKey: string;
95
+ collectedAmount: number;
96
+ currency: string;
97
+ openingCollection?: {
98
+ amountDue: number;
99
+ collectedAmount: number;
100
+ operationKey: string;
101
+ revision: number;
102
+ } | undefined;
103
+ outstanding: number;
104
+ reservedAmount: number;
105
+ revision: number;
106
+ scopeKey: string;
107
+ sign: "negative" | "positive" | "zero";
108
+ sourceChargeId: string;
109
+ sourceGross: number;
110
+ sourceProcessingFee: number;
111
+ } | undefined;
112
+ } | undefined;
113
+ retryDelayMs: number;
114
+ rollback?: {
115
+ expectedRevision: number;
116
+ groupKey: string;
117
+ } | undefined;
118
+ scopeKey: string;
119
+ source: {
120
+ customerAccountId: string;
121
+ gross: number;
122
+ invoiceId?: string | undefined;
123
+ kind: "sale";
124
+ paymentIntentId: string;
125
+ stripeAccountId?: string | undefined;
126
+ stripePriceId?: string | undefined;
127
+ stripeProductId?: string | undefined;
128
+ subscriptionId?: string | undefined;
129
+ } | {
130
+ gross: number;
131
+ groupKey: string;
132
+ kind: "invoice_recovery";
133
+ paymentIntentId: string;
134
+ };
135
+ status: "completed" | "conflict" | "queued" | "rejected" | "running" | "unknown" | "waiting";
136
+ version: number;
137
+ workflowId?: string | undefined;
138
+ }, {
139
+ accountId: import("convex/values").VString<string, "required">;
140
+ scopeKey: import("convex/values").VString<string, "required">;
141
+ currency: import("convex/values").VString<string, "required">;
142
+ claimKey: import("convex/values").VString<string, "required">;
143
+ source: import("convex/values").VUnion<{
144
+ customerAccountId: string;
145
+ gross: number;
146
+ invoiceId?: string | undefined;
147
+ kind: "sale";
148
+ paymentIntentId: string;
149
+ stripeAccountId?: string | undefined;
150
+ stripePriceId?: string | undefined;
151
+ stripeProductId?: string | undefined;
152
+ subscriptionId?: string | undefined;
153
+ } | {
154
+ gross: number;
155
+ groupKey: string;
156
+ kind: "invoice_recovery";
157
+ paymentIntentId: string;
158
+ }, [import("convex/values").VObject<{
159
+ customerAccountId: string;
160
+ gross: number;
161
+ invoiceId?: string | undefined;
162
+ kind: "sale";
163
+ paymentIntentId: string;
164
+ stripeAccountId?: string | undefined;
165
+ stripePriceId?: string | undefined;
166
+ stripeProductId?: string | undefined;
167
+ subscriptionId?: string | undefined;
168
+ }, {
169
+ kind: import("convex/values").VLiteral<"sale", "required">;
170
+ paymentIntentId: import("convex/values").VString<string, "required">;
171
+ gross: import("convex/values").VFloat64<number, "required">;
172
+ customerAccountId: import("convex/values").VString<string, "required">;
173
+ invoiceId: import("convex/values").VString<string | undefined, "optional">;
174
+ subscriptionId: import("convex/values").VString<string | undefined, "optional">;
175
+ stripeAccountId: import("convex/values").VString<string | undefined, "optional">;
176
+ stripePriceId: import("convex/values").VString<string | undefined, "optional">;
177
+ stripeProductId: import("convex/values").VString<string | undefined, "optional">;
178
+ }, "required", "customerAccountId" | "gross" | "invoiceId" | "kind" | "paymentIntentId" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId">, import("convex/values").VObject<{
179
+ gross: number;
180
+ groupKey: string;
181
+ kind: "invoice_recovery";
182
+ paymentIntentId: string;
183
+ }, {
184
+ kind: import("convex/values").VLiteral<"invoice_recovery", "required">;
185
+ paymentIntentId: import("convex/values").VString<string, "required">;
186
+ gross: import("convex/values").VFloat64<number, "required">;
187
+ groupKey: import("convex/values").VString<string, "required">;
188
+ }, "required", "gross" | "groupKey" | "kind" | "paymentIntentId">], "required", "customerAccountId" | "gross" | "groupKey" | "invoiceId" | "kind" | "paymentIntentId" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId">;
189
+ policy: import("convex/values").VObject<{
190
+ liability: {
191
+ disputeCosts: "all" | "none";
192
+ processingCosts: "all" | "none" | "uncovered";
193
+ };
194
+ rounding: "ceil" | "floor" | "nearest";
195
+ sellingFee: number;
196
+ }, {
197
+ sellingFee: import("convex/values").VFloat64<number, "required">;
198
+ liability: import("convex/values").VObject<{
199
+ disputeCosts: "all" | "none";
200
+ processingCosts: "all" | "none" | "uncovered";
201
+ }, {
202
+ 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>;
203
+ disputeCosts: import("convex/values").VUnion<"all" | "none", [import("convex/values").VLiteral<"all", "required">, import("convex/values").VLiteral<"none", "required">], "required", never>;
204
+ }, "required", "disputeCosts" | "processingCosts">;
205
+ 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>;
206
+ }, "required", "liability" | "liability.disputeCosts" | "liability.processingCosts" | "rounding" | "sellingFee">;
207
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
208
+ rollback: import("convex/values").VObject<{
209
+ expectedRevision: number;
210
+ groupKey: string;
211
+ } | undefined, {
212
+ groupKey: import("convex/values").VString<string, "required">;
213
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
214
+ }, "optional", "expectedRevision" | "groupKey">;
215
+ provider: import("convex/values").VString<string, "required">;
216
+ projection: import("convex/values").VString<string | undefined, "optional">;
217
+ importHook: import("convex/values").VString<string | undefined, "optional">;
218
+ providerApiVersion: import("convex/values").VString<string, "required">;
219
+ definitionVersion: import("convex/values").VFloat64<number, "required">;
220
+ maxAttempts: import("convex/values").VFloat64<number, "required">;
221
+ retryDelayMs: import("convex/values").VFloat64<number, "required">;
222
+ requestKey: import("convex/values").VString<string, "required">;
223
+ version: import("convex/values").VFloat64<number, "required">;
224
+ workflowId: import("convex/values").VString<string | undefined, "optional">;
225
+ 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>;
226
+ failure: import("convex/values").VUnion<{
227
+ reason: "fee_pending" | "history_incomplete" | "provider_pending";
228
+ retryable: true;
229
+ status: "not_ready";
230
+ } | {
231
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
232
+ retryable: false;
233
+ status: "conflict";
234
+ } | {
235
+ reason: "currency_mismatch" | "invalid_scope" | "payment_not_payable" | "policy_invalid" | "unsupported_source";
236
+ retryable: false;
237
+ status: "rejected";
238
+ } | {
239
+ reason: "history_incomplete" | "provider_outcome_unknown";
240
+ retryable: false;
241
+ status: "unknown";
242
+ } | undefined, [import("convex/values").VObject<{
243
+ reason: "fee_pending" | "history_incomplete" | "provider_pending";
244
+ retryable: true;
245
+ status: "not_ready";
246
+ }, {
247
+ status: import("convex/values").VLiteral<"not_ready", "required">;
248
+ 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>;
249
+ retryable: import("convex/values").VLiteral<true, "required">;
250
+ }, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
251
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
252
+ retryable: false;
253
+ status: "conflict";
254
+ }, {
255
+ status: import("convex/values").VLiteral<"conflict", "required">;
256
+ 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>;
257
+ retryable: import("convex/values").VLiteral<false, "required">;
258
+ }, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
259
+ reason: "currency_mismatch" | "invalid_scope" | "payment_not_payable" | "policy_invalid" | "unsupported_source";
260
+ retryable: false;
261
+ status: "rejected";
262
+ }, {
263
+ status: import("convex/values").VLiteral<"rejected", "required">;
264
+ 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>;
265
+ retryable: import("convex/values").VLiteral<false, "required">;
266
+ }, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
267
+ reason: "history_incomplete" | "provider_outcome_unknown";
268
+ retryable: false;
269
+ status: "unknown";
270
+ }, {
271
+ status: import("convex/values").VLiteral<"unknown", "required">;
272
+ 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>;
273
+ retryable: import("convex/values").VLiteral<false, "required">;
274
+ }, "required", "reason" | "retryable" | "status">], "optional", "reason" | "retryable" | "status">;
275
+ result: import("convex/values").VObject<{
276
+ claim: {
277
+ _creationTime: number;
278
+ _id: import("convex/values").GenericId<"recoveryClaims">;
279
+ accountId: string;
280
+ amountDue: number;
281
+ claimKey: string;
282
+ collectedAmount: number;
283
+ currency: string;
284
+ openingCollection?: {
285
+ amountDue: number;
286
+ collectedAmount: number;
287
+ operationKey: string;
288
+ revision: number;
289
+ } | undefined;
290
+ outstanding: number;
291
+ reservedAmount: number;
292
+ revision: number;
293
+ scopeKey: string;
294
+ sign: "negative" | "positive" | "zero";
295
+ sourceChargeId: string;
296
+ sourceGross: number;
297
+ sourceProcessingFee: number;
298
+ };
299
+ deficit: {
300
+ amountDue: number;
301
+ currency: string;
302
+ disputeLiability: number;
303
+ processingLiability: number;
304
+ retainedFee: number;
305
+ };
306
+ observation: {
307
+ currency: string;
308
+ disputeFees: number;
309
+ gross: number;
310
+ originalProcessingFee: number;
311
+ paymentIntentId: string;
312
+ principalReturned: number;
313
+ processingFee: number;
314
+ provenance: {
315
+ customerAccountId: string;
316
+ invoiceId: string;
317
+ invoicePaymentId: string;
318
+ recoveryInvoiceItemId?: string | undefined;
319
+ stripePriceId?: string | undefined;
320
+ stripeProductId?: string | undefined;
321
+ subscriptionId?: string | undefined;
322
+ };
323
+ sourceChargeId: string;
324
+ };
325
+ rollbackClaim?: {
326
+ _creationTime: number;
327
+ _id: import("convex/values").GenericId<"recoveryClaims">;
328
+ accountId: string;
329
+ amountDue: number;
330
+ claimKey: string;
331
+ collectedAmount: number;
332
+ currency: string;
333
+ openingCollection?: {
334
+ amountDue: number;
335
+ collectedAmount: number;
336
+ operationKey: string;
337
+ revision: number;
338
+ } | undefined;
339
+ outstanding: number;
340
+ reservedAmount: number;
341
+ revision: number;
342
+ scopeKey: string;
343
+ sign: "negative" | "positive" | "zero";
344
+ sourceChargeId: string;
345
+ sourceGross: number;
346
+ sourceProcessingFee: number;
347
+ } | undefined;
348
+ } | undefined, {
349
+ claim: import("convex/values").VObject<{
350
+ _creationTime: number;
351
+ _id: import("convex/values").GenericId<"recoveryClaims">;
352
+ accountId: string;
353
+ amountDue: number;
354
+ claimKey: string;
355
+ collectedAmount: number;
356
+ currency: string;
357
+ openingCollection?: {
358
+ amountDue: number;
359
+ collectedAmount: number;
360
+ operationKey: string;
361
+ revision: number;
362
+ } | undefined;
363
+ outstanding: number;
364
+ reservedAmount: number;
365
+ revision: number;
366
+ scopeKey: string;
367
+ sign: "negative" | "positive" | "zero";
368
+ sourceChargeId: string;
369
+ sourceGross: number;
370
+ sourceProcessingFee: number;
371
+ }, {
372
+ accountId: import("convex/values").VString<string, "required">;
373
+ scopeKey: import("convex/values").VString<string, "required">;
374
+ currency: import("convex/values").VString<string, "required">;
375
+ claimKey: import("convex/values").VString<string, "required">;
376
+ sourceChargeId: import("convex/values").VString<string, "required">;
377
+ sourceGross: import("convex/values").VFloat64<number, "required">;
378
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
379
+ amountDue: import("convex/values").VFloat64<number, "required">;
380
+ revision: import("convex/values").VFloat64<number, "required">;
381
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
382
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
383
+ outstanding: import("convex/values").VFloat64<number, "required">;
384
+ 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>;
385
+ openingCollection: import("convex/values").VObject<{
386
+ amountDue: number;
387
+ collectedAmount: number;
388
+ operationKey: string;
389
+ revision: number;
390
+ } | undefined, {
391
+ operationKey: import("convex/values").VString<string, "required">;
392
+ amountDue: import("convex/values").VFloat64<number, "required">;
393
+ revision: import("convex/values").VFloat64<number, "required">;
394
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
395
+ }, "optional", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
396
+ _id: import("convex/values").VId<import("convex/values").GenericId<"recoveryClaims">, "required">;
397
+ _creationTime: import("convex/values").VFloat64<number, "required">;
398
+ }, "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">;
399
+ rollbackClaim: import("convex/values").VObject<{
400
+ _creationTime: number;
401
+ _id: import("convex/values").GenericId<"recoveryClaims">;
402
+ accountId: string;
403
+ amountDue: number;
404
+ claimKey: string;
405
+ collectedAmount: number;
406
+ currency: string;
407
+ openingCollection?: {
408
+ amountDue: number;
409
+ collectedAmount: number;
410
+ operationKey: string;
411
+ revision: number;
412
+ } | undefined;
413
+ outstanding: number;
414
+ reservedAmount: number;
415
+ revision: number;
416
+ scopeKey: string;
417
+ sign: "negative" | "positive" | "zero";
418
+ sourceChargeId: string;
419
+ sourceGross: number;
420
+ sourceProcessingFee: number;
421
+ } | undefined, {
422
+ accountId: import("convex/values").VString<string, "required">;
423
+ scopeKey: import("convex/values").VString<string, "required">;
424
+ currency: import("convex/values").VString<string, "required">;
425
+ claimKey: import("convex/values").VString<string, "required">;
426
+ sourceChargeId: import("convex/values").VString<string, "required">;
427
+ sourceGross: import("convex/values").VFloat64<number, "required">;
428
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
429
+ amountDue: import("convex/values").VFloat64<number, "required">;
430
+ revision: import("convex/values").VFloat64<number, "required">;
431
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
432
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
433
+ outstanding: import("convex/values").VFloat64<number, "required">;
434
+ 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>;
435
+ openingCollection: import("convex/values").VObject<{
436
+ amountDue: number;
437
+ collectedAmount: number;
438
+ operationKey: string;
439
+ revision: number;
440
+ } | undefined, {
441
+ operationKey: import("convex/values").VString<string, "required">;
442
+ amountDue: import("convex/values").VFloat64<number, "required">;
443
+ revision: import("convex/values").VFloat64<number, "required">;
444
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
445
+ }, "optional", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
446
+ _id: import("convex/values").VId<import("convex/values").GenericId<"recoveryClaims">, "required">;
447
+ _creationTime: import("convex/values").VFloat64<number, "required">;
448
+ }, "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">;
449
+ deficit: import("convex/values").VObject<{
450
+ amountDue: number;
451
+ currency: string;
452
+ disputeLiability: number;
453
+ processingLiability: number;
454
+ retainedFee: number;
455
+ }, {
456
+ currency: import("convex/values").VString<string, "required">;
457
+ retainedFee: import("convex/values").VFloat64<number, "required">;
458
+ processingLiability: import("convex/values").VFloat64<number, "required">;
459
+ disputeLiability: import("convex/values").VFloat64<number, "required">;
460
+ amountDue: import("convex/values").VFloat64<number, "required">;
461
+ }, "required", "amountDue" | "currency" | "disputeLiability" | "processingLiability" | "retainedFee">;
462
+ observation: import("convex/values").VObject<{
463
+ currency: string;
464
+ disputeFees: number;
465
+ gross: number;
466
+ originalProcessingFee: number;
467
+ paymentIntentId: string;
468
+ principalReturned: number;
469
+ processingFee: number;
470
+ provenance: {
471
+ customerAccountId: string;
472
+ invoiceId: string;
473
+ invoicePaymentId: string;
474
+ recoveryInvoiceItemId?: string | undefined;
475
+ stripePriceId?: string | undefined;
476
+ stripeProductId?: string | undefined;
477
+ subscriptionId?: string | undefined;
478
+ };
479
+ sourceChargeId: string;
480
+ }, {
481
+ paymentIntentId: import("convex/values").VString<string, "required">;
482
+ sourceChargeId: import("convex/values").VString<string, "required">;
483
+ currency: import("convex/values").VString<string, "required">;
484
+ gross: import("convex/values").VFloat64<number, "required">;
485
+ originalProcessingFee: import("convex/values").VFloat64<number, "required">;
486
+ processingFee: import("convex/values").VFloat64<number, "required">;
487
+ disputeFees: import("convex/values").VFloat64<number, "required">;
488
+ principalReturned: import("convex/values").VFloat64<number, "required">;
489
+ provenance: import("convex/values").VObject<{
490
+ customerAccountId: string;
491
+ invoiceId: string;
492
+ invoicePaymentId: string;
493
+ recoveryInvoiceItemId?: string | undefined;
494
+ stripePriceId?: string | undefined;
495
+ stripeProductId?: string | undefined;
496
+ subscriptionId?: string | undefined;
497
+ }, {
498
+ invoiceId: import("convex/values").VString<string, "required">;
499
+ invoicePaymentId: import("convex/values").VString<string, "required">;
500
+ recoveryInvoiceItemId: import("convex/values").VString<string | undefined, "optional">;
501
+ customerAccountId: import("convex/values").VString<string, "required">;
502
+ subscriptionId: import("convex/values").VString<string | undefined, "optional">;
503
+ stripePriceId: import("convex/values").VString<string | undefined, "optional">;
504
+ stripeProductId: import("convex/values").VString<string | undefined, "optional">;
505
+ }, "required", "customerAccountId" | "invoiceId" | "invoicePaymentId" | "recoveryInvoiceItemId" | "stripePriceId" | "stripeProductId" | "subscriptionId">;
506
+ }, "required", "currency" | "disputeFees" | "gross" | "originalProcessingFee" | "paymentIntentId" | "principalReturned" | "processingFee" | "provenance" | "provenance.customerAccountId" | "provenance.invoiceId" | "provenance.invoicePaymentId" | "provenance.recoveryInvoiceItemId" | "provenance.stripePriceId" | "provenance.stripeProductId" | "provenance.subscriptionId" | "sourceChargeId">;
507
+ }, "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">;
508
+ }, "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">, {
509
+ by_claim_status: ["claimKey", "status", "_creationTime"];
510
+ by_payment_scope: ["accountId", "scopeKey", "currency", "source.paymentIntentId", "_creationTime"];
511
+ by_request: ["requestKey", "_creationTime"];
512
+ }, {}, {}>;
2
513
  recoveryWorkflowOperations: import("convex/server").TableDefinition<import("convex/values").VObject<{
3
514
  accountId: string;
4
515
  activePhase?: "execute" | "reconcile" | undefined;
@@ -271,6 +782,48 @@ declare const _default: import("convex/server").SchemaDefinition<{
271
782
  accountId: string;
272
783
  cancelRequested: boolean;
273
784
  enabled: boolean;
785
+ execution?: {
786
+ apply?: {
787
+ receipt?: {
788
+ customerAccount: string;
789
+ enabled?: boolean | undefined;
790
+ paymentMethodId: string | null;
791
+ paymentMethodTypes?: string[] | null | undefined;
792
+ phase: "apply" | "attach" | "create";
793
+ providerApiVersion: string;
794
+ stripeSubscriptionId: string;
795
+ } | undefined;
796
+ state: "running" | "succeeded" | "unknown";
797
+ } | undefined;
798
+ attach?: {
799
+ receipt?: {
800
+ customerAccount: string;
801
+ enabled?: boolean | undefined;
802
+ paymentMethodId: string | null;
803
+ paymentMethodTypes?: string[] | null | undefined;
804
+ phase: "apply" | "attach" | "create";
805
+ providerApiVersion: string;
806
+ stripeSubscriptionId: string;
807
+ } | undefined;
808
+ state: "running" | "succeeded" | "unknown";
809
+ } | undefined;
810
+ create?: {
811
+ receipt?: {
812
+ customerAccount: string;
813
+ enabled?: boolean | undefined;
814
+ paymentMethodId: string | null;
815
+ paymentMethodTypes?: string[] | null | undefined;
816
+ phase: "apply" | "attach" | "create";
817
+ providerApiVersion: string;
818
+ stripeSubscriptionId: string;
819
+ } | undefined;
820
+ state: "running" | "succeeded" | "unknown";
821
+ } | undefined;
822
+ definitionVersion: string;
823
+ providerAction: string;
824
+ providerApiVersion: string;
825
+ workflowId?: string | undefined;
826
+ } | undefined;
274
827
  failureCode?: "invalid_scope" | "policy_invalid" | "unsupported_source" | undefined;
275
828
  kind: "apply" | "prepare";
276
829
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
@@ -326,7 +879,147 @@ declare const _default: import("convex/server").SchemaDefinition<{
326
879
  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>;
327
880
  providerApiVersion: import("convex/values").VString<string, "required">;
328
881
  }, "optional", "customerAccount" | "paymentMethodId" | "paymentMethodTypes" | "providerApiVersion" | "stripeSubscriptionId">;
329
- }, "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">, {
882
+ execution: import("convex/values").VObject<{
883
+ apply?: {
884
+ receipt?: {
885
+ customerAccount: string;
886
+ enabled?: boolean | undefined;
887
+ paymentMethodId: string | null;
888
+ paymentMethodTypes?: string[] | null | undefined;
889
+ phase: "apply" | "attach" | "create";
890
+ providerApiVersion: string;
891
+ stripeSubscriptionId: string;
892
+ } | undefined;
893
+ state: "running" | "succeeded" | "unknown";
894
+ } | undefined;
895
+ attach?: {
896
+ receipt?: {
897
+ customerAccount: string;
898
+ enabled?: boolean | undefined;
899
+ paymentMethodId: string | null;
900
+ paymentMethodTypes?: string[] | null | undefined;
901
+ phase: "apply" | "attach" | "create";
902
+ providerApiVersion: string;
903
+ stripeSubscriptionId: string;
904
+ } | undefined;
905
+ state: "running" | "succeeded" | "unknown";
906
+ } | undefined;
907
+ create?: {
908
+ receipt?: {
909
+ customerAccount: string;
910
+ enabled?: boolean | undefined;
911
+ paymentMethodId: string | null;
912
+ paymentMethodTypes?: string[] | null | undefined;
913
+ phase: "apply" | "attach" | "create";
914
+ providerApiVersion: string;
915
+ stripeSubscriptionId: string;
916
+ } | undefined;
917
+ state: "running" | "succeeded" | "unknown";
918
+ } | undefined;
919
+ definitionVersion: string;
920
+ providerAction: string;
921
+ providerApiVersion: string;
922
+ workflowId?: string | undefined;
923
+ } | undefined, {
924
+ workflowId: import("convex/values").VString<string | undefined, "optional">;
925
+ definitionVersion: import("convex/values").VString<string, "required">;
926
+ providerApiVersion: import("convex/values").VString<string, "required">;
927
+ providerAction: import("convex/values").VString<string, "required">;
928
+ create: import("convex/values").VObject<{
929
+ receipt?: {
930
+ customerAccount: string;
931
+ enabled?: boolean | undefined;
932
+ paymentMethodId: string | null;
933
+ paymentMethodTypes?: string[] | null | undefined;
934
+ phase: "apply" | "attach" | "create";
935
+ providerApiVersion: string;
936
+ stripeSubscriptionId: string;
937
+ } | undefined;
938
+ state: "running" | "succeeded" | "unknown";
939
+ } | undefined, {
940
+ 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>;
941
+ receipt: import("convex/values").VObject<{
942
+ customerAccount: string;
943
+ enabled?: boolean | undefined;
944
+ paymentMethodId: string | null;
945
+ paymentMethodTypes?: string[] | null | undefined;
946
+ phase: "apply" | "attach" | "create";
947
+ providerApiVersion: string;
948
+ stripeSubscriptionId: string;
949
+ } | undefined, {
950
+ 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>;
951
+ customerAccount: import("convex/values").VString<string, "required">;
952
+ stripeSubscriptionId: import("convex/values").VString<string, "required">;
953
+ paymentMethodId: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
954
+ 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>;
955
+ enabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
956
+ providerApiVersion: import("convex/values").VString<string, "required">;
957
+ }, "optional", "customerAccount" | "enabled" | "paymentMethodId" | "paymentMethodTypes" | "phase" | "providerApiVersion" | "stripeSubscriptionId">;
958
+ }, "optional", "receipt" | "receipt.customerAccount" | "receipt.enabled" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.phase" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "state">;
959
+ attach: import("convex/values").VObject<{
960
+ receipt?: {
961
+ customerAccount: string;
962
+ enabled?: boolean | undefined;
963
+ paymentMethodId: string | null;
964
+ paymentMethodTypes?: string[] | null | undefined;
965
+ phase: "apply" | "attach" | "create";
966
+ providerApiVersion: string;
967
+ stripeSubscriptionId: string;
968
+ } | undefined;
969
+ state: "running" | "succeeded" | "unknown";
970
+ } | undefined, {
971
+ 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>;
972
+ receipt: import("convex/values").VObject<{
973
+ customerAccount: string;
974
+ enabled?: boolean | undefined;
975
+ paymentMethodId: string | null;
976
+ paymentMethodTypes?: string[] | null | undefined;
977
+ phase: "apply" | "attach" | "create";
978
+ providerApiVersion: string;
979
+ stripeSubscriptionId: string;
980
+ } | undefined, {
981
+ 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>;
982
+ customerAccount: import("convex/values").VString<string, "required">;
983
+ stripeSubscriptionId: import("convex/values").VString<string, "required">;
984
+ paymentMethodId: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
985
+ 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>;
986
+ enabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
987
+ providerApiVersion: import("convex/values").VString<string, "required">;
988
+ }, "optional", "customerAccount" | "enabled" | "paymentMethodId" | "paymentMethodTypes" | "phase" | "providerApiVersion" | "stripeSubscriptionId">;
989
+ }, "optional", "receipt" | "receipt.customerAccount" | "receipt.enabled" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.phase" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "state">;
990
+ apply: import("convex/values").VObject<{
991
+ receipt?: {
992
+ customerAccount: string;
993
+ enabled?: boolean | undefined;
994
+ paymentMethodId: string | null;
995
+ paymentMethodTypes?: string[] | null | undefined;
996
+ phase: "apply" | "attach" | "create";
997
+ providerApiVersion: string;
998
+ stripeSubscriptionId: string;
999
+ } | undefined;
1000
+ state: "running" | "succeeded" | "unknown";
1001
+ } | undefined, {
1002
+ 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>;
1003
+ receipt: import("convex/values").VObject<{
1004
+ customerAccount: string;
1005
+ enabled?: boolean | undefined;
1006
+ paymentMethodId: string | null;
1007
+ paymentMethodTypes?: string[] | null | undefined;
1008
+ phase: "apply" | "attach" | "create";
1009
+ providerApiVersion: string;
1010
+ stripeSubscriptionId: string;
1011
+ } | undefined, {
1012
+ 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>;
1013
+ customerAccount: import("convex/values").VString<string, "required">;
1014
+ stripeSubscriptionId: import("convex/values").VString<string, "required">;
1015
+ paymentMethodId: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
1016
+ 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>;
1017
+ enabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
1018
+ providerApiVersion: import("convex/values").VString<string, "required">;
1019
+ }, "optional", "customerAccount" | "enabled" | "paymentMethodId" | "paymentMethodTypes" | "phase" | "providerApiVersion" | "stripeSubscriptionId">;
1020
+ }, "optional", "receipt" | "receipt.customerAccount" | "receipt.enabled" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.phase" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "state">;
1021
+ }, "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">;
1022
+ }, "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">, {
330
1023
  by_preparation_version: ["preparationId", "version", "_creationTime"];
331
1024
  }, {}, {}>;
332
1025
  balanceFundingRequests: import("convex/server").TableDefinition<import("convex/values").VObject<{