@fantastic.dev/better-stripe 0.23.0 → 0.23.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/client/connect/payoutAdoption.d.ts.map +1 -1
  4. package/dist/client/connect/payoutAdoption.js +4 -3
  5. package/dist/client/connect/payoutAdoption.js.map +1 -1
  6. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +2659 -0
  7. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -0
  8. package/dist/client/connect/payoutAdoptionTestHelpers.js +231 -0
  9. package/dist/client/connect/payoutAdoptionTestHelpers.js.map +1 -0
  10. package/dist/client/connect/payoutSync.d.ts +32 -0
  11. package/dist/client/connect/payoutSync.d.ts.map +1 -0
  12. package/dist/client/connect/payoutSync.js +48 -0
  13. package/dist/client/connect/payoutSync.js.map +1 -0
  14. package/dist/client/connect/payoutSyncTestHelpers.d.ts +1263 -0
  15. package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -0
  16. package/dist/client/connect/payoutSyncTestHelpers.js +62 -0
  17. package/dist/client/connect/payoutSyncTestHelpers.js.map +1 -0
  18. package/dist/client/connect/payoutSyncValidation.d.ts +16 -0
  19. package/dist/client/connect/payoutSyncValidation.d.ts.map +1 -0
  20. package/dist/client/connect/payoutSyncValidation.js +54 -0
  21. package/dist/client/connect/payoutSyncValidation.js.map +1 -0
  22. package/dist/client/index.d.ts +26 -9
  23. package/dist/client/index.d.ts.map +1 -1
  24. package/dist/client/index.js +3 -5
  25. package/dist/client/index.js.map +1 -1
  26. package/dist/client/readContracts.d.ts +8 -0
  27. package/dist/client/readContracts.d.ts.map +1 -1
  28. package/dist/client/readContracts.js +7 -0
  29. package/dist/client/readContracts.js.map +1 -1
  30. package/dist/component/_generated/component.d.ts +69 -0
  31. package/dist/component/_generated/component.d.ts.map +1 -1
  32. package/dist/component/connect/mutations.d.ts.map +1 -1
  33. package/dist/component/connect/mutations.js +4 -27
  34. package/dist/component/connect/mutations.js.map +1 -1
  35. package/dist/component/connect/payoutWrites.d.ts +21 -0
  36. package/dist/component/connect/payoutWrites.d.ts.map +1 -0
  37. package/dist/component/connect/payoutWrites.js +19 -0
  38. package/dist/component/connect/payoutWrites.js.map +1 -0
  39. package/dist/component/earnings/triggers.d.ts +44 -0
  40. package/dist/component/earnings/triggers.d.ts.map +1 -1
  41. package/dist/component/payoutSync/helpers.d.ts +44 -0
  42. package/dist/component/payoutSync/helpers.d.ts.map +1 -0
  43. package/dist/component/payoutSync/helpers.js +60 -0
  44. package/dist/component/payoutSync/helpers.js.map +1 -0
  45. package/dist/component/payoutSync/mutations.d.ts +51 -0
  46. package/dist/component/payoutSync/mutations.d.ts.map +1 -0
  47. package/dist/component/payoutSync/mutations.js +88 -0
  48. package/dist/component/payoutSync/mutations.js.map +1 -0
  49. package/dist/component/payoutSync/queries.d.ts +16 -0
  50. package/dist/component/payoutSync/queries.d.ts.map +1 -0
  51. package/dist/component/payoutSync/queries.js +11 -0
  52. package/dist/component/payoutSync/queries.js.map +1 -0
  53. package/dist/component/payoutSync/schema.d.ts +46 -0
  54. package/dist/component/payoutSync/schema.d.ts.map +1 -0
  55. package/dist/component/payoutSync/schema.js +22 -0
  56. package/dist/component/payoutSync/schema.js.map +1 -0
  57. package/dist/component/payoutSync/validators.d.ts +137 -0
  58. package/dist/component/payoutSync/validators.d.ts.map +1 -0
  59. package/dist/component/payoutSync/validators.js +19 -0
  60. package/dist/component/payoutSync/validators.js.map +1 -0
  61. package/dist/component/schema.d.ts +21 -0
  62. package/dist/component/schema.js +2 -0
  63. package/dist/component/schema.js.map +1 -1
  64. package/docs/read-contracts.md +40 -5
  65. package/docs/settlement.md +6 -0
  66. package/package.json +1 -1
  67. package/src/client/connect/payoutAdoption.test.ts +6 -241
  68. package/src/client/connect/payoutAdoption.ts +4 -3
  69. package/src/client/connect/payoutAdoptionTestHelpers.ts +253 -0
  70. package/src/client/connect/payoutReturnedAdoption.test.ts +157 -0
  71. package/src/client/connect/payoutSync.test.ts +313 -0
  72. package/src/client/connect/payoutSync.ts +93 -0
  73. package/src/client/connect/payoutSyncTestHelpers.ts +82 -0
  74. package/src/client/connect/payoutSyncValidation.ts +74 -0
  75. package/src/client/index.ts +14 -11
  76. package/src/client/readContracts.ts +12 -0
  77. package/src/component/_generated/api.ts +10 -0
  78. package/src/component/_generated/component.ts +82 -0
  79. package/src/component/connect/mutations.ts +4 -30
  80. package/src/component/connect/payoutWrites.ts +25 -0
  81. package/src/component/payout-sync.test.ts +117 -0
  82. package/src/component/payoutSync/helpers.ts +86 -0
  83. package/src/component/payoutSync/mutations.ts +102 -0
  84. package/src/component/payoutSync/queries.ts +10 -0
  85. package/src/component/payoutSync/schema.ts +25 -0
  86. package/src/component/payoutSync/validators.ts +21 -0
  87. package/src/component/schema.ts +2 -0
