@fantastic.dev/better-stripe 0.23.0 → 0.23.2

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 (87) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/client/connect/payoutAdoption.d.ts.map +1 -1
  4. package/dist/client/connect/payoutAdoption.js +4 -3
  5. package/dist/client/connect/payoutAdoption.js.map +1 -1
  6. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +2659 -0
  7. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -0
  8. package/dist/client/connect/payoutAdoptionTestHelpers.js +231 -0
  9. package/dist/client/connect/payoutAdoptionTestHelpers.js.map +1 -0
  10. package/dist/client/connect/payoutSync.d.ts +32 -0
  11. package/dist/client/connect/payoutSync.d.ts.map +1 -0
  12. package/dist/client/connect/payoutSync.js +48 -0
  13. package/dist/client/connect/payoutSync.js.map +1 -0
  14. package/dist/client/connect/payoutSyncTestHelpers.d.ts +1263 -0
  15. package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -0
  16. package/dist/client/connect/payoutSyncTestHelpers.js +62 -0
  17. package/dist/client/connect/payoutSyncTestHelpers.js.map +1 -0
  18. package/dist/client/connect/payoutSyncValidation.d.ts +16 -0
  19. package/dist/client/connect/payoutSyncValidation.d.ts.map +1 -0
  20. package/dist/client/connect/payoutSyncValidation.js +54 -0
  21. package/dist/client/connect/payoutSyncValidation.js.map +1 -0
  22. package/dist/client/index.d.ts +26 -9
  23. package/dist/client/index.d.ts.map +1 -1
  24. package/dist/client/index.js +3 -5
  25. package/dist/client/index.js.map +1 -1
  26. package/dist/client/readContracts.d.ts +8 -0
  27. package/dist/client/readContracts.d.ts.map +1 -1
  28. package/dist/client/readContracts.js +7 -0
  29. package/dist/client/readContracts.js.map +1 -1
  30. package/dist/component/_generated/component.d.ts +69 -0
  31. package/dist/component/_generated/component.d.ts.map +1 -1
  32. package/dist/component/connect/mutations.d.ts.map +1 -1
  33. package/dist/component/connect/mutations.js +4 -27
  34. package/dist/component/connect/mutations.js.map +1 -1
  35. package/dist/component/connect/payoutWrites.d.ts +21 -0
  36. package/dist/component/connect/payoutWrites.d.ts.map +1 -0
  37. package/dist/component/connect/payoutWrites.js +19 -0
  38. package/dist/component/connect/payoutWrites.js.map +1 -0
  39. package/dist/component/earnings/triggers.d.ts +44 -0
  40. package/dist/component/earnings/triggers.d.ts.map +1 -1
  41. package/dist/component/payoutSync/helpers.d.ts +44 -0
  42. package/dist/component/payoutSync/helpers.d.ts.map +1 -0
  43. package/dist/component/payoutSync/helpers.js +60 -0
  44. package/dist/component/payoutSync/helpers.js.map +1 -0
  45. package/dist/component/payoutSync/mutations.d.ts +51 -0
  46. package/dist/component/payoutSync/mutations.d.ts.map +1 -0
  47. package/dist/component/payoutSync/mutations.js +88 -0
  48. package/dist/component/payoutSync/mutations.js.map +1 -0
  49. package/dist/component/payoutSync/queries.d.ts +16 -0
  50. package/dist/component/payoutSync/queries.d.ts.map +1 -0
  51. package/dist/component/payoutSync/queries.js +11 -0
  52. package/dist/component/payoutSync/queries.js.map +1 -0
  53. package/dist/component/payoutSync/schema.d.ts +46 -0
  54. package/dist/component/payoutSync/schema.d.ts.map +1 -0
  55. package/dist/component/payoutSync/schema.js +22 -0
  56. package/dist/component/payoutSync/schema.js.map +1 -0
  57. package/dist/component/payoutSync/validators.d.ts +137 -0
  58. package/dist/component/payoutSync/validators.d.ts.map +1 -0
  59. package/dist/component/payoutSync/validators.js +19 -0
  60. package/dist/component/payoutSync/validators.js.map +1 -0
  61. package/dist/component/schema.d.ts +21 -0
  62. package/dist/component/schema.js +2 -0
  63. package/dist/component/schema.js.map +1 -1
  64. package/docs/read-contracts.md +40 -5
  65. package/docs/settlement.md +6 -0
  66. package/package.json +1 -1
  67. package/src/client/connect/payoutAdoption.test.ts +6 -241
  68. package/src/client/connect/payoutAdoption.ts +4 -3
  69. package/src/client/connect/payoutAdoptionTestHelpers.ts +253 -0
  70. package/src/client/connect/payoutReturnedAdoption.test.ts +157 -0
  71. package/src/client/connect/payoutSync.test.ts +313 -0
  72. package/src/client/connect/payoutSync.ts +93 -0
  73. package/src/client/connect/payoutSyncTestHelpers.ts +82 -0
  74. package/src/client/connect/payoutSyncValidation.ts +74 -0
  75. package/src/client/index.ts +14 -11
  76. package/src/client/readContracts.ts +12 -0
  77. package/src/component/_generated/api.ts +10 -0
  78. package/src/component/_generated/component.ts +82 -0
  79. package/src/component/connect/mutations.ts +4 -30
  80. package/src/component/connect/payoutWrites.ts +25 -0
  81. package/src/component/payout-sync.test.ts +117 -0
  82. package/src/component/payoutSync/helpers.ts +86 -0
  83. package/src/component/payoutSync/mutations.ts +102 -0
  84. package/src/component/payoutSync/queries.ts +10 -0
  85. package/src/component/payoutSync/schema.ts +25 -0
  86. package/src/component/payoutSync/validators.ts +21 -0
  87. package/src/component/schema.ts +2 -0
