@fantastic.dev/better-stripe 0.23.0 → 0.23.1

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