@@ -0,0 +1,1263 @@
1
+ import type Stripe from "stripe";
2
+ import type { Component, RunCtx } from "../helpers.js";
3
+ export declare const component: Component;
4
+ export type Scope = {
5
+ type: "connected";
6
+ accountId: string;
7
+ } | {
8
+ type: "platform";
9
+ };
10
+ type Sync = (stripe: Stripe, component: Component, ctx: RunCtx, opts: {
11
+ stripePayoutId: string;
12
+ scope: Scope;
13
+ }) => Promise<unknown>;
14
+ export declare function operation(): Promise<Sync>;
15
+ export declare function setup(scope?: Scope): Promise<{
16
+ t: import("convex-test").TestConvex<import("convex/server").SchemaDefinition<{
17
+ payoutSyncClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
18
+ acceptedAt?: number | undefined;
19
+ acceptedFingerprint?: string | undefined;
20
+ acceptedGeneration?: number | undefined;
21
+ accountId: string;
22
+ generation: number;
23
+ startedAt: number;
24
+ status: "accepted" | "pending" | "unknown";
25
+ stripePayoutId: string;
26
+ }, {
27
+ stripePayoutId: import("convex/values").VString<string, "required">;
28
+ accountId: import("convex/values").VString<string, "required">;
29
+ generation: import("convex/values").VFloat64<number, "required">;
30
+ status: import("convex/values").VUnion<"accepted" | "pending" | "unknown", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"accepted", "required">, import("convex/values").VLiteral<"unknown", "required">], "required", never>;
31
+ startedAt: import("convex/values").VFloat64<number, "required">;
32
+ acceptedGeneration: import("convex/values").VFloat64<number | undefined, "optional">;
33
+ acceptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
34
+ acceptedFingerprint: import("convex/values").VString<string | undefined, "optional">;
35
+ }, "required", "acceptedAt" | "acceptedFingerprint" | "acceptedGeneration" | "accountId" | "generation" | "startedAt" | "status" | "stripePayoutId">, {
36
+ by_stripe_payout_id: ["stripePayoutId", "_creationTime"];
37
+ }, {}, {}>;
38
+ payoutFeeBalances: import("convex/server").TableDefinition<import("convex/values").VObject<{
39
+ accountId: string;
40
+ amount: number;
41
+ currency: string;
42
+ ownerKey: string;
43
+ revision: number;
44
+ }, {
45
+ accountId: import("convex/values").VString<string, "required">;
46
+ ownerKey: import("convex/values").VString<string, "required">;
47
+ currency: import("convex/values").VString<string, "required">;
48
+ amount: import("convex/values").VFloat64<number, "required">;
49
+ revision: import("convex/values").VFloat64<number, "required">;
50
+ }, "required", "accountId" | "amount" | "currency" | "ownerKey" | "revision">, {
51
+ by_account_currency: ["accountId", "currency", "_creationTime"];
52
+ }, {}, {}>;
53
+ payoutReleaseClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
54
+ accountId: string;
55
+ allocations: {
56
+ amount: number;
57
+ role?: "affiliate" | "other" | "store" | undefined;
58
+ stripeTransferId: string;
59
+ }[];
60
+ amount: number;
61
+ attemptedAt?: number | undefined;
62
+ currency: string;
63
+ debitFee?: number | undefined;
64
+ debitTransactionId?: string | undefined;
65
+ destinationId?: string | undefined;
66
+ expectedRevision: number;
67
+ feeRevision?: number | undefined;
68
+ historical?: boolean | undefined;
69
+ observations: {
70
+ currency: string;
71
+ ledgerFingerprint: string;
72
+ matureNet: number;
73
+ observedAt: number;
74
+ pendingCredits: number;
75
+ stripeTransferId: string;
76
+ transactionIds: string[];
77
+ }[];
78
+ operationKey: string;
79
+ ownerKey: string;
80
+ providerFee?: number | undefined;
81
+ rejection?: {
82
+ code: "amount_too_small" | "balance_insufficient";
83
+ requestId: string;
84
+ } | undefined;
85
+ returnTransactionId?: string | undefined;
86
+ status: "canceled" | "paid" | "rejected" | "reserved" | "returned" | "submitted";
87
+ stripePayoutId?: string | undefined;
88
+ }, {
89
+ accountId: import("convex/values").VString<string, "required">;
90
+ ownerKey: import("convex/values").VString<string, "required">;
91
+ historical: import("convex/values").VBoolean<boolean | undefined, "optional">;
92
+ operationKey: import("convex/values").VString<string, "required">;
93
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
94
+ currency: import("convex/values").VString<string, "required">;
95
+ amount: import("convex/values").VFloat64<number, "required">;
96
+ destinationId: import("convex/values").VString<string | undefined, "optional">;
97
+ allocations: import("convex/values").VArray<{
98
+ amount: number;
99
+ role?: "affiliate" | "other" | "store" | undefined;
100
+ stripeTransferId: string;
101
+ }[], import("convex/values").VObject<{
102
+ amount: number;
103
+ role?: "affiliate" | "other" | "store" | undefined;
104
+ stripeTransferId: string;
105
+ }, {
106
+ stripeTransferId: import("convex/values").VString<string, "required">;
107
+ amount: import("convex/values").VFloat64<number, "required">;
108
+ 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>;
109
+ }, "required", "amount" | "role" | "stripeTransferId">, "required">;
110
+ observations: import("convex/values").VArray<{
111
+ currency: string;
112
+ ledgerFingerprint: string;
113
+ matureNet: number;
114
+ observedAt: number;
115
+ pendingCredits: number;
116
+ stripeTransferId: string;
117
+ transactionIds: string[];
118
+ }[], import("convex/values").VObject<{
119
+ currency: string;
120
+ ledgerFingerprint: string;
121
+ matureNet: number;
122
+ observedAt: number;
123
+ pendingCredits: number;
124
+ stripeTransferId: string;
125
+ transactionIds: string[];
126
+ }, {
127
+ stripeTransferId: import("convex/values").VString<string, "required">;
128
+ currency: import("convex/values").VString<string, "required">;
129
+ matureNet: import("convex/values").VFloat64<number, "required">;
130
+ pendingCredits: import("convex/values").VFloat64<number, "required">;
131
+ ledgerFingerprint: import("convex/values").VString<string, "required">;
132
+ observedAt: import("convex/values").VFloat64<number, "required">;
133
+ transactionIds: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
134
+ }, "required", "currency" | "ledgerFingerprint" | "matureNet" | "observedAt" | "pendingCredits" | "stripeTransferId" | "transactionIds">, "required">;
135
+ 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>;
136
+ attemptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
137
+ stripePayoutId: import("convex/values").VString<string | undefined, "optional">;
138
+ returnTransactionId: import("convex/values").VString<string | undefined, "optional">;
139
+ feeRevision: import("convex/values").VFloat64<number | undefined, "optional">;
140
+ debitTransactionId: import("convex/values").VString<string | undefined, "optional">;
141
+ debitFee: import("convex/values").VFloat64<number | undefined, "optional">;
142
+ providerFee: import("convex/values").VFloat64<number | undefined, "optional">;
143
+ rejection: import("convex/values").VObject<{
144
+ code: "amount_too_small" | "balance_insufficient";
145
+ requestId: string;
146
+ } | undefined, {
147
+ requestId: import("convex/values").VString<string, "required">;
148
+ 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>;
149
+ }, "optional", "code" | "requestId">;
150
+ }, "required", "accountId" | "allocations" | "amount" | "attemptedAt" | "currency" | "debitFee" | "debitTransactionId" | "destinationId" | "expectedRevision" | "feeRevision" | "historical" | "observations" | "operationKey" | "ownerKey" | "providerFee" | "rejection" | "rejection.code" | "rejection.requestId" | "returnTransactionId" | "status" | "stripePayoutId">, {
151
+ by_account_status: ["accountId", "status", "_creationTime"];
152
+ by_debit_receipt: ["debitTransactionId", "_creationTime"];
153
+ by_operation: ["operationKey", "_creationTime"];
154
+ by_provider_payout: ["stripePayoutId", "_creationTime"];
155
+ by_rejection_request: ["rejection.requestId", "_creationTime"];
156
+ by_return_receipt: ["returnTransactionId", "_creationTime"];
157
+ }, {}, {}>;
158
+ payoutSourceAllocations: import("convex/server").TableDefinition<import("convex/values").VObject<{
159
+ accountId: string;
160
+ currency: string;
161
+ ownerKey: string;
162
+ paidAmount: number;
163
+ reservedAmount: number;
164
+ stripeTransferId: string;
165
+ }, {
166
+ accountId: import("convex/values").VString<string, "required">;
167
+ ownerKey: import("convex/values").VString<string, "required">;
168
+ stripeTransferId: import("convex/values").VString<string, "required">;
169
+ currency: import("convex/values").VString<string, "required">;
170
+ paidAmount: import("convex/values").VFloat64<number, "required">;
171
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
172
+ }, "required", "accountId" | "currency" | "ownerKey" | "paidAmount" | "reservedAmount" | "stripeTransferId">, {
173
+ by_account: ["accountId", "_creationTime"];
174
+ by_transfer: ["stripeTransferId", "_creationTime"];
175
+ }, {}, {}>;
176
+ payoutPolicies: import("convex/server").TableDefinition<import("convex/values").VObject<{
177
+ accountId: string;
178
+ country: string;
179
+ holdDeadline?: number | undefined;
180
+ mode: "custom" | "stripe_managed";
181
+ operationKey: string;
182
+ ownerKey: string;
183
+ previousSchedule?: {
184
+ interval: "daily" | "manual" | "monthly" | "weekly";
185
+ monthlyDays?: number[] | undefined;
186
+ weeklyDays?: string[] | undefined;
187
+ } | undefined;
188
+ revision: number;
189
+ status: "changing" | "ready";
190
+ thresholds: {
191
+ amount: number;
192
+ currency: string;
193
+ }[];
194
+ }, {
195
+ accountId: import("convex/values").VString<string, "required">;
196
+ ownerKey: import("convex/values").VString<string, "required">;
197
+ revision: import("convex/values").VFloat64<number, "required">;
198
+ mode: import("convex/values").VUnion<"custom" | "stripe_managed", [import("convex/values").VLiteral<"stripe_managed", "required">, import("convex/values").VLiteral<"custom", "required">], "required", never>;
199
+ thresholds: import("convex/values").VArray<{
200
+ amount: number;
201
+ currency: string;
202
+ }[], import("convex/values").VObject<{
203
+ amount: number;
204
+ currency: string;
205
+ }, {
206
+ currency: import("convex/values").VString<string, "required">;
207
+ amount: import("convex/values").VFloat64<number, "required">;
208
+ }, "required", "amount" | "currency">, "required">;
209
+ status: import("convex/values").VUnion<"changing" | "ready", [import("convex/values").VLiteral<"changing", "required">, import("convex/values").VLiteral<"ready", "required">], "required", never>;
210
+ operationKey: import("convex/values").VString<string, "required">;
211
+ country: import("convex/values").VString<string, "required">;
212
+ previousSchedule: import("convex/values").VObject<{
213
+ interval: "daily" | "manual" | "monthly" | "weekly";
214
+ monthlyDays?: number[] | undefined;
215
+ weeklyDays?: string[] | undefined;
216
+ } | undefined, {
217
+ 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>;
218
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
219
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
220
+ }, "optional", "interval" | "monthlyDays" | "weeklyDays">;
221
+ holdDeadline: import("convex/values").VFloat64<number | undefined, "optional">;
222
+ }, "required", "accountId" | "country" | "holdDeadline" | "mode" | "operationKey" | "ownerKey" | "previousSchedule" | "previousSchedule.interval" | "previousSchedule.monthlyDays" | "previousSchedule.weeklyDays" | "revision" | "status" | "thresholds">, {
223
+ by_account: ["accountId", "_creationTime"];
224
+ by_deadline: ["holdDeadline", "_creationTime"];
225
+ }, {}, {}>;
226
+ payoutPolicyOperations: import("convex/server").TableDefinition<import("convex/values").VObject<{
227
+ accountId: string;
228
+ adoption?: {
229
+ claims: {
230
+ fingerprint: string;
231
+ operationKey: string;
232
+ }[];
233
+ observations: {
234
+ currency: string;
235
+ ledgerFingerprint: string;
236
+ matureNet: number;
237
+ observedAt: number;
238
+ pendingCredits: number;
239
+ stripeTransferId: string;
240
+ transactionIds: string[];
241
+ }[];
242
+ oldestHeldAt?: number | undefined;
243
+ } | undefined;
244
+ attempted?: boolean | undefined;
245
+ country: string;
246
+ expectedRevision: number;
247
+ mode: "custom" | "stripe_managed";
248
+ observedAt?: number | undefined;
249
+ observedSchedule: {
250
+ interval: "daily" | "manual" | "monthly" | "weekly";
251
+ monthlyDays?: number[] | undefined;
252
+ weeklyDays?: string[] | undefined;
253
+ };
254
+ operationKey: string;
255
+ ownerKey: string;
256
+ previousSchedule: {
257
+ interval: "daily" | "manual" | "monthly" | "weekly";
258
+ monthlyDays?: number[] | undefined;
259
+ weeklyDays?: string[] | undefined;
260
+ };
261
+ revision: number;
262
+ status: "canceled" | "complete" | "pending";
263
+ targetSchedule: {
264
+ interval: "daily" | "manual" | "monthly" | "weekly";
265
+ monthlyDays?: number[] | undefined;
266
+ weeklyDays?: string[] | undefined;
267
+ };
268
+ thresholds: {
269
+ amount: number;
270
+ currency: string;
271
+ }[];
272
+ }, {
273
+ accountId: import("convex/values").VString<string, "required">;
274
+ ownerKey: import("convex/values").VString<string, "required">;
275
+ adoption: import("convex/values").VObject<{
276
+ claims: {
277
+ fingerprint: string;
278
+ operationKey: string;
279
+ }[];
280
+ observations: {
281
+ currency: string;
282
+ ledgerFingerprint: string;
283
+ matureNet: number;
284
+ observedAt: number;
285
+ pendingCredits: number;
286
+ stripeTransferId: string;
287
+ transactionIds: string[];
288
+ }[];
289
+ oldestHeldAt?: number | undefined;
290
+ } | undefined, {
291
+ observations: import("convex/values").VArray<{
292
+ currency: string;
293
+ ledgerFingerprint: string;
294
+ matureNet: number;
295
+ observedAt: number;
296
+ pendingCredits: number;
297
+ stripeTransferId: string;
298
+ transactionIds: string[];
299
+ }[], import("convex/values").VObject<{
300
+ currency: string;
301
+ ledgerFingerprint: string;
302
+ matureNet: number;
303
+ observedAt: number;
304
+ pendingCredits: number;
305
+ stripeTransferId: string;
306
+ transactionIds: string[];
307
+ }, {
308
+ stripeTransferId: import("convex/values").VString<string, "required">;
309
+ currency: import("convex/values").VString<string, "required">;
310
+ matureNet: import("convex/values").VFloat64<number, "required">;
311
+ pendingCredits: import("convex/values").VFloat64<number, "required">;
312
+ ledgerFingerprint: import("convex/values").VString<string, "required">;
313
+ observedAt: import("convex/values").VFloat64<number, "required">;
314
+ transactionIds: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
315
+ }, "required", "currency" | "ledgerFingerprint" | "matureNet" | "observedAt" | "pendingCredits" | "stripeTransferId" | "transactionIds">, "required">;
316
+ claims: import("convex/values").VArray<{
317
+ fingerprint: string;
318
+ operationKey: string;
319
+ }[], import("convex/values").VObject<{
320
+ fingerprint: string;
321
+ operationKey: string;
322
+ }, {
323
+ operationKey: import("convex/values").VString<string, "required">;
324
+ fingerprint: import("convex/values").VString<string, "required">;
325
+ }, "required", "fingerprint" | "operationKey">, "required">;
326
+ oldestHeldAt: import("convex/values").VFloat64<number | undefined, "optional">;
327
+ }, "optional", "claims" | "observations" | "oldestHeldAt">;
328
+ operationKey: import("convex/values").VString<string, "required">;
329
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
330
+ mode: import("convex/values").VUnion<"custom" | "stripe_managed", [import("convex/values").VLiteral<"stripe_managed", "required">, import("convex/values").VLiteral<"custom", "required">], "required", never>;
331
+ thresholds: import("convex/values").VArray<{
332
+ amount: number;
333
+ currency: string;
334
+ }[], import("convex/values").VObject<{
335
+ amount: number;
336
+ currency: string;
337
+ }, {
338
+ currency: import("convex/values").VString<string, "required">;
339
+ amount: import("convex/values").VFloat64<number, "required">;
340
+ }, "required", "amount" | "currency">, "required">;
341
+ country: import("convex/values").VString<string, "required">;
342
+ observedSchedule: import("convex/values").VObject<{
343
+ interval: "daily" | "manual" | "monthly" | "weekly";
344
+ monthlyDays?: number[] | undefined;
345
+ weeklyDays?: string[] | undefined;
346
+ }, {
347
+ 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>;
348
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
349
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
350
+ }, "required", "interval" | "monthlyDays" | "weeklyDays">;
351
+ observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
352
+ revision: import("convex/values").VFloat64<number, "required">;
353
+ previousSchedule: import("convex/values").VObject<{
354
+ interval: "daily" | "manual" | "monthly" | "weekly";
355
+ monthlyDays?: number[] | undefined;
356
+ weeklyDays?: string[] | undefined;
357
+ }, {
358
+ 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>;
359
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
360
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
361
+ }, "required", "interval" | "monthlyDays" | "weeklyDays">;
362
+ targetSchedule: import("convex/values").VObject<{
363
+ interval: "daily" | "manual" | "monthly" | "weekly";
364
+ monthlyDays?: number[] | undefined;
365
+ weeklyDays?: string[] | undefined;
366
+ }, {
367
+ 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>;
368
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
369
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
370
+ }, "required", "interval" | "monthlyDays" | "weeklyDays">;
371
+ 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>;
372
+ attempted: import("convex/values").VBoolean<boolean | undefined, "optional">;
373
+ }, "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">, {
374
+ by_operation: ["operationKey", "_creationTime"];
375
+ }, {}, {}>;
376
+ currencyTotals: import("convex/server").TableDefinition<import("convex/values").VObject<{
377
+ accountId: string;
378
+ count: number;
379
+ currency: string;
380
+ gross: number;
381
+ kind: "earnings" | "payouts";
382
+ paidOut: number;
383
+ reversed: number;
384
+ }, {
385
+ accountId: import("convex/values").VString<string, "required">;
386
+ currency: import("convex/values").VString<string, "required">;
387
+ kind: import("convex/values").VUnion<"earnings" | "payouts", [import("convex/values").VLiteral<"earnings", "required">, import("convex/values").VLiteral<"payouts", "required">], "required", never>;
388
+ gross: import("convex/values").VFloat64<number, "required">;
389
+ reversed: import("convex/values").VFloat64<number, "required">;
390
+ paidOut: import("convex/values").VFloat64<number, "required">;
391
+ count: import("convex/values").VFloat64<number, "required">;
392
+ }, "required", "accountId" | "count" | "currency" | "gross" | "kind" | "paidOut" | "reversed">, {
393
+ by_account_kind_currency: ["accountId", "kind", "currency", "_creationTime"];
394
+ }, {}, {}>;
395
+ recoveryClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
396
+ accountId: string;
397
+ amountDue: number;
398
+ claimKey: string;
399
+ collectedAmount: number;
400
+ currency: string;
401
+ openingCollection?: {
402
+ amountDue: number;
403
+ collectedAmount: number;
404
+ operationKey: string;
405
+ revision: number;
406
+ } | undefined;
407
+ outstanding: number;
408
+ reservedAmount: number;
409
+ revision: number;
410
+ scopeKey: string;
411
+ sign: "negative" | "positive" | "zero";
412
+ sourceChargeId: string;
413
+ sourceGross: number;
414
+ sourceProcessingFee: number;
415
+ }, {
416
+ accountId: import("convex/values").VString<string, "required">;
417
+ scopeKey: import("convex/values").VString<string, "required">;
418
+ currency: import("convex/values").VString<string, "required">;
419
+ claimKey: import("convex/values").VString<string, "required">;
420
+ sourceChargeId: import("convex/values").VString<string, "required">;
421
+ sourceGross: import("convex/values").VFloat64<number, "required">;
422
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
423
+ amountDue: import("convex/values").VFloat64<number, "required">;
424
+ revision: import("convex/values").VFloat64<number, "required">;
425
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
426
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
427
+ outstanding: import("convex/values").VFloat64<number, "required">;
428
+ 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>;
429
+ openingCollection: import("convex/values").VObject<{
430
+ amountDue: number;
431
+ collectedAmount: number;
432
+ operationKey: string;
433
+ revision: number;
434
+ } | undefined, {
435
+ operationKey: import("convex/values").VString<string, "required">;
436
+ amountDue: import("convex/values").VFloat64<number, "required">;
437
+ revision: import("convex/values").VFloat64<number, "required">;
438
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
439
+ }, "optional", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
440
+ }, "required", "accountId" | "amountDue" | "claimKey" | "collectedAmount" | "currency" | "openingCollection" | "openingCollection.amountDue" | "openingCollection.collectedAmount" | "openingCollection.operationKey" | "openingCollection.revision" | "outstanding" | "reservedAmount" | "revision" | "scopeKey" | "sign" | "sourceChargeId" | "sourceGross" | "sourceProcessingFee">, {
441
+ by_import: ["openingCollection.operationKey", "_creationTime"];
442
+ by_key: ["claimKey", "_creationTime"];
443
+ by_scope: ["accountId", "scopeKey", "currency", "_creationTime"];
444
+ by_sign: ["accountId", "scopeKey", "currency", "sign", "_creationTime"];
445
+ }, {}, {}>;
446
+ recoveryBalances: import("convex/server").TableDefinition<import("convex/values").VObject<{
447
+ accountId: string;
448
+ activeGroupKey?: string | undefined;
449
+ amountDue: number;
450
+ collectedAmount: number;
451
+ currency: string;
452
+ outstanding: number;
453
+ reservedAmount: number;
454
+ scopeKey: string;
455
+ }, {
456
+ accountId: import("convex/values").VString<string, "required">;
457
+ scopeKey: import("convex/values").VString<string, "required">;
458
+ currency: import("convex/values").VString<string, "required">;
459
+ amountDue: import("convex/values").VFloat64<number, "required">;
460
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
461
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
462
+ outstanding: import("convex/values").VFloat64<number, "required">;
463
+ activeGroupKey: import("convex/values").VString<string | undefined, "optional">;
464
+ }, "required", "accountId" | "activeGroupKey" | "amountDue" | "collectedAmount" | "currency" | "outstanding" | "reservedAmount" | "scopeKey">, {
465
+ by_scope: ["accountId", "scopeKey", "currency", "_creationTime"];
466
+ }, {}, {}>;
467
+ recoveryGroups: import("convex/server").TableDefinition<import("convex/values").VObject<{
468
+ accountId: string;
469
+ amount: number;
470
+ currency: string;
471
+ groupKey: string;
472
+ invoiceFunding?: {
473
+ sourceChargeId: string;
474
+ sourceGross: number;
475
+ sourceProcessingFee: number;
476
+ } | undefined;
477
+ invoiceItemId?: string | undefined;
478
+ maxCredit: number;
479
+ maxDebit: number;
480
+ pendingOperations: number;
481
+ scopeKey: string;
482
+ sourceGross?: number | undefined;
483
+ sourceId: string;
484
+ sourceKind: "invoice" | "settlement";
485
+ sourceProcessingFee?: number | undefined;
486
+ status: "collected" | "collecting" | "open" | "released" | "releasing" | "sealed";
487
+ }, {
488
+ accountId: import("convex/values").VString<string, "required">;
489
+ scopeKey: import("convex/values").VString<string, "required">;
490
+ currency: import("convex/values").VString<string, "required">;
491
+ groupKey: import("convex/values").VString<string, "required">;
492
+ sourceKind: import("convex/values").VUnion<"invoice" | "settlement", [import("convex/values").VLiteral<"settlement", "required">, import("convex/values").VLiteral<"invoice", "required">], "required", never>;
493
+ sourceId: import("convex/values").VString<string, "required">;
494
+ sourceGross: import("convex/values").VFloat64<number | undefined, "optional">;
495
+ sourceProcessingFee: import("convex/values").VFloat64<number | undefined, "optional">;
496
+ maxDebit: import("convex/values").VFloat64<number, "required">;
497
+ maxCredit: import("convex/values").VFloat64<number, "required">;
498
+ amount: import("convex/values").VFloat64<number, "required">;
499
+ pendingOperations: import("convex/values").VFloat64<number, "required">;
500
+ invoiceItemId: import("convex/values").VString<string | undefined, "optional">;
501
+ invoiceFunding: import("convex/values").VObject<{
502
+ sourceChargeId: string;
503
+ sourceGross: number;
504
+ sourceProcessingFee: number;
505
+ } | undefined, {
506
+ sourceChargeId: import("convex/values").VString<string, "required">;
507
+ sourceGross: import("convex/values").VFloat64<number, "required">;
508
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
509
+ }, "optional", "sourceChargeId" | "sourceGross" | "sourceProcessingFee">;
510
+ 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>;
511
+ }, "required", "accountId" | "amount" | "currency" | "groupKey" | "invoiceFunding" | "invoiceFunding.sourceChargeId" | "invoiceFunding.sourceGross" | "invoiceFunding.sourceProcessingFee" | "invoiceItemId" | "maxCredit" | "maxDebit" | "pendingOperations" | "scopeKey" | "sourceGross" | "sourceId" | "sourceKind" | "sourceProcessingFee" | "status">, {
512
+ by_key: ["groupKey", "_creationTime"];
513
+ }, {}, {}>;
514
+ recoveryReservations: import("convex/server").TableDefinition<import("convex/values").VObject<{
515
+ allocations: {
516
+ amount: number;
517
+ claimId: import("convex/values").GenericId<"recoveryClaims">;
518
+ claimKey: string;
519
+ }[];
520
+ amount: number;
521
+ groupKey: string;
522
+ limit: number;
523
+ operationKey: string;
524
+ status: "collected" | "empty" | "released" | "reserved";
525
+ }, {
526
+ operationKey: import("convex/values").VString<string, "required">;
527
+ groupKey: import("convex/values").VString<string, "required">;
528
+ amount: import("convex/values").VFloat64<number, "required">;
529
+ limit: import("convex/values").VFloat64<number, "required">;
530
+ allocations: import("convex/values").VArray<{
531
+ amount: number;
532
+ claimId: import("convex/values").GenericId<"recoveryClaims">;
533
+ claimKey: string;
534
+ }[], import("convex/values").VObject<{
535
+ amount: number;
536
+ claimId: import("convex/values").GenericId<"recoveryClaims">;
537
+ claimKey: string;
538
+ }, {
539
+ claimId: import("convex/values").VId<import("convex/values").GenericId<"recoveryClaims">, "required">;
540
+ claimKey: import("convex/values").VString<string, "required">;
541
+ amount: import("convex/values").VFloat64<number, "required">;
542
+ }, "required", "amount" | "claimId" | "claimKey">, "required">;
543
+ 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>;
544
+ }, "required", "allocations" | "amount" | "groupKey" | "limit" | "operationKey" | "status">, {
545
+ by_group_status: ["groupKey", "status", "_creationTime"];
546
+ by_key: ["operationKey", "_creationTime"];
547
+ }, {}, {}>;
548
+ settlementAllocations: import("convex/server").TableDefinition<import("convex/values").VObject<{
549
+ adjustmentAmount?: number | undefined;
550
+ currency: string;
551
+ gross: number;
552
+ paymentId?: string | undefined;
553
+ paymentIntentId?: string | undefined;
554
+ platformNet: number;
555
+ processingFee: number;
556
+ sourceChargeId: string;
557
+ sourceInvoiceId?: string | undefined;
558
+ transfers: {
559
+ amount: number;
560
+ destinationAccountId: string;
561
+ role: "affiliate" | "other" | "store";
562
+ }[];
563
+ }, {
564
+ sourceChargeId: import("convex/values").VString<string, "required">;
565
+ paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
566
+ sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
567
+ gross: import("convex/values").VFloat64<number, "required">;
568
+ currency: import("convex/values").VString<string, "required">;
569
+ processingFee: import("convex/values").VFloat64<number, "required">;
570
+ platformNet: import("convex/values").VFloat64<number, "required">;
571
+ adjustmentAmount: import("convex/values").VFloat64<number | undefined, "optional">;
572
+ paymentId: import("convex/values").VString<string | undefined, "optional">;
573
+ transfers: import("convex/values").VArray<{
574
+ amount: number;
575
+ destinationAccountId: string;
576
+ role: "affiliate" | "other" | "store";
577
+ }[], import("convex/values").VObject<{
578
+ amount: number;
579
+ destinationAccountId: string;
580
+ role: "affiliate" | "other" | "store";
581
+ }, {
582
+ destinationAccountId: import("convex/values").VString<string, "required">;
583
+ 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>;
584
+ amount: import("convex/values").VFloat64<number, "required">;
585
+ }, "required", "amount" | "destinationAccountId" | "role">, "required">;
586
+ }, "required", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">, {
587
+ by_source_charge: ["sourceChargeId", "_creationTime"];
588
+ }, {}, {}>;
589
+ commissionTerms: import("convex/server").TableDefinition<import("convex/values").VObject<{
590
+ affiliateAccountId?: string | undefined;
591
+ firstPaidInvoiceId: string;
592
+ subscriptionId: string;
593
+ term: "forever" | "one_time";
594
+ }, {
595
+ subscriptionId: import("convex/values").VString<string, "required">;
596
+ term: import("convex/values").VUnion<"forever" | "one_time", [import("convex/values").VLiteral<"forever", "required">, import("convex/values").VLiteral<"one_time", "required">], "required", never>;
597
+ affiliateAccountId: import("convex/values").VString<string | undefined, "optional">;
598
+ firstPaidInvoiceId: import("convex/values").VString<string, "required">;
599
+ }, "required", "affiliateAccountId" | "firstPaidInvoiceId" | "subscriptionId" | "term">, {
600
+ by_subscription: ["subscriptionId", "_creationTime"];
601
+ }, {}, {}>;
602
+ commissionDecisions: import("convex/server").TableDefinition<import("convex/values").VObject<{
603
+ claimKey: string;
604
+ eligible: boolean;
605
+ invoiceId: string;
606
+ subscriptionId: string;
607
+ }, {
608
+ subscriptionId: import("convex/values").VString<string, "required">;
609
+ invoiceId: import("convex/values").VString<string, "required">;
610
+ eligible: import("convex/values").VBoolean<boolean, "required">;
611
+ claimKey: import("convex/values").VString<string, "required">;
612
+ }, "required", "claimKey" | "eligible" | "invoiceId" | "subscriptionId">, {
613
+ by_subscription_invoice: ["subscriptionId", "invoiceId", "_creationTime"];
614
+ }, {}, {}>;
615
+ accounts: import("convex/server").TableDefinition<import("convex/values").VObject<{
616
+ appliedConfigurations?: ("customer" | "merchant" | "recipient")[] | undefined;
617
+ capabilities?: any;
618
+ configuration?: any;
619
+ country?: string | undefined;
620
+ email?: string | undefined;
621
+ metadata?: any;
622
+ missingRequirements?: string[] | undefined;
623
+ name?: string | undefined;
624
+ onboardingStatus: "complete" | "in_progress" | "pending" | "restricted";
625
+ orgId?: string | undefined;
626
+ requirements?: any;
627
+ statementDescriptor?: string | undefined;
628
+ stripeAccountId: string;
629
+ userId: string;
630
+ }, {
631
+ stripeAccountId: import("convex/values").VString<string, "required">;
632
+ userId: import("convex/values").VString<string, "required">;
633
+ orgId: import("convex/values").VString<string | undefined, "optional">;
634
+ email: import("convex/values").VString<string | undefined, "optional">;
635
+ name: import("convex/values").VString<string | undefined, "optional">;
636
+ country: import("convex/values").VString<string | undefined, "optional">;
637
+ capabilities: import("convex/values").VAny<any, "optional", string>;
638
+ requirements: import("convex/values").VAny<any, "optional", string>;
639
+ configuration: import("convex/values").VAny<any, "optional", string>;
640
+ 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">;
641
+ 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>;
642
+ missingRequirements: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
643
+ metadata: import("convex/values").VAny<any, "optional", string>;
644
+ statementDescriptor: import("convex/values").VString<string | undefined, "optional">;
645
+ }, "required", "appliedConfigurations" | "capabilities" | "configuration" | "country" | "email" | "metadata" | "missingRequirements" | "name" | "onboardingStatus" | "orgId" | "requirements" | "statementDescriptor" | "stripeAccountId" | "userId" | `capabilities.${string}` | `configuration.${string}` | `metadata.${string}` | `requirements.${string}`>, {
646
+ by_onboarding_status: ["onboardingStatus", "_creationTime"];
647
+ by_org_id: ["orgId", "_creationTime"];
648
+ by_stripe_account_id: ["stripeAccountId", "_creationTime"];
649
+ by_user_id: ["userId", "_creationTime"];
650
+ }, {}, {}>;
651
+ products: import("convex/server").TableDefinition<import("convex/values").VObject<{
652
+ accountId?: string | undefined;
653
+ active: boolean;
654
+ description?: string | undefined;
655
+ metadata?: any;
656
+ name: string;
657
+ stripeProductId: string;
658
+ }, {
659
+ stripeProductId: import("convex/values").VString<string, "required">;
660
+ accountId: import("convex/values").VString<string | undefined, "optional">;
661
+ name: import("convex/values").VString<string, "required">;
662
+ description: import("convex/values").VString<string | undefined, "optional">;
663
+ active: import("convex/values").VBoolean<boolean, "required">;
664
+ metadata: import("convex/values").VAny<any, "optional", string>;
665
+ }, "required", "accountId" | "active" | "description" | "metadata" | "name" | "stripeProductId" | `metadata.${string}`>, {
666
+ by_account_active: ["accountId", "active", "_creationTime"];
667
+ by_account_id: ["accountId", "_creationTime"];
668
+ by_active: ["active", "_creationTime"];
669
+ by_stripe_product_id: ["stripeProductId", "_creationTime"];
670
+ }, {}, {}>;
671
+ prices: import("convex/server").TableDefinition<import("convex/values").VObject<{
672
+ active: boolean;
673
+ currency: string;
674
+ interval?: "day" | "month" | "week" | "year" | undefined;
675
+ intervalCount?: number | undefined;
676
+ metadata?: any;
677
+ nickname?: string | undefined;
678
+ productId: string;
679
+ stripePriceId: string;
680
+ stripeProductId: string;
681
+ type: "one_time" | "recurring";
682
+ unitAmount: number;
683
+ }, {
684
+ stripePriceId: import("convex/values").VString<string, "required">;
685
+ productId: import("convex/values").VString<string, "required">;
686
+ stripeProductId: import("convex/values").VString<string, "required">;
687
+ nickname: import("convex/values").VString<string | undefined, "optional">;
688
+ unitAmount: import("convex/values").VFloat64<number, "required">;
689
+ currency: import("convex/values").VString<string, "required">;
690
+ active: import("convex/values").VBoolean<boolean, "required">;
691
+ type: import("convex/values").VUnion<"one_time" | "recurring", [import("convex/values").VLiteral<"one_time", "required">, import("convex/values").VLiteral<"recurring", "required">], "required", never>;
692
+ 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>;
693
+ intervalCount: import("convex/values").VFloat64<number | undefined, "optional">;
694
+ metadata: import("convex/values").VAny<any, "optional", string>;
695
+ }, "required", "active" | "currency" | "interval" | "intervalCount" | "metadata" | "nickname" | "productId" | "stripePriceId" | "stripeProductId" | "type" | "unitAmount" | `metadata.${string}`>, {
696
+ by_active: ["active", "_creationTime"];
697
+ by_product_active: ["productId", "active", "_creationTime"];
698
+ by_product_id: ["productId", "_creationTime"];
699
+ by_stripe_price_id: ["stripePriceId", "_creationTime"];
700
+ by_stripe_product_id: ["stripeProductId", "_creationTime"];
701
+ }, {}, {}>;
702
+ subscriptions: import("convex/server").TableDefinition<import("convex/values").VObject<{
703
+ accountId?: string | undefined;
704
+ applicationFeeAmount?: number | undefined;
705
+ applicationFeePercent?: number | undefined;
706
+ cancelAtPeriodEnd: boolean;
707
+ canceledAt?: string | undefined;
708
+ chargeType?: "destination" | "separate" | undefined;
709
+ currency?: string | undefined;
710
+ currentPeriodEnd?: string | undefined;
711
+ currentPeriodStart?: string | undefined;
712
+ destinationAccountId?: string | undefined;
713
+ feeCollectedAmount?: number | undefined;
714
+ feeRefundedAmount?: number | undefined;
715
+ isCollectionPaused?: boolean | undefined;
716
+ isTrialing: boolean;
717
+ metadata?: any;
718
+ orgId?: string | undefined;
719
+ priceId?: string | undefined;
720
+ quantity?: number | undefined;
721
+ splitRecipients?: {
722
+ amount?: number | undefined;
723
+ destinationAccountId: string;
724
+ percent?: number | undefined;
725
+ role: "affiliate" | "other" | "store";
726
+ }[] | undefined;
727
+ status: "active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid";
728
+ stripeSubscriptionId: string;
729
+ trialEnd?: string | undefined;
730
+ trialStart?: string | undefined;
731
+ userId: string;
732
+ }, {
733
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
734
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
735
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
736
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
737
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
738
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
739
+ splitRecipients: import("convex/values").VArray<{
740
+ amount?: number | undefined;
741
+ destinationAccountId: string;
742
+ percent?: number | undefined;
743
+ role: "affiliate" | "other" | "store";
744
+ }[] | undefined, import("convex/values").VObject<{
745
+ amount?: number | undefined;
746
+ destinationAccountId: string;
747
+ percent?: number | undefined;
748
+ role: "affiliate" | "other" | "store";
749
+ }, {
750
+ destinationAccountId: import("convex/values").VString<string, "required">;
751
+ 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>;
752
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
753
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
754
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
755
+ stripeSubscriptionId: import("convex/values").VString<string, "required">;
756
+ accountId: import("convex/values").VString<string | undefined, "optional">;
757
+ userId: import("convex/values").VString<string, "required">;
758
+ orgId: import("convex/values").VString<string | undefined, "optional">;
759
+ 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>;
760
+ priceId: import("convex/values").VString<string | undefined, "optional">;
761
+ quantity: import("convex/values").VFloat64<number | undefined, "optional">;
762
+ currentPeriodStart: import("convex/values").VString<string | undefined, "optional">;
763
+ currentPeriodEnd: import("convex/values").VString<string | undefined, "optional">;
764
+ cancelAtPeriodEnd: import("convex/values").VBoolean<boolean, "required">;
765
+ isCollectionPaused: import("convex/values").VBoolean<boolean | undefined, "optional">;
766
+ canceledAt: import("convex/values").VString<string | undefined, "optional">;
767
+ isTrialing: import("convex/values").VBoolean<boolean, "required">;
768
+ trialStart: import("convex/values").VString<string | undefined, "optional">;
769
+ trialEnd: import("convex/values").VString<string | undefined, "optional">;
770
+ currency: import("convex/values").VString<string | undefined, "optional">;
771
+ metadata: import("convex/values").VAny<any, "optional", string>;
772
+ }, "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}`>, {
773
+ by_account_id: ["accountId", "_creationTime"];
774
+ by_account_status: ["accountId", "status", "_creationTime"];
775
+ by_org_id: ["orgId", "_creationTime"];
776
+ by_price_id: ["priceId", "_creationTime"];
777
+ by_status: ["status", "_creationTime"];
778
+ by_stripe_subscription_id: ["stripeSubscriptionId", "_creationTime"];
779
+ by_user_id: ["userId", "_creationTime"];
780
+ }, {}, {}>;
781
+ checkoutSessions: import("convex/server").TableDefinition<import("convex/values").VObject<{
782
+ accountId?: string | undefined;
783
+ applicationFeeAmount?: number | undefined;
784
+ applicationFeePercent?: number | undefined;
785
+ chargeType?: "destination" | "separate" | undefined;
786
+ clientSecret?: string | undefined;
787
+ currency?: string | undefined;
788
+ destinationAccountId?: string | undefined;
789
+ feeCollectedAmount?: number | undefined;
790
+ feeRefundedAmount?: number | undefined;
791
+ metadata?: any;
792
+ mode: "payment" | "setup" | "subscription";
793
+ orgId?: string | undefined;
794
+ priceId?: string | undefined;
795
+ splitRecipients?: {
796
+ amount?: number | undefined;
797
+ destinationAccountId: string;
798
+ percent?: number | undefined;
799
+ role: "affiliate" | "other" | "store";
800
+ }[] | undefined;
801
+ status: "complete" | "expired" | "open";
802
+ stripeSessionId: string;
803
+ url?: string | undefined;
804
+ userId: string;
805
+ }, {
806
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
807
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
808
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
809
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
810
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
811
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
812
+ splitRecipients: import("convex/values").VArray<{
813
+ amount?: number | undefined;
814
+ destinationAccountId: string;
815
+ percent?: number | undefined;
816
+ role: "affiliate" | "other" | "store";
817
+ }[] | undefined, import("convex/values").VObject<{
818
+ amount?: number | undefined;
819
+ destinationAccountId: string;
820
+ percent?: number | undefined;
821
+ role: "affiliate" | "other" | "store";
822
+ }, {
823
+ destinationAccountId: import("convex/values").VString<string, "required">;
824
+ 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>;
825
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
826
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
827
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
828
+ stripeSessionId: import("convex/values").VString<string, "required">;
829
+ userId: import("convex/values").VString<string, "required">;
830
+ orgId: import("convex/values").VString<string | undefined, "optional">;
831
+ accountId: import("convex/values").VString<string | undefined, "optional">;
832
+ 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>;
833
+ 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>;
834
+ clientSecret: import("convex/values").VString<string | undefined, "optional">;
835
+ url: import("convex/values").VString<string | undefined, "optional">;
836
+ priceId: import("convex/values").VString<string | undefined, "optional">;
837
+ currency: import("convex/values").VString<string | undefined, "optional">;
838
+ metadata: import("convex/values").VAny<any, "optional", string>;
839
+ }, "required", "accountId" | "applicationFeeAmount" | "applicationFeePercent" | "chargeType" | "clientSecret" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "metadata" | "mode" | "orgId" | "priceId" | "splitRecipients" | "status" | "stripeSessionId" | "url" | "userId" | `metadata.${string}`>, {
840
+ by_account_id: ["accountId", "_creationTime"];
841
+ by_stripe_session_id: ["stripeSessionId", "_creationTime"];
842
+ by_user_id: ["userId", "_creationTime"];
843
+ by_user_status: ["userId", "status", "_creationTime"];
844
+ }, {}, {}>;
845
+ invoices: import("convex/server").TableDefinition<import("convex/values").VObject<{
846
+ accountId?: string | undefined;
847
+ amountDue: number;
848
+ amountPaid: number;
849
+ applicationFeeAmount?: number | undefined;
850
+ applicationFeePercent?: number | undefined;
851
+ attemptCount?: number | undefined;
852
+ chargeType?: "destination" | "separate" | undefined;
853
+ currency: string;
854
+ destinationAccountId?: string | undefined;
855
+ feeCollectedAmount?: number | undefined;
856
+ feeRefundedAmount?: number | undefined;
857
+ hostedInvoiceUrl?: string | undefined;
858
+ invoicePdf?: string | undefined;
859
+ metadata?: any;
860
+ nextPaymentAttempt?: string | undefined;
861
+ orgId?: string | undefined;
862
+ periodEnd?: string | undefined;
863
+ periodStart?: string | undefined;
864
+ splitRecipients?: {
865
+ amount?: number | undefined;
866
+ destinationAccountId: string;
867
+ percent?: number | undefined;
868
+ role: "affiliate" | "other" | "store";
869
+ }[] | undefined;
870
+ status: "draft" | "open" | "paid" | "uncollectible" | "void";
871
+ stripeInvoiceId: string;
872
+ subscriptionId?: string | undefined;
873
+ userId: string;
874
+ }, {
875
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
876
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
877
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
878
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
879
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
880
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
881
+ splitRecipients: import("convex/values").VArray<{
882
+ amount?: number | undefined;
883
+ destinationAccountId: string;
884
+ percent?: number | undefined;
885
+ role: "affiliate" | "other" | "store";
886
+ }[] | undefined, import("convex/values").VObject<{
887
+ amount?: number | undefined;
888
+ destinationAccountId: string;
889
+ percent?: number | undefined;
890
+ role: "affiliate" | "other" | "store";
891
+ }, {
892
+ destinationAccountId: import("convex/values").VString<string, "required">;
893
+ 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>;
894
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
895
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
896
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
897
+ stripeInvoiceId: import("convex/values").VString<string, "required">;
898
+ userId: import("convex/values").VString<string, "required">;
899
+ orgId: import("convex/values").VString<string | undefined, "optional">;
900
+ accountId: import("convex/values").VString<string | undefined, "optional">;
901
+ subscriptionId: import("convex/values").VString<string | undefined, "optional">;
902
+ 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>;
903
+ currency: import("convex/values").VString<string, "required">;
904
+ amountDue: import("convex/values").VFloat64<number, "required">;
905
+ amountPaid: import("convex/values").VFloat64<number, "required">;
906
+ hostedInvoiceUrl: import("convex/values").VString<string | undefined, "optional">;
907
+ invoicePdf: import("convex/values").VString<string | undefined, "optional">;
908
+ periodStart: import("convex/values").VString<string | undefined, "optional">;
909
+ periodEnd: import("convex/values").VString<string | undefined, "optional">;
910
+ nextPaymentAttempt: import("convex/values").VString<string | undefined, "optional">;
911
+ attemptCount: import("convex/values").VFloat64<number | undefined, "optional">;
912
+ metadata: import("convex/values").VAny<any, "optional", string>;
913
+ }, "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}`>, {
914
+ by_account_id: ["accountId", "_creationTime"];
915
+ by_account_status: ["accountId", "status", "_creationTime"];
916
+ by_status: ["status", "_creationTime"];
917
+ by_stripe_invoice_id: ["stripeInvoiceId", "_creationTime"];
918
+ by_subscription_id: ["subscriptionId", "_creationTime"];
919
+ by_subscription_status: ["subscriptionId", "status", "_creationTime"];
920
+ by_user_id: ["userId", "_creationTime"];
921
+ by_user_status: ["userId", "status", "_creationTime"];
922
+ }, {}, {}>;
923
+ payments: import("convex/server").TableDefinition<import("convex/values").VObject<{
924
+ accountId?: string | undefined;
925
+ amount: number;
926
+ applicationFeeAmount?: number | undefined;
927
+ applicationFeePercent?: number | undefined;
928
+ chargeType?: "destination" | "separate" | undefined;
929
+ currency: string;
930
+ destinationAccountId?: string | undefined;
931
+ feeCollectedAmount?: number | undefined;
932
+ feeRefundedAmount?: number | undefined;
933
+ metadata?: any;
934
+ orgId?: string | undefined;
935
+ refundStatus?: "fully_refunded" | "partially_refunded" | undefined;
936
+ refundedAmount?: number | undefined;
937
+ splitRecipients?: {
938
+ amount?: number | undefined;
939
+ destinationAccountId: string;
940
+ percent?: number | undefined;
941
+ role: "affiliate" | "other" | "store";
942
+ }[] | undefined;
943
+ status: "canceled" | "failed" | "processing" | "requires_action" | "succeeded";
944
+ stripePaymentIntentId: string;
945
+ userId: string;
946
+ }, {
947
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
948
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
949
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
950
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
951
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
952
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
953
+ splitRecipients: import("convex/values").VArray<{
954
+ amount?: number | undefined;
955
+ destinationAccountId: string;
956
+ percent?: number | undefined;
957
+ role: "affiliate" | "other" | "store";
958
+ }[] | undefined, import("convex/values").VObject<{
959
+ amount?: number | undefined;
960
+ destinationAccountId: string;
961
+ percent?: number | undefined;
962
+ role: "affiliate" | "other" | "store";
963
+ }, {
964
+ destinationAccountId: import("convex/values").VString<string, "required">;
965
+ 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>;
966
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
967
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
968
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
969
+ stripePaymentIntentId: import("convex/values").VString<string, "required">;
970
+ userId: import("convex/values").VString<string, "required">;
971
+ orgId: import("convex/values").VString<string | undefined, "optional">;
972
+ accountId: import("convex/values").VString<string | undefined, "optional">;
973
+ amount: import("convex/values").VFloat64<number, "required">;
974
+ currency: import("convex/values").VString<string, "required">;
975
+ 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>;
976
+ refundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
977
+ 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>;
978
+ metadata: import("convex/values").VAny<any, "optional", string>;
979
+ }, "required", "accountId" | "amount" | "applicationFeeAmount" | "applicationFeePercent" | "chargeType" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "metadata" | "orgId" | "refundStatus" | "refundedAmount" | "splitRecipients" | "status" | "stripePaymentIntentId" | "userId" | `metadata.${string}`>, {
980
+ by_account_id: ["accountId", "_creationTime"];
981
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
982
+ by_user_id: ["userId", "_creationTime"];
983
+ }, {}, {}>;
984
+ payouts: import("convex/server").TableDefinition<import("convex/values").VObject<{
985
+ accountId: string;
986
+ amount: number;
987
+ arrivalDate?: string | undefined;
988
+ currency: string;
989
+ failureCode?: string | undefined;
990
+ failureMessage?: string | undefined;
991
+ metadata?: any;
992
+ method?: string | undefined;
993
+ status: "canceled" | "failed" | "in_transit" | "paid" | "pending";
994
+ stripePayoutId: string;
995
+ totalsRecorded?: true | undefined;
996
+ }, {
997
+ stripePayoutId: import("convex/values").VString<string, "required">;
998
+ accountId: import("convex/values").VString<string, "required">;
999
+ amount: import("convex/values").VFloat64<number, "required">;
1000
+ currency: import("convex/values").VString<string, "required">;
1001
+ 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>;
1002
+ arrivalDate: import("convex/values").VString<string | undefined, "optional">;
1003
+ method: import("convex/values").VString<string | undefined, "optional">;
1004
+ failureCode: import("convex/values").VString<string | undefined, "optional">;
1005
+ failureMessage: import("convex/values").VString<string | undefined, "optional">;
1006
+ metadata: import("convex/values").VAny<any, "optional", string>;
1007
+ totalsRecorded: import("convex/values").VLiteral<true | undefined, "optional">;
1008
+ }, "required", "accountId" | "amount" | "arrivalDate" | "currency" | "failureCode" | "failureMessage" | "metadata" | "method" | "status" | "stripePayoutId" | "totalsRecorded" | `metadata.${string}`>, {
1009
+ by_account_id: ["accountId", "_creationTime"];
1010
+ by_account_status: ["accountId", "status", "_creationTime"];
1011
+ by_account_totals_recorded: ["accountId", "totalsRecorded", "_creationTime"];
1012
+ by_status: ["status", "_creationTime"];
1013
+ by_stripe_payout_id: ["stripePayoutId", "_creationTime"];
1014
+ }, {}, {}>;
1015
+ pendingFeeRefunds: import("convex/server").TableDefinition<import("convex/values").VObject<{
1016
+ feeCollectedAmount: number;
1017
+ feeRefundedAmount: number;
1018
+ stripePaymentIntentId: string;
1019
+ }, {
1020
+ stripePaymentIntentId: import("convex/values").VString<string, "required">;
1021
+ feeCollectedAmount: import("convex/values").VFloat64<number, "required">;
1022
+ feeRefundedAmount: import("convex/values").VFloat64<number, "required">;
1023
+ }, "required", "feeCollectedAmount" | "feeRefundedAmount" | "stripePaymentIntentId">, {
1024
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
1025
+ }, {}, {}>;
1026
+ refunds: import("convex/server").TableDefinition<import("convex/values").VObject<{
1027
+ accountId?: string | undefined;
1028
+ amount: number;
1029
+ currency: string;
1030
+ failureReason?: string | undefined;
1031
+ metadata?: any;
1032
+ reason?: "duplicate" | "expired_uncaptured_charge" | "fraudulent" | "requested_by_customer" | undefined;
1033
+ status: "canceled" | "failed" | "pending" | "requires_action" | "succeeded";
1034
+ stripeChargeId?: string | undefined;
1035
+ stripePaymentIntentId?: string | undefined;
1036
+ stripeRefundId: string;
1037
+ }, {
1038
+ stripeRefundId: import("convex/values").VString<string, "required">;
1039
+ stripePaymentIntentId: import("convex/values").VString<string | undefined, "optional">;
1040
+ stripeChargeId: import("convex/values").VString<string | undefined, "optional">;
1041
+ accountId: import("convex/values").VString<string | undefined, "optional">;
1042
+ amount: import("convex/values").VFloat64<number, "required">;
1043
+ currency: import("convex/values").VString<string, "required">;
1044
+ 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>;
1045
+ 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>;
1046
+ failureReason: import("convex/values").VString<string | undefined, "optional">;
1047
+ metadata: import("convex/values").VAny<any, "optional", string>;
1048
+ }, "required", "accountId" | "amount" | "currency" | "failureReason" | "metadata" | "reason" | "status" | "stripeChargeId" | "stripePaymentIntentId" | "stripeRefundId" | `metadata.${string}`>, {
1049
+ by_account_id: ["accountId", "_creationTime"];
1050
+ by_account_id_and_status: ["accountId", "status", "_creationTime"];
1051
+ by_account_id_and_stripe_payment_intent_id: ["accountId", "stripePaymentIntentId", "_creationTime"];
1052
+ by_account_id_and_stripe_payment_intent_id_and_status: ["accountId", "stripePaymentIntentId", "status", "_creationTime"];
1053
+ by_payment_intent_id_and_status: ["stripePaymentIntentId", "status", "_creationTime"];
1054
+ by_status: ["status", "_creationTime"];
1055
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
1056
+ by_stripe_refund_id: ["stripeRefundId", "_creationTime"];
1057
+ }, {}, {}>;
1058
+ disputes: import("convex/server").TableDefinition<import("convex/values").VObject<{
1059
+ accountId?: string | undefined;
1060
+ amount: number;
1061
+ currency: string;
1062
+ evidence?: any;
1063
+ evidenceDueBy?: string | undefined;
1064
+ isChargeRefundable: boolean;
1065
+ lastEvent?: string | undefined;
1066
+ linkedTransferIds?: string[] | undefined;
1067
+ metadata?: any;
1068
+ reason: string;
1069
+ statementDescriptor?: string | undefined;
1070
+ status: "lost" | "needs_response" | "prevented" | "under_review" | "warning_closed" | "warning_needs_response" | "warning_under_review" | "won";
1071
+ stripeChargeId?: string | undefined;
1072
+ stripeDisputeId: string;
1073
+ stripePaymentIntentId?: string | undefined;
1074
+ }, {
1075
+ stripeDisputeId: import("convex/values").VString<string, "required">;
1076
+ stripePaymentIntentId: import("convex/values").VString<string | undefined, "optional">;
1077
+ stripeChargeId: import("convex/values").VString<string | undefined, "optional">;
1078
+ accountId: import("convex/values").VString<string | undefined, "optional">;
1079
+ amount: import("convex/values").VFloat64<number, "required">;
1080
+ currency: import("convex/values").VString<string, "required">;
1081
+ 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>;
1082
+ reason: import("convex/values").VString<string, "required">;
1083
+ isChargeRefundable: import("convex/values").VBoolean<boolean, "required">;
1084
+ lastEvent: import("convex/values").VString<string | undefined, "optional">;
1085
+ evidenceDueBy: import("convex/values").VString<string | undefined, "optional">;
1086
+ evidence: import("convex/values").VAny<any, "optional", string>;
1087
+ statementDescriptor: import("convex/values").VString<string | undefined, "optional">;
1088
+ linkedTransferIds: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
1089
+ metadata: import("convex/values").VAny<any, "optional", string>;
1090
+ }, "required", "accountId" | "amount" | "currency" | "evidence" | "evidenceDueBy" | "isChargeRefundable" | "lastEvent" | "linkedTransferIds" | "metadata" | "reason" | "statementDescriptor" | "status" | "stripeChargeId" | "stripeDisputeId" | "stripePaymentIntentId" | `evidence.${string}` | `metadata.${string}`>, {
1091
+ by_account_id: ["accountId", "_creationTime"];
1092
+ by_account_id_and_status: ["accountId", "status", "_creationTime"];
1093
+ by_payment_intent_id_and_status: ["stripePaymentIntentId", "status", "_creationTime"];
1094
+ by_status: ["status", "_creationTime"];
1095
+ by_stripe_dispute_id: ["stripeDisputeId", "_creationTime"];
1096
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
1097
+ }, {}, {}>;
1098
+ transfers: import("convex/server").TableDefinition<import("convex/values").VObject<{
1099
+ amount: number;
1100
+ currency: string;
1101
+ destinationAccountId: string;
1102
+ metadata?: any;
1103
+ paymentId?: string | undefined;
1104
+ reinstatement?: boolean | undefined;
1105
+ reversalClaimedAmount?: number | undefined;
1106
+ reversalStatus?: "fully_reversed" | "partially_reversed" | undefined;
1107
+ reversedAmount?: number | undefined;
1108
+ role?: "affiliate" | "other" | "store" | undefined;
1109
+ sourceChargeId?: string | undefined;
1110
+ sourceInvoiceId?: string | undefined;
1111
+ status: "failed" | "paid" | "pending" | "reversed";
1112
+ stripeTransferId: string;
1113
+ totalsRecorded?: true | undefined;
1114
+ }, {
1115
+ stripeTransferId: import("convex/values").VString<string, "required">;
1116
+ sourceChargeId: import("convex/values").VString<string | undefined, "optional">;
1117
+ sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
1118
+ destinationAccountId: import("convex/values").VString<string, "required">;
1119
+ amount: import("convex/values").VFloat64<number, "required">;
1120
+ currency: import("convex/values").VString<string, "required">;
1121
+ 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>;
1122
+ 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>;
1123
+ reversedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1124
+ 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>;
1125
+ paymentId: import("convex/values").VString<string | undefined, "optional">;
1126
+ reinstatement: import("convex/values").VBoolean<boolean | undefined, "optional">;
1127
+ metadata: import("convex/values").VAny<any, "optional", string>;
1128
+ totalsRecorded: import("convex/values").VLiteral<true | undefined, "optional">;
1129
+ reversalClaimedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1130
+ }, "required", "amount" | "currency" | "destinationAccountId" | "metadata" | "paymentId" | "reinstatement" | "reversalClaimedAmount" | "reversalStatus" | "reversedAmount" | "role" | "sourceChargeId" | "sourceInvoiceId" | "status" | "stripeTransferId" | "totalsRecorded" | `metadata.${string}`>, {
1131
+ by_account_totals_recorded: ["destinationAccountId", "totalsRecorded", "_creationTime"];
1132
+ by_destination_account_id: ["destinationAccountId", "_creationTime"];
1133
+ by_source_charge_id: ["sourceChargeId", "_creationTime"];
1134
+ by_stripe_transfer_id: ["stripeTransferId", "_creationTime"];
1135
+ }, {}, {}>;
1136
+ transferReversalOps: import("convex/server").TableDefinition<import("convex/values").VObject<{
1137
+ operationId: string;
1138
+ slices: {
1139
+ from: number;
1140
+ stripeTransferId: string;
1141
+ to: number;
1142
+ }[];
1143
+ sourceChargeId: string;
1144
+ }, {
1145
+ operationId: import("convex/values").VString<string, "required">;
1146
+ sourceChargeId: import("convex/values").VString<string, "required">;
1147
+ slices: import("convex/values").VArray<{
1148
+ from: number;
1149
+ stripeTransferId: string;
1150
+ to: number;
1151
+ }[], import("convex/values").VObject<{
1152
+ from: number;
1153
+ stripeTransferId: string;
1154
+ to: number;
1155
+ }, {
1156
+ stripeTransferId: import("convex/values").VString<string, "required">;
1157
+ from: import("convex/values").VFloat64<number, "required">;
1158
+ to: import("convex/values").VFloat64<number, "required">;
1159
+ }, "required", "from" | "stripeTransferId" | "to">, "required">;
1160
+ }, "required", "operationId" | "slices" | "sourceChargeId">, {
1161
+ by_operation_id: ["operationId", "_creationTime"];
1162
+ }, {}, {}>;
1163
+ webhookEvents: import("convex/server").TableDefinition<import("convex/values").VObject<{
1164
+ eventType: string;
1165
+ lastError?: string | undefined;
1166
+ livemode?: boolean | undefined;
1167
+ processedAt: number;
1168
+ status: "failed" | "ignored" | "processed" | "processing";
1169
+ stripeEventId: string;
1170
+ }, {
1171
+ stripeEventId: import("convex/values").VString<string, "required">;
1172
+ eventType: import("convex/values").VString<string, "required">;
1173
+ livemode: import("convex/values").VBoolean<boolean | undefined, "optional">;
1174
+ processedAt: import("convex/values").VFloat64<number, "required">;
1175
+ 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>;
1176
+ lastError: import("convex/values").VString<string | undefined, "optional">;
1177
+ }, "required", "eventType" | "lastError" | "livemode" | "processedAt" | "status" | "stripeEventId">, {
1178
+ by_status: ["status", "_creationTime"];
1179
+ by_stripeEventId: ["stripeEventId", "_creationTime"];
1180
+ }, {}, {}>;
1181
+ }, boolean>>;
1182
+ ctx: RunCtx;
1183
+ mutate: (ref: Record<symbol, string>, args: never) => Promise<any>;
1184
+ retrieve: import("vitest").Mock<() => Promise<{
1185
+ id: string;
1186
+ object: 'payout';
1187
+ amount: number;
1188
+ application_fee: string | Stripe.ApplicationFee | null;
1189
+ application_fee_amount: number | null;
1190
+ arrival_date: number;
1191
+ automatic: boolean;
1192
+ balance_transaction: string | Stripe.BalanceTransaction | null;
1193
+ created: number;
1194
+ currency: string;
1195
+ description: string | null;
1196
+ destination: string | Stripe.ExternalAccount | Stripe.DeletedExternalAccount | null;
1197
+ failure_balance_transaction: string | Stripe.BalanceTransaction | null;
1198
+ failure_code: string | null;
1199
+ failure_message: string | null;
1200
+ livemode: boolean;
1201
+ metadata: Stripe.Metadata | null;
1202
+ method: string;
1203
+ original_payout: string | Stripe.Payout | null;
1204
+ payout_method: string | null;
1205
+ reconciliation_status: Stripe.Payout.ReconciliationStatus;
1206
+ reversed_by: string | Stripe.Payout | null;
1207
+ source_type: string;
1208
+ statement_descriptor: string | null;
1209
+ status: string;
1210
+ trace_id: Stripe.Payout.TraceId | null;
1211
+ type: Stripe.Payout.Type;
1212
+ }>>;
1213
+ provider: Stripe;
1214
+ scope: Scope;
1215
+ set: (patch: Partial<Stripe.Payout>) => void;
1216
+ read: () => {
1217
+ id: string;
1218
+ object: 'payout';
1219
+ amount: number;
1220
+ application_fee: string | Stripe.ApplicationFee | null;
1221
+ application_fee_amount: number | null;
1222
+ arrival_date: number;
1223
+ automatic: boolean;
1224
+ balance_transaction: string | Stripe.BalanceTransaction | null;
1225
+ created: number;
1226
+ currency: string;
1227
+ description: string | null;
1228
+ destination: string | Stripe.ExternalAccount | Stripe.DeletedExternalAccount | null;
1229
+ failure_balance_transaction: string | Stripe.BalanceTransaction | null;
1230
+ failure_code: string | null;
1231
+ failure_message: string | null;
1232
+ livemode: boolean;
1233
+ metadata: Stripe.Metadata | null;
1234
+ method: string;
1235
+ original_payout: string | Stripe.Payout | null;
1236
+ payout_method: string | null;
1237
+ reconciliation_status: Stripe.Payout.ReconciliationStatus;
1238
+ reversed_by: string | Stripe.Payout | null;
1239
+ source_type: string;
1240
+ statement_descriptor: string | null;
1241
+ status: string;
1242
+ trace_id: Stripe.Payout.TraceId | null;
1243
+ type: Stripe.Payout.Type;
1244
+ };
1245
+ run: () => Promise<unknown>;
1246
+ row: () => Promise<{
1247
+ _creationTime: number;
1248
+ _id: import("convex/values").GenericId<"payouts">;
1249
+ accountId: string;
1250
+ amount: number;
1251
+ arrivalDate?: string | undefined;
1252
+ currency: string;
1253
+ failureCode?: string | undefined;
1254
+ failureMessage?: string | undefined;
1255
+ metadata?: any;
1256
+ method?: string | undefined;
1257
+ status: "canceled" | "failed" | "in_transit" | "paid" | "pending";
1258
+ stripePayoutId: string;
1259
+ totalsRecorded?: true | undefined;
1260
+ } | null>;
1261
+ }>;
1262
+ export {};
1263
+ //# sourceMappingURL=payoutSyncTestHelpers.d.ts.map