@@ -0,0 +1,2659 @@
1
+ import type { Component, RunCtx } from "../helpers.js";
2
+ export declare const component: Component;
3
+ export declare const scope: {
4
+ accountId: string;
5
+ ownerKey: string;
6
+ operationKey: string;
7
+ currency: string;
8
+ independentLiabilities: number;
9
+ };
10
+ export declare function setup(amounts?: number[], currency?: string): Promise<{
11
+ t: import("convex-test").TestConvex<import("convex/server").SchemaDefinition<{
12
+ payoutSyncClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
13
+ acceptedAt?: number | undefined;
14
+ acceptedFingerprint?: string | undefined;
15
+ acceptedGeneration?: number | undefined;
16
+ accountId: string;
17
+ generation: number;
18
+ startedAt: number;
19
+ status: "accepted" | "pending" | "unknown";
20
+ stripePayoutId: string;
21
+ }, {
22
+ stripePayoutId: import("convex/values").VString<string, "required">;
23
+ accountId: import("convex/values").VString<string, "required">;
24
+ generation: import("convex/values").VFloat64<number, "required">;
25
+ status: import("convex/values").VUnion<"accepted" | "pending" | "unknown", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"accepted", "required">, import("convex/values").VLiteral<"unknown", "required">], "required", never>;
26
+ startedAt: import("convex/values").VFloat64<number, "required">;
27
+ acceptedGeneration: import("convex/values").VFloat64<number | undefined, "optional">;
28
+ acceptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
29
+ acceptedFingerprint: import("convex/values").VString<string | undefined, "optional">;
30
+ }, "required", "acceptedAt" | "acceptedFingerprint" | "acceptedGeneration" | "accountId" | "generation" | "startedAt" | "status" | "stripePayoutId">, {
31
+ by_stripe_payout_id: ["stripePayoutId", "_creationTime"];
32
+ }, {}, {}>;
33
+ payoutFeeBalances: import("convex/server").TableDefinition<import("convex/values").VObject<{
34
+ accountId: string;
35
+ amount: number;
36
+ currency: string;
37
+ ownerKey: string;
38
+ revision: number;
39
+ }, {
40
+ accountId: import("convex/values").VString<string, "required">;
41
+ ownerKey: import("convex/values").VString<string, "required">;
42
+ currency: import("convex/values").VString<string, "required">;
43
+ amount: import("convex/values").VFloat64<number, "required">;
44
+ revision: import("convex/values").VFloat64<number, "required">;
45
+ }, "required", "accountId" | "amount" | "currency" | "ownerKey" | "revision">, {
46
+ by_account_currency: ["accountId", "currency", "_creationTime"];
47
+ }, {}, {}>;
48
+ payoutReleaseClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
49
+ accountId: string;
50
+ allocations: {
51
+ amount: number;
52
+ role?: "affiliate" | "other" | "store" | undefined;
53
+ stripeTransferId: string;
54
+ }[];
55
+ amount: number;
56
+ attemptedAt?: number | undefined;
57
+ currency: string;
58
+ debitFee?: number | undefined;
59
+ debitTransactionId?: string | undefined;
60
+ destinationId?: string | undefined;
61
+ expectedRevision: number;
62
+ feeRevision?: number | undefined;
63
+ historical?: boolean | undefined;
64
+ observations: {
65
+ currency: string;
66
+ ledgerFingerprint: string;
67
+ matureNet: number;
68
+ observedAt: number;
69
+ pendingCredits: number;
70
+ stripeTransferId: string;
71
+ transactionIds: string[];
72
+ }[];
73
+ operationKey: string;
74
+ ownerKey: string;
75
+ providerFee?: number | undefined;
76
+ rejection?: {
77
+ code: "amount_too_small" | "balance_insufficient";
78
+ requestId: string;
79
+ } | undefined;
80
+ returnTransactionId?: string | undefined;
81
+ status: "canceled" | "paid" | "rejected" | "reserved" | "returned" | "submitted";
82
+ stripePayoutId?: string | undefined;
83
+ }, {
84
+ accountId: import("convex/values").VString<string, "required">;
85
+ ownerKey: import("convex/values").VString<string, "required">;
86
+ historical: import("convex/values").VBoolean<boolean | undefined, "optional">;
87
+ operationKey: import("convex/values").VString<string, "required">;
88
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
89
+ currency: import("convex/values").VString<string, "required">;
90
+ amount: import("convex/values").VFloat64<number, "required">;
91
+ destinationId: import("convex/values").VString<string | undefined, "optional">;
92
+ allocations: import("convex/values").VArray<{
93
+ amount: number;
94
+ role?: "affiliate" | "other" | "store" | undefined;
95
+ stripeTransferId: string;
96
+ }[], import("convex/values").VObject<{
97
+ amount: number;
98
+ role?: "affiliate" | "other" | "store" | undefined;
99
+ stripeTransferId: string;
100
+ }, {
101
+ stripeTransferId: import("convex/values").VString<string, "required">;
102
+ amount: import("convex/values").VFloat64<number, "required">;
103
+ role: import("convex/values").VUnion<"affiliate" | "other" | "store" | undefined, [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "optional", never>;
104
+ }, "required", "amount" | "role" | "stripeTransferId">, "required">;
105
+ observations: import("convex/values").VArray<{
106
+ currency: string;
107
+ ledgerFingerprint: string;
108
+ matureNet: number;
109
+ observedAt: number;
110
+ pendingCredits: number;
111
+ stripeTransferId: string;
112
+ transactionIds: string[];
113
+ }[], import("convex/values").VObject<{
114
+ currency: string;
115
+ ledgerFingerprint: string;
116
+ matureNet: number;
117
+ observedAt: number;
118
+ pendingCredits: number;
119
+ stripeTransferId: string;
120
+ transactionIds: string[];
121
+ }, {
122
+ stripeTransferId: import("convex/values").VString<string, "required">;
123
+ currency: import("convex/values").VString<string, "required">;
124
+ matureNet: import("convex/values").VFloat64<number, "required">;
125
+ pendingCredits: import("convex/values").VFloat64<number, "required">;
126
+ ledgerFingerprint: import("convex/values").VString<string, "required">;
127
+ observedAt: import("convex/values").VFloat64<number, "required">;
128
+ transactionIds: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
129
+ }, "required", "currency" | "ledgerFingerprint" | "matureNet" | "observedAt" | "pendingCredits" | "stripeTransferId" | "transactionIds">, "required">;
130
+ status: import("convex/values").VUnion<"canceled" | "paid" | "rejected" | "reserved" | "returned" | "submitted", [import("convex/values").VLiteral<"reserved", "required">, import("convex/values").VLiteral<"submitted", "required">, import("convex/values").VLiteral<"paid", "required">, import("convex/values").VLiteral<"returned", "required">, import("convex/values").VLiteral<"canceled", "required">, import("convex/values").VLiteral<"rejected", "required">], "required", never>;
131
+ attemptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
132
+ stripePayoutId: import("convex/values").VString<string | undefined, "optional">;
133
+ returnTransactionId: import("convex/values").VString<string | undefined, "optional">;
134
+ feeRevision: import("convex/values").VFloat64<number | undefined, "optional">;
135
+ debitTransactionId: import("convex/values").VString<string | undefined, "optional">;
136
+ debitFee: import("convex/values").VFloat64<number | undefined, "optional">;
137
+ providerFee: import("convex/values").VFloat64<number | undefined, "optional">;
138
+ rejection: import("convex/values").VObject<{
139
+ code: "amount_too_small" | "balance_insufficient";
140
+ requestId: string;
141
+ } | undefined, {
142
+ requestId: import("convex/values").VString<string, "required">;
143
+ code: import("convex/values").VUnion<"amount_too_small" | "balance_insufficient", [import("convex/values").VLiteral<"balance_insufficient", "required">, import("convex/values").VLiteral<"amount_too_small", "required">], "required", never>;
144
+ }, "optional", "code" | "requestId">;
145
+ }, "required", "accountId" | "allocations" | "amount" | "attemptedAt" | "currency" | "debitFee" | "debitTransactionId" | "destinationId" | "expectedRevision" | "feeRevision" | "historical" | "observations" | "operationKey" | "ownerKey" | "providerFee" | "rejection" | "rejection.code" | "rejection.requestId" | "returnTransactionId" | "status" | "stripePayoutId">, {
146
+ by_account_status: ["accountId", "status", "_creationTime"];
147
+ by_debit_receipt: ["debitTransactionId", "_creationTime"];
148
+ by_operation: ["operationKey", "_creationTime"];
149
+ by_provider_payout: ["stripePayoutId", "_creationTime"];
150
+ by_rejection_request: ["rejection.requestId", "_creationTime"];
151
+ by_return_receipt: ["returnTransactionId", "_creationTime"];
152
+ }, {}, {}>;
153
+ payoutSourceAllocations: import("convex/server").TableDefinition<import("convex/values").VObject<{
154
+ accountId: string;
155
+ currency: string;
156
+ ownerKey: string;
157
+ paidAmount: number;
158
+ reservedAmount: number;
159
+ stripeTransferId: string;
160
+ }, {
161
+ accountId: import("convex/values").VString<string, "required">;
162
+ ownerKey: import("convex/values").VString<string, "required">;
163
+ stripeTransferId: import("convex/values").VString<string, "required">;
164
+ currency: import("convex/values").VString<string, "required">;
165
+ paidAmount: import("convex/values").VFloat64<number, "required">;
166
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
167
+ }, "required", "accountId" | "currency" | "ownerKey" | "paidAmount" | "reservedAmount" | "stripeTransferId">, {
168
+ by_account: ["accountId", "_creationTime"];
169
+ by_transfer: ["stripeTransferId", "_creationTime"];
170
+ }, {}, {}>;
171
+ payoutPolicies: import("convex/server").TableDefinition<import("convex/values").VObject<{
172
+ accountId: string;
173
+ country: string;
174
+ holdDeadline?: number | undefined;
175
+ mode: "custom" | "stripe_managed";
176
+ operationKey: string;
177
+ ownerKey: string;
178
+ previousSchedule?: {
179
+ interval: "daily" | "manual" | "monthly" | "weekly";
180
+ monthlyDays?: number[] | undefined;
181
+ weeklyDays?: string[] | undefined;
182
+ } | undefined;
183
+ revision: number;
184
+ status: "changing" | "ready";
185
+ thresholds: {
186
+ amount: number;
187
+ currency: string;
188
+ }[];
189
+ }, {
190
+ accountId: import("convex/values").VString<string, "required">;
191
+ ownerKey: import("convex/values").VString<string, "required">;
192
+ revision: import("convex/values").VFloat64<number, "required">;
193
+ mode: import("convex/values").VUnion<"custom" | "stripe_managed", [import("convex/values").VLiteral<"stripe_managed", "required">, import("convex/values").VLiteral<"custom", "required">], "required", never>;
194
+ thresholds: import("convex/values").VArray<{
195
+ amount: number;
196
+ currency: string;
197
+ }[], import("convex/values").VObject<{
198
+ amount: number;
199
+ currency: string;
200
+ }, {
201
+ currency: import("convex/values").VString<string, "required">;
202
+ amount: import("convex/values").VFloat64<number, "required">;
203
+ }, "required", "amount" | "currency">, "required">;
204
+ status: import("convex/values").VUnion<"changing" | "ready", [import("convex/values").VLiteral<"changing", "required">, import("convex/values").VLiteral<"ready", "required">], "required", never>;
205
+ operationKey: import("convex/values").VString<string, "required">;
206
+ country: import("convex/values").VString<string, "required">;
207
+ previousSchedule: import("convex/values").VObject<{
208
+ interval: "daily" | "manual" | "monthly" | "weekly";
209
+ monthlyDays?: number[] | undefined;
210
+ weeklyDays?: string[] | undefined;
211
+ } | undefined, {
212
+ interval: import("convex/values").VUnion<"daily" | "manual" | "monthly" | "weekly", [import("convex/values").VLiteral<"daily", "required">, import("convex/values").VLiteral<"weekly", "required">, import("convex/values").VLiteral<"monthly", "required">, import("convex/values").VLiteral<"manual", "required">], "required", never>;
213
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
214
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
215
+ }, "optional", "interval" | "monthlyDays" | "weeklyDays">;
216
+ holdDeadline: import("convex/values").VFloat64<number | undefined, "optional">;
217
+ }, "required", "accountId" | "country" | "holdDeadline" | "mode" | "operationKey" | "ownerKey" | "previousSchedule" | "previousSchedule.interval" | "previousSchedule.monthlyDays" | "previousSchedule.weeklyDays" | "revision" | "status" | "thresholds">, {
218
+ by_account: ["accountId", "_creationTime"];
219
+ by_deadline: ["holdDeadline", "_creationTime"];
220
+ }, {}, {}>;
221
+ payoutPolicyOperations: import("convex/server").TableDefinition<import("convex/values").VObject<{
222
+ accountId: string;
223
+ adoption?: {
224
+ claims: {
225
+ fingerprint: string;
226
+ operationKey: string;
227
+ }[];
228
+ observations: {
229
+ currency: string;
230
+ ledgerFingerprint: string;
231
+ matureNet: number;
232
+ observedAt: number;
233
+ pendingCredits: number;
234
+ stripeTransferId: string;
235
+ transactionIds: string[];
236
+ }[];
237
+ oldestHeldAt?: number | undefined;
238
+ } | undefined;
239
+ attempted?: boolean | undefined;
240
+ country: string;
241
+ expectedRevision: number;
242
+ mode: "custom" | "stripe_managed";
243
+ observedAt?: number | undefined;
244
+ observedSchedule: {
245
+ interval: "daily" | "manual" | "monthly" | "weekly";
246
+ monthlyDays?: number[] | undefined;
247
+ weeklyDays?: string[] | undefined;
248
+ };
249
+ operationKey: string;
250
+ ownerKey: string;
251
+ previousSchedule: {
252
+ interval: "daily" | "manual" | "monthly" | "weekly";
253
+ monthlyDays?: number[] | undefined;
254
+ weeklyDays?: string[] | undefined;
255
+ };
256
+ revision: number;
257
+ status: "canceled" | "complete" | "pending";
258
+ targetSchedule: {
259
+ interval: "daily" | "manual" | "monthly" | "weekly";
260
+ monthlyDays?: number[] | undefined;
261
+ weeklyDays?: string[] | undefined;
262
+ };
263
+ thresholds: {
264
+ amount: number;
265
+ currency: string;
266
+ }[];
267
+ }, {
268
+ accountId: import("convex/values").VString<string, "required">;
269
+ ownerKey: import("convex/values").VString<string, "required">;
270
+ adoption: import("convex/values").VObject<{
271
+ claims: {
272
+ fingerprint: string;
273
+ operationKey: string;
274
+ }[];
275
+ observations: {
276
+ currency: string;
277
+ ledgerFingerprint: string;
278
+ matureNet: number;
279
+ observedAt: number;
280
+ pendingCredits: number;
281
+ stripeTransferId: string;
282
+ transactionIds: string[];
283
+ }[];
284
+ oldestHeldAt?: number | undefined;
285
+ } | undefined, {
286
+ observations: import("convex/values").VArray<{
287
+ currency: string;
288
+ ledgerFingerprint: string;
289
+ matureNet: number;
290
+ observedAt: number;
291
+ pendingCredits: number;
292
+ stripeTransferId: string;
293
+ transactionIds: string[];
294
+ }[], import("convex/values").VObject<{
295
+ currency: string;
296
+ ledgerFingerprint: string;
297
+ matureNet: number;
298
+ observedAt: number;
299
+ pendingCredits: number;
300
+ stripeTransferId: string;
301
+ transactionIds: string[];
302
+ }, {
303
+ stripeTransferId: import("convex/values").VString<string, "required">;
304
+ currency: import("convex/values").VString<string, "required">;
305
+ matureNet: import("convex/values").VFloat64<number, "required">;
306
+ pendingCredits: import("convex/values").VFloat64<number, "required">;
307
+ ledgerFingerprint: import("convex/values").VString<string, "required">;
308
+ observedAt: import("convex/values").VFloat64<number, "required">;
309
+ transactionIds: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
310
+ }, "required", "currency" | "ledgerFingerprint" | "matureNet" | "observedAt" | "pendingCredits" | "stripeTransferId" | "transactionIds">, "required">;
311
+ claims: import("convex/values").VArray<{
312
+ fingerprint: string;
313
+ operationKey: string;
314
+ }[], import("convex/values").VObject<{
315
+ fingerprint: string;
316
+ operationKey: string;
317
+ }, {
318
+ operationKey: import("convex/values").VString<string, "required">;
319
+ fingerprint: import("convex/values").VString<string, "required">;
320
+ }, "required", "fingerprint" | "operationKey">, "required">;
321
+ oldestHeldAt: import("convex/values").VFloat64<number | undefined, "optional">;
322
+ }, "optional", "claims" | "observations" | "oldestHeldAt">;
323
+ operationKey: import("convex/values").VString<string, "required">;
324
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
325
+ mode: import("convex/values").VUnion<"custom" | "stripe_managed", [import("convex/values").VLiteral<"stripe_managed", "required">, import("convex/values").VLiteral<"custom", "required">], "required", never>;
326
+ thresholds: import("convex/values").VArray<{
327
+ amount: number;
328
+ currency: string;
329
+ }[], import("convex/values").VObject<{
330
+ amount: number;
331
+ currency: string;
332
+ }, {
333
+ currency: import("convex/values").VString<string, "required">;
334
+ amount: import("convex/values").VFloat64<number, "required">;
335
+ }, "required", "amount" | "currency">, "required">;
336
+ country: import("convex/values").VString<string, "required">;
337
+ observedSchedule: import("convex/values").VObject<{
338
+ interval: "daily" | "manual" | "monthly" | "weekly";
339
+ monthlyDays?: number[] | undefined;
340
+ weeklyDays?: string[] | undefined;
341
+ }, {
342
+ interval: import("convex/values").VUnion<"daily" | "manual" | "monthly" | "weekly", [import("convex/values").VLiteral<"daily", "required">, import("convex/values").VLiteral<"weekly", "required">, import("convex/values").VLiteral<"monthly", "required">, import("convex/values").VLiteral<"manual", "required">], "required", never>;
343
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
344
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
345
+ }, "required", "interval" | "monthlyDays" | "weeklyDays">;
346
+ observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
347
+ revision: import("convex/values").VFloat64<number, "required">;
348
+ previousSchedule: import("convex/values").VObject<{
349
+ interval: "daily" | "manual" | "monthly" | "weekly";
350
+ monthlyDays?: number[] | undefined;
351
+ weeklyDays?: string[] | undefined;
352
+ }, {
353
+ interval: import("convex/values").VUnion<"daily" | "manual" | "monthly" | "weekly", [import("convex/values").VLiteral<"daily", "required">, import("convex/values").VLiteral<"weekly", "required">, import("convex/values").VLiteral<"monthly", "required">, import("convex/values").VLiteral<"manual", "required">], "required", never>;
354
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
355
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
356
+ }, "required", "interval" | "monthlyDays" | "weeklyDays">;
357
+ targetSchedule: import("convex/values").VObject<{
358
+ interval: "daily" | "manual" | "monthly" | "weekly";
359
+ monthlyDays?: number[] | undefined;
360
+ weeklyDays?: string[] | undefined;
361
+ }, {
362
+ interval: import("convex/values").VUnion<"daily" | "manual" | "monthly" | "weekly", [import("convex/values").VLiteral<"daily", "required">, import("convex/values").VLiteral<"weekly", "required">, import("convex/values").VLiteral<"monthly", "required">, import("convex/values").VLiteral<"manual", "required">], "required", never>;
363
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
364
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
365
+ }, "required", "interval" | "monthlyDays" | "weeklyDays">;
366
+ status: import("convex/values").VUnion<"canceled" | "complete" | "pending", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"complete", "required">, import("convex/values").VLiteral<"canceled", "required">], "required", never>;
367
+ attempted: import("convex/values").VBoolean<boolean | undefined, "optional">;
368
+ }, "required", "accountId" | "adoption" | "adoption.claims" | "adoption.observations" | "adoption.oldestHeldAt" | "attempted" | "country" | "expectedRevision" | "mode" | "observedAt" | "observedSchedule" | "observedSchedule.interval" | "observedSchedule.monthlyDays" | "observedSchedule.weeklyDays" | "operationKey" | "ownerKey" | "previousSchedule" | "previousSchedule.interval" | "previousSchedule.monthlyDays" | "previousSchedule.weeklyDays" | "revision" | "status" | "targetSchedule" | "targetSchedule.interval" | "targetSchedule.monthlyDays" | "targetSchedule.weeklyDays" | "thresholds">, {
369
+ by_operation: ["operationKey", "_creationTime"];
370
+ }, {}, {}>;
371
+ currencyTotals: import("convex/server").TableDefinition<import("convex/values").VObject<{
372
+ accountId: string;
373
+ count: number;
374
+ currency: string;
375
+ gross: number;
376
+ kind: "earnings" | "payouts";
377
+ paidOut: number;
378
+ reversed: number;
379
+ }, {
380
+ accountId: import("convex/values").VString<string, "required">;
381
+ currency: import("convex/values").VString<string, "required">;
382
+ kind: import("convex/values").VUnion<"earnings" | "payouts", [import("convex/values").VLiteral<"earnings", "required">, import("convex/values").VLiteral<"payouts", "required">], "required", never>;
383
+ gross: import("convex/values").VFloat64<number, "required">;
384
+ reversed: import("convex/values").VFloat64<number, "required">;
385
+ paidOut: import("convex/values").VFloat64<number, "required">;
386
+ count: import("convex/values").VFloat64<number, "required">;
387
+ }, "required", "accountId" | "count" | "currency" | "gross" | "kind" | "paidOut" | "reversed">, {
388
+ by_account_kind_currency: ["accountId", "kind", "currency", "_creationTime"];
389
+ }, {}, {}>;
390
+ recoveryClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
391
+ accountId: string;
392
+ amountDue: number;
393
+ claimKey: string;
394
+ collectedAmount: number;
395
+ currency: string;
396
+ openingCollection?: {
397
+ amountDue: number;
398
+ collectedAmount: number;
399
+ operationKey: string;
400
+ revision: number;
401
+ } | undefined;
402
+ outstanding: number;
403
+ reservedAmount: number;
404
+ revision: number;
405
+ scopeKey: string;
406
+ sign: "negative" | "positive" | "zero";
407
+ sourceChargeId: string;
408
+ sourceGross: number;
409
+ sourceProcessingFee: number;
410
+ }, {
411
+ accountId: import("convex/values").VString<string, "required">;
412
+ scopeKey: import("convex/values").VString<string, "required">;
413
+ currency: import("convex/values").VString<string, "required">;
414
+ claimKey: import("convex/values").VString<string, "required">;
415
+ sourceChargeId: import("convex/values").VString<string, "required">;
416
+ sourceGross: import("convex/values").VFloat64<number, "required">;
417
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
418
+ amountDue: import("convex/values").VFloat64<number, "required">;
419
+ revision: import("convex/values").VFloat64<number, "required">;
420
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
421
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
422
+ outstanding: import("convex/values").VFloat64<number, "required">;
423
+ 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>;
424
+ openingCollection: import("convex/values").VObject<{
425
+ amountDue: number;
426
+ collectedAmount: number;
427
+ operationKey: string;
428
+ revision: number;
429
+ } | undefined, {
430
+ operationKey: import("convex/values").VString<string, "required">;
431
+ amountDue: import("convex/values").VFloat64<number, "required">;
432
+ revision: import("convex/values").VFloat64<number, "required">;
433
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
434
+ }, "optional", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
435
+ }, "required", "accountId" | "amountDue" | "claimKey" | "collectedAmount" | "currency" | "openingCollection" | "openingCollection.amountDue" | "openingCollection.collectedAmount" | "openingCollection.operationKey" | "openingCollection.revision" | "outstanding" | "reservedAmount" | "revision" | "scopeKey" | "sign" | "sourceChargeId" | "sourceGross" | "sourceProcessingFee">, {
436
+ by_import: ["openingCollection.operationKey", "_creationTime"];
437
+ by_key: ["claimKey", "_creationTime"];
438
+ by_scope: ["accountId", "scopeKey", "currency", "_creationTime"];
439
+ by_sign: ["accountId", "scopeKey", "currency", "sign", "_creationTime"];
440
+ }, {}, {}>;
441
+ recoveryBalances: import("convex/server").TableDefinition<import("convex/values").VObject<{
442
+ accountId: string;
443
+ activeGroupKey?: string | undefined;
444
+ amountDue: number;
445
+ collectedAmount: number;
446
+ currency: string;
447
+ outstanding: number;
448
+ reservedAmount: number;
449
+ scopeKey: string;
450
+ }, {
451
+ accountId: import("convex/values").VString<string, "required">;
452
+ scopeKey: import("convex/values").VString<string, "required">;
453
+ currency: import("convex/values").VString<string, "required">;
454
+ amountDue: import("convex/values").VFloat64<number, "required">;
455
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
456
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
457
+ outstanding: import("convex/values").VFloat64<number, "required">;
458
+ activeGroupKey: import("convex/values").VString<string | undefined, "optional">;
459
+ }, "required", "accountId" | "activeGroupKey" | "amountDue" | "collectedAmount" | "currency" | "outstanding" | "reservedAmount" | "scopeKey">, {
460
+ by_scope: ["accountId", "scopeKey", "currency", "_creationTime"];
461
+ }, {}, {}>;
462
+ recoveryGroups: import("convex/server").TableDefinition<import("convex/values").VObject<{
463
+ accountId: string;
464
+ amount: number;
465
+ currency: string;
466
+ groupKey: string;
467
+ invoiceFunding?: {
468
+ sourceChargeId: string;
469
+ sourceGross: number;
470
+ sourceProcessingFee: number;
471
+ } | undefined;
472
+ invoiceItemId?: string | undefined;
473
+ maxCredit: number;
474
+ maxDebit: number;
475
+ pendingOperations: number;
476
+ scopeKey: string;
477
+ sourceGross?: number | undefined;
478
+ sourceId: string;
479
+ sourceKind: "invoice" | "settlement";
480
+ sourceProcessingFee?: number | undefined;
481
+ status: "collected" | "collecting" | "open" | "released" | "releasing" | "sealed";
482
+ }, {
483
+ accountId: import("convex/values").VString<string, "required">;
484
+ scopeKey: import("convex/values").VString<string, "required">;
485
+ currency: import("convex/values").VString<string, "required">;
486
+ groupKey: import("convex/values").VString<string, "required">;
487
+ sourceKind: import("convex/values").VUnion<"invoice" | "settlement", [import("convex/values").VLiteral<"settlement", "required">, import("convex/values").VLiteral<"invoice", "required">], "required", never>;
488
+ sourceId: import("convex/values").VString<string, "required">;
489
+ sourceGross: import("convex/values").VFloat64<number | undefined, "optional">;
490
+ sourceProcessingFee: import("convex/values").VFloat64<number | undefined, "optional">;
491
+ maxDebit: import("convex/values").VFloat64<number, "required">;
492
+ maxCredit: import("convex/values").VFloat64<number, "required">;
493
+ amount: import("convex/values").VFloat64<number, "required">;
494
+ pendingOperations: import("convex/values").VFloat64<number, "required">;
495
+ invoiceItemId: import("convex/values").VString<string | undefined, "optional">;
496
+ invoiceFunding: import("convex/values").VObject<{
497
+ sourceChargeId: string;
498
+ sourceGross: number;
499
+ sourceProcessingFee: number;
500
+ } | undefined, {
501
+ sourceChargeId: import("convex/values").VString<string, "required">;
502
+ sourceGross: import("convex/values").VFloat64<number, "required">;
503
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
504
+ }, "optional", "sourceChargeId" | "sourceGross" | "sourceProcessingFee">;
505
+ status: import("convex/values").VUnion<"collected" | "collecting" | "open" | "released" | "releasing" | "sealed", [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"sealed", "required">, import("convex/values").VLiteral<"collecting", "required">, import("convex/values").VLiteral<"releasing", "required">, import("convex/values").VLiteral<"collected", "required">, import("convex/values").VLiteral<"released", "required">], "required", never>;
506
+ }, "required", "accountId" | "amount" | "currency" | "groupKey" | "invoiceFunding" | "invoiceFunding.sourceChargeId" | "invoiceFunding.sourceGross" | "invoiceFunding.sourceProcessingFee" | "invoiceItemId" | "maxCredit" | "maxDebit" | "pendingOperations" | "scopeKey" | "sourceGross" | "sourceId" | "sourceKind" | "sourceProcessingFee" | "status">, {
507
+ by_key: ["groupKey", "_creationTime"];
508
+ }, {}, {}>;
509
+ recoveryReservations: import("convex/server").TableDefinition<import("convex/values").VObject<{
510
+ allocations: {
511
+ amount: number;
512
+ claimId: import("convex/values").GenericId<"recoveryClaims">;
513
+ claimKey: string;
514
+ }[];
515
+ amount: number;
516
+ groupKey: string;
517
+ limit: number;
518
+ operationKey: string;
519
+ status: "collected" | "empty" | "released" | "reserved";
520
+ }, {
521
+ operationKey: import("convex/values").VString<string, "required">;
522
+ groupKey: import("convex/values").VString<string, "required">;
523
+ amount: import("convex/values").VFloat64<number, "required">;
524
+ limit: import("convex/values").VFloat64<number, "required">;
525
+ allocations: import("convex/values").VArray<{
526
+ amount: number;
527
+ claimId: import("convex/values").GenericId<"recoveryClaims">;
528
+ claimKey: string;
529
+ }[], import("convex/values").VObject<{
530
+ amount: number;
531
+ claimId: import("convex/values").GenericId<"recoveryClaims">;
532
+ claimKey: string;
533
+ }, {
534
+ claimId: import("convex/values").VId<import("convex/values").GenericId<"recoveryClaims">, "required">;
535
+ claimKey: import("convex/values").VString<string, "required">;
536
+ amount: import("convex/values").VFloat64<number, "required">;
537
+ }, "required", "amount" | "claimId" | "claimKey">, "required">;
538
+ status: import("convex/values").VUnion<"collected" | "empty" | "released" | "reserved", [import("convex/values").VLiteral<"reserved", "required">, import("convex/values").VLiteral<"collected", "required">, import("convex/values").VLiteral<"released", "required">, import("convex/values").VLiteral<"empty", "required">], "required", never>;
539
+ }, "required", "allocations" | "amount" | "groupKey" | "limit" | "operationKey" | "status">, {
540
+ by_group_status: ["groupKey", "status", "_creationTime"];
541
+ by_key: ["operationKey", "_creationTime"];
542
+ }, {}, {}>;
543
+ settlementAllocations: import("convex/server").TableDefinition<import("convex/values").VObject<{
544
+ adjustmentAmount?: number | undefined;
545
+ currency: string;
546
+ gross: number;
547
+ paymentId?: string | undefined;
548
+ paymentIntentId?: string | undefined;
549
+ platformNet: number;
550
+ processingFee: number;
551
+ sourceChargeId: string;
552
+ sourceInvoiceId?: string | undefined;
553
+ transfers: {
554
+ amount: number;
555
+ destinationAccountId: string;
556
+ role: "affiliate" | "other" | "store";
557
+ }[];
558
+ }, {
559
+ sourceChargeId: import("convex/values").VString<string, "required">;
560
+ paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
561
+ sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
562
+ gross: import("convex/values").VFloat64<number, "required">;
563
+ currency: import("convex/values").VString<string, "required">;
564
+ processingFee: import("convex/values").VFloat64<number, "required">;
565
+ platformNet: import("convex/values").VFloat64<number, "required">;
566
+ adjustmentAmount: import("convex/values").VFloat64<number | undefined, "optional">;
567
+ paymentId: import("convex/values").VString<string | undefined, "optional">;
568
+ transfers: import("convex/values").VArray<{
569
+ amount: number;
570
+ destinationAccountId: string;
571
+ role: "affiliate" | "other" | "store";
572
+ }[], import("convex/values").VObject<{
573
+ amount: number;
574
+ destinationAccountId: string;
575
+ role: "affiliate" | "other" | "store";
576
+ }, {
577
+ destinationAccountId: import("convex/values").VString<string, "required">;
578
+ role: import("convex/values").VUnion<"affiliate" | "other" | "store", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
579
+ amount: import("convex/values").VFloat64<number, "required">;
580
+ }, "required", "amount" | "destinationAccountId" | "role">, "required">;
581
+ }, "required", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">, {
582
+ by_source_charge: ["sourceChargeId", "_creationTime"];
583
+ }, {}, {}>;
584
+ commissionTerms: import("convex/server").TableDefinition<import("convex/values").VObject<{
585
+ affiliateAccountId?: string | undefined;
586
+ firstPaidInvoiceId: string;
587
+ subscriptionId: string;
588
+ term: "forever" | "one_time";
589
+ }, {
590
+ subscriptionId: import("convex/values").VString<string, "required">;
591
+ term: import("convex/values").VUnion<"forever" | "one_time", [import("convex/values").VLiteral<"forever", "required">, import("convex/values").VLiteral<"one_time", "required">], "required", never>;
592
+ affiliateAccountId: import("convex/values").VString<string | undefined, "optional">;
593
+ firstPaidInvoiceId: import("convex/values").VString<string, "required">;
594
+ }, "required", "affiliateAccountId" | "firstPaidInvoiceId" | "subscriptionId" | "term">, {
595
+ by_subscription: ["subscriptionId", "_creationTime"];
596
+ }, {}, {}>;
597
+ commissionDecisions: import("convex/server").TableDefinition<import("convex/values").VObject<{
598
+ claimKey: string;
599
+ eligible: boolean;
600
+ invoiceId: string;
601
+ subscriptionId: string;
602
+ }, {
603
+ subscriptionId: import("convex/values").VString<string, "required">;
604
+ invoiceId: import("convex/values").VString<string, "required">;
605
+ eligible: import("convex/values").VBoolean<boolean, "required">;
606
+ claimKey: import("convex/values").VString<string, "required">;
607
+ }, "required", "claimKey" | "eligible" | "invoiceId" | "subscriptionId">, {
608
+ by_subscription_invoice: ["subscriptionId", "invoiceId", "_creationTime"];
609
+ }, {}, {}>;
610
+ accounts: import("convex/server").TableDefinition<import("convex/values").VObject<{
611
+ appliedConfigurations?: ("customer" | "merchant" | "recipient")[] | undefined;
612
+ capabilities?: any;
613
+ configuration?: any;
614
+ country?: string | undefined;
615
+ email?: string | undefined;
616
+ metadata?: any;
617
+ missingRequirements?: string[] | undefined;
618
+ name?: string | undefined;
619
+ onboardingStatus: "complete" | "in_progress" | "pending" | "restricted";
620
+ orgId?: string | undefined;
621
+ requirements?: any;
622
+ statementDescriptor?: string | undefined;
623
+ stripeAccountId: string;
624
+ userId: string;
625
+ }, {
626
+ stripeAccountId: import("convex/values").VString<string, "required">;
627
+ userId: import("convex/values").VString<string, "required">;
628
+ orgId: import("convex/values").VString<string | undefined, "optional">;
629
+ email: import("convex/values").VString<string | undefined, "optional">;
630
+ name: import("convex/values").VString<string | undefined, "optional">;
631
+ country: import("convex/values").VString<string | undefined, "optional">;
632
+ capabilities: import("convex/values").VAny<any, "optional", string>;
633
+ requirements: import("convex/values").VAny<any, "optional", string>;
634
+ configuration: import("convex/values").VAny<any, "optional", string>;
635
+ appliedConfigurations: import("convex/values").VArray<("customer" | "merchant" | "recipient")[] | undefined, import("convex/values").VUnion<"customer" | "merchant" | "recipient", [import("convex/values").VLiteral<"customer", "required">, import("convex/values").VLiteral<"merchant", "required">, import("convex/values").VLiteral<"recipient", "required">], "required", never>, "optional">;
636
+ onboardingStatus: import("convex/values").VUnion<"complete" | "in_progress" | "pending" | "restricted", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"in_progress", "required">, import("convex/values").VLiteral<"complete", "required">, import("convex/values").VLiteral<"restricted", "required">], "required", never>;
637
+ missingRequirements: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
638
+ metadata: import("convex/values").VAny<any, "optional", string>;
639
+ statementDescriptor: import("convex/values").VString<string | undefined, "optional">;
640
+ }, "required", "appliedConfigurations" | "capabilities" | "configuration" | "country" | "email" | "metadata" | "missingRequirements" | "name" | "onboardingStatus" | "orgId" | "requirements" | "statementDescriptor" | "stripeAccountId" | "userId" | `capabilities.${string}` | `configuration.${string}` | `metadata.${string}` | `requirements.${string}`>, {
641
+ by_onboarding_status: ["onboardingStatus", "_creationTime"];
642
+ by_org_id: ["orgId", "_creationTime"];
643
+ by_stripe_account_id: ["stripeAccountId", "_creationTime"];
644
+ by_user_id: ["userId", "_creationTime"];
645
+ }, {}, {}>;
646
+ products: import("convex/server").TableDefinition<import("convex/values").VObject<{
647
+ accountId?: string | undefined;
648
+ active: boolean;
649
+ description?: string | undefined;
650
+ metadata?: any;
651
+ name: string;
652
+ stripeProductId: string;
653
+ }, {
654
+ stripeProductId: import("convex/values").VString<string, "required">;
655
+ accountId: import("convex/values").VString<string | undefined, "optional">;
656
+ name: import("convex/values").VString<string, "required">;
657
+ description: import("convex/values").VString<string | undefined, "optional">;
658
+ active: import("convex/values").VBoolean<boolean, "required">;
659
+ metadata: import("convex/values").VAny<any, "optional", string>;
660
+ }, "required", "accountId" | "active" | "description" | "metadata" | "name" | "stripeProductId" | `metadata.${string}`>, {
661
+ by_account_active: ["accountId", "active", "_creationTime"];
662
+ by_account_id: ["accountId", "_creationTime"];
663
+ by_active: ["active", "_creationTime"];
664
+ by_stripe_product_id: ["stripeProductId", "_creationTime"];
665
+ }, {}, {}>;
666
+ prices: import("convex/server").TableDefinition<import("convex/values").VObject<{
667
+ active: boolean;
668
+ currency: string;
669
+ interval?: "day" | "month" | "week" | "year" | undefined;
670
+ intervalCount?: number | undefined;
671
+ metadata?: any;
672
+ nickname?: string | undefined;
673
+ productId: string;
674
+ stripePriceId: string;
675
+ stripeProductId: string;
676
+ type: "one_time" | "recurring";
677
+ unitAmount: number;
678
+ }, {
679
+ stripePriceId: import("convex/values").VString<string, "required">;
680
+ productId: import("convex/values").VString<string, "required">;
681
+ stripeProductId: import("convex/values").VString<string, "required">;
682
+ nickname: import("convex/values").VString<string | undefined, "optional">;
683
+ unitAmount: import("convex/values").VFloat64<number, "required">;
684
+ currency: import("convex/values").VString<string, "required">;
685
+ active: import("convex/values").VBoolean<boolean, "required">;
686
+ type: import("convex/values").VUnion<"one_time" | "recurring", [import("convex/values").VLiteral<"one_time", "required">, import("convex/values").VLiteral<"recurring", "required">], "required", never>;
687
+ interval: import("convex/values").VUnion<"day" | "month" | "week" | "year" | undefined, [import("convex/values").VLiteral<"day", "required">, import("convex/values").VLiteral<"week", "required">, import("convex/values").VLiteral<"month", "required">, import("convex/values").VLiteral<"year", "required">], "optional", never>;
688
+ intervalCount: import("convex/values").VFloat64<number | undefined, "optional">;
689
+ metadata: import("convex/values").VAny<any, "optional", string>;
690
+ }, "required", "active" | "currency" | "interval" | "intervalCount" | "metadata" | "nickname" | "productId" | "stripePriceId" | "stripeProductId" | "type" | "unitAmount" | `metadata.${string}`>, {
691
+ by_active: ["active", "_creationTime"];
692
+ by_product_active: ["productId", "active", "_creationTime"];
693
+ by_product_id: ["productId", "_creationTime"];
694
+ by_stripe_price_id: ["stripePriceId", "_creationTime"];
695
+ by_stripe_product_id: ["stripeProductId", "_creationTime"];
696
+ }, {}, {}>;
697
+ subscriptions: import("convex/server").TableDefinition<import("convex/values").VObject<{
698
+ accountId?: string | undefined;
699
+ applicationFeeAmount?: number | undefined;
700
+ applicationFeePercent?: number | undefined;
701
+ cancelAtPeriodEnd: boolean;
702
+ canceledAt?: string | undefined;
703
+ chargeType?: "destination" | "separate" | undefined;
704
+ currency?: string | undefined;
705
+ currentPeriodEnd?: string | undefined;
706
+ currentPeriodStart?: string | undefined;
707
+ destinationAccountId?: string | undefined;
708
+ feeCollectedAmount?: number | undefined;
709
+ feeRefundedAmount?: number | undefined;
710
+ isCollectionPaused?: boolean | undefined;
711
+ isTrialing: boolean;
712
+ metadata?: any;
713
+ orgId?: string | undefined;
714
+ priceId?: string | undefined;
715
+ quantity?: number | undefined;
716
+ splitRecipients?: {
717
+ amount?: number | undefined;
718
+ destinationAccountId: string;
719
+ percent?: number | undefined;
720
+ role: "affiliate" | "other" | "store";
721
+ }[] | undefined;
722
+ status: "active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid";
723
+ stripeSubscriptionId: string;
724
+ trialEnd?: string | undefined;
725
+ trialStart?: string | undefined;
726
+ userId: string;
727
+ }, {
728
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
729
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
730
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
731
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
732
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
733
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
734
+ splitRecipients: import("convex/values").VArray<{
735
+ amount?: number | undefined;
736
+ destinationAccountId: string;
737
+ percent?: number | undefined;
738
+ role: "affiliate" | "other" | "store";
739
+ }[] | undefined, import("convex/values").VObject<{
740
+ amount?: number | undefined;
741
+ destinationAccountId: string;
742
+ percent?: number | undefined;
743
+ role: "affiliate" | "other" | "store";
744
+ }, {
745
+ destinationAccountId: import("convex/values").VString<string, "required">;
746
+ role: import("convex/values").VUnion<"affiliate" | "other" | "store", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
747
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
748
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
749
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
750
+ stripeSubscriptionId: import("convex/values").VString<string, "required">;
751
+ accountId: import("convex/values").VString<string | undefined, "optional">;
752
+ userId: import("convex/values").VString<string, "required">;
753
+ orgId: import("convex/values").VString<string | undefined, "optional">;
754
+ status: import("convex/values").VUnion<"active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid", [import("convex/values").VLiteral<"active", "required">, import("convex/values").VLiteral<"trialing", "required">, import("convex/values").VLiteral<"past_due", "required">, import("convex/values").VLiteral<"canceled", "required">, import("convex/values").VLiteral<"incomplete", "required">, import("convex/values").VLiteral<"incomplete_expired", "required">, import("convex/values").VLiteral<"unpaid", "required">, import("convex/values").VLiteral<"paused", "required">], "required", never>;
755
+ priceId: import("convex/values").VString<string | undefined, "optional">;
756
+ quantity: import("convex/values").VFloat64<number | undefined, "optional">;
757
+ currentPeriodStart: import("convex/values").VString<string | undefined, "optional">;
758
+ currentPeriodEnd: import("convex/values").VString<string | undefined, "optional">;
759
+ cancelAtPeriodEnd: import("convex/values").VBoolean<boolean, "required">;
760
+ isCollectionPaused: import("convex/values").VBoolean<boolean | undefined, "optional">;
761
+ canceledAt: import("convex/values").VString<string | undefined, "optional">;
762
+ isTrialing: import("convex/values").VBoolean<boolean, "required">;
763
+ trialStart: import("convex/values").VString<string | undefined, "optional">;
764
+ trialEnd: import("convex/values").VString<string | undefined, "optional">;
765
+ currency: import("convex/values").VString<string | undefined, "optional">;
766
+ metadata: import("convex/values").VAny<any, "optional", string>;
767
+ }, "required", "accountId" | "applicationFeeAmount" | "applicationFeePercent" | "cancelAtPeriodEnd" | "canceledAt" | "chargeType" | "currency" | "currentPeriodEnd" | "currentPeriodStart" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "isCollectionPaused" | "isTrialing" | "metadata" | "orgId" | "priceId" | "quantity" | "splitRecipients" | "status" | "stripeSubscriptionId" | "trialEnd" | "trialStart" | "userId" | `metadata.${string}`>, {
768
+ by_account_id: ["accountId", "_creationTime"];
769
+ by_account_status: ["accountId", "status", "_creationTime"];
770
+ by_org_id: ["orgId", "_creationTime"];
771
+ by_price_id: ["priceId", "_creationTime"];
772
+ by_status: ["status", "_creationTime"];
773
+ by_stripe_subscription_id: ["stripeSubscriptionId", "_creationTime"];
774
+ by_user_id: ["userId", "_creationTime"];
775
+ }, {}, {}>;
776
+ checkoutSessions: import("convex/server").TableDefinition<import("convex/values").VObject<{
777
+ accountId?: string | undefined;
778
+ applicationFeeAmount?: number | undefined;
779
+ applicationFeePercent?: number | undefined;
780
+ chargeType?: "destination" | "separate" | undefined;
781
+ clientSecret?: string | undefined;
782
+ currency?: string | undefined;
783
+ destinationAccountId?: string | undefined;
784
+ feeCollectedAmount?: number | undefined;
785
+ feeRefundedAmount?: number | undefined;
786
+ metadata?: any;
787
+ mode: "payment" | "setup" | "subscription";
788
+ orgId?: string | undefined;
789
+ priceId?: string | undefined;
790
+ splitRecipients?: {
791
+ amount?: number | undefined;
792
+ destinationAccountId: string;
793
+ percent?: number | undefined;
794
+ role: "affiliate" | "other" | "store";
795
+ }[] | undefined;
796
+ status: "complete" | "expired" | "open";
797
+ stripeSessionId: string;
798
+ url?: string | undefined;
799
+ userId: string;
800
+ }, {
801
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
802
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
803
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
804
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
805
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
806
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
807
+ splitRecipients: import("convex/values").VArray<{
808
+ amount?: number | undefined;
809
+ destinationAccountId: string;
810
+ percent?: number | undefined;
811
+ role: "affiliate" | "other" | "store";
812
+ }[] | undefined, import("convex/values").VObject<{
813
+ amount?: number | undefined;
814
+ destinationAccountId: string;
815
+ percent?: number | undefined;
816
+ role: "affiliate" | "other" | "store";
817
+ }, {
818
+ destinationAccountId: import("convex/values").VString<string, "required">;
819
+ role: import("convex/values").VUnion<"affiliate" | "other" | "store", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
820
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
821
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
822
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
823
+ stripeSessionId: import("convex/values").VString<string, "required">;
824
+ userId: import("convex/values").VString<string, "required">;
825
+ orgId: import("convex/values").VString<string | undefined, "optional">;
826
+ accountId: import("convex/values").VString<string | undefined, "optional">;
827
+ mode: import("convex/values").VUnion<"payment" | "setup" | "subscription", [import("convex/values").VLiteral<"payment", "required">, import("convex/values").VLiteral<"subscription", "required">, import("convex/values").VLiteral<"setup", "required">], "required", never>;
828
+ status: import("convex/values").VUnion<"complete" | "expired" | "open", [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"complete", "required">, import("convex/values").VLiteral<"expired", "required">], "required", never>;
829
+ clientSecret: import("convex/values").VString<string | undefined, "optional">;
830
+ url: import("convex/values").VString<string | undefined, "optional">;
831
+ priceId: import("convex/values").VString<string | undefined, "optional">;
832
+ currency: import("convex/values").VString<string | undefined, "optional">;
833
+ metadata: import("convex/values").VAny<any, "optional", string>;
834
+ }, "required", "accountId" | "applicationFeeAmount" | "applicationFeePercent" | "chargeType" | "clientSecret" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "metadata" | "mode" | "orgId" | "priceId" | "splitRecipients" | "status" | "stripeSessionId" | "url" | "userId" | `metadata.${string}`>, {
835
+ by_account_id: ["accountId", "_creationTime"];
836
+ by_stripe_session_id: ["stripeSessionId", "_creationTime"];
837
+ by_user_id: ["userId", "_creationTime"];
838
+ by_user_status: ["userId", "status", "_creationTime"];
839
+ }, {}, {}>;
840
+ invoices: import("convex/server").TableDefinition<import("convex/values").VObject<{
841
+ accountId?: string | undefined;
842
+ amountDue: number;
843
+ amountPaid: number;
844
+ applicationFeeAmount?: number | undefined;
845
+ applicationFeePercent?: number | undefined;
846
+ attemptCount?: number | undefined;
847
+ chargeType?: "destination" | "separate" | undefined;
848
+ currency: string;
849
+ destinationAccountId?: string | undefined;
850
+ feeCollectedAmount?: number | undefined;
851
+ feeRefundedAmount?: number | undefined;
852
+ hostedInvoiceUrl?: string | undefined;
853
+ invoicePdf?: string | undefined;
854
+ metadata?: any;
855
+ nextPaymentAttempt?: string | undefined;
856
+ orgId?: string | undefined;
857
+ periodEnd?: string | undefined;
858
+ periodStart?: string | undefined;
859
+ splitRecipients?: {
860
+ amount?: number | undefined;
861
+ destinationAccountId: string;
862
+ percent?: number | undefined;
863
+ role: "affiliate" | "other" | "store";
864
+ }[] | undefined;
865
+ status: "draft" | "open" | "paid" | "uncollectible" | "void";
866
+ stripeInvoiceId: string;
867
+ subscriptionId?: string | undefined;
868
+ userId: string;
869
+ }, {
870
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
871
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
872
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
873
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
874
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
875
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
876
+ splitRecipients: import("convex/values").VArray<{
877
+ amount?: number | undefined;
878
+ destinationAccountId: string;
879
+ percent?: number | undefined;
880
+ role: "affiliate" | "other" | "store";
881
+ }[] | undefined, import("convex/values").VObject<{
882
+ amount?: number | undefined;
883
+ destinationAccountId: string;
884
+ percent?: number | undefined;
885
+ role: "affiliate" | "other" | "store";
886
+ }, {
887
+ destinationAccountId: import("convex/values").VString<string, "required">;
888
+ role: import("convex/values").VUnion<"affiliate" | "other" | "store", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
889
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
890
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
891
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
892
+ stripeInvoiceId: import("convex/values").VString<string, "required">;
893
+ userId: import("convex/values").VString<string, "required">;
894
+ orgId: import("convex/values").VString<string | undefined, "optional">;
895
+ accountId: import("convex/values").VString<string | undefined, "optional">;
896
+ subscriptionId: import("convex/values").VString<string | undefined, "optional">;
897
+ status: import("convex/values").VUnion<"draft" | "open" | "paid" | "uncollectible" | "void", [import("convex/values").VLiteral<"draft", "required">, import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"paid", "required">, import("convex/values").VLiteral<"uncollectible", "required">, import("convex/values").VLiteral<"void", "required">], "required", never>;
898
+ currency: import("convex/values").VString<string, "required">;
899
+ amountDue: import("convex/values").VFloat64<number, "required">;
900
+ amountPaid: import("convex/values").VFloat64<number, "required">;
901
+ hostedInvoiceUrl: import("convex/values").VString<string | undefined, "optional">;
902
+ invoicePdf: import("convex/values").VString<string | undefined, "optional">;
903
+ periodStart: import("convex/values").VString<string | undefined, "optional">;
904
+ periodEnd: import("convex/values").VString<string | undefined, "optional">;
905
+ nextPaymentAttempt: import("convex/values").VString<string | undefined, "optional">;
906
+ attemptCount: import("convex/values").VFloat64<number | undefined, "optional">;
907
+ metadata: import("convex/values").VAny<any, "optional", string>;
908
+ }, "required", "accountId" | "amountDue" | "amountPaid" | "applicationFeeAmount" | "applicationFeePercent" | "attemptCount" | "chargeType" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "hostedInvoiceUrl" | "invoicePdf" | "metadata" | "nextPaymentAttempt" | "orgId" | "periodEnd" | "periodStart" | "splitRecipients" | "status" | "stripeInvoiceId" | "subscriptionId" | "userId" | `metadata.${string}`>, {
909
+ by_account_id: ["accountId", "_creationTime"];
910
+ by_account_status: ["accountId", "status", "_creationTime"];
911
+ by_status: ["status", "_creationTime"];
912
+ by_stripe_invoice_id: ["stripeInvoiceId", "_creationTime"];
913
+ by_subscription_id: ["subscriptionId", "_creationTime"];
914
+ by_subscription_status: ["subscriptionId", "status", "_creationTime"];
915
+ by_user_id: ["userId", "_creationTime"];
916
+ by_user_status: ["userId", "status", "_creationTime"];
917
+ }, {}, {}>;
918
+ payments: import("convex/server").TableDefinition<import("convex/values").VObject<{
919
+ accountId?: string | undefined;
920
+ amount: number;
921
+ applicationFeeAmount?: number | undefined;
922
+ applicationFeePercent?: number | undefined;
923
+ chargeType?: "destination" | "separate" | undefined;
924
+ currency: string;
925
+ destinationAccountId?: string | undefined;
926
+ feeCollectedAmount?: number | undefined;
927
+ feeRefundedAmount?: number | undefined;
928
+ metadata?: any;
929
+ orgId?: string | undefined;
930
+ refundStatus?: "fully_refunded" | "partially_refunded" | undefined;
931
+ refundedAmount?: number | undefined;
932
+ splitRecipients?: {
933
+ amount?: number | undefined;
934
+ destinationAccountId: string;
935
+ percent?: number | undefined;
936
+ role: "affiliate" | "other" | "store";
937
+ }[] | undefined;
938
+ status: "canceled" | "failed" | "processing" | "requires_action" | "succeeded";
939
+ stripePaymentIntentId: string;
940
+ userId: string;
941
+ }, {
942
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
943
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
944
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
945
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
946
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
947
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
948
+ splitRecipients: import("convex/values").VArray<{
949
+ amount?: number | undefined;
950
+ destinationAccountId: string;
951
+ percent?: number | undefined;
952
+ role: "affiliate" | "other" | "store";
953
+ }[] | undefined, import("convex/values").VObject<{
954
+ amount?: number | undefined;
955
+ destinationAccountId: string;
956
+ percent?: number | undefined;
957
+ role: "affiliate" | "other" | "store";
958
+ }, {
959
+ destinationAccountId: import("convex/values").VString<string, "required">;
960
+ role: import("convex/values").VUnion<"affiliate" | "other" | "store", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
961
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
962
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
963
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
964
+ stripePaymentIntentId: import("convex/values").VString<string, "required">;
965
+ userId: import("convex/values").VString<string, "required">;
966
+ orgId: import("convex/values").VString<string | undefined, "optional">;
967
+ accountId: import("convex/values").VString<string | undefined, "optional">;
968
+ amount: import("convex/values").VFloat64<number, "required">;
969
+ currency: import("convex/values").VString<string, "required">;
970
+ status: import("convex/values").VUnion<"canceled" | "failed" | "processing" | "requires_action" | "succeeded", [import("convex/values").VLiteral<"succeeded", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"canceled", "required">, import("convex/values").VLiteral<"processing", "required">, import("convex/values").VLiteral<"requires_action", "required">], "required", never>;
971
+ refundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
972
+ refundStatus: import("convex/values").VUnion<"fully_refunded" | "partially_refunded" | undefined, [import("convex/values").VLiteral<"partially_refunded", "required">, import("convex/values").VLiteral<"fully_refunded", "required">], "optional", never>;
973
+ metadata: import("convex/values").VAny<any, "optional", string>;
974
+ }, "required", "accountId" | "amount" | "applicationFeeAmount" | "applicationFeePercent" | "chargeType" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "metadata" | "orgId" | "refundStatus" | "refundedAmount" | "splitRecipients" | "status" | "stripePaymentIntentId" | "userId" | `metadata.${string}`>, {
975
+ by_account_id: ["accountId", "_creationTime"];
976
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
977
+ by_user_id: ["userId", "_creationTime"];
978
+ }, {}, {}>;
979
+ payouts: import("convex/server").TableDefinition<import("convex/values").VObject<{
980
+ accountId: string;
981
+ amount: number;
982
+ arrivalDate?: string | undefined;
983
+ currency: string;
984
+ failureCode?: string | undefined;
985
+ failureMessage?: string | undefined;
986
+ metadata?: any;
987
+ method?: string | undefined;
988
+ status: "canceled" | "failed" | "in_transit" | "paid" | "pending";
989
+ stripePayoutId: string;
990
+ totalsRecorded?: true | undefined;
991
+ }, {
992
+ stripePayoutId: import("convex/values").VString<string, "required">;
993
+ accountId: import("convex/values").VString<string, "required">;
994
+ amount: import("convex/values").VFloat64<number, "required">;
995
+ currency: import("convex/values").VString<string, "required">;
996
+ status: import("convex/values").VUnion<"canceled" | "failed" | "in_transit" | "paid" | "pending", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"paid", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"canceled", "required">, import("convex/values").VLiteral<"in_transit", "required">], "required", never>;
997
+ arrivalDate: import("convex/values").VString<string | undefined, "optional">;
998
+ method: import("convex/values").VString<string | undefined, "optional">;
999
+ failureCode: import("convex/values").VString<string | undefined, "optional">;
1000
+ failureMessage: import("convex/values").VString<string | undefined, "optional">;
1001
+ metadata: import("convex/values").VAny<any, "optional", string>;
1002
+ totalsRecorded: import("convex/values").VLiteral<true | undefined, "optional">;
1003
+ }, "required", "accountId" | "amount" | "arrivalDate" | "currency" | "failureCode" | "failureMessage" | "metadata" | "method" | "status" | "stripePayoutId" | "totalsRecorded" | `metadata.${string}`>, {
1004
+ by_account_id: ["accountId", "_creationTime"];
1005
+ by_account_status: ["accountId", "status", "_creationTime"];
1006
+ by_account_totals_recorded: ["accountId", "totalsRecorded", "_creationTime"];
1007
+ by_status: ["status", "_creationTime"];
1008
+ by_stripe_payout_id: ["stripePayoutId", "_creationTime"];
1009
+ }, {}, {}>;
1010
+ pendingFeeRefunds: import("convex/server").TableDefinition<import("convex/values").VObject<{
1011
+ feeCollectedAmount: number;
1012
+ feeRefundedAmount: number;
1013
+ stripePaymentIntentId: string;
1014
+ }, {
1015
+ stripePaymentIntentId: import("convex/values").VString<string, "required">;
1016
+ feeCollectedAmount: import("convex/values").VFloat64<number, "required">;
1017
+ feeRefundedAmount: import("convex/values").VFloat64<number, "required">;
1018
+ }, "required", "feeCollectedAmount" | "feeRefundedAmount" | "stripePaymentIntentId">, {
1019
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
1020
+ }, {}, {}>;
1021
+ refunds: import("convex/server").TableDefinition<import("convex/values").VObject<{
1022
+ accountId?: string | undefined;
1023
+ amount: number;
1024
+ currency: string;
1025
+ failureReason?: string | undefined;
1026
+ metadata?: any;
1027
+ reason?: "duplicate" | "expired_uncaptured_charge" | "fraudulent" | "requested_by_customer" | undefined;
1028
+ status: "canceled" | "failed" | "pending" | "requires_action" | "succeeded";
1029
+ stripeChargeId?: string | undefined;
1030
+ stripePaymentIntentId?: string | undefined;
1031
+ stripeRefundId: string;
1032
+ }, {
1033
+ stripeRefundId: import("convex/values").VString<string, "required">;
1034
+ stripePaymentIntentId: import("convex/values").VString<string | undefined, "optional">;
1035
+ stripeChargeId: import("convex/values").VString<string | undefined, "optional">;
1036
+ accountId: import("convex/values").VString<string | undefined, "optional">;
1037
+ amount: import("convex/values").VFloat64<number, "required">;
1038
+ currency: import("convex/values").VString<string, "required">;
1039
+ status: import("convex/values").VUnion<"canceled" | "failed" | "pending" | "requires_action" | "succeeded", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"requires_action", "required">, import("convex/values").VLiteral<"succeeded", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"canceled", "required">], "required", never>;
1040
+ reason: import("convex/values").VUnion<"duplicate" | "expired_uncaptured_charge" | "fraudulent" | "requested_by_customer" | undefined, [import("convex/values").VLiteral<"duplicate", "required">, import("convex/values").VLiteral<"fraudulent", "required">, import("convex/values").VLiteral<"requested_by_customer", "required">, import("convex/values").VLiteral<"expired_uncaptured_charge", "required">], "optional", never>;
1041
+ failureReason: import("convex/values").VString<string | undefined, "optional">;
1042
+ metadata: import("convex/values").VAny<any, "optional", string>;
1043
+ }, "required", "accountId" | "amount" | "currency" | "failureReason" | "metadata" | "reason" | "status" | "stripeChargeId" | "stripePaymentIntentId" | "stripeRefundId" | `metadata.${string}`>, {
1044
+ by_account_id: ["accountId", "_creationTime"];
1045
+ by_account_id_and_status: ["accountId", "status", "_creationTime"];
1046
+ by_account_id_and_stripe_payment_intent_id: ["accountId", "stripePaymentIntentId", "_creationTime"];
1047
+ by_account_id_and_stripe_payment_intent_id_and_status: ["accountId", "stripePaymentIntentId", "status", "_creationTime"];
1048
+ by_payment_intent_id_and_status: ["stripePaymentIntentId", "status", "_creationTime"];
1049
+ by_status: ["status", "_creationTime"];
1050
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
1051
+ by_stripe_refund_id: ["stripeRefundId", "_creationTime"];
1052
+ }, {}, {}>;
1053
+ disputes: import("convex/server").TableDefinition<import("convex/values").VObject<{
1054
+ accountId?: string | undefined;
1055
+ amount: number;
1056
+ currency: string;
1057
+ evidence?: any;
1058
+ evidenceDueBy?: string | undefined;
1059
+ isChargeRefundable: boolean;
1060
+ lastEvent?: string | undefined;
1061
+ linkedTransferIds?: string[] | undefined;
1062
+ metadata?: any;
1063
+ reason: string;
1064
+ statementDescriptor?: string | undefined;
1065
+ status: "lost" | "needs_response" | "prevented" | "under_review" | "warning_closed" | "warning_needs_response" | "warning_under_review" | "won";
1066
+ stripeChargeId?: string | undefined;
1067
+ stripeDisputeId: string;
1068
+ stripePaymentIntentId?: string | undefined;
1069
+ }, {
1070
+ stripeDisputeId: import("convex/values").VString<string, "required">;
1071
+ stripePaymentIntentId: import("convex/values").VString<string | undefined, "optional">;
1072
+ stripeChargeId: import("convex/values").VString<string | undefined, "optional">;
1073
+ accountId: import("convex/values").VString<string | undefined, "optional">;
1074
+ amount: import("convex/values").VFloat64<number, "required">;
1075
+ currency: import("convex/values").VString<string, "required">;
1076
+ status: import("convex/values").VUnion<"lost" | "needs_response" | "prevented" | "under_review" | "warning_closed" | "warning_needs_response" | "warning_under_review" | "won", [import("convex/values").VLiteral<"warning_needs_response", "required">, import("convex/values").VLiteral<"warning_under_review", "required">, import("convex/values").VLiteral<"warning_closed", "required">, import("convex/values").VLiteral<"needs_response", "required">, import("convex/values").VLiteral<"under_review", "required">, import("convex/values").VLiteral<"won", "required">, import("convex/values").VLiteral<"lost", "required">, import("convex/values").VLiteral<"prevented", "required">], "required", never>;
1077
+ reason: import("convex/values").VString<string, "required">;
1078
+ isChargeRefundable: import("convex/values").VBoolean<boolean, "required">;
1079
+ lastEvent: import("convex/values").VString<string | undefined, "optional">;
1080
+ evidenceDueBy: import("convex/values").VString<string | undefined, "optional">;
1081
+ evidence: import("convex/values").VAny<any, "optional", string>;
1082
+ statementDescriptor: import("convex/values").VString<string | undefined, "optional">;
1083
+ linkedTransferIds: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
1084
+ metadata: import("convex/values").VAny<any, "optional", string>;
1085
+ }, "required", "accountId" | "amount" | "currency" | "evidence" | "evidenceDueBy" | "isChargeRefundable" | "lastEvent" | "linkedTransferIds" | "metadata" | "reason" | "statementDescriptor" | "status" | "stripeChargeId" | "stripeDisputeId" | "stripePaymentIntentId" | `evidence.${string}` | `metadata.${string}`>, {
1086
+ by_account_id: ["accountId", "_creationTime"];
1087
+ by_account_id_and_status: ["accountId", "status", "_creationTime"];
1088
+ by_payment_intent_id_and_status: ["stripePaymentIntentId", "status", "_creationTime"];
1089
+ by_status: ["status", "_creationTime"];
1090
+ by_stripe_dispute_id: ["stripeDisputeId", "_creationTime"];
1091
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
1092
+ }, {}, {}>;
1093
+ transfers: import("convex/server").TableDefinition<import("convex/values").VObject<{
1094
+ amount: number;
1095
+ currency: string;
1096
+ destinationAccountId: string;
1097
+ metadata?: any;
1098
+ paymentId?: string | undefined;
1099
+ reinstatement?: boolean | undefined;
1100
+ reversalClaimedAmount?: number | undefined;
1101
+ reversalStatus?: "fully_reversed" | "partially_reversed" | undefined;
1102
+ reversedAmount?: number | undefined;
1103
+ role?: "affiliate" | "other" | "store" | undefined;
1104
+ sourceChargeId?: string | undefined;
1105
+ sourceInvoiceId?: string | undefined;
1106
+ status: "failed" | "paid" | "pending" | "reversed";
1107
+ stripeTransferId: string;
1108
+ totalsRecorded?: true | undefined;
1109
+ }, {
1110
+ stripeTransferId: import("convex/values").VString<string, "required">;
1111
+ sourceChargeId: import("convex/values").VString<string | undefined, "optional">;
1112
+ sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
1113
+ destinationAccountId: import("convex/values").VString<string, "required">;
1114
+ amount: import("convex/values").VFloat64<number, "required">;
1115
+ currency: import("convex/values").VString<string, "required">;
1116
+ role: import("convex/values").VUnion<"affiliate" | "other" | "store" | undefined, [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "optional", never>;
1117
+ status: import("convex/values").VUnion<"failed" | "paid" | "pending" | "reversed", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"paid", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"reversed", "required">], "required", never>;
1118
+ reversedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1119
+ reversalStatus: import("convex/values").VUnion<"fully_reversed" | "partially_reversed" | undefined, [import("convex/values").VLiteral<"partially_reversed", "required">, import("convex/values").VLiteral<"fully_reversed", "required">], "optional", never>;
1120
+ paymentId: import("convex/values").VString<string | undefined, "optional">;
1121
+ reinstatement: import("convex/values").VBoolean<boolean | undefined, "optional">;
1122
+ metadata: import("convex/values").VAny<any, "optional", string>;
1123
+ totalsRecorded: import("convex/values").VLiteral<true | undefined, "optional">;
1124
+ reversalClaimedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1125
+ }, "required", "amount" | "currency" | "destinationAccountId" | "metadata" | "paymentId" | "reinstatement" | "reversalClaimedAmount" | "reversalStatus" | "reversedAmount" | "role" | "sourceChargeId" | "sourceInvoiceId" | "status" | "stripeTransferId" | "totalsRecorded" | `metadata.${string}`>, {
1126
+ by_account_totals_recorded: ["destinationAccountId", "totalsRecorded", "_creationTime"];
1127
+ by_destination_account_id: ["destinationAccountId", "_creationTime"];
1128
+ by_source_charge_id: ["sourceChargeId", "_creationTime"];
1129
+ by_stripe_transfer_id: ["stripeTransferId", "_creationTime"];
1130
+ }, {}, {}>;
1131
+ transferReversalOps: import("convex/server").TableDefinition<import("convex/values").VObject<{
1132
+ operationId: string;
1133
+ slices: {
1134
+ from: number;
1135
+ stripeTransferId: string;
1136
+ to: number;
1137
+ }[];
1138
+ sourceChargeId: string;
1139
+ }, {
1140
+ operationId: import("convex/values").VString<string, "required">;
1141
+ sourceChargeId: import("convex/values").VString<string, "required">;
1142
+ slices: import("convex/values").VArray<{
1143
+ from: number;
1144
+ stripeTransferId: string;
1145
+ to: number;
1146
+ }[], import("convex/values").VObject<{
1147
+ from: number;
1148
+ stripeTransferId: string;
1149
+ to: number;
1150
+ }, {
1151
+ stripeTransferId: import("convex/values").VString<string, "required">;
1152
+ from: import("convex/values").VFloat64<number, "required">;
1153
+ to: import("convex/values").VFloat64<number, "required">;
1154
+ }, "required", "from" | "stripeTransferId" | "to">, "required">;
1155
+ }, "required", "operationId" | "slices" | "sourceChargeId">, {
1156
+ by_operation_id: ["operationId", "_creationTime"];
1157
+ }, {}, {}>;
1158
+ webhookEvents: import("convex/server").TableDefinition<import("convex/values").VObject<{
1159
+ eventType: string;
1160
+ lastError?: string | undefined;
1161
+ livemode?: boolean | undefined;
1162
+ processedAt: number;
1163
+ status: "failed" | "ignored" | "processed" | "processing";
1164
+ stripeEventId: string;
1165
+ }, {
1166
+ stripeEventId: import("convex/values").VString<string, "required">;
1167
+ eventType: import("convex/values").VString<string, "required">;
1168
+ livemode: import("convex/values").VBoolean<boolean | undefined, "optional">;
1169
+ processedAt: import("convex/values").VFloat64<number, "required">;
1170
+ status: import("convex/values").VUnion<"failed" | "ignored" | "processed" | "processing", [import("convex/values").VLiteral<"processing", "required">, import("convex/values").VLiteral<"processed", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"ignored", "required">], "required", never>;
1171
+ lastError: import("convex/values").VString<string | undefined, "optional">;
1172
+ }, "required", "eventType" | "lastError" | "livemode" | "processedAt" | "status" | "stripeEventId">, {
1173
+ by_status: ["status", "_creationTime"];
1174
+ by_stripeEventId: ["stripeEventId", "_creationTime"];
1175
+ }, {}, {}>;
1176
+ }, boolean>>;
1177
+ ctx: RunCtx;
1178
+ provider: {
1179
+ accounts: {
1180
+ listExternalAccounts: import("vitest").Mock<() => Promise<{
1181
+ data: {
1182
+ id: string;
1183
+ object: string;
1184
+ currency: string;
1185
+ default_for_currency: boolean;
1186
+ }[];
1187
+ has_more: boolean;
1188
+ }>>;
1189
+ };
1190
+ transfers: {
1191
+ retrieve: import("vitest").Mock<(id: string) => Promise<{
1192
+ id: string;
1193
+ destination: string;
1194
+ destination_payment: string;
1195
+ source_transaction: string;
1196
+ amount: number;
1197
+ currency: string;
1198
+ amount_reversed: number;
1199
+ }>>;
1200
+ listReversals: import("vitest").Mock<() => Promise<{
1201
+ data: never[];
1202
+ has_more: boolean;
1203
+ }>>;
1204
+ };
1205
+ charges: {
1206
+ retrieve: import("vitest").Mock<(id: string) => Promise<{
1207
+ id: string;
1208
+ source_transfer: string;
1209
+ amount: number;
1210
+ currency: string;
1211
+ paid: boolean;
1212
+ status: string;
1213
+ balance_transaction: string;
1214
+ }>>;
1215
+ };
1216
+ balanceTransactions: {
1217
+ list: import("vitest").Mock<(params: {
1218
+ source?: string;
1219
+ limit?: number;
1220
+ }) => Promise<{
1221
+ data: {
1222
+ id: string;
1223
+ source: string;
1224
+ amount: number;
1225
+ fee: number;
1226
+ net: number;
1227
+ currency: string;
1228
+ created: number;
1229
+ available_on: number;
1230
+ status: string;
1231
+ type: string;
1232
+ exchange_rate: null;
1233
+ }[];
1234
+ has_more: boolean;
1235
+ }>>;
1236
+ retrieve: import("vitest").Mock<(id: string) => Promise<{
1237
+ id: string;
1238
+ source: string;
1239
+ amount: number;
1240
+ fee: number;
1241
+ net: number;
1242
+ currency: string;
1243
+ created: number;
1244
+ available_on: number;
1245
+ status: string;
1246
+ type: string;
1247
+ exchange_rate: null;
1248
+ } | undefined>>;
1249
+ };
1250
+ balance: {
1251
+ retrieve: import("vitest").Mock<() => Promise<{
1252
+ available: {
1253
+ currency: string;
1254
+ amount: number;
1255
+ source_types: {
1256
+ card: number;
1257
+ };
1258
+ }[];
1259
+ pending: never[];
1260
+ }>>;
1261
+ };
1262
+ payouts: {
1263
+ list: import("vitest").Mock<() => Promise<{
1264
+ data: Record<string, unknown>[];
1265
+ has_more: boolean;
1266
+ }>>;
1267
+ retrieve: import("vitest").Mock<(id?: string) => Promise<Record<string, unknown> | undefined>>;
1268
+ create: import("vitest").Mock<(params: {
1269
+ amount: number;
1270
+ currency: string;
1271
+ metadata: object;
1272
+ }) => Promise<Record<string, unknown>>>;
1273
+ };
1274
+ };
1275
+ verify: import("vitest").Mock<() => Promise<{
1276
+ status: "verified";
1277
+ policy: {
1278
+ _creationTime: number;
1279
+ _id: import("convex/values").GenericId<"payoutPolicies">;
1280
+ accountId: string;
1281
+ country: string;
1282
+ holdDeadline?: number | undefined;
1283
+ mode: "custom" | "stripe_managed";
1284
+ operationKey: string;
1285
+ ownerKey: string;
1286
+ previousSchedule?: {
1287
+ interval: "daily" | "manual" | "monthly" | "weekly";
1288
+ monthlyDays?: number[] | undefined;
1289
+ weeklyDays?: string[] | undefined;
1290
+ } | undefined;
1291
+ revision: number;
1292
+ status: "changing" | "ready";
1293
+ thresholds: {
1294
+ amount: number;
1295
+ currency: string;
1296
+ }[];
1297
+ };
1298
+ }>>;
1299
+ run: (extra?: {}) => Promise<import("./payoutExecution.js").PayoutReleaseResult>;
1300
+ setTransactions: (rows: {
1301
+ id: string;
1302
+ source: string;
1303
+ amount: number;
1304
+ fee: number;
1305
+ net: number;
1306
+ currency: string;
1307
+ created: number;
1308
+ available_on: number;
1309
+ status: string;
1310
+ type: string;
1311
+ exchange_rate: null;
1312
+ }[]) => void;
1313
+ transactions: () => {
1314
+ id: string;
1315
+ source: string;
1316
+ amount: number;
1317
+ fee: number;
1318
+ net: number;
1319
+ currency: string;
1320
+ created: number;
1321
+ available_on: number;
1322
+ status: string;
1323
+ type: string;
1324
+ exchange_rate: null;
1325
+ }[];
1326
+ }>;
1327
+ export declare function historical(currency?: string): Promise<{
1328
+ t: import("convex-test").TestConvex<import("convex/server").SchemaDefinition<{
1329
+ payoutSyncClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
1330
+ acceptedAt?: number | undefined;
1331
+ acceptedFingerprint?: string | undefined;
1332
+ acceptedGeneration?: number | undefined;
1333
+ accountId: string;
1334
+ generation: number;
1335
+ startedAt: number;
1336
+ status: "accepted" | "pending" | "unknown";
1337
+ stripePayoutId: string;
1338
+ }, {
1339
+ stripePayoutId: import("convex/values").VString<string, "required">;
1340
+ accountId: import("convex/values").VString<string, "required">;
1341
+ generation: import("convex/values").VFloat64<number, "required">;
1342
+ status: import("convex/values").VUnion<"accepted" | "pending" | "unknown", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"accepted", "required">, import("convex/values").VLiteral<"unknown", "required">], "required", never>;
1343
+ startedAt: import("convex/values").VFloat64<number, "required">;
1344
+ acceptedGeneration: import("convex/values").VFloat64<number | undefined, "optional">;
1345
+ acceptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
1346
+ acceptedFingerprint: import("convex/values").VString<string | undefined, "optional">;
1347
+ }, "required", "acceptedAt" | "acceptedFingerprint" | "acceptedGeneration" | "accountId" | "generation" | "startedAt" | "status" | "stripePayoutId">, {
1348
+ by_stripe_payout_id: ["stripePayoutId", "_creationTime"];
1349
+ }, {}, {}>;
1350
+ payoutFeeBalances: import("convex/server").TableDefinition<import("convex/values").VObject<{
1351
+ accountId: string;
1352
+ amount: number;
1353
+ currency: string;
1354
+ ownerKey: string;
1355
+ revision: number;
1356
+ }, {
1357
+ accountId: import("convex/values").VString<string, "required">;
1358
+ ownerKey: import("convex/values").VString<string, "required">;
1359
+ currency: import("convex/values").VString<string, "required">;
1360
+ amount: import("convex/values").VFloat64<number, "required">;
1361
+ revision: import("convex/values").VFloat64<number, "required">;
1362
+ }, "required", "accountId" | "amount" | "currency" | "ownerKey" | "revision">, {
1363
+ by_account_currency: ["accountId", "currency", "_creationTime"];
1364
+ }, {}, {}>;
1365
+ payoutReleaseClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
1366
+ accountId: string;
1367
+ allocations: {
1368
+ amount: number;
1369
+ role?: "affiliate" | "other" | "store" | undefined;
1370
+ stripeTransferId: string;
1371
+ }[];
1372
+ amount: number;
1373
+ attemptedAt?: number | undefined;
1374
+ currency: string;
1375
+ debitFee?: number | undefined;
1376
+ debitTransactionId?: string | undefined;
1377
+ destinationId?: string | undefined;
1378
+ expectedRevision: number;
1379
+ feeRevision?: number | undefined;
1380
+ historical?: boolean | undefined;
1381
+ observations: {
1382
+ currency: string;
1383
+ ledgerFingerprint: string;
1384
+ matureNet: number;
1385
+ observedAt: number;
1386
+ pendingCredits: number;
1387
+ stripeTransferId: string;
1388
+ transactionIds: string[];
1389
+ }[];
1390
+ operationKey: string;
1391
+ ownerKey: string;
1392
+ providerFee?: number | undefined;
1393
+ rejection?: {
1394
+ code: "amount_too_small" | "balance_insufficient";
1395
+ requestId: string;
1396
+ } | undefined;
1397
+ returnTransactionId?: string | undefined;
1398
+ status: "canceled" | "paid" | "rejected" | "reserved" | "returned" | "submitted";
1399
+ stripePayoutId?: string | undefined;
1400
+ }, {
1401
+ accountId: import("convex/values").VString<string, "required">;
1402
+ ownerKey: import("convex/values").VString<string, "required">;
1403
+ historical: import("convex/values").VBoolean<boolean | undefined, "optional">;
1404
+ operationKey: import("convex/values").VString<string, "required">;
1405
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
1406
+ currency: import("convex/values").VString<string, "required">;
1407
+ amount: import("convex/values").VFloat64<number, "required">;
1408
+ destinationId: import("convex/values").VString<string | undefined, "optional">;
1409
+ allocations: import("convex/values").VArray<{
1410
+ amount: number;
1411
+ role?: "affiliate" | "other" | "store" | undefined;
1412
+ stripeTransferId: string;
1413
+ }[], import("convex/values").VObject<{
1414
+ amount: number;
1415
+ role?: "affiliate" | "other" | "store" | undefined;
1416
+ stripeTransferId: string;
1417
+ }, {
1418
+ stripeTransferId: import("convex/values").VString<string, "required">;
1419
+ amount: import("convex/values").VFloat64<number, "required">;
1420
+ role: import("convex/values").VUnion<"affiliate" | "other" | "store" | undefined, [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "optional", never>;
1421
+ }, "required", "amount" | "role" | "stripeTransferId">, "required">;
1422
+ observations: import("convex/values").VArray<{
1423
+ currency: string;
1424
+ ledgerFingerprint: string;
1425
+ matureNet: number;
1426
+ observedAt: number;
1427
+ pendingCredits: number;
1428
+ stripeTransferId: string;
1429
+ transactionIds: string[];
1430
+ }[], import("convex/values").VObject<{
1431
+ currency: string;
1432
+ ledgerFingerprint: string;
1433
+ matureNet: number;
1434
+ observedAt: number;
1435
+ pendingCredits: number;
1436
+ stripeTransferId: string;
1437
+ transactionIds: string[];
1438
+ }, {
1439
+ stripeTransferId: import("convex/values").VString<string, "required">;
1440
+ currency: import("convex/values").VString<string, "required">;
1441
+ matureNet: import("convex/values").VFloat64<number, "required">;
1442
+ pendingCredits: import("convex/values").VFloat64<number, "required">;
1443
+ ledgerFingerprint: import("convex/values").VString<string, "required">;
1444
+ observedAt: import("convex/values").VFloat64<number, "required">;
1445
+ transactionIds: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
1446
+ }, "required", "currency" | "ledgerFingerprint" | "matureNet" | "observedAt" | "pendingCredits" | "stripeTransferId" | "transactionIds">, "required">;
1447
+ status: import("convex/values").VUnion<"canceled" | "paid" | "rejected" | "reserved" | "returned" | "submitted", [import("convex/values").VLiteral<"reserved", "required">, import("convex/values").VLiteral<"submitted", "required">, import("convex/values").VLiteral<"paid", "required">, import("convex/values").VLiteral<"returned", "required">, import("convex/values").VLiteral<"canceled", "required">, import("convex/values").VLiteral<"rejected", "required">], "required", never>;
1448
+ attemptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
1449
+ stripePayoutId: import("convex/values").VString<string | undefined, "optional">;
1450
+ returnTransactionId: import("convex/values").VString<string | undefined, "optional">;
1451
+ feeRevision: import("convex/values").VFloat64<number | undefined, "optional">;
1452
+ debitTransactionId: import("convex/values").VString<string | undefined, "optional">;
1453
+ debitFee: import("convex/values").VFloat64<number | undefined, "optional">;
1454
+ providerFee: import("convex/values").VFloat64<number | undefined, "optional">;
1455
+ rejection: import("convex/values").VObject<{
1456
+ code: "amount_too_small" | "balance_insufficient";
1457
+ requestId: string;
1458
+ } | undefined, {
1459
+ requestId: import("convex/values").VString<string, "required">;
1460
+ code: import("convex/values").VUnion<"amount_too_small" | "balance_insufficient", [import("convex/values").VLiteral<"balance_insufficient", "required">, import("convex/values").VLiteral<"amount_too_small", "required">], "required", never>;
1461
+ }, "optional", "code" | "requestId">;
1462
+ }, "required", "accountId" | "allocations" | "amount" | "attemptedAt" | "currency" | "debitFee" | "debitTransactionId" | "destinationId" | "expectedRevision" | "feeRevision" | "historical" | "observations" | "operationKey" | "ownerKey" | "providerFee" | "rejection" | "rejection.code" | "rejection.requestId" | "returnTransactionId" | "status" | "stripePayoutId">, {
1463
+ by_account_status: ["accountId", "status", "_creationTime"];
1464
+ by_debit_receipt: ["debitTransactionId", "_creationTime"];
1465
+ by_operation: ["operationKey", "_creationTime"];
1466
+ by_provider_payout: ["stripePayoutId", "_creationTime"];
1467
+ by_rejection_request: ["rejection.requestId", "_creationTime"];
1468
+ by_return_receipt: ["returnTransactionId", "_creationTime"];
1469
+ }, {}, {}>;
1470
+ payoutSourceAllocations: import("convex/server").TableDefinition<import("convex/values").VObject<{
1471
+ accountId: string;
1472
+ currency: string;
1473
+ ownerKey: string;
1474
+ paidAmount: number;
1475
+ reservedAmount: number;
1476
+ stripeTransferId: string;
1477
+ }, {
1478
+ accountId: import("convex/values").VString<string, "required">;
1479
+ ownerKey: import("convex/values").VString<string, "required">;
1480
+ stripeTransferId: import("convex/values").VString<string, "required">;
1481
+ currency: import("convex/values").VString<string, "required">;
1482
+ paidAmount: import("convex/values").VFloat64<number, "required">;
1483
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
1484
+ }, "required", "accountId" | "currency" | "ownerKey" | "paidAmount" | "reservedAmount" | "stripeTransferId">, {
1485
+ by_account: ["accountId", "_creationTime"];
1486
+ by_transfer: ["stripeTransferId", "_creationTime"];
1487
+ }, {}, {}>;
1488
+ payoutPolicies: import("convex/server").TableDefinition<import("convex/values").VObject<{
1489
+ accountId: string;
1490
+ country: string;
1491
+ holdDeadline?: number | undefined;
1492
+ mode: "custom" | "stripe_managed";
1493
+ operationKey: string;
1494
+ ownerKey: string;
1495
+ previousSchedule?: {
1496
+ interval: "daily" | "manual" | "monthly" | "weekly";
1497
+ monthlyDays?: number[] | undefined;
1498
+ weeklyDays?: string[] | undefined;
1499
+ } | undefined;
1500
+ revision: number;
1501
+ status: "changing" | "ready";
1502
+ thresholds: {
1503
+ amount: number;
1504
+ currency: string;
1505
+ }[];
1506
+ }, {
1507
+ accountId: import("convex/values").VString<string, "required">;
1508
+ ownerKey: import("convex/values").VString<string, "required">;
1509
+ revision: import("convex/values").VFloat64<number, "required">;
1510
+ mode: import("convex/values").VUnion<"custom" | "stripe_managed", [import("convex/values").VLiteral<"stripe_managed", "required">, import("convex/values").VLiteral<"custom", "required">], "required", never>;
1511
+ thresholds: import("convex/values").VArray<{
1512
+ amount: number;
1513
+ currency: string;
1514
+ }[], import("convex/values").VObject<{
1515
+ amount: number;
1516
+ currency: string;
1517
+ }, {
1518
+ currency: import("convex/values").VString<string, "required">;
1519
+ amount: import("convex/values").VFloat64<number, "required">;
1520
+ }, "required", "amount" | "currency">, "required">;
1521
+ status: import("convex/values").VUnion<"changing" | "ready", [import("convex/values").VLiteral<"changing", "required">, import("convex/values").VLiteral<"ready", "required">], "required", never>;
1522
+ operationKey: import("convex/values").VString<string, "required">;
1523
+ country: import("convex/values").VString<string, "required">;
1524
+ previousSchedule: import("convex/values").VObject<{
1525
+ interval: "daily" | "manual" | "monthly" | "weekly";
1526
+ monthlyDays?: number[] | undefined;
1527
+ weeklyDays?: string[] | undefined;
1528
+ } | undefined, {
1529
+ interval: import("convex/values").VUnion<"daily" | "manual" | "monthly" | "weekly", [import("convex/values").VLiteral<"daily", "required">, import("convex/values").VLiteral<"weekly", "required">, import("convex/values").VLiteral<"monthly", "required">, import("convex/values").VLiteral<"manual", "required">], "required", never>;
1530
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
1531
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
1532
+ }, "optional", "interval" | "monthlyDays" | "weeklyDays">;
1533
+ holdDeadline: import("convex/values").VFloat64<number | undefined, "optional">;
1534
+ }, "required", "accountId" | "country" | "holdDeadline" | "mode" | "operationKey" | "ownerKey" | "previousSchedule" | "previousSchedule.interval" | "previousSchedule.monthlyDays" | "previousSchedule.weeklyDays" | "revision" | "status" | "thresholds">, {
1535
+ by_account: ["accountId", "_creationTime"];
1536
+ by_deadline: ["holdDeadline", "_creationTime"];
1537
+ }, {}, {}>;
1538
+ payoutPolicyOperations: import("convex/server").TableDefinition<import("convex/values").VObject<{
1539
+ accountId: string;
1540
+ adoption?: {
1541
+ claims: {
1542
+ fingerprint: string;
1543
+ operationKey: string;
1544
+ }[];
1545
+ observations: {
1546
+ currency: string;
1547
+ ledgerFingerprint: string;
1548
+ matureNet: number;
1549
+ observedAt: number;
1550
+ pendingCredits: number;
1551
+ stripeTransferId: string;
1552
+ transactionIds: string[];
1553
+ }[];
1554
+ oldestHeldAt?: number | undefined;
1555
+ } | undefined;
1556
+ attempted?: boolean | undefined;
1557
+ country: string;
1558
+ expectedRevision: number;
1559
+ mode: "custom" | "stripe_managed";
1560
+ observedAt?: number | undefined;
1561
+ observedSchedule: {
1562
+ interval: "daily" | "manual" | "monthly" | "weekly";
1563
+ monthlyDays?: number[] | undefined;
1564
+ weeklyDays?: string[] | undefined;
1565
+ };
1566
+ operationKey: string;
1567
+ ownerKey: string;
1568
+ previousSchedule: {
1569
+ interval: "daily" | "manual" | "monthly" | "weekly";
1570
+ monthlyDays?: number[] | undefined;
1571
+ weeklyDays?: string[] | undefined;
1572
+ };
1573
+ revision: number;
1574
+ status: "canceled" | "complete" | "pending";
1575
+ targetSchedule: {
1576
+ interval: "daily" | "manual" | "monthly" | "weekly";
1577
+ monthlyDays?: number[] | undefined;
1578
+ weeklyDays?: string[] | undefined;
1579
+ };
1580
+ thresholds: {
1581
+ amount: number;
1582
+ currency: string;
1583
+ }[];
1584
+ }, {
1585
+ accountId: import("convex/values").VString<string, "required">;
1586
+ ownerKey: import("convex/values").VString<string, "required">;
1587
+ adoption: import("convex/values").VObject<{
1588
+ claims: {
1589
+ fingerprint: string;
1590
+ operationKey: string;
1591
+ }[];
1592
+ observations: {
1593
+ currency: string;
1594
+ ledgerFingerprint: string;
1595
+ matureNet: number;
1596
+ observedAt: number;
1597
+ pendingCredits: number;
1598
+ stripeTransferId: string;
1599
+ transactionIds: string[];
1600
+ }[];
1601
+ oldestHeldAt?: number | undefined;
1602
+ } | undefined, {
1603
+ observations: import("convex/values").VArray<{
1604
+ currency: string;
1605
+ ledgerFingerprint: string;
1606
+ matureNet: number;
1607
+ observedAt: number;
1608
+ pendingCredits: number;
1609
+ stripeTransferId: string;
1610
+ transactionIds: string[];
1611
+ }[], import("convex/values").VObject<{
1612
+ currency: string;
1613
+ ledgerFingerprint: string;
1614
+ matureNet: number;
1615
+ observedAt: number;
1616
+ pendingCredits: number;
1617
+ stripeTransferId: string;
1618
+ transactionIds: string[];
1619
+ }, {
1620
+ stripeTransferId: import("convex/values").VString<string, "required">;
1621
+ currency: import("convex/values").VString<string, "required">;
1622
+ matureNet: import("convex/values").VFloat64<number, "required">;
1623
+ pendingCredits: import("convex/values").VFloat64<number, "required">;
1624
+ ledgerFingerprint: import("convex/values").VString<string, "required">;
1625
+ observedAt: import("convex/values").VFloat64<number, "required">;
1626
+ transactionIds: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
1627
+ }, "required", "currency" | "ledgerFingerprint" | "matureNet" | "observedAt" | "pendingCredits" | "stripeTransferId" | "transactionIds">, "required">;
1628
+ claims: import("convex/values").VArray<{
1629
+ fingerprint: string;
1630
+ operationKey: string;
1631
+ }[], import("convex/values").VObject<{
1632
+ fingerprint: string;
1633
+ operationKey: string;
1634
+ }, {
1635
+ operationKey: import("convex/values").VString<string, "required">;
1636
+ fingerprint: import("convex/values").VString<string, "required">;
1637
+ }, "required", "fingerprint" | "operationKey">, "required">;
1638
+ oldestHeldAt: import("convex/values").VFloat64<number | undefined, "optional">;
1639
+ }, "optional", "claims" | "observations" | "oldestHeldAt">;
1640
+ operationKey: import("convex/values").VString<string, "required">;
1641
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
1642
+ mode: import("convex/values").VUnion<"custom" | "stripe_managed", [import("convex/values").VLiteral<"stripe_managed", "required">, import("convex/values").VLiteral<"custom", "required">], "required", never>;
1643
+ thresholds: import("convex/values").VArray<{
1644
+ amount: number;
1645
+ currency: string;
1646
+ }[], import("convex/values").VObject<{
1647
+ amount: number;
1648
+ currency: string;
1649
+ }, {
1650
+ currency: import("convex/values").VString<string, "required">;
1651
+ amount: import("convex/values").VFloat64<number, "required">;
1652
+ }, "required", "amount" | "currency">, "required">;
1653
+ country: import("convex/values").VString<string, "required">;
1654
+ observedSchedule: import("convex/values").VObject<{
1655
+ interval: "daily" | "manual" | "monthly" | "weekly";
1656
+ monthlyDays?: number[] | undefined;
1657
+ weeklyDays?: string[] | undefined;
1658
+ }, {
1659
+ interval: import("convex/values").VUnion<"daily" | "manual" | "monthly" | "weekly", [import("convex/values").VLiteral<"daily", "required">, import("convex/values").VLiteral<"weekly", "required">, import("convex/values").VLiteral<"monthly", "required">, import("convex/values").VLiteral<"manual", "required">], "required", never>;
1660
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
1661
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
1662
+ }, "required", "interval" | "monthlyDays" | "weeklyDays">;
1663
+ observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
1664
+ revision: import("convex/values").VFloat64<number, "required">;
1665
+ previousSchedule: import("convex/values").VObject<{
1666
+ interval: "daily" | "manual" | "monthly" | "weekly";
1667
+ monthlyDays?: number[] | undefined;
1668
+ weeklyDays?: string[] | undefined;
1669
+ }, {
1670
+ interval: import("convex/values").VUnion<"daily" | "manual" | "monthly" | "weekly", [import("convex/values").VLiteral<"daily", "required">, import("convex/values").VLiteral<"weekly", "required">, import("convex/values").VLiteral<"monthly", "required">, import("convex/values").VLiteral<"manual", "required">], "required", never>;
1671
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
1672
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
1673
+ }, "required", "interval" | "monthlyDays" | "weeklyDays">;
1674
+ targetSchedule: import("convex/values").VObject<{
1675
+ interval: "daily" | "manual" | "monthly" | "weekly";
1676
+ monthlyDays?: number[] | undefined;
1677
+ weeklyDays?: string[] | undefined;
1678
+ }, {
1679
+ interval: import("convex/values").VUnion<"daily" | "manual" | "monthly" | "weekly", [import("convex/values").VLiteral<"daily", "required">, import("convex/values").VLiteral<"weekly", "required">, import("convex/values").VLiteral<"monthly", "required">, import("convex/values").VLiteral<"manual", "required">], "required", never>;
1680
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
1681
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
1682
+ }, "required", "interval" | "monthlyDays" | "weeklyDays">;
1683
+ status: import("convex/values").VUnion<"canceled" | "complete" | "pending", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"complete", "required">, import("convex/values").VLiteral<"canceled", "required">], "required", never>;
1684
+ attempted: import("convex/values").VBoolean<boolean | undefined, "optional">;
1685
+ }, "required", "accountId" | "adoption" | "adoption.claims" | "adoption.observations" | "adoption.oldestHeldAt" | "attempted" | "country" | "expectedRevision" | "mode" | "observedAt" | "observedSchedule" | "observedSchedule.interval" | "observedSchedule.monthlyDays" | "observedSchedule.weeklyDays" | "operationKey" | "ownerKey" | "previousSchedule" | "previousSchedule.interval" | "previousSchedule.monthlyDays" | "previousSchedule.weeklyDays" | "revision" | "status" | "targetSchedule" | "targetSchedule.interval" | "targetSchedule.monthlyDays" | "targetSchedule.weeklyDays" | "thresholds">, {
1686
+ by_operation: ["operationKey", "_creationTime"];
1687
+ }, {}, {}>;
1688
+ currencyTotals: import("convex/server").TableDefinition<import("convex/values").VObject<{
1689
+ accountId: string;
1690
+ count: number;
1691
+ currency: string;
1692
+ gross: number;
1693
+ kind: "earnings" | "payouts";
1694
+ paidOut: number;
1695
+ reversed: number;
1696
+ }, {
1697
+ accountId: import("convex/values").VString<string, "required">;
1698
+ currency: import("convex/values").VString<string, "required">;
1699
+ kind: import("convex/values").VUnion<"earnings" | "payouts", [import("convex/values").VLiteral<"earnings", "required">, import("convex/values").VLiteral<"payouts", "required">], "required", never>;
1700
+ gross: import("convex/values").VFloat64<number, "required">;
1701
+ reversed: import("convex/values").VFloat64<number, "required">;
1702
+ paidOut: import("convex/values").VFloat64<number, "required">;
1703
+ count: import("convex/values").VFloat64<number, "required">;
1704
+ }, "required", "accountId" | "count" | "currency" | "gross" | "kind" | "paidOut" | "reversed">, {
1705
+ by_account_kind_currency: ["accountId", "kind", "currency", "_creationTime"];
1706
+ }, {}, {}>;
1707
+ recoveryClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
1708
+ accountId: string;
1709
+ amountDue: number;
1710
+ claimKey: string;
1711
+ collectedAmount: number;
1712
+ currency: string;
1713
+ openingCollection?: {
1714
+ amountDue: number;
1715
+ collectedAmount: number;
1716
+ operationKey: string;
1717
+ revision: number;
1718
+ } | undefined;
1719
+ outstanding: number;
1720
+ reservedAmount: number;
1721
+ revision: number;
1722
+ scopeKey: string;
1723
+ sign: "negative" | "positive" | "zero";
1724
+ sourceChargeId: string;
1725
+ sourceGross: number;
1726
+ sourceProcessingFee: number;
1727
+ }, {
1728
+ accountId: import("convex/values").VString<string, "required">;
1729
+ scopeKey: import("convex/values").VString<string, "required">;
1730
+ currency: import("convex/values").VString<string, "required">;
1731
+ claimKey: import("convex/values").VString<string, "required">;
1732
+ sourceChargeId: import("convex/values").VString<string, "required">;
1733
+ sourceGross: import("convex/values").VFloat64<number, "required">;
1734
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
1735
+ amountDue: import("convex/values").VFloat64<number, "required">;
1736
+ revision: import("convex/values").VFloat64<number, "required">;
1737
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
1738
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
1739
+ outstanding: import("convex/values").VFloat64<number, "required">;
1740
+ 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>;
1741
+ openingCollection: import("convex/values").VObject<{
1742
+ amountDue: number;
1743
+ collectedAmount: number;
1744
+ operationKey: string;
1745
+ revision: number;
1746
+ } | undefined, {
1747
+ operationKey: import("convex/values").VString<string, "required">;
1748
+ amountDue: import("convex/values").VFloat64<number, "required">;
1749
+ revision: import("convex/values").VFloat64<number, "required">;
1750
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
1751
+ }, "optional", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
1752
+ }, "required", "accountId" | "amountDue" | "claimKey" | "collectedAmount" | "currency" | "openingCollection" | "openingCollection.amountDue" | "openingCollection.collectedAmount" | "openingCollection.operationKey" | "openingCollection.revision" | "outstanding" | "reservedAmount" | "revision" | "scopeKey" | "sign" | "sourceChargeId" | "sourceGross" | "sourceProcessingFee">, {
1753
+ by_import: ["openingCollection.operationKey", "_creationTime"];
1754
+ by_key: ["claimKey", "_creationTime"];
1755
+ by_scope: ["accountId", "scopeKey", "currency", "_creationTime"];
1756
+ by_sign: ["accountId", "scopeKey", "currency", "sign", "_creationTime"];
1757
+ }, {}, {}>;
1758
+ recoveryBalances: import("convex/server").TableDefinition<import("convex/values").VObject<{
1759
+ accountId: string;
1760
+ activeGroupKey?: string | undefined;
1761
+ amountDue: number;
1762
+ collectedAmount: number;
1763
+ currency: string;
1764
+ outstanding: number;
1765
+ reservedAmount: number;
1766
+ scopeKey: string;
1767
+ }, {
1768
+ accountId: import("convex/values").VString<string, "required">;
1769
+ scopeKey: import("convex/values").VString<string, "required">;
1770
+ currency: import("convex/values").VString<string, "required">;
1771
+ amountDue: import("convex/values").VFloat64<number, "required">;
1772
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
1773
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
1774
+ outstanding: import("convex/values").VFloat64<number, "required">;
1775
+ activeGroupKey: import("convex/values").VString<string | undefined, "optional">;
1776
+ }, "required", "accountId" | "activeGroupKey" | "amountDue" | "collectedAmount" | "currency" | "outstanding" | "reservedAmount" | "scopeKey">, {
1777
+ by_scope: ["accountId", "scopeKey", "currency", "_creationTime"];
1778
+ }, {}, {}>;
1779
+ recoveryGroups: import("convex/server").TableDefinition<import("convex/values").VObject<{
1780
+ accountId: string;
1781
+ amount: number;
1782
+ currency: string;
1783
+ groupKey: string;
1784
+ invoiceFunding?: {
1785
+ sourceChargeId: string;
1786
+ sourceGross: number;
1787
+ sourceProcessingFee: number;
1788
+ } | undefined;
1789
+ invoiceItemId?: string | undefined;
1790
+ maxCredit: number;
1791
+ maxDebit: number;
1792
+ pendingOperations: number;
1793
+ scopeKey: string;
1794
+ sourceGross?: number | undefined;
1795
+ sourceId: string;
1796
+ sourceKind: "invoice" | "settlement";
1797
+ sourceProcessingFee?: number | undefined;
1798
+ status: "collected" | "collecting" | "open" | "released" | "releasing" | "sealed";
1799
+ }, {
1800
+ accountId: import("convex/values").VString<string, "required">;
1801
+ scopeKey: import("convex/values").VString<string, "required">;
1802
+ currency: import("convex/values").VString<string, "required">;
1803
+ groupKey: import("convex/values").VString<string, "required">;
1804
+ sourceKind: import("convex/values").VUnion<"invoice" | "settlement", [import("convex/values").VLiteral<"settlement", "required">, import("convex/values").VLiteral<"invoice", "required">], "required", never>;
1805
+ sourceId: import("convex/values").VString<string, "required">;
1806
+ sourceGross: import("convex/values").VFloat64<number | undefined, "optional">;
1807
+ sourceProcessingFee: import("convex/values").VFloat64<number | undefined, "optional">;
1808
+ maxDebit: import("convex/values").VFloat64<number, "required">;
1809
+ maxCredit: import("convex/values").VFloat64<number, "required">;
1810
+ amount: import("convex/values").VFloat64<number, "required">;
1811
+ pendingOperations: import("convex/values").VFloat64<number, "required">;
1812
+ invoiceItemId: import("convex/values").VString<string | undefined, "optional">;
1813
+ invoiceFunding: import("convex/values").VObject<{
1814
+ sourceChargeId: string;
1815
+ sourceGross: number;
1816
+ sourceProcessingFee: number;
1817
+ } | undefined, {
1818
+ sourceChargeId: import("convex/values").VString<string, "required">;
1819
+ sourceGross: import("convex/values").VFloat64<number, "required">;
1820
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
1821
+ }, "optional", "sourceChargeId" | "sourceGross" | "sourceProcessingFee">;
1822
+ status: import("convex/values").VUnion<"collected" | "collecting" | "open" | "released" | "releasing" | "sealed", [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"sealed", "required">, import("convex/values").VLiteral<"collecting", "required">, import("convex/values").VLiteral<"releasing", "required">, import("convex/values").VLiteral<"collected", "required">, import("convex/values").VLiteral<"released", "required">], "required", never>;
1823
+ }, "required", "accountId" | "amount" | "currency" | "groupKey" | "invoiceFunding" | "invoiceFunding.sourceChargeId" | "invoiceFunding.sourceGross" | "invoiceFunding.sourceProcessingFee" | "invoiceItemId" | "maxCredit" | "maxDebit" | "pendingOperations" | "scopeKey" | "sourceGross" | "sourceId" | "sourceKind" | "sourceProcessingFee" | "status">, {
1824
+ by_key: ["groupKey", "_creationTime"];
1825
+ }, {}, {}>;
1826
+ recoveryReservations: import("convex/server").TableDefinition<import("convex/values").VObject<{
1827
+ allocations: {
1828
+ amount: number;
1829
+ claimId: import("convex/values").GenericId<"recoveryClaims">;
1830
+ claimKey: string;
1831
+ }[];
1832
+ amount: number;
1833
+ groupKey: string;
1834
+ limit: number;
1835
+ operationKey: string;
1836
+ status: "collected" | "empty" | "released" | "reserved";
1837
+ }, {
1838
+ operationKey: import("convex/values").VString<string, "required">;
1839
+ groupKey: import("convex/values").VString<string, "required">;
1840
+ amount: import("convex/values").VFloat64<number, "required">;
1841
+ limit: import("convex/values").VFloat64<number, "required">;
1842
+ allocations: import("convex/values").VArray<{
1843
+ amount: number;
1844
+ claimId: import("convex/values").GenericId<"recoveryClaims">;
1845
+ claimKey: string;
1846
+ }[], import("convex/values").VObject<{
1847
+ amount: number;
1848
+ claimId: import("convex/values").GenericId<"recoveryClaims">;
1849
+ claimKey: string;
1850
+ }, {
1851
+ claimId: import("convex/values").VId<import("convex/values").GenericId<"recoveryClaims">, "required">;
1852
+ claimKey: import("convex/values").VString<string, "required">;
1853
+ amount: import("convex/values").VFloat64<number, "required">;
1854
+ }, "required", "amount" | "claimId" | "claimKey">, "required">;
1855
+ status: import("convex/values").VUnion<"collected" | "empty" | "released" | "reserved", [import("convex/values").VLiteral<"reserved", "required">, import("convex/values").VLiteral<"collected", "required">, import("convex/values").VLiteral<"released", "required">, import("convex/values").VLiteral<"empty", "required">], "required", never>;
1856
+ }, "required", "allocations" | "amount" | "groupKey" | "limit" | "operationKey" | "status">, {
1857
+ by_group_status: ["groupKey", "status", "_creationTime"];
1858
+ by_key: ["operationKey", "_creationTime"];
1859
+ }, {}, {}>;
1860
+ settlementAllocations: import("convex/server").TableDefinition<import("convex/values").VObject<{
1861
+ adjustmentAmount?: number | undefined;
1862
+ currency: string;
1863
+ gross: number;
1864
+ paymentId?: string | undefined;
1865
+ paymentIntentId?: string | undefined;
1866
+ platformNet: number;
1867
+ processingFee: number;
1868
+ sourceChargeId: string;
1869
+ sourceInvoiceId?: string | undefined;
1870
+ transfers: {
1871
+ amount: number;
1872
+ destinationAccountId: string;
1873
+ role: "affiliate" | "other" | "store";
1874
+ }[];
1875
+ }, {
1876
+ sourceChargeId: import("convex/values").VString<string, "required">;
1877
+ paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
1878
+ sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
1879
+ gross: import("convex/values").VFloat64<number, "required">;
1880
+ currency: import("convex/values").VString<string, "required">;
1881
+ processingFee: import("convex/values").VFloat64<number, "required">;
1882
+ platformNet: import("convex/values").VFloat64<number, "required">;
1883
+ adjustmentAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1884
+ paymentId: import("convex/values").VString<string | undefined, "optional">;
1885
+ transfers: import("convex/values").VArray<{
1886
+ amount: number;
1887
+ destinationAccountId: string;
1888
+ role: "affiliate" | "other" | "store";
1889
+ }[], import("convex/values").VObject<{
1890
+ amount: number;
1891
+ destinationAccountId: string;
1892
+ role: "affiliate" | "other" | "store";
1893
+ }, {
1894
+ destinationAccountId: import("convex/values").VString<string, "required">;
1895
+ role: import("convex/values").VUnion<"affiliate" | "other" | "store", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
1896
+ amount: import("convex/values").VFloat64<number, "required">;
1897
+ }, "required", "amount" | "destinationAccountId" | "role">, "required">;
1898
+ }, "required", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">, {
1899
+ by_source_charge: ["sourceChargeId", "_creationTime"];
1900
+ }, {}, {}>;
1901
+ commissionTerms: import("convex/server").TableDefinition<import("convex/values").VObject<{
1902
+ affiliateAccountId?: string | undefined;
1903
+ firstPaidInvoiceId: string;
1904
+ subscriptionId: string;
1905
+ term: "forever" | "one_time";
1906
+ }, {
1907
+ subscriptionId: import("convex/values").VString<string, "required">;
1908
+ term: import("convex/values").VUnion<"forever" | "one_time", [import("convex/values").VLiteral<"forever", "required">, import("convex/values").VLiteral<"one_time", "required">], "required", never>;
1909
+ affiliateAccountId: import("convex/values").VString<string | undefined, "optional">;
1910
+ firstPaidInvoiceId: import("convex/values").VString<string, "required">;
1911
+ }, "required", "affiliateAccountId" | "firstPaidInvoiceId" | "subscriptionId" | "term">, {
1912
+ by_subscription: ["subscriptionId", "_creationTime"];
1913
+ }, {}, {}>;
1914
+ commissionDecisions: import("convex/server").TableDefinition<import("convex/values").VObject<{
1915
+ claimKey: string;
1916
+ eligible: boolean;
1917
+ invoiceId: string;
1918
+ subscriptionId: string;
1919
+ }, {
1920
+ subscriptionId: import("convex/values").VString<string, "required">;
1921
+ invoiceId: import("convex/values").VString<string, "required">;
1922
+ eligible: import("convex/values").VBoolean<boolean, "required">;
1923
+ claimKey: import("convex/values").VString<string, "required">;
1924
+ }, "required", "claimKey" | "eligible" | "invoiceId" | "subscriptionId">, {
1925
+ by_subscription_invoice: ["subscriptionId", "invoiceId", "_creationTime"];
1926
+ }, {}, {}>;
1927
+ accounts: import("convex/server").TableDefinition<import("convex/values").VObject<{
1928
+ appliedConfigurations?: ("customer" | "merchant" | "recipient")[] | undefined;
1929
+ capabilities?: any;
1930
+ configuration?: any;
1931
+ country?: string | undefined;
1932
+ email?: string | undefined;
1933
+ metadata?: any;
1934
+ missingRequirements?: string[] | undefined;
1935
+ name?: string | undefined;
1936
+ onboardingStatus: "complete" | "in_progress" | "pending" | "restricted";
1937
+ orgId?: string | undefined;
1938
+ requirements?: any;
1939
+ statementDescriptor?: string | undefined;
1940
+ stripeAccountId: string;
1941
+ userId: string;
1942
+ }, {
1943
+ stripeAccountId: import("convex/values").VString<string, "required">;
1944
+ userId: import("convex/values").VString<string, "required">;
1945
+ orgId: import("convex/values").VString<string | undefined, "optional">;
1946
+ email: import("convex/values").VString<string | undefined, "optional">;
1947
+ name: import("convex/values").VString<string | undefined, "optional">;
1948
+ country: import("convex/values").VString<string | undefined, "optional">;
1949
+ capabilities: import("convex/values").VAny<any, "optional", string>;
1950
+ requirements: import("convex/values").VAny<any, "optional", string>;
1951
+ configuration: import("convex/values").VAny<any, "optional", string>;
1952
+ appliedConfigurations: import("convex/values").VArray<("customer" | "merchant" | "recipient")[] | undefined, import("convex/values").VUnion<"customer" | "merchant" | "recipient", [import("convex/values").VLiteral<"customer", "required">, import("convex/values").VLiteral<"merchant", "required">, import("convex/values").VLiteral<"recipient", "required">], "required", never>, "optional">;
1953
+ onboardingStatus: import("convex/values").VUnion<"complete" | "in_progress" | "pending" | "restricted", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"in_progress", "required">, import("convex/values").VLiteral<"complete", "required">, import("convex/values").VLiteral<"restricted", "required">], "required", never>;
1954
+ missingRequirements: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
1955
+ metadata: import("convex/values").VAny<any, "optional", string>;
1956
+ statementDescriptor: import("convex/values").VString<string | undefined, "optional">;
1957
+ }, "required", "appliedConfigurations" | "capabilities" | "configuration" | "country" | "email" | "metadata" | "missingRequirements" | "name" | "onboardingStatus" | "orgId" | "requirements" | "statementDescriptor" | "stripeAccountId" | "userId" | `capabilities.${string}` | `configuration.${string}` | `metadata.${string}` | `requirements.${string}`>, {
1958
+ by_onboarding_status: ["onboardingStatus", "_creationTime"];
1959
+ by_org_id: ["orgId", "_creationTime"];
1960
+ by_stripe_account_id: ["stripeAccountId", "_creationTime"];
1961
+ by_user_id: ["userId", "_creationTime"];
1962
+ }, {}, {}>;
1963
+ products: import("convex/server").TableDefinition<import("convex/values").VObject<{
1964
+ accountId?: string | undefined;
1965
+ active: boolean;
1966
+ description?: string | undefined;
1967
+ metadata?: any;
1968
+ name: string;
1969
+ stripeProductId: string;
1970
+ }, {
1971
+ stripeProductId: import("convex/values").VString<string, "required">;
1972
+ accountId: import("convex/values").VString<string | undefined, "optional">;
1973
+ name: import("convex/values").VString<string, "required">;
1974
+ description: import("convex/values").VString<string | undefined, "optional">;
1975
+ active: import("convex/values").VBoolean<boolean, "required">;
1976
+ metadata: import("convex/values").VAny<any, "optional", string>;
1977
+ }, "required", "accountId" | "active" | "description" | "metadata" | "name" | "stripeProductId" | `metadata.${string}`>, {
1978
+ by_account_active: ["accountId", "active", "_creationTime"];
1979
+ by_account_id: ["accountId", "_creationTime"];
1980
+ by_active: ["active", "_creationTime"];
1981
+ by_stripe_product_id: ["stripeProductId", "_creationTime"];
1982
+ }, {}, {}>;
1983
+ prices: import("convex/server").TableDefinition<import("convex/values").VObject<{
1984
+ active: boolean;
1985
+ currency: string;
1986
+ interval?: "day" | "month" | "week" | "year" | undefined;
1987
+ intervalCount?: number | undefined;
1988
+ metadata?: any;
1989
+ nickname?: string | undefined;
1990
+ productId: string;
1991
+ stripePriceId: string;
1992
+ stripeProductId: string;
1993
+ type: "one_time" | "recurring";
1994
+ unitAmount: number;
1995
+ }, {
1996
+ stripePriceId: import("convex/values").VString<string, "required">;
1997
+ productId: import("convex/values").VString<string, "required">;
1998
+ stripeProductId: import("convex/values").VString<string, "required">;
1999
+ nickname: import("convex/values").VString<string | undefined, "optional">;
2000
+ unitAmount: import("convex/values").VFloat64<number, "required">;
2001
+ currency: import("convex/values").VString<string, "required">;
2002
+ active: import("convex/values").VBoolean<boolean, "required">;
2003
+ type: import("convex/values").VUnion<"one_time" | "recurring", [import("convex/values").VLiteral<"one_time", "required">, import("convex/values").VLiteral<"recurring", "required">], "required", never>;
2004
+ interval: import("convex/values").VUnion<"day" | "month" | "week" | "year" | undefined, [import("convex/values").VLiteral<"day", "required">, import("convex/values").VLiteral<"week", "required">, import("convex/values").VLiteral<"month", "required">, import("convex/values").VLiteral<"year", "required">], "optional", never>;
2005
+ intervalCount: import("convex/values").VFloat64<number | undefined, "optional">;
2006
+ metadata: import("convex/values").VAny<any, "optional", string>;
2007
+ }, "required", "active" | "currency" | "interval" | "intervalCount" | "metadata" | "nickname" | "productId" | "stripePriceId" | "stripeProductId" | "type" | "unitAmount" | `metadata.${string}`>, {
2008
+ by_active: ["active", "_creationTime"];
2009
+ by_product_active: ["productId", "active", "_creationTime"];
2010
+ by_product_id: ["productId", "_creationTime"];
2011
+ by_stripe_price_id: ["stripePriceId", "_creationTime"];
2012
+ by_stripe_product_id: ["stripeProductId", "_creationTime"];
2013
+ }, {}, {}>;
2014
+ subscriptions: import("convex/server").TableDefinition<import("convex/values").VObject<{
2015
+ accountId?: string | undefined;
2016
+ applicationFeeAmount?: number | undefined;
2017
+ applicationFeePercent?: number | undefined;
2018
+ cancelAtPeriodEnd: boolean;
2019
+ canceledAt?: string | undefined;
2020
+ chargeType?: "destination" | "separate" | undefined;
2021
+ currency?: string | undefined;
2022
+ currentPeriodEnd?: string | undefined;
2023
+ currentPeriodStart?: string | undefined;
2024
+ destinationAccountId?: string | undefined;
2025
+ feeCollectedAmount?: number | undefined;
2026
+ feeRefundedAmount?: number | undefined;
2027
+ isCollectionPaused?: boolean | undefined;
2028
+ isTrialing: boolean;
2029
+ metadata?: any;
2030
+ orgId?: string | undefined;
2031
+ priceId?: string | undefined;
2032
+ quantity?: number | undefined;
2033
+ splitRecipients?: {
2034
+ amount?: number | undefined;
2035
+ destinationAccountId: string;
2036
+ percent?: number | undefined;
2037
+ role: "affiliate" | "other" | "store";
2038
+ }[] | undefined;
2039
+ status: "active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid";
2040
+ stripeSubscriptionId: string;
2041
+ trialEnd?: string | undefined;
2042
+ trialStart?: string | undefined;
2043
+ userId: string;
2044
+ }, {
2045
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
2046
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2047
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
2048
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2049
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2050
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
2051
+ splitRecipients: import("convex/values").VArray<{
2052
+ amount?: number | undefined;
2053
+ destinationAccountId: string;
2054
+ percent?: number | undefined;
2055
+ role: "affiliate" | "other" | "store";
2056
+ }[] | undefined, import("convex/values").VObject<{
2057
+ amount?: number | undefined;
2058
+ destinationAccountId: string;
2059
+ percent?: number | undefined;
2060
+ role: "affiliate" | "other" | "store";
2061
+ }, {
2062
+ destinationAccountId: import("convex/values").VString<string, "required">;
2063
+ role: import("convex/values").VUnion<"affiliate" | "other" | "store", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
2064
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
2065
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
2066
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
2067
+ stripeSubscriptionId: import("convex/values").VString<string, "required">;
2068
+ accountId: import("convex/values").VString<string | undefined, "optional">;
2069
+ userId: import("convex/values").VString<string, "required">;
2070
+ orgId: import("convex/values").VString<string | undefined, "optional">;
2071
+ status: import("convex/values").VUnion<"active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid", [import("convex/values").VLiteral<"active", "required">, import("convex/values").VLiteral<"trialing", "required">, import("convex/values").VLiteral<"past_due", "required">, import("convex/values").VLiteral<"canceled", "required">, import("convex/values").VLiteral<"incomplete", "required">, import("convex/values").VLiteral<"incomplete_expired", "required">, import("convex/values").VLiteral<"unpaid", "required">, import("convex/values").VLiteral<"paused", "required">], "required", never>;
2072
+ priceId: import("convex/values").VString<string | undefined, "optional">;
2073
+ quantity: import("convex/values").VFloat64<number | undefined, "optional">;
2074
+ currentPeriodStart: import("convex/values").VString<string | undefined, "optional">;
2075
+ currentPeriodEnd: import("convex/values").VString<string | undefined, "optional">;
2076
+ cancelAtPeriodEnd: import("convex/values").VBoolean<boolean, "required">;
2077
+ isCollectionPaused: import("convex/values").VBoolean<boolean | undefined, "optional">;
2078
+ canceledAt: import("convex/values").VString<string | undefined, "optional">;
2079
+ isTrialing: import("convex/values").VBoolean<boolean, "required">;
2080
+ trialStart: import("convex/values").VString<string | undefined, "optional">;
2081
+ trialEnd: import("convex/values").VString<string | undefined, "optional">;
2082
+ currency: import("convex/values").VString<string | undefined, "optional">;
2083
+ metadata: import("convex/values").VAny<any, "optional", string>;
2084
+ }, "required", "accountId" | "applicationFeeAmount" | "applicationFeePercent" | "cancelAtPeriodEnd" | "canceledAt" | "chargeType" | "currency" | "currentPeriodEnd" | "currentPeriodStart" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "isCollectionPaused" | "isTrialing" | "metadata" | "orgId" | "priceId" | "quantity" | "splitRecipients" | "status" | "stripeSubscriptionId" | "trialEnd" | "trialStart" | "userId" | `metadata.${string}`>, {
2085
+ by_account_id: ["accountId", "_creationTime"];
2086
+ by_account_status: ["accountId", "status", "_creationTime"];
2087
+ by_org_id: ["orgId", "_creationTime"];
2088
+ by_price_id: ["priceId", "_creationTime"];
2089
+ by_status: ["status", "_creationTime"];
2090
+ by_stripe_subscription_id: ["stripeSubscriptionId", "_creationTime"];
2091
+ by_user_id: ["userId", "_creationTime"];
2092
+ }, {}, {}>;
2093
+ checkoutSessions: import("convex/server").TableDefinition<import("convex/values").VObject<{
2094
+ accountId?: string | undefined;
2095
+ applicationFeeAmount?: number | undefined;
2096
+ applicationFeePercent?: number | undefined;
2097
+ chargeType?: "destination" | "separate" | undefined;
2098
+ clientSecret?: string | undefined;
2099
+ currency?: string | undefined;
2100
+ destinationAccountId?: string | undefined;
2101
+ feeCollectedAmount?: number | undefined;
2102
+ feeRefundedAmount?: number | undefined;
2103
+ metadata?: any;
2104
+ mode: "payment" | "setup" | "subscription";
2105
+ orgId?: string | undefined;
2106
+ priceId?: string | undefined;
2107
+ splitRecipients?: {
2108
+ amount?: number | undefined;
2109
+ destinationAccountId: string;
2110
+ percent?: number | undefined;
2111
+ role: "affiliate" | "other" | "store";
2112
+ }[] | undefined;
2113
+ status: "complete" | "expired" | "open";
2114
+ stripeSessionId: string;
2115
+ url?: string | undefined;
2116
+ userId: string;
2117
+ }, {
2118
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
2119
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2120
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
2121
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2122
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2123
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
2124
+ splitRecipients: import("convex/values").VArray<{
2125
+ amount?: number | undefined;
2126
+ destinationAccountId: string;
2127
+ percent?: number | undefined;
2128
+ role: "affiliate" | "other" | "store";
2129
+ }[] | undefined, import("convex/values").VObject<{
2130
+ amount?: number | undefined;
2131
+ destinationAccountId: string;
2132
+ percent?: number | undefined;
2133
+ role: "affiliate" | "other" | "store";
2134
+ }, {
2135
+ destinationAccountId: import("convex/values").VString<string, "required">;
2136
+ role: import("convex/values").VUnion<"affiliate" | "other" | "store", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
2137
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
2138
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
2139
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
2140
+ stripeSessionId: import("convex/values").VString<string, "required">;
2141
+ userId: import("convex/values").VString<string, "required">;
2142
+ orgId: import("convex/values").VString<string | undefined, "optional">;
2143
+ accountId: import("convex/values").VString<string | undefined, "optional">;
2144
+ mode: import("convex/values").VUnion<"payment" | "setup" | "subscription", [import("convex/values").VLiteral<"payment", "required">, import("convex/values").VLiteral<"subscription", "required">, import("convex/values").VLiteral<"setup", "required">], "required", never>;
2145
+ status: import("convex/values").VUnion<"complete" | "expired" | "open", [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"complete", "required">, import("convex/values").VLiteral<"expired", "required">], "required", never>;
2146
+ clientSecret: import("convex/values").VString<string | undefined, "optional">;
2147
+ url: import("convex/values").VString<string | undefined, "optional">;
2148
+ priceId: import("convex/values").VString<string | undefined, "optional">;
2149
+ currency: import("convex/values").VString<string | undefined, "optional">;
2150
+ metadata: import("convex/values").VAny<any, "optional", string>;
2151
+ }, "required", "accountId" | "applicationFeeAmount" | "applicationFeePercent" | "chargeType" | "clientSecret" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "metadata" | "mode" | "orgId" | "priceId" | "splitRecipients" | "status" | "stripeSessionId" | "url" | "userId" | `metadata.${string}`>, {
2152
+ by_account_id: ["accountId", "_creationTime"];
2153
+ by_stripe_session_id: ["stripeSessionId", "_creationTime"];
2154
+ by_user_id: ["userId", "_creationTime"];
2155
+ by_user_status: ["userId", "status", "_creationTime"];
2156
+ }, {}, {}>;
2157
+ invoices: import("convex/server").TableDefinition<import("convex/values").VObject<{
2158
+ accountId?: string | undefined;
2159
+ amountDue: number;
2160
+ amountPaid: number;
2161
+ applicationFeeAmount?: number | undefined;
2162
+ applicationFeePercent?: number | undefined;
2163
+ attemptCount?: number | undefined;
2164
+ chargeType?: "destination" | "separate" | undefined;
2165
+ currency: string;
2166
+ destinationAccountId?: string | undefined;
2167
+ feeCollectedAmount?: number | undefined;
2168
+ feeRefundedAmount?: number | undefined;
2169
+ hostedInvoiceUrl?: string | undefined;
2170
+ invoicePdf?: string | undefined;
2171
+ metadata?: any;
2172
+ nextPaymentAttempt?: string | undefined;
2173
+ orgId?: string | undefined;
2174
+ periodEnd?: string | undefined;
2175
+ periodStart?: string | undefined;
2176
+ splitRecipients?: {
2177
+ amount?: number | undefined;
2178
+ destinationAccountId: string;
2179
+ percent?: number | undefined;
2180
+ role: "affiliate" | "other" | "store";
2181
+ }[] | undefined;
2182
+ status: "draft" | "open" | "paid" | "uncollectible" | "void";
2183
+ stripeInvoiceId: string;
2184
+ subscriptionId?: string | undefined;
2185
+ userId: string;
2186
+ }, {
2187
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
2188
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2189
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
2190
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2191
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2192
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
2193
+ splitRecipients: import("convex/values").VArray<{
2194
+ amount?: number | undefined;
2195
+ destinationAccountId: string;
2196
+ percent?: number | undefined;
2197
+ role: "affiliate" | "other" | "store";
2198
+ }[] | undefined, import("convex/values").VObject<{
2199
+ amount?: number | undefined;
2200
+ destinationAccountId: string;
2201
+ percent?: number | undefined;
2202
+ role: "affiliate" | "other" | "store";
2203
+ }, {
2204
+ destinationAccountId: import("convex/values").VString<string, "required">;
2205
+ role: import("convex/values").VUnion<"affiliate" | "other" | "store", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
2206
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
2207
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
2208
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
2209
+ stripeInvoiceId: import("convex/values").VString<string, "required">;
2210
+ userId: import("convex/values").VString<string, "required">;
2211
+ orgId: import("convex/values").VString<string | undefined, "optional">;
2212
+ accountId: import("convex/values").VString<string | undefined, "optional">;
2213
+ subscriptionId: import("convex/values").VString<string | undefined, "optional">;
2214
+ status: import("convex/values").VUnion<"draft" | "open" | "paid" | "uncollectible" | "void", [import("convex/values").VLiteral<"draft", "required">, import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"paid", "required">, import("convex/values").VLiteral<"uncollectible", "required">, import("convex/values").VLiteral<"void", "required">], "required", never>;
2215
+ currency: import("convex/values").VString<string, "required">;
2216
+ amountDue: import("convex/values").VFloat64<number, "required">;
2217
+ amountPaid: import("convex/values").VFloat64<number, "required">;
2218
+ hostedInvoiceUrl: import("convex/values").VString<string | undefined, "optional">;
2219
+ invoicePdf: import("convex/values").VString<string | undefined, "optional">;
2220
+ periodStart: import("convex/values").VString<string | undefined, "optional">;
2221
+ periodEnd: import("convex/values").VString<string | undefined, "optional">;
2222
+ nextPaymentAttempt: import("convex/values").VString<string | undefined, "optional">;
2223
+ attemptCount: import("convex/values").VFloat64<number | undefined, "optional">;
2224
+ metadata: import("convex/values").VAny<any, "optional", string>;
2225
+ }, "required", "accountId" | "amountDue" | "amountPaid" | "applicationFeeAmount" | "applicationFeePercent" | "attemptCount" | "chargeType" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "hostedInvoiceUrl" | "invoicePdf" | "metadata" | "nextPaymentAttempt" | "orgId" | "periodEnd" | "periodStart" | "splitRecipients" | "status" | "stripeInvoiceId" | "subscriptionId" | "userId" | `metadata.${string}`>, {
2226
+ by_account_id: ["accountId", "_creationTime"];
2227
+ by_account_status: ["accountId", "status", "_creationTime"];
2228
+ by_status: ["status", "_creationTime"];
2229
+ by_stripe_invoice_id: ["stripeInvoiceId", "_creationTime"];
2230
+ by_subscription_id: ["subscriptionId", "_creationTime"];
2231
+ by_subscription_status: ["subscriptionId", "status", "_creationTime"];
2232
+ by_user_id: ["userId", "_creationTime"];
2233
+ by_user_status: ["userId", "status", "_creationTime"];
2234
+ }, {}, {}>;
2235
+ payments: import("convex/server").TableDefinition<import("convex/values").VObject<{
2236
+ accountId?: string | undefined;
2237
+ amount: number;
2238
+ applicationFeeAmount?: number | undefined;
2239
+ applicationFeePercent?: number | undefined;
2240
+ chargeType?: "destination" | "separate" | undefined;
2241
+ currency: string;
2242
+ destinationAccountId?: string | undefined;
2243
+ feeCollectedAmount?: number | undefined;
2244
+ feeRefundedAmount?: number | undefined;
2245
+ metadata?: any;
2246
+ orgId?: string | undefined;
2247
+ refundStatus?: "fully_refunded" | "partially_refunded" | undefined;
2248
+ refundedAmount?: number | undefined;
2249
+ splitRecipients?: {
2250
+ amount?: number | undefined;
2251
+ destinationAccountId: string;
2252
+ percent?: number | undefined;
2253
+ role: "affiliate" | "other" | "store";
2254
+ }[] | undefined;
2255
+ status: "canceled" | "failed" | "processing" | "requires_action" | "succeeded";
2256
+ stripePaymentIntentId: string;
2257
+ userId: string;
2258
+ }, {
2259
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
2260
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2261
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
2262
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2263
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2264
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
2265
+ splitRecipients: import("convex/values").VArray<{
2266
+ amount?: number | undefined;
2267
+ destinationAccountId: string;
2268
+ percent?: number | undefined;
2269
+ role: "affiliate" | "other" | "store";
2270
+ }[] | undefined, import("convex/values").VObject<{
2271
+ amount?: number | undefined;
2272
+ destinationAccountId: string;
2273
+ percent?: number | undefined;
2274
+ role: "affiliate" | "other" | "store";
2275
+ }, {
2276
+ destinationAccountId: import("convex/values").VString<string, "required">;
2277
+ role: import("convex/values").VUnion<"affiliate" | "other" | "store", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
2278
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
2279
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
2280
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
2281
+ stripePaymentIntentId: import("convex/values").VString<string, "required">;
2282
+ userId: import("convex/values").VString<string, "required">;
2283
+ orgId: import("convex/values").VString<string | undefined, "optional">;
2284
+ accountId: import("convex/values").VString<string | undefined, "optional">;
2285
+ amount: import("convex/values").VFloat64<number, "required">;
2286
+ currency: import("convex/values").VString<string, "required">;
2287
+ status: import("convex/values").VUnion<"canceled" | "failed" | "processing" | "requires_action" | "succeeded", [import("convex/values").VLiteral<"succeeded", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"canceled", "required">, import("convex/values").VLiteral<"processing", "required">, import("convex/values").VLiteral<"requires_action", "required">], "required", never>;
2288
+ refundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2289
+ refundStatus: import("convex/values").VUnion<"fully_refunded" | "partially_refunded" | undefined, [import("convex/values").VLiteral<"partially_refunded", "required">, import("convex/values").VLiteral<"fully_refunded", "required">], "optional", never>;
2290
+ metadata: import("convex/values").VAny<any, "optional", string>;
2291
+ }, "required", "accountId" | "amount" | "applicationFeeAmount" | "applicationFeePercent" | "chargeType" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "metadata" | "orgId" | "refundStatus" | "refundedAmount" | "splitRecipients" | "status" | "stripePaymentIntentId" | "userId" | `metadata.${string}`>, {
2292
+ by_account_id: ["accountId", "_creationTime"];
2293
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
2294
+ by_user_id: ["userId", "_creationTime"];
2295
+ }, {}, {}>;
2296
+ payouts: import("convex/server").TableDefinition<import("convex/values").VObject<{
2297
+ accountId: string;
2298
+ amount: number;
2299
+ arrivalDate?: string | undefined;
2300
+ currency: string;
2301
+ failureCode?: string | undefined;
2302
+ failureMessage?: string | undefined;
2303
+ metadata?: any;
2304
+ method?: string | undefined;
2305
+ status: "canceled" | "failed" | "in_transit" | "paid" | "pending";
2306
+ stripePayoutId: string;
2307
+ totalsRecorded?: true | undefined;
2308
+ }, {
2309
+ stripePayoutId: import("convex/values").VString<string, "required">;
2310
+ accountId: import("convex/values").VString<string, "required">;
2311
+ amount: import("convex/values").VFloat64<number, "required">;
2312
+ currency: import("convex/values").VString<string, "required">;
2313
+ status: import("convex/values").VUnion<"canceled" | "failed" | "in_transit" | "paid" | "pending", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"paid", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"canceled", "required">, import("convex/values").VLiteral<"in_transit", "required">], "required", never>;
2314
+ arrivalDate: import("convex/values").VString<string | undefined, "optional">;
2315
+ method: import("convex/values").VString<string | undefined, "optional">;
2316
+ failureCode: import("convex/values").VString<string | undefined, "optional">;
2317
+ failureMessage: import("convex/values").VString<string | undefined, "optional">;
2318
+ metadata: import("convex/values").VAny<any, "optional", string>;
2319
+ totalsRecorded: import("convex/values").VLiteral<true | undefined, "optional">;
2320
+ }, "required", "accountId" | "amount" | "arrivalDate" | "currency" | "failureCode" | "failureMessage" | "metadata" | "method" | "status" | "stripePayoutId" | "totalsRecorded" | `metadata.${string}`>, {
2321
+ by_account_id: ["accountId", "_creationTime"];
2322
+ by_account_status: ["accountId", "status", "_creationTime"];
2323
+ by_account_totals_recorded: ["accountId", "totalsRecorded", "_creationTime"];
2324
+ by_status: ["status", "_creationTime"];
2325
+ by_stripe_payout_id: ["stripePayoutId", "_creationTime"];
2326
+ }, {}, {}>;
2327
+ pendingFeeRefunds: import("convex/server").TableDefinition<import("convex/values").VObject<{
2328
+ feeCollectedAmount: number;
2329
+ feeRefundedAmount: number;
2330
+ stripePaymentIntentId: string;
2331
+ }, {
2332
+ stripePaymentIntentId: import("convex/values").VString<string, "required">;
2333
+ feeCollectedAmount: import("convex/values").VFloat64<number, "required">;
2334
+ feeRefundedAmount: import("convex/values").VFloat64<number, "required">;
2335
+ }, "required", "feeCollectedAmount" | "feeRefundedAmount" | "stripePaymentIntentId">, {
2336
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
2337
+ }, {}, {}>;
2338
+ refunds: import("convex/server").TableDefinition<import("convex/values").VObject<{
2339
+ accountId?: string | undefined;
2340
+ amount: number;
2341
+ currency: string;
2342
+ failureReason?: string | undefined;
2343
+ metadata?: any;
2344
+ reason?: "duplicate" | "expired_uncaptured_charge" | "fraudulent" | "requested_by_customer" | undefined;
2345
+ status: "canceled" | "failed" | "pending" | "requires_action" | "succeeded";
2346
+ stripeChargeId?: string | undefined;
2347
+ stripePaymentIntentId?: string | undefined;
2348
+ stripeRefundId: string;
2349
+ }, {
2350
+ stripeRefundId: import("convex/values").VString<string, "required">;
2351
+ stripePaymentIntentId: import("convex/values").VString<string | undefined, "optional">;
2352
+ stripeChargeId: import("convex/values").VString<string | undefined, "optional">;
2353
+ accountId: import("convex/values").VString<string | undefined, "optional">;
2354
+ amount: import("convex/values").VFloat64<number, "required">;
2355
+ currency: import("convex/values").VString<string, "required">;
2356
+ status: import("convex/values").VUnion<"canceled" | "failed" | "pending" | "requires_action" | "succeeded", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"requires_action", "required">, import("convex/values").VLiteral<"succeeded", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"canceled", "required">], "required", never>;
2357
+ reason: import("convex/values").VUnion<"duplicate" | "expired_uncaptured_charge" | "fraudulent" | "requested_by_customer" | undefined, [import("convex/values").VLiteral<"duplicate", "required">, import("convex/values").VLiteral<"fraudulent", "required">, import("convex/values").VLiteral<"requested_by_customer", "required">, import("convex/values").VLiteral<"expired_uncaptured_charge", "required">], "optional", never>;
2358
+ failureReason: import("convex/values").VString<string | undefined, "optional">;
2359
+ metadata: import("convex/values").VAny<any, "optional", string>;
2360
+ }, "required", "accountId" | "amount" | "currency" | "failureReason" | "metadata" | "reason" | "status" | "stripeChargeId" | "stripePaymentIntentId" | "stripeRefundId" | `metadata.${string}`>, {
2361
+ by_account_id: ["accountId", "_creationTime"];
2362
+ by_account_id_and_status: ["accountId", "status", "_creationTime"];
2363
+ by_account_id_and_stripe_payment_intent_id: ["accountId", "stripePaymentIntentId", "_creationTime"];
2364
+ by_account_id_and_stripe_payment_intent_id_and_status: ["accountId", "stripePaymentIntentId", "status", "_creationTime"];
2365
+ by_payment_intent_id_and_status: ["stripePaymentIntentId", "status", "_creationTime"];
2366
+ by_status: ["status", "_creationTime"];
2367
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
2368
+ by_stripe_refund_id: ["stripeRefundId", "_creationTime"];
2369
+ }, {}, {}>;
2370
+ disputes: import("convex/server").TableDefinition<import("convex/values").VObject<{
2371
+ accountId?: string | undefined;
2372
+ amount: number;
2373
+ currency: string;
2374
+ evidence?: any;
2375
+ evidenceDueBy?: string | undefined;
2376
+ isChargeRefundable: boolean;
2377
+ lastEvent?: string | undefined;
2378
+ linkedTransferIds?: string[] | undefined;
2379
+ metadata?: any;
2380
+ reason: string;
2381
+ statementDescriptor?: string | undefined;
2382
+ status: "lost" | "needs_response" | "prevented" | "under_review" | "warning_closed" | "warning_needs_response" | "warning_under_review" | "won";
2383
+ stripeChargeId?: string | undefined;
2384
+ stripeDisputeId: string;
2385
+ stripePaymentIntentId?: string | undefined;
2386
+ }, {
2387
+ stripeDisputeId: import("convex/values").VString<string, "required">;
2388
+ stripePaymentIntentId: import("convex/values").VString<string | undefined, "optional">;
2389
+ stripeChargeId: import("convex/values").VString<string | undefined, "optional">;
2390
+ accountId: import("convex/values").VString<string | undefined, "optional">;
2391
+ amount: import("convex/values").VFloat64<number, "required">;
2392
+ currency: import("convex/values").VString<string, "required">;
2393
+ status: import("convex/values").VUnion<"lost" | "needs_response" | "prevented" | "under_review" | "warning_closed" | "warning_needs_response" | "warning_under_review" | "won", [import("convex/values").VLiteral<"warning_needs_response", "required">, import("convex/values").VLiteral<"warning_under_review", "required">, import("convex/values").VLiteral<"warning_closed", "required">, import("convex/values").VLiteral<"needs_response", "required">, import("convex/values").VLiteral<"under_review", "required">, import("convex/values").VLiteral<"won", "required">, import("convex/values").VLiteral<"lost", "required">, import("convex/values").VLiteral<"prevented", "required">], "required", never>;
2394
+ reason: import("convex/values").VString<string, "required">;
2395
+ isChargeRefundable: import("convex/values").VBoolean<boolean, "required">;
2396
+ lastEvent: import("convex/values").VString<string | undefined, "optional">;
2397
+ evidenceDueBy: import("convex/values").VString<string | undefined, "optional">;
2398
+ evidence: import("convex/values").VAny<any, "optional", string>;
2399
+ statementDescriptor: import("convex/values").VString<string | undefined, "optional">;
2400
+ linkedTransferIds: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
2401
+ metadata: import("convex/values").VAny<any, "optional", string>;
2402
+ }, "required", "accountId" | "amount" | "currency" | "evidence" | "evidenceDueBy" | "isChargeRefundable" | "lastEvent" | "linkedTransferIds" | "metadata" | "reason" | "statementDescriptor" | "status" | "stripeChargeId" | "stripeDisputeId" | "stripePaymentIntentId" | `evidence.${string}` | `metadata.${string}`>, {
2403
+ by_account_id: ["accountId", "_creationTime"];
2404
+ by_account_id_and_status: ["accountId", "status", "_creationTime"];
2405
+ by_payment_intent_id_and_status: ["stripePaymentIntentId", "status", "_creationTime"];
2406
+ by_status: ["status", "_creationTime"];
2407
+ by_stripe_dispute_id: ["stripeDisputeId", "_creationTime"];
2408
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
2409
+ }, {}, {}>;
2410
+ transfers: import("convex/server").TableDefinition<import("convex/values").VObject<{
2411
+ amount: number;
2412
+ currency: string;
2413
+ destinationAccountId: string;
2414
+ metadata?: any;
2415
+ paymentId?: string | undefined;
2416
+ reinstatement?: boolean | undefined;
2417
+ reversalClaimedAmount?: number | undefined;
2418
+ reversalStatus?: "fully_reversed" | "partially_reversed" | undefined;
2419
+ reversedAmount?: number | undefined;
2420
+ role?: "affiliate" | "other" | "store" | undefined;
2421
+ sourceChargeId?: string | undefined;
2422
+ sourceInvoiceId?: string | undefined;
2423
+ status: "failed" | "paid" | "pending" | "reversed";
2424
+ stripeTransferId: string;
2425
+ totalsRecorded?: true | undefined;
2426
+ }, {
2427
+ stripeTransferId: import("convex/values").VString<string, "required">;
2428
+ sourceChargeId: import("convex/values").VString<string | undefined, "optional">;
2429
+ sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
2430
+ destinationAccountId: import("convex/values").VString<string, "required">;
2431
+ amount: import("convex/values").VFloat64<number, "required">;
2432
+ currency: import("convex/values").VString<string, "required">;
2433
+ role: import("convex/values").VUnion<"affiliate" | "other" | "store" | undefined, [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "optional", never>;
2434
+ status: import("convex/values").VUnion<"failed" | "paid" | "pending" | "reversed", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"paid", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"reversed", "required">], "required", never>;
2435
+ reversedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2436
+ reversalStatus: import("convex/values").VUnion<"fully_reversed" | "partially_reversed" | undefined, [import("convex/values").VLiteral<"partially_reversed", "required">, import("convex/values").VLiteral<"fully_reversed", "required">], "optional", never>;
2437
+ paymentId: import("convex/values").VString<string | undefined, "optional">;
2438
+ reinstatement: import("convex/values").VBoolean<boolean | undefined, "optional">;
2439
+ metadata: import("convex/values").VAny<any, "optional", string>;
2440
+ totalsRecorded: import("convex/values").VLiteral<true | undefined, "optional">;
2441
+ reversalClaimedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2442
+ }, "required", "amount" | "currency" | "destinationAccountId" | "metadata" | "paymentId" | "reinstatement" | "reversalClaimedAmount" | "reversalStatus" | "reversedAmount" | "role" | "sourceChargeId" | "sourceInvoiceId" | "status" | "stripeTransferId" | "totalsRecorded" | `metadata.${string}`>, {
2443
+ by_account_totals_recorded: ["destinationAccountId", "totalsRecorded", "_creationTime"];
2444
+ by_destination_account_id: ["destinationAccountId", "_creationTime"];
2445
+ by_source_charge_id: ["sourceChargeId", "_creationTime"];
2446
+ by_stripe_transfer_id: ["stripeTransferId", "_creationTime"];
2447
+ }, {}, {}>;
2448
+ transferReversalOps: import("convex/server").TableDefinition<import("convex/values").VObject<{
2449
+ operationId: string;
2450
+ slices: {
2451
+ from: number;
2452
+ stripeTransferId: string;
2453
+ to: number;
2454
+ }[];
2455
+ sourceChargeId: string;
2456
+ }, {
2457
+ operationId: import("convex/values").VString<string, "required">;
2458
+ sourceChargeId: import("convex/values").VString<string, "required">;
2459
+ slices: import("convex/values").VArray<{
2460
+ from: number;
2461
+ stripeTransferId: string;
2462
+ to: number;
2463
+ }[], import("convex/values").VObject<{
2464
+ from: number;
2465
+ stripeTransferId: string;
2466
+ to: number;
2467
+ }, {
2468
+ stripeTransferId: import("convex/values").VString<string, "required">;
2469
+ from: import("convex/values").VFloat64<number, "required">;
2470
+ to: import("convex/values").VFloat64<number, "required">;
2471
+ }, "required", "from" | "stripeTransferId" | "to">, "required">;
2472
+ }, "required", "operationId" | "slices" | "sourceChargeId">, {
2473
+ by_operation_id: ["operationId", "_creationTime"];
2474
+ }, {}, {}>;
2475
+ webhookEvents: import("convex/server").TableDefinition<import("convex/values").VObject<{
2476
+ eventType: string;
2477
+ lastError?: string | undefined;
2478
+ livemode?: boolean | undefined;
2479
+ processedAt: number;
2480
+ status: "failed" | "ignored" | "processed" | "processing";
2481
+ stripeEventId: string;
2482
+ }, {
2483
+ stripeEventId: import("convex/values").VString<string, "required">;
2484
+ eventType: import("convex/values").VString<string, "required">;
2485
+ livemode: import("convex/values").VBoolean<boolean | undefined, "optional">;
2486
+ processedAt: import("convex/values").VFloat64<number, "required">;
2487
+ status: import("convex/values").VUnion<"failed" | "ignored" | "processed" | "processing", [import("convex/values").VLiteral<"processing", "required">, import("convex/values").VLiteral<"processed", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"ignored", "required">], "required", never>;
2488
+ lastError: import("convex/values").VString<string | undefined, "optional">;
2489
+ }, "required", "eventType" | "lastError" | "livemode" | "processedAt" | "status" | "stripeEventId">, {
2490
+ by_status: ["status", "_creationTime"];
2491
+ by_stripeEventId: ["stripeEventId", "_creationTime"];
2492
+ }, {}, {}>;
2493
+ }, boolean>>;
2494
+ ctx: RunCtx;
2495
+ provider: {
2496
+ accounts: {
2497
+ listExternalAccounts: import("vitest").Mock<() => Promise<{
2498
+ data: {
2499
+ id: string;
2500
+ object: string;
2501
+ currency: string;
2502
+ default_for_currency: boolean;
2503
+ }[];
2504
+ has_more: boolean;
2505
+ }>>;
2506
+ };
2507
+ transfers: {
2508
+ retrieve: import("vitest").Mock<(id: string) => Promise<{
2509
+ id: string;
2510
+ destination: string;
2511
+ destination_payment: string;
2512
+ source_transaction: string;
2513
+ amount: number;
2514
+ currency: string;
2515
+ amount_reversed: number;
2516
+ }>>;
2517
+ listReversals: import("vitest").Mock<() => Promise<{
2518
+ data: never[];
2519
+ has_more: boolean;
2520
+ }>>;
2521
+ };
2522
+ charges: {
2523
+ retrieve: import("vitest").Mock<(id: string) => Promise<{
2524
+ id: string;
2525
+ source_transfer: string;
2526
+ amount: number;
2527
+ currency: string;
2528
+ paid: boolean;
2529
+ status: string;
2530
+ balance_transaction: string;
2531
+ }>>;
2532
+ };
2533
+ balanceTransactions: {
2534
+ list: import("vitest").Mock<(params: {
2535
+ source?: string;
2536
+ limit?: number;
2537
+ }) => Promise<{
2538
+ data: {
2539
+ id: string;
2540
+ source: string;
2541
+ amount: number;
2542
+ fee: number;
2543
+ net: number;
2544
+ currency: string;
2545
+ created: number;
2546
+ available_on: number;
2547
+ status: string;
2548
+ type: string;
2549
+ exchange_rate: null;
2550
+ }[];
2551
+ has_more: boolean;
2552
+ }>>;
2553
+ retrieve: import("vitest").Mock<(id: string) => Promise<{
2554
+ id: string;
2555
+ source: string;
2556
+ amount: number;
2557
+ fee: number;
2558
+ net: number;
2559
+ currency: string;
2560
+ created: number;
2561
+ available_on: number;
2562
+ status: string;
2563
+ type: string;
2564
+ exchange_rate: null;
2565
+ } | undefined>>;
2566
+ };
2567
+ balance: {
2568
+ retrieve: import("vitest").Mock<() => Promise<{
2569
+ available: {
2570
+ currency: string;
2571
+ amount: number;
2572
+ source_types: {
2573
+ card: number;
2574
+ };
2575
+ }[];
2576
+ pending: never[];
2577
+ }>>;
2578
+ };
2579
+ payouts: {
2580
+ list: import("vitest").Mock<() => Promise<{
2581
+ data: Record<string, unknown>[];
2582
+ has_more: boolean;
2583
+ }>>;
2584
+ retrieve: import("vitest").Mock<(id?: string) => Promise<Record<string, unknown> | undefined>>;
2585
+ create: import("vitest").Mock<(params: {
2586
+ amount: number;
2587
+ currency: string;
2588
+ metadata: object;
2589
+ }) => Promise<Record<string, unknown>>>;
2590
+ };
2591
+ };
2592
+ verify: import("vitest").Mock<() => Promise<{
2593
+ status: "verified";
2594
+ policy: {
2595
+ _creationTime: number;
2596
+ _id: import("convex/values").GenericId<"payoutPolicies">;
2597
+ accountId: string;
2598
+ country: string;
2599
+ holdDeadline?: number | undefined;
2600
+ mode: "custom" | "stripe_managed";
2601
+ operationKey: string;
2602
+ ownerKey: string;
2603
+ previousSchedule?: {
2604
+ interval: "daily" | "manual" | "monthly" | "weekly";
2605
+ monthlyDays?: number[] | undefined;
2606
+ weeklyDays?: string[] | undefined;
2607
+ } | undefined;
2608
+ revision: number;
2609
+ status: "changing" | "ready";
2610
+ thresholds: {
2611
+ amount: number;
2612
+ currency: string;
2613
+ }[];
2614
+ };
2615
+ }>>;
2616
+ run: (extra?: {}) => Promise<import("./payoutExecution.js").PayoutReleaseResult>;
2617
+ setTransactions: (rows: {
2618
+ id: string;
2619
+ source: string;
2620
+ amount: number;
2621
+ fee: number;
2622
+ net: number;
2623
+ currency: string;
2624
+ created: number;
2625
+ available_on: number;
2626
+ status: string;
2627
+ type: string;
2628
+ exchange_rate: null;
2629
+ }[]) => void;
2630
+ transactions: () => {
2631
+ id: string;
2632
+ source: string;
2633
+ amount: number;
2634
+ fee: number;
2635
+ net: number;
2636
+ currency: string;
2637
+ created: number;
2638
+ available_on: number;
2639
+ status: string;
2640
+ type: string;
2641
+ exchange_rate: null;
2642
+ }[];
2643
+ adopt: (extra?: {}) => Promise<import("./payoutAdoption.js").PayoutAdoptionResult>;
2644
+ opts: {
2645
+ accountId: string;
2646
+ ownerKey: string;
2647
+ currency: string;
2648
+ expectedRevision: number;
2649
+ payouts: {
2650
+ stripePayoutId: string;
2651
+ allocations: {
2652
+ stripeTransferId: string;
2653
+ amount: number;
2654
+ }[];
2655
+ }[];
2656
+ };
2657
+ amounts: number[];
2658
+ }>;
2659
+ //# sourceMappingURL=payoutAdoptionTestHelpers.d.ts.map