@fantastic.dev/better-stripe 0.29.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/MIGRATION.md +8 -0
  3. package/README.md +3 -1
  4. package/dist/client/connect/payoutActivationProof.d.ts.map +1 -1
  5. package/dist/client/connect/payoutActivationProof.js +88 -42
  6. package/dist/client/connect/payoutActivationProof.js.map +1 -1
  7. package/dist/client/connect/payoutAdoption.d.ts +3 -0
  8. package/dist/client/connect/payoutAdoption.d.ts.map +1 -1
  9. package/dist/client/connect/payoutAdoption.js +218 -183
  10. package/dist/client/connect/payoutAdoption.js.map +1 -1
  11. package/dist/client/connect/payoutAdoptionCollection.d.ts +21 -0
  12. package/dist/client/connect/payoutAdoptionCollection.d.ts.map +1 -0
  13. package/dist/client/connect/payoutAdoptionCollection.js +44 -0
  14. package/dist/client/connect/payoutAdoptionCollection.js.map +1 -0
  15. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +26 -6
  16. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
  17. package/dist/client/connect/payoutExecutionTestHelpers.d.ts +13 -3
  18. package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
  19. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +3745 -0
  20. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -0
  21. package/dist/client/connect/payoutLargeAdoptionTestHelpers.js +55 -0
  22. package/dist/client/connect/payoutLargeAdoptionTestHelpers.js.map +1 -0
  23. package/dist/client/connect/payoutOutcomeBatches.d.ts +5 -0
  24. package/dist/client/connect/payoutOutcomeBatches.d.ts.map +1 -0
  25. package/dist/client/connect/payoutOutcomeBatches.js +21 -0
  26. package/dist/client/connect/payoutOutcomeBatches.js.map +1 -0
  27. package/dist/client/connect/payoutPolicyState.d.ts +14 -0
  28. package/dist/client/connect/payoutPolicyState.d.ts.map +1 -0
  29. package/dist/client/connect/payoutPolicyState.js +19 -0
  30. package/dist/client/connect/payoutPolicyState.js.map +1 -0
  31. package/dist/client/connect/payoutQualification.js +1 -1
  32. package/dist/client/connect/payoutQualification.js.map +1 -1
  33. package/dist/client/connect/payoutReconciliation.d.ts +11 -6
  34. package/dist/client/connect/payoutReconciliation.d.ts.map +1 -1
  35. package/dist/client/connect/payoutReconciliation.js +62 -16
  36. package/dist/client/connect/payoutReconciliation.js.map +1 -1
  37. package/dist/client/connect/payoutResumableProof.d.ts +17 -0
  38. package/dist/client/connect/payoutResumableProof.d.ts.map +1 -0
  39. package/dist/client/connect/payoutResumableProof.js +25 -0
  40. package/dist/client/connect/payoutResumableProof.js.map +1 -0
  41. package/dist/client/connect/payoutSyncTestHelpers.d.ts +13 -3
  42. package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
  43. package/dist/client/connect/transferReceipt.d.ts +6 -2
  44. package/dist/client/connect/transferReceipt.d.ts.map +1 -1
  45. package/dist/client/connect/transferReceipt.js +3 -3
  46. package/dist/client/connect/transferReceipt.js.map +1 -1
  47. package/dist/client/payoutPolicy.d.ts.map +1 -1
  48. package/dist/client/payoutPolicy.js +24 -14
  49. package/dist/client/payoutPolicy.js.map +1 -1
  50. package/dist/component/_generated/component.d.ts +72 -0
  51. package/dist/component/_generated/component.d.ts.map +1 -1
  52. package/dist/component/earnings/triggers.d.ts +12 -4
  53. package/dist/component/earnings/triggers.d.ts.map +1 -1
  54. package/dist/component/payoutPolicy/adoption.d.ts.map +1 -1
  55. package/dist/component/payoutPolicy/adoption.js +12 -7
  56. package/dist/component/payoutPolicy/adoption.js.map +1 -1
  57. package/dist/component/payoutPolicy/mutations.d.ts +12 -0
  58. package/dist/component/payoutPolicy/mutations.d.ts.map +1 -1
  59. package/dist/component/payoutPolicy/queries.d.ts +2 -0
  60. package/dist/component/payoutPolicy/queries.d.ts.map +1 -1
  61. package/dist/component/payoutPolicy/schema.d.ts +31 -7
  62. package/dist/component/payoutPolicy/schema.d.ts.map +1 -1
  63. package/dist/component/payoutPolicy/schema.js +2 -0
  64. package/dist/component/payoutPolicy/schema.js.map +1 -1
  65. package/dist/component/payoutRelease/adoption.d.ts +3 -1
  66. package/dist/component/payoutRelease/adoption.d.ts.map +1 -1
  67. package/dist/component/payoutRelease/adoption.js +33 -16
  68. package/dist/component/payoutRelease/adoption.js.map +1 -1
  69. package/dist/component/payoutRelease/fees.d.ts.map +1 -1
  70. package/dist/component/payoutRelease/fees.js +7 -0
  71. package/dist/component/payoutRelease/fees.js.map +1 -1
  72. package/dist/component/payoutRelease/mutations.d.ts +59 -0
  73. package/dist/component/payoutRelease/mutations.d.ts.map +1 -1
  74. package/dist/component/payoutRelease/mutations.js +25 -80
  75. package/dist/component/payoutRelease/mutations.js.map +1 -1
  76. package/dist/component/payoutRelease/outcome.d.ts +69 -0
  77. package/dist/component/payoutRelease/outcome.d.ts.map +1 -0
  78. package/dist/component/payoutRelease/outcome.js +94 -0
  79. package/dist/component/payoutRelease/outcome.js.map +1 -0
  80. package/dist/component/payoutRelease/planning.d.ts.map +1 -1
  81. package/dist/component/payoutRelease/planning.js +5 -2
  82. package/dist/component/payoutRelease/planning.js.map +1 -1
  83. package/dist/component/payoutRelease/queries.d.ts +2 -2
  84. package/dist/component/payoutRelease/queries.d.ts.map +1 -1
  85. package/dist/component/payoutRelease/queries.js +2 -0
  86. package/dist/component/payoutRelease/queries.js.map +1 -1
  87. package/dist/component/payoutSnapshots/adoption.d.ts +88 -0
  88. package/dist/component/payoutSnapshots/adoption.d.ts.map +1 -0
  89. package/dist/component/payoutSnapshots/adoption.js +49 -0
  90. package/dist/component/payoutSnapshots/adoption.js.map +1 -0
  91. package/dist/component/payoutSnapshots/financial.d.ts +31 -19
  92. package/dist/component/payoutSnapshots/financial.d.ts.map +1 -1
  93. package/dist/component/payoutSnapshots/financial.js +28 -14
  94. package/dist/component/payoutSnapshots/financial.js.map +1 -1
  95. package/dist/component/payoutSnapshots/localState.d.ts +20 -16
  96. package/dist/component/payoutSnapshots/localState.d.ts.map +1 -1
  97. package/dist/component/payoutSnapshots/localState.js +13 -4
  98. package/dist/component/payoutSnapshots/localState.js.map +1 -1
  99. package/dist/component/payoutSnapshots/mutations.d.ts.map +1 -1
  100. package/dist/component/payoutSnapshots/mutations.js +1 -1
  101. package/dist/component/payoutSnapshots/mutations.js.map +1 -1
  102. package/dist/component/payoutSnapshots/queries.d.ts.map +1 -1
  103. package/dist/component/payoutSnapshots/queries.js +6 -4
  104. package/dist/component/payoutSnapshots/queries.js.map +1 -1
  105. package/dist/component/payoutSnapshots/schema.d.ts +5 -1
  106. package/dist/component/payoutSnapshots/schema.d.ts.map +1 -1
  107. package/dist/component/payoutSnapshots/schema.js +2 -0
  108. package/dist/component/payoutSnapshots/schema.js.map +1 -1
  109. package/dist/component/schema.d.ts +13 -3
  110. package/docs/settlement.md +61 -8
  111. package/package.json +1 -1
  112. package/src/client/connect/payoutActivationProof.ts +123 -53
  113. package/src/client/connect/payoutAdoption.ts +299 -215
  114. package/src/client/connect/payoutAdoptionCollection.ts +78 -0
  115. package/src/client/connect/payoutAdoptionConcurrency.test.ts +266 -0
  116. package/src/client/connect/payoutCacheIdentity.test.ts +93 -0
  117. package/src/client/connect/payoutLargeAdoption.test.ts +541 -0
  118. package/src/client/connect/payoutLargeAdoptionTestHelpers.ts +74 -0
  119. package/src/client/connect/payoutOutcomeBatches.test.ts +40 -0
  120. package/src/client/connect/payoutOutcomeBatches.ts +24 -0
  121. package/src/client/connect/payoutPolicyState.ts +36 -0
  122. package/src/client/connect/payoutQualification.ts +10 -4
  123. package/src/client/connect/payoutReconciliation.ts +86 -7
  124. package/src/client/connect/payoutResumableProof.ts +41 -0
  125. package/src/client/connect/transferReceipt.ts +3 -2
  126. package/src/client/connect/transferReceiptBaseline.test.ts +55 -0
  127. package/src/client/payoutPolicy.ts +37 -23
  128. package/src/component/_generated/api.ts +4 -0
  129. package/src/component/_generated/component.ts +85 -0
  130. package/src/component/payout-snapshots.test.ts +45 -1
  131. package/src/component/payoutPolicy/adoption.ts +20 -7
  132. package/src/component/payoutPolicy/schema.ts +2 -0
  133. package/src/component/payoutRelease/adoption.ts +57 -27
  134. package/src/component/payoutRelease/fees.ts +9 -0
  135. package/src/component/payoutRelease/mutations.ts +26 -96
  136. package/src/component/payoutRelease/outcome.ts +119 -0
  137. package/src/component/payoutRelease/planning.ts +5 -2
  138. package/src/component/payoutRelease/queries.ts +2 -0
  139. package/src/component/payoutSnapshots/adoption.ts +73 -0
  140. package/src/component/payoutSnapshots/financial.ts +33 -20
  141. package/src/component/payoutSnapshots/localState.ts +17 -3
  142. package/src/component/payoutSnapshots/mutations.ts +8 -1
  143. package/src/component/payoutSnapshots/queries.ts +8 -6
  144. package/src/component/payoutSnapshots/schema.ts +2 -0
@@ -0,0 +1,3745 @@
1
+ export declare function large(count?: number, amount?: number): Promise<{
2
+ t: import("convex-test").TestConvex<import("convex/server").SchemaDefinition<{
3
+ payoutWorkerJobs: import("convex/server").TableDefinition<import("convex/values").VObject<{
4
+ accountId: string;
5
+ cadenceMs: number;
6
+ completedGeneration?: number | undefined;
7
+ completedOperationKey?: string | undefined;
8
+ currency: string;
9
+ generation: number;
10
+ hasOperation: boolean;
11
+ lastAttemptAt?: number | undefined;
12
+ lastReason?: string | undefined;
13
+ lastResultAt?: number | undefined;
14
+ leaseUntil?: number | undefined;
15
+ nextAttemptAt: number;
16
+ operationKey?: string | undefined;
17
+ ownerKey: string;
18
+ sequence: number;
19
+ }, {
20
+ accountId: import("convex/values").VString<string, "required">;
21
+ ownerKey: import("convex/values").VString<string, "required">;
22
+ currency: import("convex/values").VString<string, "required">;
23
+ generation: import("convex/values").VFloat64<number, "required">;
24
+ sequence: import("convex/values").VFloat64<number, "required">;
25
+ cadenceMs: import("convex/values").VFloat64<number, "required">;
26
+ nextAttemptAt: import("convex/values").VFloat64<number, "required">;
27
+ leaseUntil: import("convex/values").VFloat64<number | undefined, "optional">;
28
+ operationKey: import("convex/values").VString<string | undefined, "optional">;
29
+ hasOperation: import("convex/values").VBoolean<boolean, "required">;
30
+ lastReason: import("convex/values").VString<string | undefined, "optional">;
31
+ lastAttemptAt: import("convex/values").VFloat64<number | undefined, "optional">;
32
+ lastResultAt: import("convex/values").VFloat64<number | undefined, "optional">;
33
+ completedGeneration: import("convex/values").VFloat64<number | undefined, "optional">;
34
+ completedOperationKey: import("convex/values").VString<string | undefined, "optional">;
35
+ }, "required", "accountId" | "cadenceMs" | "completedGeneration" | "completedOperationKey" | "currency" | "generation" | "hasOperation" | "lastAttemptAt" | "lastReason" | "lastResultAt" | "leaseUntil" | "nextAttemptAt" | "operationKey" | "ownerKey" | "sequence">, {
36
+ by_account_currency: ["accountId", "currency", "_creationTime"];
37
+ by_operation_pending: ["hasOperation", "nextAttemptAt", "_creationTime"];
38
+ }, {}, {}>;
39
+ payoutFinancialRevisions: import("convex/server").TableDefinition<import("convex/values").VObject<{
40
+ accountId: string;
41
+ revision: number;
42
+ riskRevision: number;
43
+ }, {
44
+ accountId: import("convex/values").VString<string, "required">;
45
+ revision: import("convex/values").VFloat64<number, "required">;
46
+ riskRevision: import("convex/values").VFloat64<number, "required">;
47
+ }, "required", "accountId" | "revision" | "riskRevision">, {
48
+ by_account: ["accountId", "_creationTime"];
49
+ }, {}, {}>;
50
+ payoutRiskEvents: import("convex/server").TableDefinition<import("convex/values").VObject<{
51
+ accountId: string;
52
+ key: string;
53
+ kind: "allocation" | "claim" | "fee" | "liability" | "provider_payout" | "transfer";
54
+ removed?: boolean | undefined;
55
+ riskRevision: number;
56
+ }, {
57
+ accountId: import("convex/values").VString<string, "required">;
58
+ riskRevision: import("convex/values").VFloat64<number, "required">;
59
+ kind: import("convex/values").VUnion<"allocation" | "claim" | "fee" | "liability" | "provider_payout" | "transfer", [import("convex/values").VLiteral<"transfer", "required">, import("convex/values").VLiteral<"provider_payout", "required">, import("convex/values").VLiteral<"allocation", "required">, import("convex/values").VLiteral<"claim", "required">, import("convex/values").VLiteral<"fee", "required">, import("convex/values").VLiteral<"liability", "required">], "required", never>;
60
+ key: import("convex/values").VString<string, "required">;
61
+ removed: import("convex/values").VBoolean<boolean | undefined, "optional">;
62
+ }, "required", "accountId" | "key" | "kind" | "removed" | "riskRevision">, {
63
+ by_account_revision: ["accountId", "riskRevision", "_creationTime"];
64
+ }, {}, {}>;
65
+ payoutRiskRevisions: import("convex/server").TableDefinition<import("convex/values").VObject<{
66
+ accountId: string;
67
+ riskRevision: number;
68
+ }, {
69
+ accountId: import("convex/values").VString<string, "required">;
70
+ riskRevision: import("convex/values").VFloat64<number, "required">;
71
+ }, "required", "accountId" | "riskRevision">, {
72
+ by_account: ["accountId", "_creationTime"];
73
+ }, {}, {}>;
74
+ payoutSnapshots: import("convex/server").TableDefinition<import("convex/values").VObject<{
75
+ accountId: string;
76
+ allocationCount: number;
77
+ allocationCursor?: string | undefined;
78
+ boundOperationKey?: string | undefined;
79
+ boundRiskRevision?: number | undefined;
80
+ claimCount: number;
81
+ claimCursor?: string | undefined;
82
+ deferredPositiveChanges: boolean;
83
+ expectedRevision: number;
84
+ expiresAt: number;
85
+ feeCount: number;
86
+ feeCursor?: string | undefined;
87
+ initialRevision: number;
88
+ initialRiskRevision: number;
89
+ observedRevision: number;
90
+ operationKey: string;
91
+ ownerKey: string;
92
+ phase: "allocations" | "check" | "claims" | "discarding" | "fees" | "invalidated" | "local_ready" | "repair" | "sources";
93
+ policyMode?: string | undefined;
94
+ policyOperationKey?: string | undefined;
95
+ providerChanged: boolean;
96
+ readOnly: boolean;
97
+ reason?: string | undefined;
98
+ riskRevision: number;
99
+ sourceCount: number;
100
+ sourceCursor?: string | undefined;
101
+ sourceFence: number;
102
+ step: number;
103
+ }, {
104
+ readOnly: import("convex/values").VBoolean<boolean, "required">;
105
+ boundOperationKey: import("convex/values").VString<string | undefined, "optional">;
106
+ boundRiskRevision: import("convex/values").VFloat64<number | undefined, "optional">;
107
+ accountId: import("convex/values").VString<string, "required">;
108
+ ownerKey: import("convex/values").VString<string, "required">;
109
+ operationKey: import("convex/values").VString<string, "required">;
110
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
111
+ policyMode: import("convex/values").VString<string | undefined, "optional">;
112
+ policyOperationKey: import("convex/values").VString<string | undefined, "optional">;
113
+ phase: import("convex/values").VUnion<"allocations" | "check" | "claims" | "discarding" | "fees" | "invalidated" | "local_ready" | "repair" | "sources", [import("convex/values").VLiteral<"sources", "required">, import("convex/values").VLiteral<"allocations", "required">, import("convex/values").VLiteral<"fees", "required">, import("convex/values").VLiteral<"claims", "required">, import("convex/values").VLiteral<"repair", "required">, import("convex/values").VLiteral<"check", "required">, import("convex/values").VLiteral<"local_ready", "required">, import("convex/values").VLiteral<"invalidated", "required">, import("convex/values").VLiteral<"discarding", "required">], "required", never>;
114
+ step: import("convex/values").VFloat64<number, "required">;
115
+ sourceFence: import("convex/values").VFloat64<number, "required">;
116
+ sourceCursor: import("convex/values").VString<string | undefined, "optional">;
117
+ allocationCursor: import("convex/values").VString<string | undefined, "optional">;
118
+ feeCursor: import("convex/values").VString<string | undefined, "optional">;
119
+ claimCursor: import("convex/values").VString<string | undefined, "optional">;
120
+ initialRevision: import("convex/values").VFloat64<number, "required">;
121
+ initialRiskRevision: import("convex/values").VFloat64<number, "required">;
122
+ riskRevision: import("convex/values").VFloat64<number, "required">;
123
+ observedRevision: import("convex/values").VFloat64<number, "required">;
124
+ sourceCount: import("convex/values").VFloat64<number, "required">;
125
+ allocationCount: import("convex/values").VFloat64<number, "required">;
126
+ claimCount: import("convex/values").VFloat64<number, "required">;
127
+ feeCount: import("convex/values").VFloat64<number, "required">;
128
+ deferredPositiveChanges: import("convex/values").VBoolean<boolean, "required">;
129
+ providerChanged: import("convex/values").VBoolean<boolean, "required">;
130
+ expiresAt: import("convex/values").VFloat64<number, "required">;
131
+ reason: import("convex/values").VString<string | undefined, "optional">;
132
+ }, "required", "accountId" | "allocationCount" | "allocationCursor" | "boundOperationKey" | "boundRiskRevision" | "claimCount" | "claimCursor" | "deferredPositiveChanges" | "expectedRevision" | "expiresAt" | "feeCount" | "feeCursor" | "initialRevision" | "initialRiskRevision" | "observedRevision" | "operationKey" | "ownerKey" | "phase" | "policyMode" | "policyOperationKey" | "providerChanged" | "readOnly" | "reason" | "riskRevision" | "sourceCount" | "sourceCursor" | "sourceFence" | "step">, {
133
+ by_account_phase: ["accountId", "phase", "_creationTime"];
134
+ by_operation: ["operationKey", "_creationTime"];
135
+ by_read_only: ["readOnly", "_creationTime"];
136
+ }, {}, {}>;
137
+ payoutSnapshotSources: import("convex/server").TableDefinition<import("convex/values").VObject<{
138
+ allocationCurrency?: string | undefined;
139
+ allocationDocId?: import("convex/values").GenericId<"payoutSourceAllocations"> | undefined;
140
+ allocationPresent: boolean;
141
+ amount: number;
142
+ currency: string;
143
+ expectedPaid: number;
144
+ expectedReserved: number;
145
+ ledgerFingerprint: string;
146
+ needsCheck: boolean;
147
+ paidAmount: number;
148
+ reinstatement: boolean;
149
+ reservedAmount: number;
150
+ reversalClaimedAmount: number;
151
+ reversedAmount: number;
152
+ role?: string | undefined;
153
+ snapshotId: import("convex/values").GenericId<"payoutSnapshots">;
154
+ sourceChargeId?: string | undefined;
155
+ sourceCreatedAt: number;
156
+ status: string;
157
+ stripeTransferId: string;
158
+ transferDocId?: import("convex/values").GenericId<"transfers"> | undefined;
159
+ }, {
160
+ snapshotId: import("convex/values").VId<import("convex/values").GenericId<"payoutSnapshots">, "required">;
161
+ stripeTransferId: import("convex/values").VString<string, "required">;
162
+ ledgerFingerprint: import("convex/values").VString<string, "required">;
163
+ transferDocId: import("convex/values").VId<import("convex/values").GenericId<"transfers"> | undefined, "optional">;
164
+ allocationDocId: import("convex/values").VId<import("convex/values").GenericId<"payoutSourceAllocations"> | undefined, "optional">;
165
+ sourceCreatedAt: import("convex/values").VFloat64<number, "required">;
166
+ currency: import("convex/values").VString<string, "required">;
167
+ amount: import("convex/values").VFloat64<number, "required">;
168
+ status: import("convex/values").VString<string, "required">;
169
+ role: import("convex/values").VString<string | undefined, "optional">;
170
+ sourceChargeId: import("convex/values").VString<string | undefined, "optional">;
171
+ reversedAmount: import("convex/values").VFloat64<number, "required">;
172
+ reversalClaimedAmount: import("convex/values").VFloat64<number, "required">;
173
+ reinstatement: import("convex/values").VBoolean<boolean, "required">;
174
+ allocationPresent: import("convex/values").VBoolean<boolean, "required">;
175
+ allocationCurrency: import("convex/values").VString<string | undefined, "optional">;
176
+ paidAmount: import("convex/values").VFloat64<number, "required">;
177
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
178
+ expectedPaid: import("convex/values").VFloat64<number, "required">;
179
+ expectedReserved: import("convex/values").VFloat64<number, "required">;
180
+ needsCheck: import("convex/values").VBoolean<boolean, "required">;
181
+ }, "required", "allocationCurrency" | "allocationDocId" | "allocationPresent" | "amount" | "currency" | "expectedPaid" | "expectedReserved" | "ledgerFingerprint" | "needsCheck" | "paidAmount" | "reinstatement" | "reservedAmount" | "reversalClaimedAmount" | "reversedAmount" | "role" | "snapshotId" | "sourceChargeId" | "sourceCreatedAt" | "status" | "stripeTransferId" | "transferDocId">, {
182
+ by_snapshot: ["snapshotId", "_creationTime"];
183
+ by_snapshot_check: ["snapshotId", "needsCheck", "_creationTime"];
184
+ by_snapshot_transfer: ["snapshotId", "stripeTransferId", "_creationTime"];
185
+ }, {}, {}>;
186
+ payoutSnapshotClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
187
+ allocations: {
188
+ amount: number;
189
+ role?: string | undefined;
190
+ stripeTransferId: string;
191
+ }[];
192
+ amount: number;
193
+ currency: string;
194
+ fingerprint: string;
195
+ historical?: boolean | undefined;
196
+ operationKey: string;
197
+ providerFee?: number | undefined;
198
+ snapshotId: import("convex/values").GenericId<"payoutSnapshots">;
199
+ status: string;
200
+ stripePayoutId?: string | undefined;
201
+ }, {
202
+ snapshotId: import("convex/values").VId<import("convex/values").GenericId<"payoutSnapshots">, "required">;
203
+ operationKey: import("convex/values").VString<string, "required">;
204
+ fingerprint: import("convex/values").VString<string, "required">;
205
+ currency: import("convex/values").VString<string, "required">;
206
+ amount: import("convex/values").VFloat64<number, "required">;
207
+ status: import("convex/values").VString<string, "required">;
208
+ stripePayoutId: import("convex/values").VString<string | undefined, "optional">;
209
+ historical: import("convex/values").VBoolean<boolean | undefined, "optional">;
210
+ providerFee: import("convex/values").VFloat64<number | undefined, "optional">;
211
+ allocations: import("convex/values").VArray<{
212
+ amount: number;
213
+ role?: string | undefined;
214
+ stripeTransferId: string;
215
+ }[], import("convex/values").VObject<{
216
+ amount: number;
217
+ role?: string | undefined;
218
+ stripeTransferId: string;
219
+ }, {
220
+ stripeTransferId: import("convex/values").VString<string, "required">;
221
+ amount: import("convex/values").VFloat64<number, "required">;
222
+ role: import("convex/values").VString<string | undefined, "optional">;
223
+ }, "required", "amount" | "role" | "stripeTransferId">, "required">;
224
+ }, "required", "allocations" | "amount" | "currency" | "fingerprint" | "historical" | "operationKey" | "providerFee" | "snapshotId" | "status" | "stripePayoutId">, {
225
+ by_snapshot: ["snapshotId", "_creationTime"];
226
+ by_snapshot_operation: ["snapshotId", "operationKey", "_creationTime"];
227
+ }, {}, {}>;
228
+ payoutSnapshotFees: import("convex/server").TableDefinition<import("convex/values").VObject<{
229
+ amount: number;
230
+ currency: string;
231
+ revision: number;
232
+ snapshotId: import("convex/values").GenericId<"payoutSnapshots">;
233
+ }, {
234
+ snapshotId: import("convex/values").VId<import("convex/values").GenericId<"payoutSnapshots">, "required">;
235
+ currency: import("convex/values").VString<string, "required">;
236
+ amount: import("convex/values").VFloat64<number, "required">;
237
+ revision: import("convex/values").VFloat64<number, "required">;
238
+ }, "required", "amount" | "currency" | "revision" | "snapshotId">, {
239
+ by_snapshot: ["snapshotId", "_creationTime"];
240
+ by_snapshot_currency: ["snapshotId", "currency", "_creationTime"];
241
+ }, {}, {}>;
242
+ affiliateObligations: import("convex/server").TableDefinition<import("convex/values").VObject<{
243
+ accounted?: boolean | undefined;
244
+ activeOperationId?: import("convex/values").GenericId<"affiliateRecoveryOperations"> | undefined;
245
+ affiliateAccountId: string;
246
+ chargeAmount: number;
247
+ creditAmount?: number | undefined;
248
+ currency: string;
249
+ debtAmount?: number | undefined;
250
+ debtStatus?: "open" | "settled" | undefined;
251
+ disputeId?: string | undefined;
252
+ disputeState?: "lost" | "open" | "won" | undefined;
253
+ disputedPrincipal: number;
254
+ earningId?: import("convex/values").GenericId<"affiliateEarnings"> | undefined;
255
+ finalizedAmount: number;
256
+ lastError?: string | undefined;
257
+ lastRefundId?: string | undefined;
258
+ lastState?: string | undefined;
259
+ legacyReceiptIds?: string[] | undefined;
260
+ legacyRestorationIds?: string[] | undefined;
261
+ lostPrincipal: number;
262
+ needsReconciliation: boolean;
263
+ offsetAmount?: number | undefined;
264
+ operationSequence?: number | undefined;
265
+ operatorNote?: string | undefined;
266
+ originalCommission: number;
267
+ paymentId?: string | undefined;
268
+ paymentIntentId?: string | undefined;
269
+ provisionalAmount: number;
270
+ recoveredAmount: number;
271
+ refundedPrincipal: number;
272
+ releasedCommission?: number | undefined;
273
+ reservedRecovery?: number | undefined;
274
+ reservedRestoration?: number | undefined;
275
+ restoredAmount?: number | undefined;
276
+ sourceChargeId: string;
277
+ sourceInvoiceId?: string | undefined;
278
+ storeAccountId?: string | undefined;
279
+ stripeTransferId?: string | undefined;
280
+ }, {
281
+ stripeTransferId: import("convex/values").VString<string | undefined, "optional">;
282
+ sourceChargeId: import("convex/values").VString<string, "required">;
283
+ sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
284
+ paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
285
+ paymentId: import("convex/values").VString<string | undefined, "optional">;
286
+ storeAccountId: import("convex/values").VString<string | undefined, "optional">;
287
+ lastRefundId: import("convex/values").VString<string | undefined, "optional">;
288
+ affiliateAccountId: import("convex/values").VString<string, "required">;
289
+ currency: import("convex/values").VString<string, "required">;
290
+ chargeAmount: import("convex/values").VFloat64<number, "required">;
291
+ originalCommission: import("convex/values").VFloat64<number, "required">;
292
+ refundedPrincipal: import("convex/values").VFloat64<number, "required">;
293
+ disputedPrincipal: import("convex/values").VFloat64<number, "required">;
294
+ lostPrincipal: import("convex/values").VFloat64<number, "required">;
295
+ finalizedAmount: import("convex/values").VFloat64<number, "required">;
296
+ provisionalAmount: import("convex/values").VFloat64<number, "required">;
297
+ recoveredAmount: import("convex/values").VFloat64<number, "required">;
298
+ needsReconciliation: import("convex/values").VBoolean<boolean, "required">;
299
+ accounted: import("convex/values").VBoolean<boolean | undefined, "optional">;
300
+ legacyReceiptIds: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
301
+ legacyRestorationIds: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
302
+ operatorNote: import("convex/values").VString<string | undefined, "optional">;
303
+ earningId: import("convex/values").VId<import("convex/values").GenericId<"affiliateEarnings"> | undefined, "optional">;
304
+ releasedCommission: import("convex/values").VFloat64<number | undefined, "optional">;
305
+ offsetAmount: import("convex/values").VFloat64<number | undefined, "optional">;
306
+ restoredAmount: import("convex/values").VFloat64<number | undefined, "optional">;
307
+ reservedRecovery: import("convex/values").VFloat64<number | undefined, "optional">;
308
+ reservedRestoration: import("convex/values").VFloat64<number | undefined, "optional">;
309
+ debtAmount: import("convex/values").VFloat64<number | undefined, "optional">;
310
+ creditAmount: import("convex/values").VFloat64<number | undefined, "optional">;
311
+ debtStatus: import("convex/values").VUnion<"open" | "settled" | undefined, [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"settled", "required">], "optional", never>;
312
+ disputeState: import("convex/values").VUnion<"lost" | "open" | "won" | undefined, [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"lost", "required">, import("convex/values").VLiteral<"won", "required">], "optional", never>;
313
+ disputeId: import("convex/values").VString<string | undefined, "optional">;
314
+ activeOperationId: import("convex/values").VId<import("convex/values").GenericId<"affiliateRecoveryOperations"> | undefined, "optional">;
315
+ lastState: import("convex/values").VString<string | undefined, "optional">;
316
+ lastError: import("convex/values").VString<string | undefined, "optional">;
317
+ operationSequence: import("convex/values").VFloat64<number | undefined, "optional">;
318
+ }, "required", "accounted" | "activeOperationId" | "affiliateAccountId" | "chargeAmount" | "creditAmount" | "currency" | "debtAmount" | "debtStatus" | "disputeId" | "disputeState" | "disputedPrincipal" | "earningId" | "finalizedAmount" | "lastError" | "lastRefundId" | "lastState" | "legacyReceiptIds" | "legacyRestorationIds" | "lostPrincipal" | "needsReconciliation" | "offsetAmount" | "operationSequence" | "operatorNote" | "originalCommission" | "paymentId" | "paymentIntentId" | "provisionalAmount" | "recoveredAmount" | "refundedPrincipal" | "releasedCommission" | "reservedRecovery" | "reservedRestoration" | "restoredAmount" | "sourceChargeId" | "sourceInvoiceId" | "storeAccountId" | "stripeTransferId">, {
319
+ by_affiliate_currency: ["affiliateAccountId", "currency", "_creationTime"];
320
+ by_affiliate_currency_debt: ["affiliateAccountId", "currency", "debtStatus", "_creationTime"];
321
+ by_charge: ["sourceChargeId", "_creationTime"];
322
+ by_transfer: ["stripeTransferId", "_creationTime"];
323
+ }, {}, {}>;
324
+ affiliateRecoveryOperations: import("convex/server").TableDefinition<import("convex/values").VObject<{
325
+ amount: number;
326
+ attempted: boolean;
327
+ createdAt: number;
328
+ error?: string | undefined;
329
+ kind: "recovery" | "restoration";
330
+ obligationId: import("convex/values").GenericId<"affiliateObligations">;
331
+ providerBaseline?: number | undefined;
332
+ receiptId?: string | undefined;
333
+ sourceEventId?: string | undefined;
334
+ state: "canceled" | "failed" | "insufficient_balance" | "pending" | "succeeded" | "unknown" | "unsupported";
335
+ }, {
336
+ obligationId: import("convex/values").VId<import("convex/values").GenericId<"affiliateObligations">, "required">;
337
+ sourceEventId: import("convex/values").VString<string | undefined, "optional">;
338
+ kind: import("convex/values").VUnion<"recovery" | "restoration", [import("convex/values").VLiteral<"recovery", "required">, import("convex/values").VLiteral<"restoration", "required">], "required", never>;
339
+ amount: import("convex/values").VFloat64<number, "required">;
340
+ state: import("convex/values").VUnion<"canceled" | "failed" | "insufficient_balance" | "pending" | "succeeded" | "unknown" | "unsupported", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"insufficient_balance", "required">, import("convex/values").VLiteral<"unsupported", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"succeeded", "required">, import("convex/values").VLiteral<"canceled", "required">], "required", never>;
341
+ receiptId: import("convex/values").VString<string | undefined, "optional">;
342
+ error: import("convex/values").VString<string | undefined, "optional">;
343
+ attempted: import("convex/values").VBoolean<boolean, "required">;
344
+ providerBaseline: import("convex/values").VFloat64<number | undefined, "optional">;
345
+ createdAt: import("convex/values").VFloat64<number, "required">;
346
+ }, "required", "amount" | "attempted" | "createdAt" | "error" | "kind" | "obligationId" | "providerBaseline" | "receiptId" | "sourceEventId" | "state">, {
347
+ by_obligation: ["obligationId", "_creationTime"];
348
+ by_state: ["state", "_creationTime"];
349
+ }, {}, {}>;
350
+ affiliatePayoutReleases: import("convex/server").TableDefinition<import("convex/values").VObject<{
351
+ affiliateAccountId: string;
352
+ amount: number;
353
+ createdAt: number;
354
+ currency: string;
355
+ minimumAmount: number;
356
+ operationKey: string;
357
+ state: "failed" | "pending" | "submitted" | "unknown";
358
+ stripePayoutId?: string | undefined;
359
+ }, {
360
+ affiliateAccountId: import("convex/values").VString<string, "required">;
361
+ currency: import("convex/values").VString<string, "required">;
362
+ operationKey: import("convex/values").VString<string, "required">;
363
+ amount: import("convex/values").VFloat64<number, "required">;
364
+ minimumAmount: import("convex/values").VFloat64<number, "required">;
365
+ state: import("convex/values").VUnion<"failed" | "pending" | "submitted" | "unknown", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"submitted", "required">, import("convex/values").VLiteral<"failed", "required">], "required", never>;
366
+ stripePayoutId: import("convex/values").VString<string | undefined, "optional">;
367
+ createdAt: import("convex/values").VFloat64<number, "required">;
368
+ }, "required", "affiliateAccountId" | "amount" | "createdAt" | "currency" | "minimumAmount" | "operationKey" | "state" | "stripePayoutId">, {
369
+ by_key: ["operationKey", "_creationTime"];
370
+ by_state: ["state", "_creationTime"];
371
+ }, {}, {}>;
372
+ affiliateEarnings: import("convex/server").TableDefinition<import("convex/values").VObject<{
373
+ affiliateAccountId: string;
374
+ currency: string;
375
+ originalCommission: number;
376
+ paymentIntentId?: string | undefined;
377
+ releaseAmount: number;
378
+ sourceChargeId: string;
379
+ sourceInvoiceId?: string | undefined;
380
+ status: "paid" | "reserved";
381
+ stripeTransferId?: string | undefined;
382
+ withheldAmount: number;
383
+ }, {
384
+ sourceChargeId: import("convex/values").VString<string, "required">;
385
+ affiliateAccountId: import("convex/values").VString<string, "required">;
386
+ currency: import("convex/values").VString<string, "required">;
387
+ originalCommission: import("convex/values").VFloat64<number, "required">;
388
+ withheldAmount: import("convex/values").VFloat64<number, "required">;
389
+ releaseAmount: import("convex/values").VFloat64<number, "required">;
390
+ sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
391
+ paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
392
+ stripeTransferId: import("convex/values").VString<string | undefined, "optional">;
393
+ status: import("convex/values").VUnion<"paid" | "reserved", [import("convex/values").VLiteral<"reserved", "required">, import("convex/values").VLiteral<"paid", "required">], "required", never>;
394
+ }, "required", "affiliateAccountId" | "currency" | "originalCommission" | "paymentIntentId" | "releaseAmount" | "sourceChargeId" | "sourceInvoiceId" | "status" | "stripeTransferId" | "withheldAmount">, {
395
+ by_affiliate_currency: ["affiliateAccountId", "currency", "_creationTime"];
396
+ by_charge_affiliate: ["sourceChargeId", "affiliateAccountId", "_creationTime"];
397
+ }, {}, {}>;
398
+ affiliateOffsets: import("convex/server").TableDefinition<import("convex/values").VObject<{
399
+ amount: number;
400
+ earningId: import("convex/values").GenericId<"affiliateEarnings">;
401
+ obligationId: import("convex/values").GenericId<"affiliateObligations">;
402
+ }, {
403
+ earningId: import("convex/values").VId<import("convex/values").GenericId<"affiliateEarnings">, "required">;
404
+ obligationId: import("convex/values").VId<import("convex/values").GenericId<"affiliateObligations">, "required">;
405
+ amount: import("convex/values").VFloat64<number, "required">;
406
+ }, "required", "amount" | "earningId" | "obligationId">, {
407
+ by_earning: ["earningId", "_creationTime"];
408
+ by_obligation: ["obligationId", "_creationTime"];
409
+ }, {}, {}>;
410
+ affiliateRecoveryBalances: import("convex/server").TableDefinition<import("convex/values").VObject<{
411
+ activePayoutKey?: string | undefined;
412
+ affiliateAccountId: string;
413
+ currency: string;
414
+ netPayable: number;
415
+ offsetAmount: number;
416
+ originalCommission: number;
417
+ outstandingDebt: number;
418
+ pendingPayoutAmount?: number | undefined;
419
+ recoveredAmount: number;
420
+ reservedRecovery: number;
421
+ reservedRestoration: number;
422
+ restorationDue: number;
423
+ restoredAmount: number;
424
+ withheldAmount: number;
425
+ }, {
426
+ activePayoutKey: import("convex/values").VString<string | undefined, "optional">;
427
+ pendingPayoutAmount: import("convex/values").VFloat64<number | undefined, "optional">;
428
+ affiliateAccountId: import("convex/values").VString<string, "required">;
429
+ currency: import("convex/values").VString<string, "required">;
430
+ originalCommission: import("convex/values").VFloat64<number, "required">;
431
+ recoveredAmount: import("convex/values").VFloat64<number, "required">;
432
+ offsetAmount: import("convex/values").VFloat64<number, "required">;
433
+ restoredAmount: import("convex/values").VFloat64<number, "required">;
434
+ outstandingDebt: import("convex/values").VFloat64<number, "required">;
435
+ reservedRecovery: import("convex/values").VFloat64<number, "required">;
436
+ reservedRestoration: import("convex/values").VFloat64<number, "required">;
437
+ restorationDue: import("convex/values").VFloat64<number, "required">;
438
+ withheldAmount: import("convex/values").VFloat64<number, "required">;
439
+ netPayable: import("convex/values").VFloat64<number, "required">;
440
+ }, "required", "activePayoutKey" | "affiliateAccountId" | "currency" | "netPayable" | "offsetAmount" | "originalCommission" | "outstandingDebt" | "pendingPayoutAmount" | "recoveredAmount" | "reservedRecovery" | "reservedRestoration" | "restorationDue" | "restoredAmount" | "withheldAmount">, {
441
+ by_affiliate_currency: ["affiliateAccountId", "currency", "_creationTime"];
442
+ }, {}, {}>;
443
+ affiliateReversalReceipts: import("convex/server").TableDefinition<import("convex/values").VObject<{
444
+ amount: number;
445
+ operationId: string;
446
+ stripeReversalId: string;
447
+ stripeTransferId: string;
448
+ }, {
449
+ stripeReversalId: import("convex/values").VString<string, "required">;
450
+ stripeTransferId: import("convex/values").VString<string, "required">;
451
+ operationId: import("convex/values").VString<string, "required">;
452
+ amount: import("convex/values").VFloat64<number, "required">;
453
+ }, "required", "amount" | "operationId" | "stripeReversalId" | "stripeTransferId">, {
454
+ by_receipt: ["stripeReversalId", "_creationTime"];
455
+ by_transfer: ["stripeTransferId", "_creationTime"];
456
+ by_transfer_operation: ["stripeTransferId", "operationId", "_creationTime"];
457
+ }, {}, {}>;
458
+ payoutSyncClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
459
+ acceptedAt?: number | undefined;
460
+ acceptedFingerprint?: string | undefined;
461
+ acceptedGeneration?: number | undefined;
462
+ accountId: string;
463
+ generation: number;
464
+ startedAt: number;
465
+ status: "accepted" | "pending" | "unknown";
466
+ stripePayoutId: string;
467
+ }, {
468
+ stripePayoutId: import("convex/values").VString<string, "required">;
469
+ accountId: import("convex/values").VString<string, "required">;
470
+ generation: import("convex/values").VFloat64<number, "required">;
471
+ 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>;
472
+ startedAt: import("convex/values").VFloat64<number, "required">;
473
+ acceptedGeneration: import("convex/values").VFloat64<number | undefined, "optional">;
474
+ acceptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
475
+ acceptedFingerprint: import("convex/values").VString<string | undefined, "optional">;
476
+ }, "required", "acceptedAt" | "acceptedFingerprint" | "acceptedGeneration" | "accountId" | "generation" | "startedAt" | "status" | "stripePayoutId">, {
477
+ by_stripe_payout_id: ["stripePayoutId", "_creationTime"];
478
+ }, {}, {}>;
479
+ payoutFeeBalances: import("convex/server").TableDefinition<import("convex/values").VObject<{
480
+ accountId: string;
481
+ amount: number;
482
+ currency: string;
483
+ ownerKey: string;
484
+ revision: number;
485
+ }, {
486
+ accountId: import("convex/values").VString<string, "required">;
487
+ ownerKey: import("convex/values").VString<string, "required">;
488
+ currency: import("convex/values").VString<string, "required">;
489
+ amount: import("convex/values").VFloat64<number, "required">;
490
+ revision: import("convex/values").VFloat64<number, "required">;
491
+ }, "required", "accountId" | "amount" | "currency" | "ownerKey" | "revision">, {
492
+ by_account_currency: ["accountId", "currency", "_creationTime"];
493
+ }, {}, {}>;
494
+ payoutReleaseClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
495
+ accountId: string;
496
+ allocations: {
497
+ amount: number;
498
+ role?: "affiliate" | "other" | "store" | undefined;
499
+ stripeTransferId: string;
500
+ }[];
501
+ amount: number;
502
+ attemptedAt?: number | undefined;
503
+ currency: string;
504
+ debitFee?: number | undefined;
505
+ debitTransactionId?: string | undefined;
506
+ destinationId?: string | undefined;
507
+ expectedRevision: number;
508
+ feeRevision?: number | undefined;
509
+ historical?: boolean | undefined;
510
+ independentLiabilities?: number | undefined;
511
+ liabilityRevision?: number | undefined;
512
+ observations: {
513
+ currency: string;
514
+ ledgerFingerprint: string;
515
+ matureNet: number;
516
+ observedAt: number;
517
+ pendingCredits: number;
518
+ stripeTransferId: string;
519
+ transactionIds: string[];
520
+ }[];
521
+ operationKey: string;
522
+ ownerKey: string;
523
+ providerFee?: number | undefined;
524
+ rejection?: {
525
+ code: "amount_too_small" | "balance_insufficient";
526
+ requestId: string;
527
+ } | undefined;
528
+ returnTransactionId?: string | undefined;
529
+ snapshotId?: import("convex/values").GenericId<"payoutSnapshots"> | undefined;
530
+ status: "canceled" | "paid" | "rejected" | "reserved" | "returned" | "submitted";
531
+ stripePayoutId?: string | undefined;
532
+ }, {
533
+ accountId: import("convex/values").VString<string, "required">;
534
+ ownerKey: import("convex/values").VString<string, "required">;
535
+ historical: import("convex/values").VBoolean<boolean | undefined, "optional">;
536
+ snapshotId: import("convex/values").VId<import("convex/values").GenericId<"payoutSnapshots"> | undefined, "optional">;
537
+ liabilityRevision: import("convex/values").VFloat64<number | undefined, "optional">;
538
+ independentLiabilities: import("convex/values").VFloat64<number | undefined, "optional">;
539
+ operationKey: import("convex/values").VString<string, "required">;
540
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
541
+ currency: import("convex/values").VString<string, "required">;
542
+ amount: import("convex/values").VFloat64<number, "required">;
543
+ destinationId: import("convex/values").VString<string | undefined, "optional">;
544
+ allocations: import("convex/values").VArray<{
545
+ amount: number;
546
+ role?: "affiliate" | "other" | "store" | undefined;
547
+ stripeTransferId: string;
548
+ }[], import("convex/values").VObject<{
549
+ amount: number;
550
+ role?: "affiliate" | "other" | "store" | undefined;
551
+ stripeTransferId: string;
552
+ }, {
553
+ stripeTransferId: import("convex/values").VString<string, "required">;
554
+ amount: import("convex/values").VFloat64<number, "required">;
555
+ 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>;
556
+ }, "required", "amount" | "role" | "stripeTransferId">, "required">;
557
+ observations: import("convex/values").VArray<{
558
+ currency: string;
559
+ ledgerFingerprint: string;
560
+ matureNet: number;
561
+ observedAt: number;
562
+ pendingCredits: number;
563
+ stripeTransferId: string;
564
+ transactionIds: string[];
565
+ }[], import("convex/values").VObject<{
566
+ currency: string;
567
+ ledgerFingerprint: string;
568
+ matureNet: number;
569
+ observedAt: number;
570
+ pendingCredits: number;
571
+ stripeTransferId: string;
572
+ transactionIds: string[];
573
+ }, {
574
+ stripeTransferId: import("convex/values").VString<string, "required">;
575
+ currency: import("convex/values").VString<string, "required">;
576
+ matureNet: import("convex/values").VFloat64<number, "required">;
577
+ pendingCredits: import("convex/values").VFloat64<number, "required">;
578
+ ledgerFingerprint: import("convex/values").VString<string, "required">;
579
+ observedAt: import("convex/values").VFloat64<number, "required">;
580
+ transactionIds: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
581
+ }, "required", "currency" | "ledgerFingerprint" | "matureNet" | "observedAt" | "pendingCredits" | "stripeTransferId" | "transactionIds">, "required">;
582
+ 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>;
583
+ attemptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
584
+ stripePayoutId: import("convex/values").VString<string | undefined, "optional">;
585
+ returnTransactionId: import("convex/values").VString<string | undefined, "optional">;
586
+ feeRevision: import("convex/values").VFloat64<number | undefined, "optional">;
587
+ debitTransactionId: import("convex/values").VString<string | undefined, "optional">;
588
+ debitFee: import("convex/values").VFloat64<number | undefined, "optional">;
589
+ providerFee: import("convex/values").VFloat64<number | undefined, "optional">;
590
+ rejection: import("convex/values").VObject<{
591
+ code: "amount_too_small" | "balance_insufficient";
592
+ requestId: string;
593
+ } | undefined, {
594
+ requestId: import("convex/values").VString<string, "required">;
595
+ 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>;
596
+ }, "optional", "code" | "requestId">;
597
+ }, "required", "accountId" | "allocations" | "amount" | "attemptedAt" | "currency" | "debitFee" | "debitTransactionId" | "destinationId" | "expectedRevision" | "feeRevision" | "historical" | "independentLiabilities" | "liabilityRevision" | "observations" | "operationKey" | "ownerKey" | "providerFee" | "rejection" | "rejection.code" | "rejection.requestId" | "returnTransactionId" | "snapshotId" | "status" | "stripePayoutId">, {
598
+ by_account_status: ["accountId", "status", "_creationTime"];
599
+ by_debit_receipt: ["debitTransactionId", "_creationTime"];
600
+ by_operation: ["operationKey", "_creationTime"];
601
+ by_provider_payout: ["stripePayoutId", "_creationTime"];
602
+ by_rejection_request: ["rejection.requestId", "_creationTime"];
603
+ by_return_receipt: ["returnTransactionId", "_creationTime"];
604
+ by_status: ["status", "_creationTime"];
605
+ }, {}, {}>;
606
+ payoutSourceAllocations: import("convex/server").TableDefinition<import("convex/values").VObject<{
607
+ accountId: string;
608
+ currency: string;
609
+ ownerKey: string;
610
+ paidAmount: number;
611
+ reservedAmount: number;
612
+ stripeTransferId: string;
613
+ }, {
614
+ accountId: import("convex/values").VString<string, "required">;
615
+ ownerKey: import("convex/values").VString<string, "required">;
616
+ stripeTransferId: import("convex/values").VString<string, "required">;
617
+ currency: import("convex/values").VString<string, "required">;
618
+ paidAmount: import("convex/values").VFloat64<number, "required">;
619
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
620
+ }, "required", "accountId" | "currency" | "ownerKey" | "paidAmount" | "reservedAmount" | "stripeTransferId">, {
621
+ by_account: ["accountId", "_creationTime"];
622
+ by_transfer: ["stripeTransferId", "_creationTime"];
623
+ }, {}, {}>;
624
+ payoutPolicies: import("convex/server").TableDefinition<import("convex/values").VObject<{
625
+ accountId: string;
626
+ country: string;
627
+ holdDeadline?: number | undefined;
628
+ holdingExpiry?: {
629
+ balances?: {
630
+ available: number;
631
+ currency: string;
632
+ pending: number;
633
+ }[] | undefined;
634
+ deadline: number;
635
+ observedAt?: number | undefined;
636
+ status: "balance_remaining" | "claims_unresolved" | "no_held_balance" | "unverified";
637
+ } | undefined;
638
+ mode: "custom" | "stripe_managed";
639
+ operationKey: string;
640
+ ownerKey: string;
641
+ previousSchedule?: {
642
+ interval: "daily" | "manual" | "monthly" | "weekly";
643
+ monthlyDays?: number[] | undefined;
644
+ weeklyDays?: string[] | undefined;
645
+ } | undefined;
646
+ revision: number;
647
+ status: "changing" | "ready";
648
+ thresholds: {
649
+ amount: number;
650
+ currency: string;
651
+ }[];
652
+ }, {
653
+ accountId: import("convex/values").VString<string, "required">;
654
+ ownerKey: import("convex/values").VString<string, "required">;
655
+ revision: import("convex/values").VFloat64<number, "required">;
656
+ mode: import("convex/values").VUnion<"custom" | "stripe_managed", [import("convex/values").VLiteral<"stripe_managed", "required">, import("convex/values").VLiteral<"custom", "required">], "required", never>;
657
+ thresholds: import("convex/values").VArray<{
658
+ amount: number;
659
+ currency: string;
660
+ }[], import("convex/values").VObject<{
661
+ amount: number;
662
+ currency: string;
663
+ }, {
664
+ currency: import("convex/values").VString<string, "required">;
665
+ amount: import("convex/values").VFloat64<number, "required">;
666
+ }, "required", "amount" | "currency">, "required">;
667
+ status: import("convex/values").VUnion<"changing" | "ready", [import("convex/values").VLiteral<"changing", "required">, import("convex/values").VLiteral<"ready", "required">], "required", never>;
668
+ operationKey: import("convex/values").VString<string, "required">;
669
+ country: import("convex/values").VString<string, "required">;
670
+ previousSchedule: import("convex/values").VObject<{
671
+ interval: "daily" | "manual" | "monthly" | "weekly";
672
+ monthlyDays?: number[] | undefined;
673
+ weeklyDays?: string[] | undefined;
674
+ } | undefined, {
675
+ 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>;
676
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
677
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
678
+ }, "optional", "interval" | "monthlyDays" | "weeklyDays">;
679
+ holdDeadline: import("convex/values").VFloat64<number | undefined, "optional">;
680
+ holdingExpiry: import("convex/values").VObject<{
681
+ balances?: {
682
+ available: number;
683
+ currency: string;
684
+ pending: number;
685
+ }[] | undefined;
686
+ deadline: number;
687
+ observedAt?: number | undefined;
688
+ status: "balance_remaining" | "claims_unresolved" | "no_held_balance" | "unverified";
689
+ } | undefined, {
690
+ deadline: import("convex/values").VFloat64<number, "required">;
691
+ status: import("convex/values").VUnion<"balance_remaining" | "claims_unresolved" | "no_held_balance" | "unverified", [import("convex/values").VLiteral<"unverified", "required">, import("convex/values").VLiteral<"balance_remaining", "required">, import("convex/values").VLiteral<"claims_unresolved", "required">, import("convex/values").VLiteral<"no_held_balance", "required">], "required", never>;
692
+ observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
693
+ balances: import("convex/values").VArray<{
694
+ available: number;
695
+ currency: string;
696
+ pending: number;
697
+ }[] | undefined, import("convex/values").VObject<{
698
+ available: number;
699
+ currency: string;
700
+ pending: number;
701
+ }, {
702
+ currency: import("convex/values").VString<string, "required">;
703
+ available: import("convex/values").VFloat64<number, "required">;
704
+ pending: import("convex/values").VFloat64<number, "required">;
705
+ }, "required", "available" | "currency" | "pending">, "optional">;
706
+ }, "optional", "balances" | "deadline" | "observedAt" | "status">;
707
+ }, "required", "accountId" | "country" | "holdDeadline" | "holdingExpiry" | "holdingExpiry.balances" | "holdingExpiry.deadline" | "holdingExpiry.observedAt" | "holdingExpiry.status" | "mode" | "operationKey" | "ownerKey" | "previousSchedule" | "previousSchedule.interval" | "previousSchedule.monthlyDays" | "previousSchedule.weeklyDays" | "revision" | "status" | "thresholds">, {
708
+ by_account: ["accountId", "_creationTime"];
709
+ by_deadline: ["holdDeadline", "_creationTime"];
710
+ by_mode_status: ["mode", "status", "_creationTime"];
711
+ by_status: ["status", "_creationTime"];
712
+ }, {}, {}>;
713
+ payoutPolicyOperations: import("convex/server").TableDefinition<import("convex/values").VObject<{
714
+ accountId: string;
715
+ adoption?: {
716
+ claims: {
717
+ fingerprint: string;
718
+ operationKey: string;
719
+ }[];
720
+ collectionKey?: string | undefined;
721
+ observations: {
722
+ currency: string;
723
+ ledgerFingerprint: string;
724
+ matureNet: number;
725
+ observedAt: number;
726
+ pendingCredits: number;
727
+ stripeTransferId: string;
728
+ transactionIds: string[];
729
+ }[];
730
+ oldestHeldAt?: number | undefined;
731
+ snapshotId?: import("convex/values").GenericId<"payoutSnapshots"> | undefined;
732
+ } | undefined;
733
+ attempted?: boolean | undefined;
734
+ country: string;
735
+ expectedRevision: number;
736
+ mode: "custom" | "stripe_managed";
737
+ observedAt?: number | undefined;
738
+ observedSchedule: {
739
+ interval: "daily" | "manual" | "monthly" | "weekly";
740
+ monthlyDays?: number[] | undefined;
741
+ weeklyDays?: string[] | undefined;
742
+ };
743
+ operationKey: string;
744
+ ownerKey: string;
745
+ previousSchedule: {
746
+ interval: "daily" | "manual" | "monthly" | "weekly";
747
+ monthlyDays?: number[] | undefined;
748
+ weeklyDays?: string[] | undefined;
749
+ };
750
+ revision: number;
751
+ status: "canceled" | "complete" | "pending";
752
+ targetSchedule: {
753
+ interval: "daily" | "manual" | "monthly" | "weekly";
754
+ monthlyDays?: number[] | undefined;
755
+ weeklyDays?: string[] | undefined;
756
+ };
757
+ thresholds: {
758
+ amount: number;
759
+ currency: string;
760
+ }[];
761
+ }, {
762
+ accountId: import("convex/values").VString<string, "required">;
763
+ ownerKey: import("convex/values").VString<string, "required">;
764
+ adoption: import("convex/values").VObject<{
765
+ claims: {
766
+ fingerprint: string;
767
+ operationKey: string;
768
+ }[];
769
+ collectionKey?: string | undefined;
770
+ observations: {
771
+ currency: string;
772
+ ledgerFingerprint: string;
773
+ matureNet: number;
774
+ observedAt: number;
775
+ pendingCredits: number;
776
+ stripeTransferId: string;
777
+ transactionIds: string[];
778
+ }[];
779
+ oldestHeldAt?: number | undefined;
780
+ snapshotId?: import("convex/values").GenericId<"payoutSnapshots"> | undefined;
781
+ } | undefined, {
782
+ snapshotId: import("convex/values").VId<import("convex/values").GenericId<"payoutSnapshots"> | undefined, "optional">;
783
+ collectionKey: import("convex/values").VString<string | undefined, "optional">;
784
+ observations: import("convex/values").VArray<{
785
+ currency: string;
786
+ ledgerFingerprint: string;
787
+ matureNet: number;
788
+ observedAt: number;
789
+ pendingCredits: number;
790
+ stripeTransferId: string;
791
+ transactionIds: string[];
792
+ }[], import("convex/values").VObject<{
793
+ currency: string;
794
+ ledgerFingerprint: string;
795
+ matureNet: number;
796
+ observedAt: number;
797
+ pendingCredits: number;
798
+ stripeTransferId: string;
799
+ transactionIds: string[];
800
+ }, {
801
+ stripeTransferId: import("convex/values").VString<string, "required">;
802
+ currency: import("convex/values").VString<string, "required">;
803
+ matureNet: import("convex/values").VFloat64<number, "required">;
804
+ pendingCredits: import("convex/values").VFloat64<number, "required">;
805
+ ledgerFingerprint: import("convex/values").VString<string, "required">;
806
+ observedAt: import("convex/values").VFloat64<number, "required">;
807
+ transactionIds: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
808
+ }, "required", "currency" | "ledgerFingerprint" | "matureNet" | "observedAt" | "pendingCredits" | "stripeTransferId" | "transactionIds">, "required">;
809
+ claims: import("convex/values").VArray<{
810
+ fingerprint: string;
811
+ operationKey: string;
812
+ }[], import("convex/values").VObject<{
813
+ fingerprint: string;
814
+ operationKey: string;
815
+ }, {
816
+ operationKey: import("convex/values").VString<string, "required">;
817
+ fingerprint: import("convex/values").VString<string, "required">;
818
+ }, "required", "fingerprint" | "operationKey">, "required">;
819
+ oldestHeldAt: import("convex/values").VFloat64<number | undefined, "optional">;
820
+ }, "optional", "claims" | "collectionKey" | "observations" | "oldestHeldAt" | "snapshotId">;
821
+ operationKey: import("convex/values").VString<string, "required">;
822
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
823
+ mode: import("convex/values").VUnion<"custom" | "stripe_managed", [import("convex/values").VLiteral<"stripe_managed", "required">, import("convex/values").VLiteral<"custom", "required">], "required", never>;
824
+ thresholds: import("convex/values").VArray<{
825
+ amount: number;
826
+ currency: string;
827
+ }[], import("convex/values").VObject<{
828
+ amount: number;
829
+ currency: string;
830
+ }, {
831
+ currency: import("convex/values").VString<string, "required">;
832
+ amount: import("convex/values").VFloat64<number, "required">;
833
+ }, "required", "amount" | "currency">, "required">;
834
+ country: import("convex/values").VString<string, "required">;
835
+ observedSchedule: import("convex/values").VObject<{
836
+ interval: "daily" | "manual" | "monthly" | "weekly";
837
+ monthlyDays?: number[] | undefined;
838
+ weeklyDays?: string[] | undefined;
839
+ }, {
840
+ 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>;
841
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
842
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
843
+ }, "required", "interval" | "monthlyDays" | "weeklyDays">;
844
+ observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
845
+ revision: import("convex/values").VFloat64<number, "required">;
846
+ previousSchedule: import("convex/values").VObject<{
847
+ interval: "daily" | "manual" | "monthly" | "weekly";
848
+ monthlyDays?: number[] | undefined;
849
+ weeklyDays?: string[] | undefined;
850
+ }, {
851
+ 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>;
852
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
853
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
854
+ }, "required", "interval" | "monthlyDays" | "weeklyDays">;
855
+ targetSchedule: import("convex/values").VObject<{
856
+ interval: "daily" | "manual" | "monthly" | "weekly";
857
+ monthlyDays?: number[] | undefined;
858
+ weeklyDays?: string[] | undefined;
859
+ }, {
860
+ 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>;
861
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
862
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
863
+ }, "required", "interval" | "monthlyDays" | "weeklyDays">;
864
+ 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>;
865
+ attempted: import("convex/values").VBoolean<boolean | undefined, "optional">;
866
+ }, "required", "accountId" | "adoption" | "adoption.claims" | "adoption.collectionKey" | "adoption.observations" | "adoption.oldestHeldAt" | "adoption.snapshotId" | "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">, {
867
+ by_operation: ["operationKey", "_creationTime"];
868
+ }, {}, {}>;
869
+ currencyTotals: import("convex/server").TableDefinition<import("convex/values").VObject<{
870
+ accountId: string;
871
+ count: number;
872
+ currency: string;
873
+ gross: number;
874
+ kind: "earnings" | "payouts";
875
+ paidOut: number;
876
+ reversed: number;
877
+ }, {
878
+ accountId: import("convex/values").VString<string, "required">;
879
+ currency: import("convex/values").VString<string, "required">;
880
+ kind: import("convex/values").VUnion<"earnings" | "payouts", [import("convex/values").VLiteral<"earnings", "required">, import("convex/values").VLiteral<"payouts", "required">], "required", never>;
881
+ gross: import("convex/values").VFloat64<number, "required">;
882
+ reversed: import("convex/values").VFloat64<number, "required">;
883
+ paidOut: import("convex/values").VFloat64<number, "required">;
884
+ count: import("convex/values").VFloat64<number, "required">;
885
+ }, "required", "accountId" | "count" | "currency" | "gross" | "kind" | "paidOut" | "reversed">, {
886
+ by_account_kind_currency: ["accountId", "kind", "currency", "_creationTime"];
887
+ }, {}, {}>;
888
+ recoveryClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
889
+ accountId: string;
890
+ amountDue: number;
891
+ claimKey: string;
892
+ collectedAmount: number;
893
+ currency: string;
894
+ openingCollection?: {
895
+ amountDue: number;
896
+ collectedAmount: number;
897
+ operationKey: string;
898
+ revision: number;
899
+ } | undefined;
900
+ outstanding: number;
901
+ reservedAmount: number;
902
+ revision: number;
903
+ scopeKey: string;
904
+ sign: "negative" | "positive" | "zero";
905
+ sourceChargeId: string;
906
+ sourceGross: number;
907
+ sourceProcessingFee: number;
908
+ }, {
909
+ accountId: import("convex/values").VString<string, "required">;
910
+ scopeKey: import("convex/values").VString<string, "required">;
911
+ currency: import("convex/values").VString<string, "required">;
912
+ claimKey: import("convex/values").VString<string, "required">;
913
+ sourceChargeId: import("convex/values").VString<string, "required">;
914
+ sourceGross: import("convex/values").VFloat64<number, "required">;
915
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
916
+ amountDue: import("convex/values").VFloat64<number, "required">;
917
+ revision: import("convex/values").VFloat64<number, "required">;
918
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
919
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
920
+ outstanding: import("convex/values").VFloat64<number, "required">;
921
+ 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>;
922
+ openingCollection: import("convex/values").VObject<{
923
+ amountDue: number;
924
+ collectedAmount: number;
925
+ operationKey: string;
926
+ revision: number;
927
+ } | undefined, {
928
+ operationKey: import("convex/values").VString<string, "required">;
929
+ amountDue: import("convex/values").VFloat64<number, "required">;
930
+ revision: import("convex/values").VFloat64<number, "required">;
931
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
932
+ }, "optional", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
933
+ }, "required", "accountId" | "amountDue" | "claimKey" | "collectedAmount" | "currency" | "openingCollection" | "openingCollection.amountDue" | "openingCollection.collectedAmount" | "openingCollection.operationKey" | "openingCollection.revision" | "outstanding" | "reservedAmount" | "revision" | "scopeKey" | "sign" | "sourceChargeId" | "sourceGross" | "sourceProcessingFee">, {
934
+ by_import: ["openingCollection.operationKey", "_creationTime"];
935
+ by_key: ["claimKey", "_creationTime"];
936
+ by_scope: ["accountId", "scopeKey", "currency", "_creationTime"];
937
+ by_sign: ["accountId", "scopeKey", "currency", "sign", "_creationTime"];
938
+ }, {}, {}>;
939
+ recoveryBalances: import("convex/server").TableDefinition<import("convex/values").VObject<{
940
+ accountId: string;
941
+ activeGroupKey?: string | undefined;
942
+ amountDue: number;
943
+ collectedAmount: number;
944
+ currency: string;
945
+ outstanding: number;
946
+ reservedAmount: number;
947
+ scopeKey: string;
948
+ }, {
949
+ accountId: import("convex/values").VString<string, "required">;
950
+ scopeKey: import("convex/values").VString<string, "required">;
951
+ currency: import("convex/values").VString<string, "required">;
952
+ amountDue: import("convex/values").VFloat64<number, "required">;
953
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
954
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
955
+ outstanding: import("convex/values").VFloat64<number, "required">;
956
+ activeGroupKey: import("convex/values").VString<string | undefined, "optional">;
957
+ }, "required", "accountId" | "activeGroupKey" | "amountDue" | "collectedAmount" | "currency" | "outstanding" | "reservedAmount" | "scopeKey">, {
958
+ by_scope: ["accountId", "scopeKey", "currency", "_creationTime"];
959
+ }, {}, {}>;
960
+ recoveryGroups: import("convex/server").TableDefinition<import("convex/values").VObject<{
961
+ accountId: string;
962
+ amount: number;
963
+ currency: string;
964
+ groupKey: string;
965
+ invoiceFunding?: {
966
+ sourceChargeId: string;
967
+ sourceGross: number;
968
+ sourceProcessingFee: number;
969
+ } | undefined;
970
+ invoiceItemId?: string | undefined;
971
+ maxCredit: number;
972
+ maxDebit: number;
973
+ pendingOperations: number;
974
+ scopeKey: string;
975
+ sourceGross?: number | undefined;
976
+ sourceId: string;
977
+ sourceKind: "invoice" | "settlement";
978
+ sourceProcessingFee?: number | undefined;
979
+ status: "collected" | "collecting" | "open" | "released" | "releasing" | "sealed";
980
+ }, {
981
+ accountId: import("convex/values").VString<string, "required">;
982
+ scopeKey: import("convex/values").VString<string, "required">;
983
+ currency: import("convex/values").VString<string, "required">;
984
+ groupKey: import("convex/values").VString<string, "required">;
985
+ sourceKind: import("convex/values").VUnion<"invoice" | "settlement", [import("convex/values").VLiteral<"settlement", "required">, import("convex/values").VLiteral<"invoice", "required">], "required", never>;
986
+ sourceId: import("convex/values").VString<string, "required">;
987
+ sourceGross: import("convex/values").VFloat64<number | undefined, "optional">;
988
+ sourceProcessingFee: import("convex/values").VFloat64<number | undefined, "optional">;
989
+ maxDebit: import("convex/values").VFloat64<number, "required">;
990
+ maxCredit: import("convex/values").VFloat64<number, "required">;
991
+ amount: import("convex/values").VFloat64<number, "required">;
992
+ pendingOperations: import("convex/values").VFloat64<number, "required">;
993
+ invoiceItemId: import("convex/values").VString<string | undefined, "optional">;
994
+ invoiceFunding: import("convex/values").VObject<{
995
+ sourceChargeId: string;
996
+ sourceGross: number;
997
+ sourceProcessingFee: number;
998
+ } | undefined, {
999
+ sourceChargeId: import("convex/values").VString<string, "required">;
1000
+ sourceGross: import("convex/values").VFloat64<number, "required">;
1001
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
1002
+ }, "optional", "sourceChargeId" | "sourceGross" | "sourceProcessingFee">;
1003
+ 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>;
1004
+ }, "required", "accountId" | "amount" | "currency" | "groupKey" | "invoiceFunding" | "invoiceFunding.sourceChargeId" | "invoiceFunding.sourceGross" | "invoiceFunding.sourceProcessingFee" | "invoiceItemId" | "maxCredit" | "maxDebit" | "pendingOperations" | "scopeKey" | "sourceGross" | "sourceId" | "sourceKind" | "sourceProcessingFee" | "status">, {
1005
+ by_key: ["groupKey", "_creationTime"];
1006
+ }, {}, {}>;
1007
+ recoveryReservations: import("convex/server").TableDefinition<import("convex/values").VObject<{
1008
+ allocations: {
1009
+ amount: number;
1010
+ claimId: import("convex/values").GenericId<"recoveryClaims">;
1011
+ claimKey: string;
1012
+ }[];
1013
+ amount: number;
1014
+ groupKey: string;
1015
+ limit: number;
1016
+ operationKey: string;
1017
+ status: "collected" | "empty" | "released" | "reserved";
1018
+ }, {
1019
+ operationKey: import("convex/values").VString<string, "required">;
1020
+ groupKey: import("convex/values").VString<string, "required">;
1021
+ amount: import("convex/values").VFloat64<number, "required">;
1022
+ limit: import("convex/values").VFloat64<number, "required">;
1023
+ allocations: import("convex/values").VArray<{
1024
+ amount: number;
1025
+ claimId: import("convex/values").GenericId<"recoveryClaims">;
1026
+ claimKey: string;
1027
+ }[], import("convex/values").VObject<{
1028
+ amount: number;
1029
+ claimId: import("convex/values").GenericId<"recoveryClaims">;
1030
+ claimKey: string;
1031
+ }, {
1032
+ claimId: import("convex/values").VId<import("convex/values").GenericId<"recoveryClaims">, "required">;
1033
+ claimKey: import("convex/values").VString<string, "required">;
1034
+ amount: import("convex/values").VFloat64<number, "required">;
1035
+ }, "required", "amount" | "claimId" | "claimKey">, "required">;
1036
+ 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>;
1037
+ }, "required", "allocations" | "amount" | "groupKey" | "limit" | "operationKey" | "status">, {
1038
+ by_group_status: ["groupKey", "status", "_creationTime"];
1039
+ by_key: ["operationKey", "_creationTime"];
1040
+ }, {}, {}>;
1041
+ settlementAllocations: import("convex/server").TableDefinition<import("convex/values").VObject<{
1042
+ adjustmentAmount?: number | undefined;
1043
+ currency: string;
1044
+ gross: number;
1045
+ paymentId?: string | undefined;
1046
+ paymentIntentId?: string | undefined;
1047
+ platformNet: number;
1048
+ processingFee: number;
1049
+ sourceChargeId: string;
1050
+ sourceInvoiceId?: string | undefined;
1051
+ transfers: {
1052
+ amount: number;
1053
+ destinationAccountId: string;
1054
+ role: "affiliate" | "other" | "store";
1055
+ }[];
1056
+ }, {
1057
+ sourceChargeId: import("convex/values").VString<string, "required">;
1058
+ paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
1059
+ sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
1060
+ gross: import("convex/values").VFloat64<number, "required">;
1061
+ currency: import("convex/values").VString<string, "required">;
1062
+ processingFee: import("convex/values").VFloat64<number, "required">;
1063
+ platformNet: import("convex/values").VFloat64<number, "required">;
1064
+ adjustmentAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1065
+ paymentId: import("convex/values").VString<string | undefined, "optional">;
1066
+ transfers: import("convex/values").VArray<{
1067
+ amount: number;
1068
+ destinationAccountId: string;
1069
+ role: "affiliate" | "other" | "store";
1070
+ }[], import("convex/values").VObject<{
1071
+ amount: number;
1072
+ destinationAccountId: string;
1073
+ role: "affiliate" | "other" | "store";
1074
+ }, {
1075
+ destinationAccountId: import("convex/values").VString<string, "required">;
1076
+ 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>;
1077
+ amount: import("convex/values").VFloat64<number, "required">;
1078
+ }, "required", "amount" | "destinationAccountId" | "role">, "required">;
1079
+ }, "required", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">, {
1080
+ by_source_charge: ["sourceChargeId", "_creationTime"];
1081
+ }, {}, {}>;
1082
+ commissionTerms: import("convex/server").TableDefinition<import("convex/values").VObject<{
1083
+ affiliateAccountId?: string | undefined;
1084
+ firstPaidInvoiceId: string;
1085
+ subscriptionId: string;
1086
+ term: "forever" | "one_time";
1087
+ }, {
1088
+ subscriptionId: import("convex/values").VString<string, "required">;
1089
+ term: import("convex/values").VUnion<"forever" | "one_time", [import("convex/values").VLiteral<"forever", "required">, import("convex/values").VLiteral<"one_time", "required">], "required", never>;
1090
+ affiliateAccountId: import("convex/values").VString<string | undefined, "optional">;
1091
+ firstPaidInvoiceId: import("convex/values").VString<string, "required">;
1092
+ }, "required", "affiliateAccountId" | "firstPaidInvoiceId" | "subscriptionId" | "term">, {
1093
+ by_subscription: ["subscriptionId", "_creationTime"];
1094
+ }, {}, {}>;
1095
+ commissionDecisions: import("convex/server").TableDefinition<import("convex/values").VObject<{
1096
+ claimKey: string;
1097
+ eligible: boolean;
1098
+ invoiceId: string;
1099
+ subscriptionId: string;
1100
+ }, {
1101
+ subscriptionId: import("convex/values").VString<string, "required">;
1102
+ invoiceId: import("convex/values").VString<string, "required">;
1103
+ eligible: import("convex/values").VBoolean<boolean, "required">;
1104
+ claimKey: import("convex/values").VString<string, "required">;
1105
+ }, "required", "claimKey" | "eligible" | "invoiceId" | "subscriptionId">, {
1106
+ by_subscription_invoice: ["subscriptionId", "invoiceId", "_creationTime"];
1107
+ }, {}, {}>;
1108
+ accounts: import("convex/server").TableDefinition<import("convex/values").VObject<{
1109
+ appliedConfigurations?: ("customer" | "merchant" | "recipient")[] | undefined;
1110
+ capabilities?: any;
1111
+ configuration?: any;
1112
+ country?: string | undefined;
1113
+ email?: string | undefined;
1114
+ metadata?: any;
1115
+ missingRequirements?: string[] | undefined;
1116
+ name?: string | undefined;
1117
+ onboardingStatus: "complete" | "in_progress" | "pending" | "restricted";
1118
+ orgId?: string | undefined;
1119
+ requirements?: any;
1120
+ statementDescriptor?: string | undefined;
1121
+ stripeAccountId: string;
1122
+ userId: string;
1123
+ }, {
1124
+ stripeAccountId: import("convex/values").VString<string, "required">;
1125
+ userId: import("convex/values").VString<string, "required">;
1126
+ orgId: import("convex/values").VString<string | undefined, "optional">;
1127
+ email: import("convex/values").VString<string | undefined, "optional">;
1128
+ name: import("convex/values").VString<string | undefined, "optional">;
1129
+ country: import("convex/values").VString<string | undefined, "optional">;
1130
+ capabilities: import("convex/values").VAny<any, "optional", string>;
1131
+ requirements: import("convex/values").VAny<any, "optional", string>;
1132
+ configuration: import("convex/values").VAny<any, "optional", string>;
1133
+ 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">;
1134
+ 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>;
1135
+ missingRequirements: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
1136
+ metadata: import("convex/values").VAny<any, "optional", string>;
1137
+ statementDescriptor: import("convex/values").VString<string | undefined, "optional">;
1138
+ }, "required", "appliedConfigurations" | "capabilities" | "configuration" | "country" | "email" | "metadata" | "missingRequirements" | "name" | "onboardingStatus" | "orgId" | "requirements" | "statementDescriptor" | "stripeAccountId" | "userId" | `capabilities.${string}` | `configuration.${string}` | `metadata.${string}` | `requirements.${string}`>, {
1139
+ by_onboarding_status: ["onboardingStatus", "_creationTime"];
1140
+ by_org_id: ["orgId", "_creationTime"];
1141
+ by_stripe_account_id: ["stripeAccountId", "_creationTime"];
1142
+ by_user_id: ["userId", "_creationTime"];
1143
+ }, {}, {}>;
1144
+ products: import("convex/server").TableDefinition<import("convex/values").VObject<{
1145
+ accountId?: string | undefined;
1146
+ active: boolean;
1147
+ description?: string | undefined;
1148
+ metadata?: any;
1149
+ name: string;
1150
+ stripeProductId: string;
1151
+ }, {
1152
+ stripeProductId: import("convex/values").VString<string, "required">;
1153
+ accountId: import("convex/values").VString<string | undefined, "optional">;
1154
+ name: import("convex/values").VString<string, "required">;
1155
+ description: import("convex/values").VString<string | undefined, "optional">;
1156
+ active: import("convex/values").VBoolean<boolean, "required">;
1157
+ metadata: import("convex/values").VAny<any, "optional", string>;
1158
+ }, "required", "accountId" | "active" | "description" | "metadata" | "name" | "stripeProductId" | `metadata.${string}`>, {
1159
+ by_account_active: ["accountId", "active", "_creationTime"];
1160
+ by_account_id: ["accountId", "_creationTime"];
1161
+ by_active: ["active", "_creationTime"];
1162
+ by_stripe_product_id: ["stripeProductId", "_creationTime"];
1163
+ }, {}, {}>;
1164
+ prices: import("convex/server").TableDefinition<import("convex/values").VObject<{
1165
+ active: boolean;
1166
+ currency: string;
1167
+ interval?: "day" | "month" | "week" | "year" | undefined;
1168
+ intervalCount?: number | undefined;
1169
+ metadata?: any;
1170
+ nickname?: string | undefined;
1171
+ productId: string;
1172
+ stripePriceId: string;
1173
+ stripeProductId: string;
1174
+ type: "one_time" | "recurring";
1175
+ unitAmount: number;
1176
+ }, {
1177
+ stripePriceId: import("convex/values").VString<string, "required">;
1178
+ productId: import("convex/values").VString<string, "required">;
1179
+ stripeProductId: import("convex/values").VString<string, "required">;
1180
+ nickname: import("convex/values").VString<string | undefined, "optional">;
1181
+ unitAmount: import("convex/values").VFloat64<number, "required">;
1182
+ currency: import("convex/values").VString<string, "required">;
1183
+ active: import("convex/values").VBoolean<boolean, "required">;
1184
+ type: import("convex/values").VUnion<"one_time" | "recurring", [import("convex/values").VLiteral<"one_time", "required">, import("convex/values").VLiteral<"recurring", "required">], "required", never>;
1185
+ 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>;
1186
+ intervalCount: import("convex/values").VFloat64<number | undefined, "optional">;
1187
+ metadata: import("convex/values").VAny<any, "optional", string>;
1188
+ }, "required", "active" | "currency" | "interval" | "intervalCount" | "metadata" | "nickname" | "productId" | "stripePriceId" | "stripeProductId" | "type" | "unitAmount" | `metadata.${string}`>, {
1189
+ by_active: ["active", "_creationTime"];
1190
+ by_product_active: ["productId", "active", "_creationTime"];
1191
+ by_product_id: ["productId", "_creationTime"];
1192
+ by_stripe_price_id: ["stripePriceId", "_creationTime"];
1193
+ by_stripe_product_id: ["stripeProductId", "_creationTime"];
1194
+ }, {}, {}>;
1195
+ subscriptions: import("convex/server").TableDefinition<import("convex/values").VObject<{
1196
+ accountId?: string | undefined;
1197
+ applicationFeeAmount?: number | undefined;
1198
+ applicationFeePercent?: number | undefined;
1199
+ cancelAtPeriodEnd: boolean;
1200
+ canceledAt?: string | undefined;
1201
+ chargeType?: "destination" | "separate" | undefined;
1202
+ currency?: string | undefined;
1203
+ currentPeriodEnd?: string | undefined;
1204
+ currentPeriodStart?: string | undefined;
1205
+ destinationAccountId?: string | undefined;
1206
+ feeCollectedAmount?: number | undefined;
1207
+ feeRefundedAmount?: number | undefined;
1208
+ isCollectionPaused?: boolean | undefined;
1209
+ isTrialing: boolean;
1210
+ metadata?: any;
1211
+ orgId?: string | undefined;
1212
+ priceId?: string | undefined;
1213
+ quantity?: number | undefined;
1214
+ splitRecipients?: {
1215
+ amount?: number | undefined;
1216
+ destinationAccountId: string;
1217
+ percent?: number | undefined;
1218
+ role: "affiliate" | "other" | "store";
1219
+ }[] | undefined;
1220
+ status: "active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid";
1221
+ stripeSubscriptionId: string;
1222
+ trialEnd?: string | undefined;
1223
+ trialStart?: string | undefined;
1224
+ userId: string;
1225
+ }, {
1226
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
1227
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1228
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
1229
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1230
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1231
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
1232
+ splitRecipients: import("convex/values").VArray<{
1233
+ amount?: number | undefined;
1234
+ destinationAccountId: string;
1235
+ percent?: number | undefined;
1236
+ role: "affiliate" | "other" | "store";
1237
+ }[] | undefined, import("convex/values").VObject<{
1238
+ amount?: number | undefined;
1239
+ destinationAccountId: string;
1240
+ percent?: number | undefined;
1241
+ role: "affiliate" | "other" | "store";
1242
+ }, {
1243
+ destinationAccountId: import("convex/values").VString<string, "required">;
1244
+ 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>;
1245
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
1246
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
1247
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
1248
+ stripeSubscriptionId: import("convex/values").VString<string, "required">;
1249
+ accountId: import("convex/values").VString<string | undefined, "optional">;
1250
+ userId: import("convex/values").VString<string, "required">;
1251
+ orgId: import("convex/values").VString<string | undefined, "optional">;
1252
+ 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>;
1253
+ priceId: import("convex/values").VString<string | undefined, "optional">;
1254
+ quantity: import("convex/values").VFloat64<number | undefined, "optional">;
1255
+ currentPeriodStart: import("convex/values").VString<string | undefined, "optional">;
1256
+ currentPeriodEnd: import("convex/values").VString<string | undefined, "optional">;
1257
+ cancelAtPeriodEnd: import("convex/values").VBoolean<boolean, "required">;
1258
+ isCollectionPaused: import("convex/values").VBoolean<boolean | undefined, "optional">;
1259
+ canceledAt: import("convex/values").VString<string | undefined, "optional">;
1260
+ isTrialing: import("convex/values").VBoolean<boolean, "required">;
1261
+ trialStart: import("convex/values").VString<string | undefined, "optional">;
1262
+ trialEnd: import("convex/values").VString<string | undefined, "optional">;
1263
+ currency: import("convex/values").VString<string | undefined, "optional">;
1264
+ metadata: import("convex/values").VAny<any, "optional", string>;
1265
+ }, "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}`>, {
1266
+ by_account_id: ["accountId", "_creationTime"];
1267
+ by_account_status: ["accountId", "status", "_creationTime"];
1268
+ by_org_id: ["orgId", "_creationTime"];
1269
+ by_price_id: ["priceId", "_creationTime"];
1270
+ by_status: ["status", "_creationTime"];
1271
+ by_stripe_subscription_id: ["stripeSubscriptionId", "_creationTime"];
1272
+ by_user_id: ["userId", "_creationTime"];
1273
+ }, {}, {}>;
1274
+ checkoutSessions: import("convex/server").TableDefinition<import("convex/values").VObject<{
1275
+ accountId?: string | undefined;
1276
+ applicationFeeAmount?: number | undefined;
1277
+ applicationFeePercent?: number | undefined;
1278
+ chargeType?: "destination" | "separate" | undefined;
1279
+ clientSecret?: string | undefined;
1280
+ currency?: string | undefined;
1281
+ destinationAccountId?: string | undefined;
1282
+ feeCollectedAmount?: number | undefined;
1283
+ feeRefundedAmount?: number | undefined;
1284
+ metadata?: any;
1285
+ mode: "payment" | "setup" | "subscription";
1286
+ orgId?: string | undefined;
1287
+ priceId?: string | undefined;
1288
+ splitRecipients?: {
1289
+ amount?: number | undefined;
1290
+ destinationAccountId: string;
1291
+ percent?: number | undefined;
1292
+ role: "affiliate" | "other" | "store";
1293
+ }[] | undefined;
1294
+ status: "complete" | "expired" | "open";
1295
+ stripeSessionId: string;
1296
+ url?: string | undefined;
1297
+ userId: string;
1298
+ }, {
1299
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
1300
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1301
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
1302
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1303
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1304
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
1305
+ splitRecipients: import("convex/values").VArray<{
1306
+ amount?: number | undefined;
1307
+ destinationAccountId: string;
1308
+ percent?: number | undefined;
1309
+ role: "affiliate" | "other" | "store";
1310
+ }[] | undefined, import("convex/values").VObject<{
1311
+ amount?: number | undefined;
1312
+ destinationAccountId: string;
1313
+ percent?: number | undefined;
1314
+ role: "affiliate" | "other" | "store";
1315
+ }, {
1316
+ destinationAccountId: import("convex/values").VString<string, "required">;
1317
+ 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>;
1318
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
1319
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
1320
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
1321
+ stripeSessionId: import("convex/values").VString<string, "required">;
1322
+ userId: import("convex/values").VString<string, "required">;
1323
+ orgId: import("convex/values").VString<string | undefined, "optional">;
1324
+ accountId: import("convex/values").VString<string | undefined, "optional">;
1325
+ 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>;
1326
+ 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>;
1327
+ clientSecret: import("convex/values").VString<string | undefined, "optional">;
1328
+ url: import("convex/values").VString<string | undefined, "optional">;
1329
+ priceId: import("convex/values").VString<string | undefined, "optional">;
1330
+ currency: import("convex/values").VString<string | undefined, "optional">;
1331
+ metadata: import("convex/values").VAny<any, "optional", string>;
1332
+ }, "required", "accountId" | "applicationFeeAmount" | "applicationFeePercent" | "chargeType" | "clientSecret" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "metadata" | "mode" | "orgId" | "priceId" | "splitRecipients" | "status" | "stripeSessionId" | "url" | "userId" | `metadata.${string}`>, {
1333
+ by_account_id: ["accountId", "_creationTime"];
1334
+ by_stripe_session_id: ["stripeSessionId", "_creationTime"];
1335
+ by_user_id: ["userId", "_creationTime"];
1336
+ by_user_status: ["userId", "status", "_creationTime"];
1337
+ }, {}, {}>;
1338
+ invoices: import("convex/server").TableDefinition<import("convex/values").VObject<{
1339
+ accountId?: string | undefined;
1340
+ amountDue: number;
1341
+ amountPaid: number;
1342
+ applicationFeeAmount?: number | undefined;
1343
+ applicationFeePercent?: number | undefined;
1344
+ attemptCount?: number | undefined;
1345
+ chargeType?: "destination" | "separate" | undefined;
1346
+ currency: string;
1347
+ destinationAccountId?: string | undefined;
1348
+ feeCollectedAmount?: number | undefined;
1349
+ feeRefundedAmount?: number | undefined;
1350
+ hostedInvoiceUrl?: string | undefined;
1351
+ invoicePdf?: string | undefined;
1352
+ metadata?: any;
1353
+ nextPaymentAttempt?: string | undefined;
1354
+ orgId?: string | undefined;
1355
+ periodEnd?: string | undefined;
1356
+ periodStart?: string | undefined;
1357
+ splitRecipients?: {
1358
+ amount?: number | undefined;
1359
+ destinationAccountId: string;
1360
+ percent?: number | undefined;
1361
+ role: "affiliate" | "other" | "store";
1362
+ }[] | undefined;
1363
+ status: "draft" | "open" | "paid" | "uncollectible" | "void";
1364
+ stripeInvoiceId: string;
1365
+ subscriptionId?: string | undefined;
1366
+ userId: string;
1367
+ }, {
1368
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
1369
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1370
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
1371
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1372
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1373
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
1374
+ splitRecipients: import("convex/values").VArray<{
1375
+ amount?: number | undefined;
1376
+ destinationAccountId: string;
1377
+ percent?: number | undefined;
1378
+ role: "affiliate" | "other" | "store";
1379
+ }[] | undefined, import("convex/values").VObject<{
1380
+ amount?: number | undefined;
1381
+ destinationAccountId: string;
1382
+ percent?: number | undefined;
1383
+ role: "affiliate" | "other" | "store";
1384
+ }, {
1385
+ destinationAccountId: import("convex/values").VString<string, "required">;
1386
+ 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>;
1387
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
1388
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
1389
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
1390
+ stripeInvoiceId: import("convex/values").VString<string, "required">;
1391
+ userId: import("convex/values").VString<string, "required">;
1392
+ orgId: import("convex/values").VString<string | undefined, "optional">;
1393
+ accountId: import("convex/values").VString<string | undefined, "optional">;
1394
+ subscriptionId: import("convex/values").VString<string | undefined, "optional">;
1395
+ 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>;
1396
+ currency: import("convex/values").VString<string, "required">;
1397
+ amountDue: import("convex/values").VFloat64<number, "required">;
1398
+ amountPaid: import("convex/values").VFloat64<number, "required">;
1399
+ hostedInvoiceUrl: import("convex/values").VString<string | undefined, "optional">;
1400
+ invoicePdf: import("convex/values").VString<string | undefined, "optional">;
1401
+ periodStart: import("convex/values").VString<string | undefined, "optional">;
1402
+ periodEnd: import("convex/values").VString<string | undefined, "optional">;
1403
+ nextPaymentAttempt: import("convex/values").VString<string | undefined, "optional">;
1404
+ attemptCount: import("convex/values").VFloat64<number | undefined, "optional">;
1405
+ metadata: import("convex/values").VAny<any, "optional", string>;
1406
+ }, "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}`>, {
1407
+ by_account_id: ["accountId", "_creationTime"];
1408
+ by_account_status: ["accountId", "status", "_creationTime"];
1409
+ by_status: ["status", "_creationTime"];
1410
+ by_stripe_invoice_id: ["stripeInvoiceId", "_creationTime"];
1411
+ by_subscription_id: ["subscriptionId", "_creationTime"];
1412
+ by_subscription_status: ["subscriptionId", "status", "_creationTime"];
1413
+ by_user_id: ["userId", "_creationTime"];
1414
+ by_user_status: ["userId", "status", "_creationTime"];
1415
+ }, {}, {}>;
1416
+ payments: import("convex/server").TableDefinition<import("convex/values").VObject<{
1417
+ accountId?: string | undefined;
1418
+ amount: number;
1419
+ applicationFeeAmount?: number | undefined;
1420
+ applicationFeePercent?: number | undefined;
1421
+ chargeType?: "destination" | "separate" | undefined;
1422
+ currency: string;
1423
+ destinationAccountId?: string | undefined;
1424
+ feeCollectedAmount?: number | undefined;
1425
+ feeRefundedAmount?: number | undefined;
1426
+ metadata?: any;
1427
+ orgId?: string | undefined;
1428
+ refundStatus?: "fully_refunded" | "partially_refunded" | undefined;
1429
+ refundedAmount?: number | undefined;
1430
+ splitRecipients?: {
1431
+ amount?: number | undefined;
1432
+ destinationAccountId: string;
1433
+ percent?: number | undefined;
1434
+ role: "affiliate" | "other" | "store";
1435
+ }[] | undefined;
1436
+ status: "canceled" | "failed" | "processing" | "requires_action" | "succeeded";
1437
+ stripePaymentIntentId: string;
1438
+ userId: string;
1439
+ }, {
1440
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
1441
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1442
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
1443
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1444
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1445
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
1446
+ splitRecipients: import("convex/values").VArray<{
1447
+ amount?: number | undefined;
1448
+ destinationAccountId: string;
1449
+ percent?: number | undefined;
1450
+ role: "affiliate" | "other" | "store";
1451
+ }[] | undefined, import("convex/values").VObject<{
1452
+ amount?: number | undefined;
1453
+ destinationAccountId: string;
1454
+ percent?: number | undefined;
1455
+ role: "affiliate" | "other" | "store";
1456
+ }, {
1457
+ destinationAccountId: import("convex/values").VString<string, "required">;
1458
+ 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>;
1459
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
1460
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
1461
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
1462
+ stripePaymentIntentId: import("convex/values").VString<string, "required">;
1463
+ userId: import("convex/values").VString<string, "required">;
1464
+ orgId: import("convex/values").VString<string | undefined, "optional">;
1465
+ accountId: import("convex/values").VString<string | undefined, "optional">;
1466
+ amount: import("convex/values").VFloat64<number, "required">;
1467
+ currency: import("convex/values").VString<string, "required">;
1468
+ 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>;
1469
+ refundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1470
+ 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>;
1471
+ metadata: import("convex/values").VAny<any, "optional", string>;
1472
+ }, "required", "accountId" | "amount" | "applicationFeeAmount" | "applicationFeePercent" | "chargeType" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "metadata" | "orgId" | "refundStatus" | "refundedAmount" | "splitRecipients" | "status" | "stripePaymentIntentId" | "userId" | `metadata.${string}`>, {
1473
+ by_account_id: ["accountId", "_creationTime"];
1474
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
1475
+ by_user_id: ["userId", "_creationTime"];
1476
+ }, {}, {}>;
1477
+ payouts: import("convex/server").TableDefinition<import("convex/values").VObject<{
1478
+ accountId: string;
1479
+ amount: number;
1480
+ arrivalDate?: string | undefined;
1481
+ currency: string;
1482
+ failureCode?: string | undefined;
1483
+ failureMessage?: string | undefined;
1484
+ metadata?: any;
1485
+ method?: string | undefined;
1486
+ status: "canceled" | "failed" | "in_transit" | "paid" | "pending";
1487
+ stripePayoutId: string;
1488
+ totalsRecorded?: true | undefined;
1489
+ }, {
1490
+ stripePayoutId: import("convex/values").VString<string, "required">;
1491
+ accountId: import("convex/values").VString<string, "required">;
1492
+ amount: import("convex/values").VFloat64<number, "required">;
1493
+ currency: import("convex/values").VString<string, "required">;
1494
+ 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>;
1495
+ arrivalDate: import("convex/values").VString<string | undefined, "optional">;
1496
+ method: import("convex/values").VString<string | undefined, "optional">;
1497
+ failureCode: import("convex/values").VString<string | undefined, "optional">;
1498
+ failureMessage: import("convex/values").VString<string | undefined, "optional">;
1499
+ metadata: import("convex/values").VAny<any, "optional", string>;
1500
+ totalsRecorded: import("convex/values").VLiteral<true | undefined, "optional">;
1501
+ }, "required", "accountId" | "amount" | "arrivalDate" | "currency" | "failureCode" | "failureMessage" | "metadata" | "method" | "status" | "stripePayoutId" | "totalsRecorded" | `metadata.${string}`>, {
1502
+ by_account_id: ["accountId", "_creationTime"];
1503
+ by_account_status: ["accountId", "status", "_creationTime"];
1504
+ by_account_totals_recorded: ["accountId", "totalsRecorded", "_creationTime"];
1505
+ by_status: ["status", "_creationTime"];
1506
+ by_stripe_payout_id: ["stripePayoutId", "_creationTime"];
1507
+ }, {}, {}>;
1508
+ pendingFeeRefunds: import("convex/server").TableDefinition<import("convex/values").VObject<{
1509
+ feeCollectedAmount: number;
1510
+ feeRefundedAmount: number;
1511
+ stripePaymentIntentId: string;
1512
+ }, {
1513
+ stripePaymentIntentId: import("convex/values").VString<string, "required">;
1514
+ feeCollectedAmount: import("convex/values").VFloat64<number, "required">;
1515
+ feeRefundedAmount: import("convex/values").VFloat64<number, "required">;
1516
+ }, "required", "feeCollectedAmount" | "feeRefundedAmount" | "stripePaymentIntentId">, {
1517
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
1518
+ }, {}, {}>;
1519
+ refunds: import("convex/server").TableDefinition<import("convex/values").VObject<{
1520
+ accountId?: string | undefined;
1521
+ amount: number;
1522
+ currency: string;
1523
+ failureReason?: string | undefined;
1524
+ metadata?: any;
1525
+ reason?: "duplicate" | "expired_uncaptured_charge" | "fraudulent" | "requested_by_customer" | undefined;
1526
+ status: "canceled" | "failed" | "pending" | "requires_action" | "succeeded";
1527
+ stripeChargeId?: string | undefined;
1528
+ stripePaymentIntentId?: string | undefined;
1529
+ stripeRefundId: string;
1530
+ }, {
1531
+ stripeRefundId: import("convex/values").VString<string, "required">;
1532
+ stripePaymentIntentId: import("convex/values").VString<string | undefined, "optional">;
1533
+ stripeChargeId: import("convex/values").VString<string | undefined, "optional">;
1534
+ accountId: import("convex/values").VString<string | undefined, "optional">;
1535
+ amount: import("convex/values").VFloat64<number, "required">;
1536
+ currency: import("convex/values").VString<string, "required">;
1537
+ 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>;
1538
+ 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>;
1539
+ failureReason: import("convex/values").VString<string | undefined, "optional">;
1540
+ metadata: import("convex/values").VAny<any, "optional", string>;
1541
+ }, "required", "accountId" | "amount" | "currency" | "failureReason" | "metadata" | "reason" | "status" | "stripeChargeId" | "stripePaymentIntentId" | "stripeRefundId" | `metadata.${string}`>, {
1542
+ by_account_id: ["accountId", "_creationTime"];
1543
+ by_account_id_and_status: ["accountId", "status", "_creationTime"];
1544
+ by_account_id_and_stripe_payment_intent_id: ["accountId", "stripePaymentIntentId", "_creationTime"];
1545
+ by_account_id_and_stripe_payment_intent_id_and_status: ["accountId", "stripePaymentIntentId", "status", "_creationTime"];
1546
+ by_payment_intent_id_and_status: ["stripePaymentIntentId", "status", "_creationTime"];
1547
+ by_status: ["status", "_creationTime"];
1548
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
1549
+ by_stripe_refund_id: ["stripeRefundId", "_creationTime"];
1550
+ }, {}, {}>;
1551
+ disputes: import("convex/server").TableDefinition<import("convex/values").VObject<{
1552
+ accountId?: string | undefined;
1553
+ amount: number;
1554
+ currency: string;
1555
+ evidence?: any;
1556
+ evidenceDueBy?: string | undefined;
1557
+ isChargeRefundable: boolean;
1558
+ lastEvent?: string | undefined;
1559
+ linkedTransferIds?: string[] | undefined;
1560
+ metadata?: any;
1561
+ reason: string;
1562
+ statementDescriptor?: string | undefined;
1563
+ status: "lost" | "needs_response" | "prevented" | "under_review" | "warning_closed" | "warning_needs_response" | "warning_under_review" | "won";
1564
+ stripeChargeId?: string | undefined;
1565
+ stripeDisputeId: string;
1566
+ stripePaymentIntentId?: string | undefined;
1567
+ }, {
1568
+ stripeDisputeId: import("convex/values").VString<string, "required">;
1569
+ stripePaymentIntentId: import("convex/values").VString<string | undefined, "optional">;
1570
+ stripeChargeId: import("convex/values").VString<string | undefined, "optional">;
1571
+ accountId: import("convex/values").VString<string | undefined, "optional">;
1572
+ amount: import("convex/values").VFloat64<number, "required">;
1573
+ currency: import("convex/values").VString<string, "required">;
1574
+ 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>;
1575
+ reason: import("convex/values").VString<string, "required">;
1576
+ isChargeRefundable: import("convex/values").VBoolean<boolean, "required">;
1577
+ lastEvent: import("convex/values").VString<string | undefined, "optional">;
1578
+ evidenceDueBy: import("convex/values").VString<string | undefined, "optional">;
1579
+ evidence: import("convex/values").VAny<any, "optional", string>;
1580
+ statementDescriptor: import("convex/values").VString<string | undefined, "optional">;
1581
+ linkedTransferIds: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
1582
+ metadata: import("convex/values").VAny<any, "optional", string>;
1583
+ }, "required", "accountId" | "amount" | "currency" | "evidence" | "evidenceDueBy" | "isChargeRefundable" | "lastEvent" | "linkedTransferIds" | "metadata" | "reason" | "statementDescriptor" | "status" | "stripeChargeId" | "stripeDisputeId" | "stripePaymentIntentId" | `evidence.${string}` | `metadata.${string}`>, {
1584
+ by_account_id: ["accountId", "_creationTime"];
1585
+ by_account_id_and_status: ["accountId", "status", "_creationTime"];
1586
+ by_payment_intent_id_and_status: ["stripePaymentIntentId", "status", "_creationTime"];
1587
+ by_status: ["status", "_creationTime"];
1588
+ by_stripe_dispute_id: ["stripeDisputeId", "_creationTime"];
1589
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
1590
+ }, {}, {}>;
1591
+ transfers: import("convex/server").TableDefinition<import("convex/values").VObject<{
1592
+ amount: number;
1593
+ currency: string;
1594
+ destinationAccountId: string;
1595
+ metadata?: any;
1596
+ paymentId?: string | undefined;
1597
+ reinstatement?: boolean | undefined;
1598
+ reversalClaimedAmount?: number | undefined;
1599
+ reversalStatus?: "fully_reversed" | "partially_reversed" | undefined;
1600
+ reversedAmount?: number | undefined;
1601
+ role?: "affiliate" | "other" | "store" | undefined;
1602
+ sourceChargeId?: string | undefined;
1603
+ sourceInvoiceId?: string | undefined;
1604
+ status: "failed" | "paid" | "pending" | "reversed";
1605
+ stripeTransferId: string;
1606
+ totalsRecorded?: true | undefined;
1607
+ }, {
1608
+ stripeTransferId: import("convex/values").VString<string, "required">;
1609
+ sourceChargeId: import("convex/values").VString<string | undefined, "optional">;
1610
+ sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
1611
+ destinationAccountId: import("convex/values").VString<string, "required">;
1612
+ amount: import("convex/values").VFloat64<number, "required">;
1613
+ currency: import("convex/values").VString<string, "required">;
1614
+ 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>;
1615
+ 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>;
1616
+ reversedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1617
+ 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>;
1618
+ paymentId: import("convex/values").VString<string | undefined, "optional">;
1619
+ reinstatement: import("convex/values").VBoolean<boolean | undefined, "optional">;
1620
+ metadata: import("convex/values").VAny<any, "optional", string>;
1621
+ totalsRecorded: import("convex/values").VLiteral<true | undefined, "optional">;
1622
+ reversalClaimedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
1623
+ }, "required", "amount" | "currency" | "destinationAccountId" | "metadata" | "paymentId" | "reinstatement" | "reversalClaimedAmount" | "reversalStatus" | "reversedAmount" | "role" | "sourceChargeId" | "sourceInvoiceId" | "status" | "stripeTransferId" | "totalsRecorded" | `metadata.${string}`>, {
1624
+ by_account_totals_recorded: ["destinationAccountId", "totalsRecorded", "_creationTime"];
1625
+ by_destination_account_id: ["destinationAccountId", "_creationTime"];
1626
+ by_source_charge_id: ["sourceChargeId", "_creationTime"];
1627
+ by_stripe_transfer_id: ["stripeTransferId", "_creationTime"];
1628
+ }, {}, {}>;
1629
+ transferReversalOps: import("convex/server").TableDefinition<import("convex/values").VObject<{
1630
+ commissionExposure?: {
1631
+ chargeAmount: number;
1632
+ disputeId?: string | undefined;
1633
+ disputeState?: "lost" | "open" | "won" | undefined;
1634
+ finalized: boolean;
1635
+ kind: "dispute" | "refund";
1636
+ principal: number;
1637
+ refundId?: string | undefined;
1638
+ refundedPrincipal?: number | undefined;
1639
+ } | undefined;
1640
+ operationId: string;
1641
+ slices: {
1642
+ from: number;
1643
+ stripeTransferId: string;
1644
+ to: number;
1645
+ }[];
1646
+ sourceChargeId: string;
1647
+ }, {
1648
+ operationId: import("convex/values").VString<string, "required">;
1649
+ sourceChargeId: import("convex/values").VString<string, "required">;
1650
+ slices: import("convex/values").VArray<{
1651
+ from: number;
1652
+ stripeTransferId: string;
1653
+ to: number;
1654
+ }[], import("convex/values").VObject<{
1655
+ from: number;
1656
+ stripeTransferId: string;
1657
+ to: number;
1658
+ }, {
1659
+ stripeTransferId: import("convex/values").VString<string, "required">;
1660
+ from: import("convex/values").VFloat64<number, "required">;
1661
+ to: import("convex/values").VFloat64<number, "required">;
1662
+ }, "required", "from" | "stripeTransferId" | "to">, "required">;
1663
+ commissionExposure: import("convex/values").VObject<{
1664
+ chargeAmount: number;
1665
+ disputeId?: string | undefined;
1666
+ disputeState?: "lost" | "open" | "won" | undefined;
1667
+ finalized: boolean;
1668
+ kind: "dispute" | "refund";
1669
+ principal: number;
1670
+ refundId?: string | undefined;
1671
+ refundedPrincipal?: number | undefined;
1672
+ } | undefined, {
1673
+ kind: import("convex/values").VUnion<"dispute" | "refund", [import("convex/values").VLiteral<"refund", "required">, import("convex/values").VLiteral<"dispute", "required">], "required", never>;
1674
+ chargeAmount: import("convex/values").VFloat64<number, "required">;
1675
+ principal: import("convex/values").VFloat64<number, "required">;
1676
+ finalized: import("convex/values").VBoolean<boolean, "required">;
1677
+ disputeState: import("convex/values").VUnion<"lost" | "open" | "won" | undefined, [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"lost", "required">, import("convex/values").VLiteral<"won", "required">], "optional", never>;
1678
+ disputeId: import("convex/values").VString<string | undefined, "optional">;
1679
+ refundedPrincipal: import("convex/values").VFloat64<number | undefined, "optional">;
1680
+ refundId: import("convex/values").VString<string | undefined, "optional">;
1681
+ }, "optional", "chargeAmount" | "disputeId" | "disputeState" | "finalized" | "kind" | "principal" | "refundId" | "refundedPrincipal">;
1682
+ }, "required", "commissionExposure" | "commissionExposure.chargeAmount" | "commissionExposure.disputeId" | "commissionExposure.disputeState" | "commissionExposure.finalized" | "commissionExposure.kind" | "commissionExposure.principal" | "commissionExposure.refundId" | "commissionExposure.refundedPrincipal" | "operationId" | "slices" | "sourceChargeId">, {
1683
+ by_operation_id: ["operationId", "_creationTime"];
1684
+ by_source_charge: ["sourceChargeId", "_creationTime"];
1685
+ }, {}, {}>;
1686
+ webhookEvents: import("convex/server").TableDefinition<import("convex/values").VObject<{
1687
+ eventType: string;
1688
+ lastError?: string | undefined;
1689
+ livemode?: boolean | undefined;
1690
+ processedAt: number;
1691
+ status: "failed" | "ignored" | "processed" | "processing";
1692
+ stripeEventId: string;
1693
+ }, {
1694
+ stripeEventId: import("convex/values").VString<string, "required">;
1695
+ eventType: import("convex/values").VString<string, "required">;
1696
+ livemode: import("convex/values").VBoolean<boolean | undefined, "optional">;
1697
+ processedAt: import("convex/values").VFloat64<number, "required">;
1698
+ 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>;
1699
+ lastError: import("convex/values").VString<string | undefined, "optional">;
1700
+ }, "required", "eventType" | "lastError" | "livemode" | "processedAt" | "status" | "stripeEventId">, {
1701
+ by_status: ["status", "_creationTime"];
1702
+ by_stripeEventId: ["stripeEventId", "_creationTime"];
1703
+ }, {}, {}>;
1704
+ }, boolean>>;
1705
+ ctx: import("../helpers.js").RunCtx;
1706
+ provider: {
1707
+ accounts: {
1708
+ listExternalAccounts: import("vitest").Mock<() => Promise<{
1709
+ data: {
1710
+ id: string;
1711
+ object: string;
1712
+ currency: string;
1713
+ default_for_currency: boolean;
1714
+ }[];
1715
+ has_more: boolean;
1716
+ }>>;
1717
+ };
1718
+ transfers: {
1719
+ retrieve: import("vitest").Mock<(id: string) => Promise<{
1720
+ id: string;
1721
+ destination: string;
1722
+ destination_payment: string;
1723
+ source_transaction: string;
1724
+ amount: number;
1725
+ currency: string;
1726
+ amount_reversed: number;
1727
+ }>>;
1728
+ listReversals: import("vitest").Mock<() => Promise<{
1729
+ data: never[];
1730
+ has_more: boolean;
1731
+ }>>;
1732
+ };
1733
+ charges: {
1734
+ retrieve: import("vitest").Mock<(id: string) => Promise<{
1735
+ id: string;
1736
+ source_transfer: string;
1737
+ amount: number;
1738
+ currency: string;
1739
+ paid: boolean;
1740
+ status: string;
1741
+ balance_transaction: string;
1742
+ }>>;
1743
+ };
1744
+ balanceTransactions: {
1745
+ list: import("vitest").Mock<(params: {
1746
+ source?: string;
1747
+ limit?: number;
1748
+ }) => Promise<{
1749
+ data: {
1750
+ id: string;
1751
+ source: string;
1752
+ amount: number;
1753
+ fee: number;
1754
+ net: number;
1755
+ currency: string;
1756
+ created: number;
1757
+ available_on: number;
1758
+ status: string;
1759
+ type: string;
1760
+ exchange_rate: null;
1761
+ }[];
1762
+ has_more: boolean;
1763
+ }>>;
1764
+ retrieve: import("vitest").Mock<(id: string) => Promise<{
1765
+ id: string;
1766
+ source: string;
1767
+ amount: number;
1768
+ fee: number;
1769
+ net: number;
1770
+ currency: string;
1771
+ created: number;
1772
+ available_on: number;
1773
+ status: string;
1774
+ type: string;
1775
+ exchange_rate: null;
1776
+ } | undefined>>;
1777
+ };
1778
+ balance: {
1779
+ retrieve: import("vitest").Mock<() => Promise<{
1780
+ available: {
1781
+ currency: string;
1782
+ amount: number;
1783
+ source_types: {
1784
+ card: number;
1785
+ };
1786
+ }[];
1787
+ pending: never[];
1788
+ }>>;
1789
+ };
1790
+ payouts: {
1791
+ list: import("vitest").Mock<() => Promise<{
1792
+ data: Record<string, unknown>[];
1793
+ has_more: boolean;
1794
+ }>>;
1795
+ retrieve: import("vitest").Mock<(id?: string) => Promise<Record<string, unknown> | undefined>>;
1796
+ create: import("vitest").Mock<(params: {
1797
+ amount: number;
1798
+ currency: string;
1799
+ metadata: object;
1800
+ }) => Promise<Record<string, unknown>>>;
1801
+ };
1802
+ };
1803
+ verify: import("vitest").Mock<() => Promise<{
1804
+ status: "verified";
1805
+ policy: {
1806
+ _creationTime: number;
1807
+ _id: import("convex/values").GenericId<"payoutPolicies">;
1808
+ accountId: string;
1809
+ country: string;
1810
+ holdDeadline?: number | undefined;
1811
+ holdingExpiry?: {
1812
+ balances?: {
1813
+ available: number;
1814
+ currency: string;
1815
+ pending: number;
1816
+ }[] | undefined;
1817
+ deadline: number;
1818
+ observedAt?: number | undefined;
1819
+ status: "balance_remaining" | "claims_unresolved" | "no_held_balance" | "unverified";
1820
+ } | undefined;
1821
+ mode: "custom" | "stripe_managed";
1822
+ operationKey: string;
1823
+ ownerKey: string;
1824
+ previousSchedule?: {
1825
+ interval: "daily" | "manual" | "monthly" | "weekly";
1826
+ monthlyDays?: number[] | undefined;
1827
+ weeklyDays?: string[] | undefined;
1828
+ } | undefined;
1829
+ revision: number;
1830
+ status: "changing" | "ready";
1831
+ thresholds: {
1832
+ amount: number;
1833
+ currency: string;
1834
+ }[];
1835
+ };
1836
+ }>>;
1837
+ run: (extra?: {}) => Promise<import("./payoutExecution.js").PayoutReleaseResult>;
1838
+ setTransactions: (rows: {
1839
+ id: string;
1840
+ source: string;
1841
+ amount: number;
1842
+ fee: number;
1843
+ net: number;
1844
+ currency: string;
1845
+ created: number;
1846
+ available_on: number;
1847
+ status: string;
1848
+ type: string;
1849
+ exchange_rate: null;
1850
+ }[]) => void;
1851
+ transactions: () => {
1852
+ id: string;
1853
+ source: string;
1854
+ amount: number;
1855
+ fee: number;
1856
+ net: number;
1857
+ currency: string;
1858
+ created: number;
1859
+ available_on: number;
1860
+ status: string;
1861
+ type: string;
1862
+ exchange_rate: null;
1863
+ }[];
1864
+ }>;
1865
+ export declare function withHistory(count?: number, amount?: number): Promise<{
1866
+ s: {
1867
+ t: import("convex-test").TestConvex<import("convex/server").SchemaDefinition<{
1868
+ payoutWorkerJobs: import("convex/server").TableDefinition<import("convex/values").VObject<{
1869
+ accountId: string;
1870
+ cadenceMs: number;
1871
+ completedGeneration?: number | undefined;
1872
+ completedOperationKey?: string | undefined;
1873
+ currency: string;
1874
+ generation: number;
1875
+ hasOperation: boolean;
1876
+ lastAttemptAt?: number | undefined;
1877
+ lastReason?: string | undefined;
1878
+ lastResultAt?: number | undefined;
1879
+ leaseUntil?: number | undefined;
1880
+ nextAttemptAt: number;
1881
+ operationKey?: string | undefined;
1882
+ ownerKey: string;
1883
+ sequence: number;
1884
+ }, {
1885
+ accountId: import("convex/values").VString<string, "required">;
1886
+ ownerKey: import("convex/values").VString<string, "required">;
1887
+ currency: import("convex/values").VString<string, "required">;
1888
+ generation: import("convex/values").VFloat64<number, "required">;
1889
+ sequence: import("convex/values").VFloat64<number, "required">;
1890
+ cadenceMs: import("convex/values").VFloat64<number, "required">;
1891
+ nextAttemptAt: import("convex/values").VFloat64<number, "required">;
1892
+ leaseUntil: import("convex/values").VFloat64<number | undefined, "optional">;
1893
+ operationKey: import("convex/values").VString<string | undefined, "optional">;
1894
+ hasOperation: import("convex/values").VBoolean<boolean, "required">;
1895
+ lastReason: import("convex/values").VString<string | undefined, "optional">;
1896
+ lastAttemptAt: import("convex/values").VFloat64<number | undefined, "optional">;
1897
+ lastResultAt: import("convex/values").VFloat64<number | undefined, "optional">;
1898
+ completedGeneration: import("convex/values").VFloat64<number | undefined, "optional">;
1899
+ completedOperationKey: import("convex/values").VString<string | undefined, "optional">;
1900
+ }, "required", "accountId" | "cadenceMs" | "completedGeneration" | "completedOperationKey" | "currency" | "generation" | "hasOperation" | "lastAttemptAt" | "lastReason" | "lastResultAt" | "leaseUntil" | "nextAttemptAt" | "operationKey" | "ownerKey" | "sequence">, {
1901
+ by_account_currency: ["accountId", "currency", "_creationTime"];
1902
+ by_operation_pending: ["hasOperation", "nextAttemptAt", "_creationTime"];
1903
+ }, {}, {}>;
1904
+ payoutFinancialRevisions: import("convex/server").TableDefinition<import("convex/values").VObject<{
1905
+ accountId: string;
1906
+ revision: number;
1907
+ riskRevision: number;
1908
+ }, {
1909
+ accountId: import("convex/values").VString<string, "required">;
1910
+ revision: import("convex/values").VFloat64<number, "required">;
1911
+ riskRevision: import("convex/values").VFloat64<number, "required">;
1912
+ }, "required", "accountId" | "revision" | "riskRevision">, {
1913
+ by_account: ["accountId", "_creationTime"];
1914
+ }, {}, {}>;
1915
+ payoutRiskEvents: import("convex/server").TableDefinition<import("convex/values").VObject<{
1916
+ accountId: string;
1917
+ key: string;
1918
+ kind: "allocation" | "claim" | "fee" | "liability" | "provider_payout" | "transfer";
1919
+ removed?: boolean | undefined;
1920
+ riskRevision: number;
1921
+ }, {
1922
+ accountId: import("convex/values").VString<string, "required">;
1923
+ riskRevision: import("convex/values").VFloat64<number, "required">;
1924
+ kind: import("convex/values").VUnion<"allocation" | "claim" | "fee" | "liability" | "provider_payout" | "transfer", [import("convex/values").VLiteral<"transfer", "required">, import("convex/values").VLiteral<"provider_payout", "required">, import("convex/values").VLiteral<"allocation", "required">, import("convex/values").VLiteral<"claim", "required">, import("convex/values").VLiteral<"fee", "required">, import("convex/values").VLiteral<"liability", "required">], "required", never>;
1925
+ key: import("convex/values").VString<string, "required">;
1926
+ removed: import("convex/values").VBoolean<boolean | undefined, "optional">;
1927
+ }, "required", "accountId" | "key" | "kind" | "removed" | "riskRevision">, {
1928
+ by_account_revision: ["accountId", "riskRevision", "_creationTime"];
1929
+ }, {}, {}>;
1930
+ payoutRiskRevisions: import("convex/server").TableDefinition<import("convex/values").VObject<{
1931
+ accountId: string;
1932
+ riskRevision: number;
1933
+ }, {
1934
+ accountId: import("convex/values").VString<string, "required">;
1935
+ riskRevision: import("convex/values").VFloat64<number, "required">;
1936
+ }, "required", "accountId" | "riskRevision">, {
1937
+ by_account: ["accountId", "_creationTime"];
1938
+ }, {}, {}>;
1939
+ payoutSnapshots: import("convex/server").TableDefinition<import("convex/values").VObject<{
1940
+ accountId: string;
1941
+ allocationCount: number;
1942
+ allocationCursor?: string | undefined;
1943
+ boundOperationKey?: string | undefined;
1944
+ boundRiskRevision?: number | undefined;
1945
+ claimCount: number;
1946
+ claimCursor?: string | undefined;
1947
+ deferredPositiveChanges: boolean;
1948
+ expectedRevision: number;
1949
+ expiresAt: number;
1950
+ feeCount: number;
1951
+ feeCursor?: string | undefined;
1952
+ initialRevision: number;
1953
+ initialRiskRevision: number;
1954
+ observedRevision: number;
1955
+ operationKey: string;
1956
+ ownerKey: string;
1957
+ phase: "allocations" | "check" | "claims" | "discarding" | "fees" | "invalidated" | "local_ready" | "repair" | "sources";
1958
+ policyMode?: string | undefined;
1959
+ policyOperationKey?: string | undefined;
1960
+ providerChanged: boolean;
1961
+ readOnly: boolean;
1962
+ reason?: string | undefined;
1963
+ riskRevision: number;
1964
+ sourceCount: number;
1965
+ sourceCursor?: string | undefined;
1966
+ sourceFence: number;
1967
+ step: number;
1968
+ }, {
1969
+ readOnly: import("convex/values").VBoolean<boolean, "required">;
1970
+ boundOperationKey: import("convex/values").VString<string | undefined, "optional">;
1971
+ boundRiskRevision: import("convex/values").VFloat64<number | undefined, "optional">;
1972
+ accountId: import("convex/values").VString<string, "required">;
1973
+ ownerKey: import("convex/values").VString<string, "required">;
1974
+ operationKey: import("convex/values").VString<string, "required">;
1975
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
1976
+ policyMode: import("convex/values").VString<string | undefined, "optional">;
1977
+ policyOperationKey: import("convex/values").VString<string | undefined, "optional">;
1978
+ phase: import("convex/values").VUnion<"allocations" | "check" | "claims" | "discarding" | "fees" | "invalidated" | "local_ready" | "repair" | "sources", [import("convex/values").VLiteral<"sources", "required">, import("convex/values").VLiteral<"allocations", "required">, import("convex/values").VLiteral<"fees", "required">, import("convex/values").VLiteral<"claims", "required">, import("convex/values").VLiteral<"repair", "required">, import("convex/values").VLiteral<"check", "required">, import("convex/values").VLiteral<"local_ready", "required">, import("convex/values").VLiteral<"invalidated", "required">, import("convex/values").VLiteral<"discarding", "required">], "required", never>;
1979
+ step: import("convex/values").VFloat64<number, "required">;
1980
+ sourceFence: import("convex/values").VFloat64<number, "required">;
1981
+ sourceCursor: import("convex/values").VString<string | undefined, "optional">;
1982
+ allocationCursor: import("convex/values").VString<string | undefined, "optional">;
1983
+ feeCursor: import("convex/values").VString<string | undefined, "optional">;
1984
+ claimCursor: import("convex/values").VString<string | undefined, "optional">;
1985
+ initialRevision: import("convex/values").VFloat64<number, "required">;
1986
+ initialRiskRevision: import("convex/values").VFloat64<number, "required">;
1987
+ riskRevision: import("convex/values").VFloat64<number, "required">;
1988
+ observedRevision: import("convex/values").VFloat64<number, "required">;
1989
+ sourceCount: import("convex/values").VFloat64<number, "required">;
1990
+ allocationCount: import("convex/values").VFloat64<number, "required">;
1991
+ claimCount: import("convex/values").VFloat64<number, "required">;
1992
+ feeCount: import("convex/values").VFloat64<number, "required">;
1993
+ deferredPositiveChanges: import("convex/values").VBoolean<boolean, "required">;
1994
+ providerChanged: import("convex/values").VBoolean<boolean, "required">;
1995
+ expiresAt: import("convex/values").VFloat64<number, "required">;
1996
+ reason: import("convex/values").VString<string | undefined, "optional">;
1997
+ }, "required", "accountId" | "allocationCount" | "allocationCursor" | "boundOperationKey" | "boundRiskRevision" | "claimCount" | "claimCursor" | "deferredPositiveChanges" | "expectedRevision" | "expiresAt" | "feeCount" | "feeCursor" | "initialRevision" | "initialRiskRevision" | "observedRevision" | "operationKey" | "ownerKey" | "phase" | "policyMode" | "policyOperationKey" | "providerChanged" | "readOnly" | "reason" | "riskRevision" | "sourceCount" | "sourceCursor" | "sourceFence" | "step">, {
1998
+ by_account_phase: ["accountId", "phase", "_creationTime"];
1999
+ by_operation: ["operationKey", "_creationTime"];
2000
+ by_read_only: ["readOnly", "_creationTime"];
2001
+ }, {}, {}>;
2002
+ payoutSnapshotSources: import("convex/server").TableDefinition<import("convex/values").VObject<{
2003
+ allocationCurrency?: string | undefined;
2004
+ allocationDocId?: import("convex/values").GenericId<"payoutSourceAllocations"> | undefined;
2005
+ allocationPresent: boolean;
2006
+ amount: number;
2007
+ currency: string;
2008
+ expectedPaid: number;
2009
+ expectedReserved: number;
2010
+ ledgerFingerprint: string;
2011
+ needsCheck: boolean;
2012
+ paidAmount: number;
2013
+ reinstatement: boolean;
2014
+ reservedAmount: number;
2015
+ reversalClaimedAmount: number;
2016
+ reversedAmount: number;
2017
+ role?: string | undefined;
2018
+ snapshotId: import("convex/values").GenericId<"payoutSnapshots">;
2019
+ sourceChargeId?: string | undefined;
2020
+ sourceCreatedAt: number;
2021
+ status: string;
2022
+ stripeTransferId: string;
2023
+ transferDocId?: import("convex/values").GenericId<"transfers"> | undefined;
2024
+ }, {
2025
+ snapshotId: import("convex/values").VId<import("convex/values").GenericId<"payoutSnapshots">, "required">;
2026
+ stripeTransferId: import("convex/values").VString<string, "required">;
2027
+ ledgerFingerprint: import("convex/values").VString<string, "required">;
2028
+ transferDocId: import("convex/values").VId<import("convex/values").GenericId<"transfers"> | undefined, "optional">;
2029
+ allocationDocId: import("convex/values").VId<import("convex/values").GenericId<"payoutSourceAllocations"> | undefined, "optional">;
2030
+ sourceCreatedAt: import("convex/values").VFloat64<number, "required">;
2031
+ currency: import("convex/values").VString<string, "required">;
2032
+ amount: import("convex/values").VFloat64<number, "required">;
2033
+ status: import("convex/values").VString<string, "required">;
2034
+ role: import("convex/values").VString<string | undefined, "optional">;
2035
+ sourceChargeId: import("convex/values").VString<string | undefined, "optional">;
2036
+ reversedAmount: import("convex/values").VFloat64<number, "required">;
2037
+ reversalClaimedAmount: import("convex/values").VFloat64<number, "required">;
2038
+ reinstatement: import("convex/values").VBoolean<boolean, "required">;
2039
+ allocationPresent: import("convex/values").VBoolean<boolean, "required">;
2040
+ allocationCurrency: import("convex/values").VString<string | undefined, "optional">;
2041
+ paidAmount: import("convex/values").VFloat64<number, "required">;
2042
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
2043
+ expectedPaid: import("convex/values").VFloat64<number, "required">;
2044
+ expectedReserved: import("convex/values").VFloat64<number, "required">;
2045
+ needsCheck: import("convex/values").VBoolean<boolean, "required">;
2046
+ }, "required", "allocationCurrency" | "allocationDocId" | "allocationPresent" | "amount" | "currency" | "expectedPaid" | "expectedReserved" | "ledgerFingerprint" | "needsCheck" | "paidAmount" | "reinstatement" | "reservedAmount" | "reversalClaimedAmount" | "reversedAmount" | "role" | "snapshotId" | "sourceChargeId" | "sourceCreatedAt" | "status" | "stripeTransferId" | "transferDocId">, {
2047
+ by_snapshot: ["snapshotId", "_creationTime"];
2048
+ by_snapshot_check: ["snapshotId", "needsCheck", "_creationTime"];
2049
+ by_snapshot_transfer: ["snapshotId", "stripeTransferId", "_creationTime"];
2050
+ }, {}, {}>;
2051
+ payoutSnapshotClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
2052
+ allocations: {
2053
+ amount: number;
2054
+ role?: string | undefined;
2055
+ stripeTransferId: string;
2056
+ }[];
2057
+ amount: number;
2058
+ currency: string;
2059
+ fingerprint: string;
2060
+ historical?: boolean | undefined;
2061
+ operationKey: string;
2062
+ providerFee?: number | undefined;
2063
+ snapshotId: import("convex/values").GenericId<"payoutSnapshots">;
2064
+ status: string;
2065
+ stripePayoutId?: string | undefined;
2066
+ }, {
2067
+ snapshotId: import("convex/values").VId<import("convex/values").GenericId<"payoutSnapshots">, "required">;
2068
+ operationKey: import("convex/values").VString<string, "required">;
2069
+ fingerprint: import("convex/values").VString<string, "required">;
2070
+ currency: import("convex/values").VString<string, "required">;
2071
+ amount: import("convex/values").VFloat64<number, "required">;
2072
+ status: import("convex/values").VString<string, "required">;
2073
+ stripePayoutId: import("convex/values").VString<string | undefined, "optional">;
2074
+ historical: import("convex/values").VBoolean<boolean | undefined, "optional">;
2075
+ providerFee: import("convex/values").VFloat64<number | undefined, "optional">;
2076
+ allocations: import("convex/values").VArray<{
2077
+ amount: number;
2078
+ role?: string | undefined;
2079
+ stripeTransferId: string;
2080
+ }[], import("convex/values").VObject<{
2081
+ amount: number;
2082
+ role?: string | undefined;
2083
+ stripeTransferId: string;
2084
+ }, {
2085
+ stripeTransferId: import("convex/values").VString<string, "required">;
2086
+ amount: import("convex/values").VFloat64<number, "required">;
2087
+ role: import("convex/values").VString<string | undefined, "optional">;
2088
+ }, "required", "amount" | "role" | "stripeTransferId">, "required">;
2089
+ }, "required", "allocations" | "amount" | "currency" | "fingerprint" | "historical" | "operationKey" | "providerFee" | "snapshotId" | "status" | "stripePayoutId">, {
2090
+ by_snapshot: ["snapshotId", "_creationTime"];
2091
+ by_snapshot_operation: ["snapshotId", "operationKey", "_creationTime"];
2092
+ }, {}, {}>;
2093
+ payoutSnapshotFees: import("convex/server").TableDefinition<import("convex/values").VObject<{
2094
+ amount: number;
2095
+ currency: string;
2096
+ revision: number;
2097
+ snapshotId: import("convex/values").GenericId<"payoutSnapshots">;
2098
+ }, {
2099
+ snapshotId: import("convex/values").VId<import("convex/values").GenericId<"payoutSnapshots">, "required">;
2100
+ currency: import("convex/values").VString<string, "required">;
2101
+ amount: import("convex/values").VFloat64<number, "required">;
2102
+ revision: import("convex/values").VFloat64<number, "required">;
2103
+ }, "required", "amount" | "currency" | "revision" | "snapshotId">, {
2104
+ by_snapshot: ["snapshotId", "_creationTime"];
2105
+ by_snapshot_currency: ["snapshotId", "currency", "_creationTime"];
2106
+ }, {}, {}>;
2107
+ affiliateObligations: import("convex/server").TableDefinition<import("convex/values").VObject<{
2108
+ accounted?: boolean | undefined;
2109
+ activeOperationId?: import("convex/values").GenericId<"affiliateRecoveryOperations"> | undefined;
2110
+ affiliateAccountId: string;
2111
+ chargeAmount: number;
2112
+ creditAmount?: number | undefined;
2113
+ currency: string;
2114
+ debtAmount?: number | undefined;
2115
+ debtStatus?: "open" | "settled" | undefined;
2116
+ disputeId?: string | undefined;
2117
+ disputeState?: "lost" | "open" | "won" | undefined;
2118
+ disputedPrincipal: number;
2119
+ earningId?: import("convex/values").GenericId<"affiliateEarnings"> | undefined;
2120
+ finalizedAmount: number;
2121
+ lastError?: string | undefined;
2122
+ lastRefundId?: string | undefined;
2123
+ lastState?: string | undefined;
2124
+ legacyReceiptIds?: string[] | undefined;
2125
+ legacyRestorationIds?: string[] | undefined;
2126
+ lostPrincipal: number;
2127
+ needsReconciliation: boolean;
2128
+ offsetAmount?: number | undefined;
2129
+ operationSequence?: number | undefined;
2130
+ operatorNote?: string | undefined;
2131
+ originalCommission: number;
2132
+ paymentId?: string | undefined;
2133
+ paymentIntentId?: string | undefined;
2134
+ provisionalAmount: number;
2135
+ recoveredAmount: number;
2136
+ refundedPrincipal: number;
2137
+ releasedCommission?: number | undefined;
2138
+ reservedRecovery?: number | undefined;
2139
+ reservedRestoration?: number | undefined;
2140
+ restoredAmount?: number | undefined;
2141
+ sourceChargeId: string;
2142
+ sourceInvoiceId?: string | undefined;
2143
+ storeAccountId?: string | undefined;
2144
+ stripeTransferId?: string | undefined;
2145
+ }, {
2146
+ stripeTransferId: import("convex/values").VString<string | undefined, "optional">;
2147
+ sourceChargeId: import("convex/values").VString<string, "required">;
2148
+ sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
2149
+ paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
2150
+ paymentId: import("convex/values").VString<string | undefined, "optional">;
2151
+ storeAccountId: import("convex/values").VString<string | undefined, "optional">;
2152
+ lastRefundId: import("convex/values").VString<string | undefined, "optional">;
2153
+ affiliateAccountId: import("convex/values").VString<string, "required">;
2154
+ currency: import("convex/values").VString<string, "required">;
2155
+ chargeAmount: import("convex/values").VFloat64<number, "required">;
2156
+ originalCommission: import("convex/values").VFloat64<number, "required">;
2157
+ refundedPrincipal: import("convex/values").VFloat64<number, "required">;
2158
+ disputedPrincipal: import("convex/values").VFloat64<number, "required">;
2159
+ lostPrincipal: import("convex/values").VFloat64<number, "required">;
2160
+ finalizedAmount: import("convex/values").VFloat64<number, "required">;
2161
+ provisionalAmount: import("convex/values").VFloat64<number, "required">;
2162
+ recoveredAmount: import("convex/values").VFloat64<number, "required">;
2163
+ needsReconciliation: import("convex/values").VBoolean<boolean, "required">;
2164
+ accounted: import("convex/values").VBoolean<boolean | undefined, "optional">;
2165
+ legacyReceiptIds: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
2166
+ legacyRestorationIds: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
2167
+ operatorNote: import("convex/values").VString<string | undefined, "optional">;
2168
+ earningId: import("convex/values").VId<import("convex/values").GenericId<"affiliateEarnings"> | undefined, "optional">;
2169
+ releasedCommission: import("convex/values").VFloat64<number | undefined, "optional">;
2170
+ offsetAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2171
+ restoredAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2172
+ reservedRecovery: import("convex/values").VFloat64<number | undefined, "optional">;
2173
+ reservedRestoration: import("convex/values").VFloat64<number | undefined, "optional">;
2174
+ debtAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2175
+ creditAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2176
+ debtStatus: import("convex/values").VUnion<"open" | "settled" | undefined, [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"settled", "required">], "optional", never>;
2177
+ disputeState: import("convex/values").VUnion<"lost" | "open" | "won" | undefined, [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"lost", "required">, import("convex/values").VLiteral<"won", "required">], "optional", never>;
2178
+ disputeId: import("convex/values").VString<string | undefined, "optional">;
2179
+ activeOperationId: import("convex/values").VId<import("convex/values").GenericId<"affiliateRecoveryOperations"> | undefined, "optional">;
2180
+ lastState: import("convex/values").VString<string | undefined, "optional">;
2181
+ lastError: import("convex/values").VString<string | undefined, "optional">;
2182
+ operationSequence: import("convex/values").VFloat64<number | undefined, "optional">;
2183
+ }, "required", "accounted" | "activeOperationId" | "affiliateAccountId" | "chargeAmount" | "creditAmount" | "currency" | "debtAmount" | "debtStatus" | "disputeId" | "disputeState" | "disputedPrincipal" | "earningId" | "finalizedAmount" | "lastError" | "lastRefundId" | "lastState" | "legacyReceiptIds" | "legacyRestorationIds" | "lostPrincipal" | "needsReconciliation" | "offsetAmount" | "operationSequence" | "operatorNote" | "originalCommission" | "paymentId" | "paymentIntentId" | "provisionalAmount" | "recoveredAmount" | "refundedPrincipal" | "releasedCommission" | "reservedRecovery" | "reservedRestoration" | "restoredAmount" | "sourceChargeId" | "sourceInvoiceId" | "storeAccountId" | "stripeTransferId">, {
2184
+ by_affiliate_currency: ["affiliateAccountId", "currency", "_creationTime"];
2185
+ by_affiliate_currency_debt: ["affiliateAccountId", "currency", "debtStatus", "_creationTime"];
2186
+ by_charge: ["sourceChargeId", "_creationTime"];
2187
+ by_transfer: ["stripeTransferId", "_creationTime"];
2188
+ }, {}, {}>;
2189
+ affiliateRecoveryOperations: import("convex/server").TableDefinition<import("convex/values").VObject<{
2190
+ amount: number;
2191
+ attempted: boolean;
2192
+ createdAt: number;
2193
+ error?: string | undefined;
2194
+ kind: "recovery" | "restoration";
2195
+ obligationId: import("convex/values").GenericId<"affiliateObligations">;
2196
+ providerBaseline?: number | undefined;
2197
+ receiptId?: string | undefined;
2198
+ sourceEventId?: string | undefined;
2199
+ state: "canceled" | "failed" | "insufficient_balance" | "pending" | "succeeded" | "unknown" | "unsupported";
2200
+ }, {
2201
+ obligationId: import("convex/values").VId<import("convex/values").GenericId<"affiliateObligations">, "required">;
2202
+ sourceEventId: import("convex/values").VString<string | undefined, "optional">;
2203
+ kind: import("convex/values").VUnion<"recovery" | "restoration", [import("convex/values").VLiteral<"recovery", "required">, import("convex/values").VLiteral<"restoration", "required">], "required", never>;
2204
+ amount: import("convex/values").VFloat64<number, "required">;
2205
+ state: import("convex/values").VUnion<"canceled" | "failed" | "insufficient_balance" | "pending" | "succeeded" | "unknown" | "unsupported", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"insufficient_balance", "required">, import("convex/values").VLiteral<"unsupported", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"succeeded", "required">, import("convex/values").VLiteral<"canceled", "required">], "required", never>;
2206
+ receiptId: import("convex/values").VString<string | undefined, "optional">;
2207
+ error: import("convex/values").VString<string | undefined, "optional">;
2208
+ attempted: import("convex/values").VBoolean<boolean, "required">;
2209
+ providerBaseline: import("convex/values").VFloat64<number | undefined, "optional">;
2210
+ createdAt: import("convex/values").VFloat64<number, "required">;
2211
+ }, "required", "amount" | "attempted" | "createdAt" | "error" | "kind" | "obligationId" | "providerBaseline" | "receiptId" | "sourceEventId" | "state">, {
2212
+ by_obligation: ["obligationId", "_creationTime"];
2213
+ by_state: ["state", "_creationTime"];
2214
+ }, {}, {}>;
2215
+ affiliatePayoutReleases: import("convex/server").TableDefinition<import("convex/values").VObject<{
2216
+ affiliateAccountId: string;
2217
+ amount: number;
2218
+ createdAt: number;
2219
+ currency: string;
2220
+ minimumAmount: number;
2221
+ operationKey: string;
2222
+ state: "failed" | "pending" | "submitted" | "unknown";
2223
+ stripePayoutId?: string | undefined;
2224
+ }, {
2225
+ affiliateAccountId: import("convex/values").VString<string, "required">;
2226
+ currency: import("convex/values").VString<string, "required">;
2227
+ operationKey: import("convex/values").VString<string, "required">;
2228
+ amount: import("convex/values").VFloat64<number, "required">;
2229
+ minimumAmount: import("convex/values").VFloat64<number, "required">;
2230
+ state: import("convex/values").VUnion<"failed" | "pending" | "submitted" | "unknown", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"submitted", "required">, import("convex/values").VLiteral<"failed", "required">], "required", never>;
2231
+ stripePayoutId: import("convex/values").VString<string | undefined, "optional">;
2232
+ createdAt: import("convex/values").VFloat64<number, "required">;
2233
+ }, "required", "affiliateAccountId" | "amount" | "createdAt" | "currency" | "minimumAmount" | "operationKey" | "state" | "stripePayoutId">, {
2234
+ by_key: ["operationKey", "_creationTime"];
2235
+ by_state: ["state", "_creationTime"];
2236
+ }, {}, {}>;
2237
+ affiliateEarnings: import("convex/server").TableDefinition<import("convex/values").VObject<{
2238
+ affiliateAccountId: string;
2239
+ currency: string;
2240
+ originalCommission: number;
2241
+ paymentIntentId?: string | undefined;
2242
+ releaseAmount: number;
2243
+ sourceChargeId: string;
2244
+ sourceInvoiceId?: string | undefined;
2245
+ status: "paid" | "reserved";
2246
+ stripeTransferId?: string | undefined;
2247
+ withheldAmount: number;
2248
+ }, {
2249
+ sourceChargeId: import("convex/values").VString<string, "required">;
2250
+ affiliateAccountId: import("convex/values").VString<string, "required">;
2251
+ currency: import("convex/values").VString<string, "required">;
2252
+ originalCommission: import("convex/values").VFloat64<number, "required">;
2253
+ withheldAmount: import("convex/values").VFloat64<number, "required">;
2254
+ releaseAmount: import("convex/values").VFloat64<number, "required">;
2255
+ sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
2256
+ paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
2257
+ stripeTransferId: import("convex/values").VString<string | undefined, "optional">;
2258
+ status: import("convex/values").VUnion<"paid" | "reserved", [import("convex/values").VLiteral<"reserved", "required">, import("convex/values").VLiteral<"paid", "required">], "required", never>;
2259
+ }, "required", "affiliateAccountId" | "currency" | "originalCommission" | "paymentIntentId" | "releaseAmount" | "sourceChargeId" | "sourceInvoiceId" | "status" | "stripeTransferId" | "withheldAmount">, {
2260
+ by_affiliate_currency: ["affiliateAccountId", "currency", "_creationTime"];
2261
+ by_charge_affiliate: ["sourceChargeId", "affiliateAccountId", "_creationTime"];
2262
+ }, {}, {}>;
2263
+ affiliateOffsets: import("convex/server").TableDefinition<import("convex/values").VObject<{
2264
+ amount: number;
2265
+ earningId: import("convex/values").GenericId<"affiliateEarnings">;
2266
+ obligationId: import("convex/values").GenericId<"affiliateObligations">;
2267
+ }, {
2268
+ earningId: import("convex/values").VId<import("convex/values").GenericId<"affiliateEarnings">, "required">;
2269
+ obligationId: import("convex/values").VId<import("convex/values").GenericId<"affiliateObligations">, "required">;
2270
+ amount: import("convex/values").VFloat64<number, "required">;
2271
+ }, "required", "amount" | "earningId" | "obligationId">, {
2272
+ by_earning: ["earningId", "_creationTime"];
2273
+ by_obligation: ["obligationId", "_creationTime"];
2274
+ }, {}, {}>;
2275
+ affiliateRecoveryBalances: import("convex/server").TableDefinition<import("convex/values").VObject<{
2276
+ activePayoutKey?: string | undefined;
2277
+ affiliateAccountId: string;
2278
+ currency: string;
2279
+ netPayable: number;
2280
+ offsetAmount: number;
2281
+ originalCommission: number;
2282
+ outstandingDebt: number;
2283
+ pendingPayoutAmount?: number | undefined;
2284
+ recoveredAmount: number;
2285
+ reservedRecovery: number;
2286
+ reservedRestoration: number;
2287
+ restorationDue: number;
2288
+ restoredAmount: number;
2289
+ withheldAmount: number;
2290
+ }, {
2291
+ activePayoutKey: import("convex/values").VString<string | undefined, "optional">;
2292
+ pendingPayoutAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2293
+ affiliateAccountId: import("convex/values").VString<string, "required">;
2294
+ currency: import("convex/values").VString<string, "required">;
2295
+ originalCommission: import("convex/values").VFloat64<number, "required">;
2296
+ recoveredAmount: import("convex/values").VFloat64<number, "required">;
2297
+ offsetAmount: import("convex/values").VFloat64<number, "required">;
2298
+ restoredAmount: import("convex/values").VFloat64<number, "required">;
2299
+ outstandingDebt: import("convex/values").VFloat64<number, "required">;
2300
+ reservedRecovery: import("convex/values").VFloat64<number, "required">;
2301
+ reservedRestoration: import("convex/values").VFloat64<number, "required">;
2302
+ restorationDue: import("convex/values").VFloat64<number, "required">;
2303
+ withheldAmount: import("convex/values").VFloat64<number, "required">;
2304
+ netPayable: import("convex/values").VFloat64<number, "required">;
2305
+ }, "required", "activePayoutKey" | "affiliateAccountId" | "currency" | "netPayable" | "offsetAmount" | "originalCommission" | "outstandingDebt" | "pendingPayoutAmount" | "recoveredAmount" | "reservedRecovery" | "reservedRestoration" | "restorationDue" | "restoredAmount" | "withheldAmount">, {
2306
+ by_affiliate_currency: ["affiliateAccountId", "currency", "_creationTime"];
2307
+ }, {}, {}>;
2308
+ affiliateReversalReceipts: import("convex/server").TableDefinition<import("convex/values").VObject<{
2309
+ amount: number;
2310
+ operationId: string;
2311
+ stripeReversalId: string;
2312
+ stripeTransferId: string;
2313
+ }, {
2314
+ stripeReversalId: import("convex/values").VString<string, "required">;
2315
+ stripeTransferId: import("convex/values").VString<string, "required">;
2316
+ operationId: import("convex/values").VString<string, "required">;
2317
+ amount: import("convex/values").VFloat64<number, "required">;
2318
+ }, "required", "amount" | "operationId" | "stripeReversalId" | "stripeTransferId">, {
2319
+ by_receipt: ["stripeReversalId", "_creationTime"];
2320
+ by_transfer: ["stripeTransferId", "_creationTime"];
2321
+ by_transfer_operation: ["stripeTransferId", "operationId", "_creationTime"];
2322
+ }, {}, {}>;
2323
+ payoutSyncClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
2324
+ acceptedAt?: number | undefined;
2325
+ acceptedFingerprint?: string | undefined;
2326
+ acceptedGeneration?: number | undefined;
2327
+ accountId: string;
2328
+ generation: number;
2329
+ startedAt: number;
2330
+ status: "accepted" | "pending" | "unknown";
2331
+ stripePayoutId: string;
2332
+ }, {
2333
+ stripePayoutId: import("convex/values").VString<string, "required">;
2334
+ accountId: import("convex/values").VString<string, "required">;
2335
+ generation: import("convex/values").VFloat64<number, "required">;
2336
+ 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>;
2337
+ startedAt: import("convex/values").VFloat64<number, "required">;
2338
+ acceptedGeneration: import("convex/values").VFloat64<number | undefined, "optional">;
2339
+ acceptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
2340
+ acceptedFingerprint: import("convex/values").VString<string | undefined, "optional">;
2341
+ }, "required", "acceptedAt" | "acceptedFingerprint" | "acceptedGeneration" | "accountId" | "generation" | "startedAt" | "status" | "stripePayoutId">, {
2342
+ by_stripe_payout_id: ["stripePayoutId", "_creationTime"];
2343
+ }, {}, {}>;
2344
+ payoutFeeBalances: import("convex/server").TableDefinition<import("convex/values").VObject<{
2345
+ accountId: string;
2346
+ amount: number;
2347
+ currency: string;
2348
+ ownerKey: string;
2349
+ revision: number;
2350
+ }, {
2351
+ accountId: import("convex/values").VString<string, "required">;
2352
+ ownerKey: import("convex/values").VString<string, "required">;
2353
+ currency: import("convex/values").VString<string, "required">;
2354
+ amount: import("convex/values").VFloat64<number, "required">;
2355
+ revision: import("convex/values").VFloat64<number, "required">;
2356
+ }, "required", "accountId" | "amount" | "currency" | "ownerKey" | "revision">, {
2357
+ by_account_currency: ["accountId", "currency", "_creationTime"];
2358
+ }, {}, {}>;
2359
+ payoutReleaseClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
2360
+ accountId: string;
2361
+ allocations: {
2362
+ amount: number;
2363
+ role?: "affiliate" | "other" | "store" | undefined;
2364
+ stripeTransferId: string;
2365
+ }[];
2366
+ amount: number;
2367
+ attemptedAt?: number | undefined;
2368
+ currency: string;
2369
+ debitFee?: number | undefined;
2370
+ debitTransactionId?: string | undefined;
2371
+ destinationId?: string | undefined;
2372
+ expectedRevision: number;
2373
+ feeRevision?: number | undefined;
2374
+ historical?: boolean | undefined;
2375
+ independentLiabilities?: number | undefined;
2376
+ liabilityRevision?: number | undefined;
2377
+ observations: {
2378
+ currency: string;
2379
+ ledgerFingerprint: string;
2380
+ matureNet: number;
2381
+ observedAt: number;
2382
+ pendingCredits: number;
2383
+ stripeTransferId: string;
2384
+ transactionIds: string[];
2385
+ }[];
2386
+ operationKey: string;
2387
+ ownerKey: string;
2388
+ providerFee?: number | undefined;
2389
+ rejection?: {
2390
+ code: "amount_too_small" | "balance_insufficient";
2391
+ requestId: string;
2392
+ } | undefined;
2393
+ returnTransactionId?: string | undefined;
2394
+ snapshotId?: import("convex/values").GenericId<"payoutSnapshots"> | undefined;
2395
+ status: "canceled" | "paid" | "rejected" | "reserved" | "returned" | "submitted";
2396
+ stripePayoutId?: string | undefined;
2397
+ }, {
2398
+ accountId: import("convex/values").VString<string, "required">;
2399
+ ownerKey: import("convex/values").VString<string, "required">;
2400
+ historical: import("convex/values").VBoolean<boolean | undefined, "optional">;
2401
+ snapshotId: import("convex/values").VId<import("convex/values").GenericId<"payoutSnapshots"> | undefined, "optional">;
2402
+ liabilityRevision: import("convex/values").VFloat64<number | undefined, "optional">;
2403
+ independentLiabilities: import("convex/values").VFloat64<number | undefined, "optional">;
2404
+ operationKey: import("convex/values").VString<string, "required">;
2405
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
2406
+ currency: import("convex/values").VString<string, "required">;
2407
+ amount: import("convex/values").VFloat64<number, "required">;
2408
+ destinationId: import("convex/values").VString<string | undefined, "optional">;
2409
+ allocations: import("convex/values").VArray<{
2410
+ amount: number;
2411
+ role?: "affiliate" | "other" | "store" | undefined;
2412
+ stripeTransferId: string;
2413
+ }[], import("convex/values").VObject<{
2414
+ amount: number;
2415
+ role?: "affiliate" | "other" | "store" | undefined;
2416
+ stripeTransferId: string;
2417
+ }, {
2418
+ stripeTransferId: import("convex/values").VString<string, "required">;
2419
+ amount: import("convex/values").VFloat64<number, "required">;
2420
+ 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>;
2421
+ }, "required", "amount" | "role" | "stripeTransferId">, "required">;
2422
+ observations: import("convex/values").VArray<{
2423
+ currency: string;
2424
+ ledgerFingerprint: string;
2425
+ matureNet: number;
2426
+ observedAt: number;
2427
+ pendingCredits: number;
2428
+ stripeTransferId: string;
2429
+ transactionIds: string[];
2430
+ }[], import("convex/values").VObject<{
2431
+ currency: string;
2432
+ ledgerFingerprint: string;
2433
+ matureNet: number;
2434
+ observedAt: number;
2435
+ pendingCredits: number;
2436
+ stripeTransferId: string;
2437
+ transactionIds: string[];
2438
+ }, {
2439
+ stripeTransferId: import("convex/values").VString<string, "required">;
2440
+ currency: import("convex/values").VString<string, "required">;
2441
+ matureNet: import("convex/values").VFloat64<number, "required">;
2442
+ pendingCredits: import("convex/values").VFloat64<number, "required">;
2443
+ ledgerFingerprint: import("convex/values").VString<string, "required">;
2444
+ observedAt: import("convex/values").VFloat64<number, "required">;
2445
+ transactionIds: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
2446
+ }, "required", "currency" | "ledgerFingerprint" | "matureNet" | "observedAt" | "pendingCredits" | "stripeTransferId" | "transactionIds">, "required">;
2447
+ 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>;
2448
+ attemptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
2449
+ stripePayoutId: import("convex/values").VString<string | undefined, "optional">;
2450
+ returnTransactionId: import("convex/values").VString<string | undefined, "optional">;
2451
+ feeRevision: import("convex/values").VFloat64<number | undefined, "optional">;
2452
+ debitTransactionId: import("convex/values").VString<string | undefined, "optional">;
2453
+ debitFee: import("convex/values").VFloat64<number | undefined, "optional">;
2454
+ providerFee: import("convex/values").VFloat64<number | undefined, "optional">;
2455
+ rejection: import("convex/values").VObject<{
2456
+ code: "amount_too_small" | "balance_insufficient";
2457
+ requestId: string;
2458
+ } | undefined, {
2459
+ requestId: import("convex/values").VString<string, "required">;
2460
+ 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>;
2461
+ }, "optional", "code" | "requestId">;
2462
+ }, "required", "accountId" | "allocations" | "amount" | "attemptedAt" | "currency" | "debitFee" | "debitTransactionId" | "destinationId" | "expectedRevision" | "feeRevision" | "historical" | "independentLiabilities" | "liabilityRevision" | "observations" | "operationKey" | "ownerKey" | "providerFee" | "rejection" | "rejection.code" | "rejection.requestId" | "returnTransactionId" | "snapshotId" | "status" | "stripePayoutId">, {
2463
+ by_account_status: ["accountId", "status", "_creationTime"];
2464
+ by_debit_receipt: ["debitTransactionId", "_creationTime"];
2465
+ by_operation: ["operationKey", "_creationTime"];
2466
+ by_provider_payout: ["stripePayoutId", "_creationTime"];
2467
+ by_rejection_request: ["rejection.requestId", "_creationTime"];
2468
+ by_return_receipt: ["returnTransactionId", "_creationTime"];
2469
+ by_status: ["status", "_creationTime"];
2470
+ }, {}, {}>;
2471
+ payoutSourceAllocations: import("convex/server").TableDefinition<import("convex/values").VObject<{
2472
+ accountId: string;
2473
+ currency: string;
2474
+ ownerKey: string;
2475
+ paidAmount: number;
2476
+ reservedAmount: number;
2477
+ stripeTransferId: string;
2478
+ }, {
2479
+ accountId: import("convex/values").VString<string, "required">;
2480
+ ownerKey: import("convex/values").VString<string, "required">;
2481
+ stripeTransferId: import("convex/values").VString<string, "required">;
2482
+ currency: import("convex/values").VString<string, "required">;
2483
+ paidAmount: import("convex/values").VFloat64<number, "required">;
2484
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
2485
+ }, "required", "accountId" | "currency" | "ownerKey" | "paidAmount" | "reservedAmount" | "stripeTransferId">, {
2486
+ by_account: ["accountId", "_creationTime"];
2487
+ by_transfer: ["stripeTransferId", "_creationTime"];
2488
+ }, {}, {}>;
2489
+ payoutPolicies: import("convex/server").TableDefinition<import("convex/values").VObject<{
2490
+ accountId: string;
2491
+ country: string;
2492
+ holdDeadline?: number | undefined;
2493
+ holdingExpiry?: {
2494
+ balances?: {
2495
+ available: number;
2496
+ currency: string;
2497
+ pending: number;
2498
+ }[] | undefined;
2499
+ deadline: number;
2500
+ observedAt?: number | undefined;
2501
+ status: "balance_remaining" | "claims_unresolved" | "no_held_balance" | "unverified";
2502
+ } | undefined;
2503
+ mode: "custom" | "stripe_managed";
2504
+ operationKey: string;
2505
+ ownerKey: string;
2506
+ previousSchedule?: {
2507
+ interval: "daily" | "manual" | "monthly" | "weekly";
2508
+ monthlyDays?: number[] | undefined;
2509
+ weeklyDays?: string[] | undefined;
2510
+ } | undefined;
2511
+ revision: number;
2512
+ status: "changing" | "ready";
2513
+ thresholds: {
2514
+ amount: number;
2515
+ currency: string;
2516
+ }[];
2517
+ }, {
2518
+ accountId: import("convex/values").VString<string, "required">;
2519
+ ownerKey: import("convex/values").VString<string, "required">;
2520
+ revision: import("convex/values").VFloat64<number, "required">;
2521
+ mode: import("convex/values").VUnion<"custom" | "stripe_managed", [import("convex/values").VLiteral<"stripe_managed", "required">, import("convex/values").VLiteral<"custom", "required">], "required", never>;
2522
+ thresholds: import("convex/values").VArray<{
2523
+ amount: number;
2524
+ currency: string;
2525
+ }[], import("convex/values").VObject<{
2526
+ amount: number;
2527
+ currency: string;
2528
+ }, {
2529
+ currency: import("convex/values").VString<string, "required">;
2530
+ amount: import("convex/values").VFloat64<number, "required">;
2531
+ }, "required", "amount" | "currency">, "required">;
2532
+ status: import("convex/values").VUnion<"changing" | "ready", [import("convex/values").VLiteral<"changing", "required">, import("convex/values").VLiteral<"ready", "required">], "required", never>;
2533
+ operationKey: import("convex/values").VString<string, "required">;
2534
+ country: import("convex/values").VString<string, "required">;
2535
+ previousSchedule: import("convex/values").VObject<{
2536
+ interval: "daily" | "manual" | "monthly" | "weekly";
2537
+ monthlyDays?: number[] | undefined;
2538
+ weeklyDays?: string[] | undefined;
2539
+ } | undefined, {
2540
+ 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>;
2541
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
2542
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
2543
+ }, "optional", "interval" | "monthlyDays" | "weeklyDays">;
2544
+ holdDeadline: import("convex/values").VFloat64<number | undefined, "optional">;
2545
+ holdingExpiry: import("convex/values").VObject<{
2546
+ balances?: {
2547
+ available: number;
2548
+ currency: string;
2549
+ pending: number;
2550
+ }[] | undefined;
2551
+ deadline: number;
2552
+ observedAt?: number | undefined;
2553
+ status: "balance_remaining" | "claims_unresolved" | "no_held_balance" | "unverified";
2554
+ } | undefined, {
2555
+ deadline: import("convex/values").VFloat64<number, "required">;
2556
+ status: import("convex/values").VUnion<"balance_remaining" | "claims_unresolved" | "no_held_balance" | "unverified", [import("convex/values").VLiteral<"unverified", "required">, import("convex/values").VLiteral<"balance_remaining", "required">, import("convex/values").VLiteral<"claims_unresolved", "required">, import("convex/values").VLiteral<"no_held_balance", "required">], "required", never>;
2557
+ observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
2558
+ balances: import("convex/values").VArray<{
2559
+ available: number;
2560
+ currency: string;
2561
+ pending: number;
2562
+ }[] | undefined, import("convex/values").VObject<{
2563
+ available: number;
2564
+ currency: string;
2565
+ pending: number;
2566
+ }, {
2567
+ currency: import("convex/values").VString<string, "required">;
2568
+ available: import("convex/values").VFloat64<number, "required">;
2569
+ pending: import("convex/values").VFloat64<number, "required">;
2570
+ }, "required", "available" | "currency" | "pending">, "optional">;
2571
+ }, "optional", "balances" | "deadline" | "observedAt" | "status">;
2572
+ }, "required", "accountId" | "country" | "holdDeadline" | "holdingExpiry" | "holdingExpiry.balances" | "holdingExpiry.deadline" | "holdingExpiry.observedAt" | "holdingExpiry.status" | "mode" | "operationKey" | "ownerKey" | "previousSchedule" | "previousSchedule.interval" | "previousSchedule.monthlyDays" | "previousSchedule.weeklyDays" | "revision" | "status" | "thresholds">, {
2573
+ by_account: ["accountId", "_creationTime"];
2574
+ by_deadline: ["holdDeadline", "_creationTime"];
2575
+ by_mode_status: ["mode", "status", "_creationTime"];
2576
+ by_status: ["status", "_creationTime"];
2577
+ }, {}, {}>;
2578
+ payoutPolicyOperations: import("convex/server").TableDefinition<import("convex/values").VObject<{
2579
+ accountId: string;
2580
+ adoption?: {
2581
+ claims: {
2582
+ fingerprint: string;
2583
+ operationKey: string;
2584
+ }[];
2585
+ collectionKey?: string | undefined;
2586
+ observations: {
2587
+ currency: string;
2588
+ ledgerFingerprint: string;
2589
+ matureNet: number;
2590
+ observedAt: number;
2591
+ pendingCredits: number;
2592
+ stripeTransferId: string;
2593
+ transactionIds: string[];
2594
+ }[];
2595
+ oldestHeldAt?: number | undefined;
2596
+ snapshotId?: import("convex/values").GenericId<"payoutSnapshots"> | undefined;
2597
+ } | undefined;
2598
+ attempted?: boolean | undefined;
2599
+ country: string;
2600
+ expectedRevision: number;
2601
+ mode: "custom" | "stripe_managed";
2602
+ observedAt?: number | undefined;
2603
+ observedSchedule: {
2604
+ interval: "daily" | "manual" | "monthly" | "weekly";
2605
+ monthlyDays?: number[] | undefined;
2606
+ weeklyDays?: string[] | undefined;
2607
+ };
2608
+ operationKey: string;
2609
+ ownerKey: string;
2610
+ previousSchedule: {
2611
+ interval: "daily" | "manual" | "monthly" | "weekly";
2612
+ monthlyDays?: number[] | undefined;
2613
+ weeklyDays?: string[] | undefined;
2614
+ };
2615
+ revision: number;
2616
+ status: "canceled" | "complete" | "pending";
2617
+ targetSchedule: {
2618
+ interval: "daily" | "manual" | "monthly" | "weekly";
2619
+ monthlyDays?: number[] | undefined;
2620
+ weeklyDays?: string[] | undefined;
2621
+ };
2622
+ thresholds: {
2623
+ amount: number;
2624
+ currency: string;
2625
+ }[];
2626
+ }, {
2627
+ accountId: import("convex/values").VString<string, "required">;
2628
+ ownerKey: import("convex/values").VString<string, "required">;
2629
+ adoption: import("convex/values").VObject<{
2630
+ claims: {
2631
+ fingerprint: string;
2632
+ operationKey: string;
2633
+ }[];
2634
+ collectionKey?: string | undefined;
2635
+ observations: {
2636
+ currency: string;
2637
+ ledgerFingerprint: string;
2638
+ matureNet: number;
2639
+ observedAt: number;
2640
+ pendingCredits: number;
2641
+ stripeTransferId: string;
2642
+ transactionIds: string[];
2643
+ }[];
2644
+ oldestHeldAt?: number | undefined;
2645
+ snapshotId?: import("convex/values").GenericId<"payoutSnapshots"> | undefined;
2646
+ } | undefined, {
2647
+ snapshotId: import("convex/values").VId<import("convex/values").GenericId<"payoutSnapshots"> | undefined, "optional">;
2648
+ collectionKey: import("convex/values").VString<string | undefined, "optional">;
2649
+ observations: import("convex/values").VArray<{
2650
+ currency: string;
2651
+ ledgerFingerprint: string;
2652
+ matureNet: number;
2653
+ observedAt: number;
2654
+ pendingCredits: number;
2655
+ stripeTransferId: string;
2656
+ transactionIds: string[];
2657
+ }[], import("convex/values").VObject<{
2658
+ currency: string;
2659
+ ledgerFingerprint: string;
2660
+ matureNet: number;
2661
+ observedAt: number;
2662
+ pendingCredits: number;
2663
+ stripeTransferId: string;
2664
+ transactionIds: string[];
2665
+ }, {
2666
+ stripeTransferId: import("convex/values").VString<string, "required">;
2667
+ currency: import("convex/values").VString<string, "required">;
2668
+ matureNet: import("convex/values").VFloat64<number, "required">;
2669
+ pendingCredits: import("convex/values").VFloat64<number, "required">;
2670
+ ledgerFingerprint: import("convex/values").VString<string, "required">;
2671
+ observedAt: import("convex/values").VFloat64<number, "required">;
2672
+ transactionIds: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
2673
+ }, "required", "currency" | "ledgerFingerprint" | "matureNet" | "observedAt" | "pendingCredits" | "stripeTransferId" | "transactionIds">, "required">;
2674
+ claims: import("convex/values").VArray<{
2675
+ fingerprint: string;
2676
+ operationKey: string;
2677
+ }[], import("convex/values").VObject<{
2678
+ fingerprint: string;
2679
+ operationKey: string;
2680
+ }, {
2681
+ operationKey: import("convex/values").VString<string, "required">;
2682
+ fingerprint: import("convex/values").VString<string, "required">;
2683
+ }, "required", "fingerprint" | "operationKey">, "required">;
2684
+ oldestHeldAt: import("convex/values").VFloat64<number | undefined, "optional">;
2685
+ }, "optional", "claims" | "collectionKey" | "observations" | "oldestHeldAt" | "snapshotId">;
2686
+ operationKey: import("convex/values").VString<string, "required">;
2687
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
2688
+ mode: import("convex/values").VUnion<"custom" | "stripe_managed", [import("convex/values").VLiteral<"stripe_managed", "required">, import("convex/values").VLiteral<"custom", "required">], "required", never>;
2689
+ thresholds: import("convex/values").VArray<{
2690
+ amount: number;
2691
+ currency: string;
2692
+ }[], import("convex/values").VObject<{
2693
+ amount: number;
2694
+ currency: string;
2695
+ }, {
2696
+ currency: import("convex/values").VString<string, "required">;
2697
+ amount: import("convex/values").VFloat64<number, "required">;
2698
+ }, "required", "amount" | "currency">, "required">;
2699
+ country: import("convex/values").VString<string, "required">;
2700
+ observedSchedule: import("convex/values").VObject<{
2701
+ interval: "daily" | "manual" | "monthly" | "weekly";
2702
+ monthlyDays?: number[] | undefined;
2703
+ weeklyDays?: string[] | undefined;
2704
+ }, {
2705
+ 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>;
2706
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
2707
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
2708
+ }, "required", "interval" | "monthlyDays" | "weeklyDays">;
2709
+ observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
2710
+ revision: import("convex/values").VFloat64<number, "required">;
2711
+ previousSchedule: import("convex/values").VObject<{
2712
+ interval: "daily" | "manual" | "monthly" | "weekly";
2713
+ monthlyDays?: number[] | undefined;
2714
+ weeklyDays?: string[] | undefined;
2715
+ }, {
2716
+ 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>;
2717
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
2718
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
2719
+ }, "required", "interval" | "monthlyDays" | "weeklyDays">;
2720
+ targetSchedule: import("convex/values").VObject<{
2721
+ interval: "daily" | "manual" | "monthly" | "weekly";
2722
+ monthlyDays?: number[] | undefined;
2723
+ weeklyDays?: string[] | undefined;
2724
+ }, {
2725
+ 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>;
2726
+ weeklyDays: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
2727
+ monthlyDays: import("convex/values").VArray<number[] | undefined, import("convex/values").VFloat64<number, "required">, "optional">;
2728
+ }, "required", "interval" | "monthlyDays" | "weeklyDays">;
2729
+ 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>;
2730
+ attempted: import("convex/values").VBoolean<boolean | undefined, "optional">;
2731
+ }, "required", "accountId" | "adoption" | "adoption.claims" | "adoption.collectionKey" | "adoption.observations" | "adoption.oldestHeldAt" | "adoption.snapshotId" | "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">, {
2732
+ by_operation: ["operationKey", "_creationTime"];
2733
+ }, {}, {}>;
2734
+ currencyTotals: import("convex/server").TableDefinition<import("convex/values").VObject<{
2735
+ accountId: string;
2736
+ count: number;
2737
+ currency: string;
2738
+ gross: number;
2739
+ kind: "earnings" | "payouts";
2740
+ paidOut: number;
2741
+ reversed: number;
2742
+ }, {
2743
+ accountId: import("convex/values").VString<string, "required">;
2744
+ currency: import("convex/values").VString<string, "required">;
2745
+ kind: import("convex/values").VUnion<"earnings" | "payouts", [import("convex/values").VLiteral<"earnings", "required">, import("convex/values").VLiteral<"payouts", "required">], "required", never>;
2746
+ gross: import("convex/values").VFloat64<number, "required">;
2747
+ reversed: import("convex/values").VFloat64<number, "required">;
2748
+ paidOut: import("convex/values").VFloat64<number, "required">;
2749
+ count: import("convex/values").VFloat64<number, "required">;
2750
+ }, "required", "accountId" | "count" | "currency" | "gross" | "kind" | "paidOut" | "reversed">, {
2751
+ by_account_kind_currency: ["accountId", "kind", "currency", "_creationTime"];
2752
+ }, {}, {}>;
2753
+ recoveryClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
2754
+ accountId: string;
2755
+ amountDue: number;
2756
+ claimKey: string;
2757
+ collectedAmount: number;
2758
+ currency: string;
2759
+ openingCollection?: {
2760
+ amountDue: number;
2761
+ collectedAmount: number;
2762
+ operationKey: string;
2763
+ revision: number;
2764
+ } | undefined;
2765
+ outstanding: number;
2766
+ reservedAmount: number;
2767
+ revision: number;
2768
+ scopeKey: string;
2769
+ sign: "negative" | "positive" | "zero";
2770
+ sourceChargeId: string;
2771
+ sourceGross: number;
2772
+ sourceProcessingFee: number;
2773
+ }, {
2774
+ accountId: import("convex/values").VString<string, "required">;
2775
+ scopeKey: import("convex/values").VString<string, "required">;
2776
+ currency: import("convex/values").VString<string, "required">;
2777
+ claimKey: import("convex/values").VString<string, "required">;
2778
+ sourceChargeId: import("convex/values").VString<string, "required">;
2779
+ sourceGross: import("convex/values").VFloat64<number, "required">;
2780
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
2781
+ amountDue: import("convex/values").VFloat64<number, "required">;
2782
+ revision: import("convex/values").VFloat64<number, "required">;
2783
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
2784
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
2785
+ outstanding: import("convex/values").VFloat64<number, "required">;
2786
+ 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>;
2787
+ openingCollection: import("convex/values").VObject<{
2788
+ amountDue: number;
2789
+ collectedAmount: number;
2790
+ operationKey: string;
2791
+ revision: number;
2792
+ } | undefined, {
2793
+ operationKey: import("convex/values").VString<string, "required">;
2794
+ amountDue: import("convex/values").VFloat64<number, "required">;
2795
+ revision: import("convex/values").VFloat64<number, "required">;
2796
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
2797
+ }, "optional", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
2798
+ }, "required", "accountId" | "amountDue" | "claimKey" | "collectedAmount" | "currency" | "openingCollection" | "openingCollection.amountDue" | "openingCollection.collectedAmount" | "openingCollection.operationKey" | "openingCollection.revision" | "outstanding" | "reservedAmount" | "revision" | "scopeKey" | "sign" | "sourceChargeId" | "sourceGross" | "sourceProcessingFee">, {
2799
+ by_import: ["openingCollection.operationKey", "_creationTime"];
2800
+ by_key: ["claimKey", "_creationTime"];
2801
+ by_scope: ["accountId", "scopeKey", "currency", "_creationTime"];
2802
+ by_sign: ["accountId", "scopeKey", "currency", "sign", "_creationTime"];
2803
+ }, {}, {}>;
2804
+ recoveryBalances: import("convex/server").TableDefinition<import("convex/values").VObject<{
2805
+ accountId: string;
2806
+ activeGroupKey?: string | undefined;
2807
+ amountDue: number;
2808
+ collectedAmount: number;
2809
+ currency: string;
2810
+ outstanding: number;
2811
+ reservedAmount: number;
2812
+ scopeKey: string;
2813
+ }, {
2814
+ accountId: import("convex/values").VString<string, "required">;
2815
+ scopeKey: import("convex/values").VString<string, "required">;
2816
+ currency: import("convex/values").VString<string, "required">;
2817
+ amountDue: import("convex/values").VFloat64<number, "required">;
2818
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
2819
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
2820
+ outstanding: import("convex/values").VFloat64<number, "required">;
2821
+ activeGroupKey: import("convex/values").VString<string | undefined, "optional">;
2822
+ }, "required", "accountId" | "activeGroupKey" | "amountDue" | "collectedAmount" | "currency" | "outstanding" | "reservedAmount" | "scopeKey">, {
2823
+ by_scope: ["accountId", "scopeKey", "currency", "_creationTime"];
2824
+ }, {}, {}>;
2825
+ recoveryGroups: import("convex/server").TableDefinition<import("convex/values").VObject<{
2826
+ accountId: string;
2827
+ amount: number;
2828
+ currency: string;
2829
+ groupKey: string;
2830
+ invoiceFunding?: {
2831
+ sourceChargeId: string;
2832
+ sourceGross: number;
2833
+ sourceProcessingFee: number;
2834
+ } | undefined;
2835
+ invoiceItemId?: string | undefined;
2836
+ maxCredit: number;
2837
+ maxDebit: number;
2838
+ pendingOperations: number;
2839
+ scopeKey: string;
2840
+ sourceGross?: number | undefined;
2841
+ sourceId: string;
2842
+ sourceKind: "invoice" | "settlement";
2843
+ sourceProcessingFee?: number | undefined;
2844
+ status: "collected" | "collecting" | "open" | "released" | "releasing" | "sealed";
2845
+ }, {
2846
+ accountId: import("convex/values").VString<string, "required">;
2847
+ scopeKey: import("convex/values").VString<string, "required">;
2848
+ currency: import("convex/values").VString<string, "required">;
2849
+ groupKey: import("convex/values").VString<string, "required">;
2850
+ sourceKind: import("convex/values").VUnion<"invoice" | "settlement", [import("convex/values").VLiteral<"settlement", "required">, import("convex/values").VLiteral<"invoice", "required">], "required", never>;
2851
+ sourceId: import("convex/values").VString<string, "required">;
2852
+ sourceGross: import("convex/values").VFloat64<number | undefined, "optional">;
2853
+ sourceProcessingFee: import("convex/values").VFloat64<number | undefined, "optional">;
2854
+ maxDebit: import("convex/values").VFloat64<number, "required">;
2855
+ maxCredit: import("convex/values").VFloat64<number, "required">;
2856
+ amount: import("convex/values").VFloat64<number, "required">;
2857
+ pendingOperations: import("convex/values").VFloat64<number, "required">;
2858
+ invoiceItemId: import("convex/values").VString<string | undefined, "optional">;
2859
+ invoiceFunding: import("convex/values").VObject<{
2860
+ sourceChargeId: string;
2861
+ sourceGross: number;
2862
+ sourceProcessingFee: number;
2863
+ } | undefined, {
2864
+ sourceChargeId: import("convex/values").VString<string, "required">;
2865
+ sourceGross: import("convex/values").VFloat64<number, "required">;
2866
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
2867
+ }, "optional", "sourceChargeId" | "sourceGross" | "sourceProcessingFee">;
2868
+ 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>;
2869
+ }, "required", "accountId" | "amount" | "currency" | "groupKey" | "invoiceFunding" | "invoiceFunding.sourceChargeId" | "invoiceFunding.sourceGross" | "invoiceFunding.sourceProcessingFee" | "invoiceItemId" | "maxCredit" | "maxDebit" | "pendingOperations" | "scopeKey" | "sourceGross" | "sourceId" | "sourceKind" | "sourceProcessingFee" | "status">, {
2870
+ by_key: ["groupKey", "_creationTime"];
2871
+ }, {}, {}>;
2872
+ recoveryReservations: import("convex/server").TableDefinition<import("convex/values").VObject<{
2873
+ allocations: {
2874
+ amount: number;
2875
+ claimId: import("convex/values").GenericId<"recoveryClaims">;
2876
+ claimKey: string;
2877
+ }[];
2878
+ amount: number;
2879
+ groupKey: string;
2880
+ limit: number;
2881
+ operationKey: string;
2882
+ status: "collected" | "empty" | "released" | "reserved";
2883
+ }, {
2884
+ operationKey: import("convex/values").VString<string, "required">;
2885
+ groupKey: import("convex/values").VString<string, "required">;
2886
+ amount: import("convex/values").VFloat64<number, "required">;
2887
+ limit: import("convex/values").VFloat64<number, "required">;
2888
+ allocations: import("convex/values").VArray<{
2889
+ amount: number;
2890
+ claimId: import("convex/values").GenericId<"recoveryClaims">;
2891
+ claimKey: string;
2892
+ }[], import("convex/values").VObject<{
2893
+ amount: number;
2894
+ claimId: import("convex/values").GenericId<"recoveryClaims">;
2895
+ claimKey: string;
2896
+ }, {
2897
+ claimId: import("convex/values").VId<import("convex/values").GenericId<"recoveryClaims">, "required">;
2898
+ claimKey: import("convex/values").VString<string, "required">;
2899
+ amount: import("convex/values").VFloat64<number, "required">;
2900
+ }, "required", "amount" | "claimId" | "claimKey">, "required">;
2901
+ 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>;
2902
+ }, "required", "allocations" | "amount" | "groupKey" | "limit" | "operationKey" | "status">, {
2903
+ by_group_status: ["groupKey", "status", "_creationTime"];
2904
+ by_key: ["operationKey", "_creationTime"];
2905
+ }, {}, {}>;
2906
+ settlementAllocations: import("convex/server").TableDefinition<import("convex/values").VObject<{
2907
+ adjustmentAmount?: number | undefined;
2908
+ currency: string;
2909
+ gross: number;
2910
+ paymentId?: string | undefined;
2911
+ paymentIntentId?: string | undefined;
2912
+ platformNet: number;
2913
+ processingFee: number;
2914
+ sourceChargeId: string;
2915
+ sourceInvoiceId?: string | undefined;
2916
+ transfers: {
2917
+ amount: number;
2918
+ destinationAccountId: string;
2919
+ role: "affiliate" | "other" | "store";
2920
+ }[];
2921
+ }, {
2922
+ sourceChargeId: import("convex/values").VString<string, "required">;
2923
+ paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
2924
+ sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
2925
+ gross: import("convex/values").VFloat64<number, "required">;
2926
+ currency: import("convex/values").VString<string, "required">;
2927
+ processingFee: import("convex/values").VFloat64<number, "required">;
2928
+ platformNet: import("convex/values").VFloat64<number, "required">;
2929
+ adjustmentAmount: import("convex/values").VFloat64<number | undefined, "optional">;
2930
+ paymentId: import("convex/values").VString<string | undefined, "optional">;
2931
+ transfers: import("convex/values").VArray<{
2932
+ amount: number;
2933
+ destinationAccountId: string;
2934
+ role: "affiliate" | "other" | "store";
2935
+ }[], import("convex/values").VObject<{
2936
+ amount: number;
2937
+ destinationAccountId: string;
2938
+ role: "affiliate" | "other" | "store";
2939
+ }, {
2940
+ destinationAccountId: import("convex/values").VString<string, "required">;
2941
+ 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>;
2942
+ amount: import("convex/values").VFloat64<number, "required">;
2943
+ }, "required", "amount" | "destinationAccountId" | "role">, "required">;
2944
+ }, "required", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">, {
2945
+ by_source_charge: ["sourceChargeId", "_creationTime"];
2946
+ }, {}, {}>;
2947
+ commissionTerms: import("convex/server").TableDefinition<import("convex/values").VObject<{
2948
+ affiliateAccountId?: string | undefined;
2949
+ firstPaidInvoiceId: string;
2950
+ subscriptionId: string;
2951
+ term: "forever" | "one_time";
2952
+ }, {
2953
+ subscriptionId: import("convex/values").VString<string, "required">;
2954
+ term: import("convex/values").VUnion<"forever" | "one_time", [import("convex/values").VLiteral<"forever", "required">, import("convex/values").VLiteral<"one_time", "required">], "required", never>;
2955
+ affiliateAccountId: import("convex/values").VString<string | undefined, "optional">;
2956
+ firstPaidInvoiceId: import("convex/values").VString<string, "required">;
2957
+ }, "required", "affiliateAccountId" | "firstPaidInvoiceId" | "subscriptionId" | "term">, {
2958
+ by_subscription: ["subscriptionId", "_creationTime"];
2959
+ }, {}, {}>;
2960
+ commissionDecisions: import("convex/server").TableDefinition<import("convex/values").VObject<{
2961
+ claimKey: string;
2962
+ eligible: boolean;
2963
+ invoiceId: string;
2964
+ subscriptionId: string;
2965
+ }, {
2966
+ subscriptionId: import("convex/values").VString<string, "required">;
2967
+ invoiceId: import("convex/values").VString<string, "required">;
2968
+ eligible: import("convex/values").VBoolean<boolean, "required">;
2969
+ claimKey: import("convex/values").VString<string, "required">;
2970
+ }, "required", "claimKey" | "eligible" | "invoiceId" | "subscriptionId">, {
2971
+ by_subscription_invoice: ["subscriptionId", "invoiceId", "_creationTime"];
2972
+ }, {}, {}>;
2973
+ accounts: import("convex/server").TableDefinition<import("convex/values").VObject<{
2974
+ appliedConfigurations?: ("customer" | "merchant" | "recipient")[] | undefined;
2975
+ capabilities?: any;
2976
+ configuration?: any;
2977
+ country?: string | undefined;
2978
+ email?: string | undefined;
2979
+ metadata?: any;
2980
+ missingRequirements?: string[] | undefined;
2981
+ name?: string | undefined;
2982
+ onboardingStatus: "complete" | "in_progress" | "pending" | "restricted";
2983
+ orgId?: string | undefined;
2984
+ requirements?: any;
2985
+ statementDescriptor?: string | undefined;
2986
+ stripeAccountId: string;
2987
+ userId: string;
2988
+ }, {
2989
+ stripeAccountId: import("convex/values").VString<string, "required">;
2990
+ userId: import("convex/values").VString<string, "required">;
2991
+ orgId: import("convex/values").VString<string | undefined, "optional">;
2992
+ email: import("convex/values").VString<string | undefined, "optional">;
2993
+ name: import("convex/values").VString<string | undefined, "optional">;
2994
+ country: import("convex/values").VString<string | undefined, "optional">;
2995
+ capabilities: import("convex/values").VAny<any, "optional", string>;
2996
+ requirements: import("convex/values").VAny<any, "optional", string>;
2997
+ configuration: import("convex/values").VAny<any, "optional", string>;
2998
+ 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">;
2999
+ 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>;
3000
+ missingRequirements: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
3001
+ metadata: import("convex/values").VAny<any, "optional", string>;
3002
+ statementDescriptor: import("convex/values").VString<string | undefined, "optional">;
3003
+ }, "required", "appliedConfigurations" | "capabilities" | "configuration" | "country" | "email" | "metadata" | "missingRequirements" | "name" | "onboardingStatus" | "orgId" | "requirements" | "statementDescriptor" | "stripeAccountId" | "userId" | `capabilities.${string}` | `configuration.${string}` | `metadata.${string}` | `requirements.${string}`>, {
3004
+ by_onboarding_status: ["onboardingStatus", "_creationTime"];
3005
+ by_org_id: ["orgId", "_creationTime"];
3006
+ by_stripe_account_id: ["stripeAccountId", "_creationTime"];
3007
+ by_user_id: ["userId", "_creationTime"];
3008
+ }, {}, {}>;
3009
+ products: import("convex/server").TableDefinition<import("convex/values").VObject<{
3010
+ accountId?: string | undefined;
3011
+ active: boolean;
3012
+ description?: string | undefined;
3013
+ metadata?: any;
3014
+ name: string;
3015
+ stripeProductId: string;
3016
+ }, {
3017
+ stripeProductId: import("convex/values").VString<string, "required">;
3018
+ accountId: import("convex/values").VString<string | undefined, "optional">;
3019
+ name: import("convex/values").VString<string, "required">;
3020
+ description: import("convex/values").VString<string | undefined, "optional">;
3021
+ active: import("convex/values").VBoolean<boolean, "required">;
3022
+ metadata: import("convex/values").VAny<any, "optional", string>;
3023
+ }, "required", "accountId" | "active" | "description" | "metadata" | "name" | "stripeProductId" | `metadata.${string}`>, {
3024
+ by_account_active: ["accountId", "active", "_creationTime"];
3025
+ by_account_id: ["accountId", "_creationTime"];
3026
+ by_active: ["active", "_creationTime"];
3027
+ by_stripe_product_id: ["stripeProductId", "_creationTime"];
3028
+ }, {}, {}>;
3029
+ prices: import("convex/server").TableDefinition<import("convex/values").VObject<{
3030
+ active: boolean;
3031
+ currency: string;
3032
+ interval?: "day" | "month" | "week" | "year" | undefined;
3033
+ intervalCount?: number | undefined;
3034
+ metadata?: any;
3035
+ nickname?: string | undefined;
3036
+ productId: string;
3037
+ stripePriceId: string;
3038
+ stripeProductId: string;
3039
+ type: "one_time" | "recurring";
3040
+ unitAmount: number;
3041
+ }, {
3042
+ stripePriceId: import("convex/values").VString<string, "required">;
3043
+ productId: import("convex/values").VString<string, "required">;
3044
+ stripeProductId: import("convex/values").VString<string, "required">;
3045
+ nickname: import("convex/values").VString<string | undefined, "optional">;
3046
+ unitAmount: import("convex/values").VFloat64<number, "required">;
3047
+ currency: import("convex/values").VString<string, "required">;
3048
+ active: import("convex/values").VBoolean<boolean, "required">;
3049
+ type: import("convex/values").VUnion<"one_time" | "recurring", [import("convex/values").VLiteral<"one_time", "required">, import("convex/values").VLiteral<"recurring", "required">], "required", never>;
3050
+ 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>;
3051
+ intervalCount: import("convex/values").VFloat64<number | undefined, "optional">;
3052
+ metadata: import("convex/values").VAny<any, "optional", string>;
3053
+ }, "required", "active" | "currency" | "interval" | "intervalCount" | "metadata" | "nickname" | "productId" | "stripePriceId" | "stripeProductId" | "type" | "unitAmount" | `metadata.${string}`>, {
3054
+ by_active: ["active", "_creationTime"];
3055
+ by_product_active: ["productId", "active", "_creationTime"];
3056
+ by_product_id: ["productId", "_creationTime"];
3057
+ by_stripe_price_id: ["stripePriceId", "_creationTime"];
3058
+ by_stripe_product_id: ["stripeProductId", "_creationTime"];
3059
+ }, {}, {}>;
3060
+ subscriptions: import("convex/server").TableDefinition<import("convex/values").VObject<{
3061
+ accountId?: string | undefined;
3062
+ applicationFeeAmount?: number | undefined;
3063
+ applicationFeePercent?: number | undefined;
3064
+ cancelAtPeriodEnd: boolean;
3065
+ canceledAt?: string | undefined;
3066
+ chargeType?: "destination" | "separate" | undefined;
3067
+ currency?: string | undefined;
3068
+ currentPeriodEnd?: string | undefined;
3069
+ currentPeriodStart?: string | undefined;
3070
+ destinationAccountId?: string | undefined;
3071
+ feeCollectedAmount?: number | undefined;
3072
+ feeRefundedAmount?: number | undefined;
3073
+ isCollectionPaused?: boolean | undefined;
3074
+ isTrialing: boolean;
3075
+ metadata?: any;
3076
+ orgId?: string | undefined;
3077
+ priceId?: string | undefined;
3078
+ quantity?: number | undefined;
3079
+ splitRecipients?: {
3080
+ amount?: number | undefined;
3081
+ destinationAccountId: string;
3082
+ percent?: number | undefined;
3083
+ role: "affiliate" | "other" | "store";
3084
+ }[] | undefined;
3085
+ status: "active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid";
3086
+ stripeSubscriptionId: string;
3087
+ trialEnd?: string | undefined;
3088
+ trialStart?: string | undefined;
3089
+ userId: string;
3090
+ }, {
3091
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
3092
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
3093
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
3094
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
3095
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
3096
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
3097
+ splitRecipients: import("convex/values").VArray<{
3098
+ amount?: number | undefined;
3099
+ destinationAccountId: string;
3100
+ percent?: number | undefined;
3101
+ role: "affiliate" | "other" | "store";
3102
+ }[] | undefined, import("convex/values").VObject<{
3103
+ amount?: number | undefined;
3104
+ destinationAccountId: string;
3105
+ percent?: number | undefined;
3106
+ role: "affiliate" | "other" | "store";
3107
+ }, {
3108
+ destinationAccountId: import("convex/values").VString<string, "required">;
3109
+ 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>;
3110
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
3111
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
3112
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
3113
+ stripeSubscriptionId: import("convex/values").VString<string, "required">;
3114
+ accountId: import("convex/values").VString<string | undefined, "optional">;
3115
+ userId: import("convex/values").VString<string, "required">;
3116
+ orgId: import("convex/values").VString<string | undefined, "optional">;
3117
+ 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>;
3118
+ priceId: import("convex/values").VString<string | undefined, "optional">;
3119
+ quantity: import("convex/values").VFloat64<number | undefined, "optional">;
3120
+ currentPeriodStart: import("convex/values").VString<string | undefined, "optional">;
3121
+ currentPeriodEnd: import("convex/values").VString<string | undefined, "optional">;
3122
+ cancelAtPeriodEnd: import("convex/values").VBoolean<boolean, "required">;
3123
+ isCollectionPaused: import("convex/values").VBoolean<boolean | undefined, "optional">;
3124
+ canceledAt: import("convex/values").VString<string | undefined, "optional">;
3125
+ isTrialing: import("convex/values").VBoolean<boolean, "required">;
3126
+ trialStart: import("convex/values").VString<string | undefined, "optional">;
3127
+ trialEnd: import("convex/values").VString<string | undefined, "optional">;
3128
+ currency: import("convex/values").VString<string | undefined, "optional">;
3129
+ metadata: import("convex/values").VAny<any, "optional", string>;
3130
+ }, "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}`>, {
3131
+ by_account_id: ["accountId", "_creationTime"];
3132
+ by_account_status: ["accountId", "status", "_creationTime"];
3133
+ by_org_id: ["orgId", "_creationTime"];
3134
+ by_price_id: ["priceId", "_creationTime"];
3135
+ by_status: ["status", "_creationTime"];
3136
+ by_stripe_subscription_id: ["stripeSubscriptionId", "_creationTime"];
3137
+ by_user_id: ["userId", "_creationTime"];
3138
+ }, {}, {}>;
3139
+ checkoutSessions: import("convex/server").TableDefinition<import("convex/values").VObject<{
3140
+ accountId?: string | undefined;
3141
+ applicationFeeAmount?: number | undefined;
3142
+ applicationFeePercent?: number | undefined;
3143
+ chargeType?: "destination" | "separate" | undefined;
3144
+ clientSecret?: string | undefined;
3145
+ currency?: string | undefined;
3146
+ destinationAccountId?: string | undefined;
3147
+ feeCollectedAmount?: number | undefined;
3148
+ feeRefundedAmount?: number | undefined;
3149
+ metadata?: any;
3150
+ mode: "payment" | "setup" | "subscription";
3151
+ orgId?: string | undefined;
3152
+ priceId?: string | undefined;
3153
+ splitRecipients?: {
3154
+ amount?: number | undefined;
3155
+ destinationAccountId: string;
3156
+ percent?: number | undefined;
3157
+ role: "affiliate" | "other" | "store";
3158
+ }[] | undefined;
3159
+ status: "complete" | "expired" | "open";
3160
+ stripeSessionId: string;
3161
+ url?: string | undefined;
3162
+ userId: string;
3163
+ }, {
3164
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
3165
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
3166
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
3167
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
3168
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
3169
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
3170
+ splitRecipients: import("convex/values").VArray<{
3171
+ amount?: number | undefined;
3172
+ destinationAccountId: string;
3173
+ percent?: number | undefined;
3174
+ role: "affiliate" | "other" | "store";
3175
+ }[] | undefined, import("convex/values").VObject<{
3176
+ amount?: number | undefined;
3177
+ destinationAccountId: string;
3178
+ percent?: number | undefined;
3179
+ role: "affiliate" | "other" | "store";
3180
+ }, {
3181
+ destinationAccountId: import("convex/values").VString<string, "required">;
3182
+ 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>;
3183
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
3184
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
3185
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
3186
+ stripeSessionId: import("convex/values").VString<string, "required">;
3187
+ userId: import("convex/values").VString<string, "required">;
3188
+ orgId: import("convex/values").VString<string | undefined, "optional">;
3189
+ accountId: import("convex/values").VString<string | undefined, "optional">;
3190
+ 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>;
3191
+ 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>;
3192
+ clientSecret: import("convex/values").VString<string | undefined, "optional">;
3193
+ url: import("convex/values").VString<string | undefined, "optional">;
3194
+ priceId: import("convex/values").VString<string | undefined, "optional">;
3195
+ currency: import("convex/values").VString<string | undefined, "optional">;
3196
+ metadata: import("convex/values").VAny<any, "optional", string>;
3197
+ }, "required", "accountId" | "applicationFeeAmount" | "applicationFeePercent" | "chargeType" | "clientSecret" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "metadata" | "mode" | "orgId" | "priceId" | "splitRecipients" | "status" | "stripeSessionId" | "url" | "userId" | `metadata.${string}`>, {
3198
+ by_account_id: ["accountId", "_creationTime"];
3199
+ by_stripe_session_id: ["stripeSessionId", "_creationTime"];
3200
+ by_user_id: ["userId", "_creationTime"];
3201
+ by_user_status: ["userId", "status", "_creationTime"];
3202
+ }, {}, {}>;
3203
+ invoices: import("convex/server").TableDefinition<import("convex/values").VObject<{
3204
+ accountId?: string | undefined;
3205
+ amountDue: number;
3206
+ amountPaid: number;
3207
+ applicationFeeAmount?: number | undefined;
3208
+ applicationFeePercent?: number | undefined;
3209
+ attemptCount?: number | undefined;
3210
+ chargeType?: "destination" | "separate" | undefined;
3211
+ currency: string;
3212
+ destinationAccountId?: string | undefined;
3213
+ feeCollectedAmount?: number | undefined;
3214
+ feeRefundedAmount?: number | undefined;
3215
+ hostedInvoiceUrl?: string | undefined;
3216
+ invoicePdf?: string | undefined;
3217
+ metadata?: any;
3218
+ nextPaymentAttempt?: string | undefined;
3219
+ orgId?: string | undefined;
3220
+ periodEnd?: string | undefined;
3221
+ periodStart?: string | undefined;
3222
+ splitRecipients?: {
3223
+ amount?: number | undefined;
3224
+ destinationAccountId: string;
3225
+ percent?: number | undefined;
3226
+ role: "affiliate" | "other" | "store";
3227
+ }[] | undefined;
3228
+ status: "draft" | "open" | "paid" | "uncollectible" | "void";
3229
+ stripeInvoiceId: string;
3230
+ subscriptionId?: string | undefined;
3231
+ userId: string;
3232
+ }, {
3233
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
3234
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
3235
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
3236
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
3237
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
3238
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
3239
+ splitRecipients: import("convex/values").VArray<{
3240
+ amount?: number | undefined;
3241
+ destinationAccountId: string;
3242
+ percent?: number | undefined;
3243
+ role: "affiliate" | "other" | "store";
3244
+ }[] | undefined, import("convex/values").VObject<{
3245
+ amount?: number | undefined;
3246
+ destinationAccountId: string;
3247
+ percent?: number | undefined;
3248
+ role: "affiliate" | "other" | "store";
3249
+ }, {
3250
+ destinationAccountId: import("convex/values").VString<string, "required">;
3251
+ 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>;
3252
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
3253
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
3254
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
3255
+ stripeInvoiceId: import("convex/values").VString<string, "required">;
3256
+ userId: import("convex/values").VString<string, "required">;
3257
+ orgId: import("convex/values").VString<string | undefined, "optional">;
3258
+ accountId: import("convex/values").VString<string | undefined, "optional">;
3259
+ subscriptionId: import("convex/values").VString<string | undefined, "optional">;
3260
+ 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>;
3261
+ currency: import("convex/values").VString<string, "required">;
3262
+ amountDue: import("convex/values").VFloat64<number, "required">;
3263
+ amountPaid: import("convex/values").VFloat64<number, "required">;
3264
+ hostedInvoiceUrl: import("convex/values").VString<string | undefined, "optional">;
3265
+ invoicePdf: import("convex/values").VString<string | undefined, "optional">;
3266
+ periodStart: import("convex/values").VString<string | undefined, "optional">;
3267
+ periodEnd: import("convex/values").VString<string | undefined, "optional">;
3268
+ nextPaymentAttempt: import("convex/values").VString<string | undefined, "optional">;
3269
+ attemptCount: import("convex/values").VFloat64<number | undefined, "optional">;
3270
+ metadata: import("convex/values").VAny<any, "optional", string>;
3271
+ }, "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}`>, {
3272
+ by_account_id: ["accountId", "_creationTime"];
3273
+ by_account_status: ["accountId", "status", "_creationTime"];
3274
+ by_status: ["status", "_creationTime"];
3275
+ by_stripe_invoice_id: ["stripeInvoiceId", "_creationTime"];
3276
+ by_subscription_id: ["subscriptionId", "_creationTime"];
3277
+ by_subscription_status: ["subscriptionId", "status", "_creationTime"];
3278
+ by_user_id: ["userId", "_creationTime"];
3279
+ by_user_status: ["userId", "status", "_creationTime"];
3280
+ }, {}, {}>;
3281
+ payments: import("convex/server").TableDefinition<import("convex/values").VObject<{
3282
+ accountId?: string | undefined;
3283
+ amount: number;
3284
+ applicationFeeAmount?: number | undefined;
3285
+ applicationFeePercent?: number | undefined;
3286
+ chargeType?: "destination" | "separate" | undefined;
3287
+ currency: string;
3288
+ destinationAccountId?: string | undefined;
3289
+ feeCollectedAmount?: number | undefined;
3290
+ feeRefundedAmount?: number | undefined;
3291
+ metadata?: any;
3292
+ orgId?: string | undefined;
3293
+ refundStatus?: "fully_refunded" | "partially_refunded" | undefined;
3294
+ refundedAmount?: number | undefined;
3295
+ splitRecipients?: {
3296
+ amount?: number | undefined;
3297
+ destinationAccountId: string;
3298
+ percent?: number | undefined;
3299
+ role: "affiliate" | "other" | "store";
3300
+ }[] | undefined;
3301
+ status: "canceled" | "failed" | "processing" | "requires_action" | "succeeded";
3302
+ stripePaymentIntentId: string;
3303
+ userId: string;
3304
+ }, {
3305
+ destinationAccountId: import("convex/values").VString<string | undefined, "optional">;
3306
+ applicationFeeAmount: import("convex/values").VFloat64<number | undefined, "optional">;
3307
+ applicationFeePercent: import("convex/values").VFloat64<number | undefined, "optional">;
3308
+ feeCollectedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
3309
+ feeRefundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
3310
+ chargeType: import("convex/values").VUnion<"destination" | "separate" | undefined, [import("convex/values").VLiteral<"destination", "required">, import("convex/values").VLiteral<"separate", "required">], "optional", never>;
3311
+ splitRecipients: import("convex/values").VArray<{
3312
+ amount?: number | undefined;
3313
+ destinationAccountId: string;
3314
+ percent?: number | undefined;
3315
+ role: "affiliate" | "other" | "store";
3316
+ }[] | undefined, import("convex/values").VObject<{
3317
+ amount?: number | undefined;
3318
+ destinationAccountId: string;
3319
+ percent?: number | undefined;
3320
+ role: "affiliate" | "other" | "store";
3321
+ }, {
3322
+ destinationAccountId: import("convex/values").VString<string, "required">;
3323
+ 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>;
3324
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
3325
+ percent: import("convex/values").VFloat64<number | undefined, "optional">;
3326
+ }, "required", "amount" | "destinationAccountId" | "percent" | "role">, "optional">;
3327
+ stripePaymentIntentId: import("convex/values").VString<string, "required">;
3328
+ userId: import("convex/values").VString<string, "required">;
3329
+ orgId: import("convex/values").VString<string | undefined, "optional">;
3330
+ accountId: import("convex/values").VString<string | undefined, "optional">;
3331
+ amount: import("convex/values").VFloat64<number, "required">;
3332
+ currency: import("convex/values").VString<string, "required">;
3333
+ 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>;
3334
+ refundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
3335
+ 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>;
3336
+ metadata: import("convex/values").VAny<any, "optional", string>;
3337
+ }, "required", "accountId" | "amount" | "applicationFeeAmount" | "applicationFeePercent" | "chargeType" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "metadata" | "orgId" | "refundStatus" | "refundedAmount" | "splitRecipients" | "status" | "stripePaymentIntentId" | "userId" | `metadata.${string}`>, {
3338
+ by_account_id: ["accountId", "_creationTime"];
3339
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
3340
+ by_user_id: ["userId", "_creationTime"];
3341
+ }, {}, {}>;
3342
+ payouts: import("convex/server").TableDefinition<import("convex/values").VObject<{
3343
+ accountId: string;
3344
+ amount: number;
3345
+ arrivalDate?: string | undefined;
3346
+ currency: string;
3347
+ failureCode?: string | undefined;
3348
+ failureMessage?: string | undefined;
3349
+ metadata?: any;
3350
+ method?: string | undefined;
3351
+ status: "canceled" | "failed" | "in_transit" | "paid" | "pending";
3352
+ stripePayoutId: string;
3353
+ totalsRecorded?: true | undefined;
3354
+ }, {
3355
+ stripePayoutId: import("convex/values").VString<string, "required">;
3356
+ accountId: import("convex/values").VString<string, "required">;
3357
+ amount: import("convex/values").VFloat64<number, "required">;
3358
+ currency: import("convex/values").VString<string, "required">;
3359
+ 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>;
3360
+ arrivalDate: import("convex/values").VString<string | undefined, "optional">;
3361
+ method: import("convex/values").VString<string | undefined, "optional">;
3362
+ failureCode: import("convex/values").VString<string | undefined, "optional">;
3363
+ failureMessage: import("convex/values").VString<string | undefined, "optional">;
3364
+ metadata: import("convex/values").VAny<any, "optional", string>;
3365
+ totalsRecorded: import("convex/values").VLiteral<true | undefined, "optional">;
3366
+ }, "required", "accountId" | "amount" | "arrivalDate" | "currency" | "failureCode" | "failureMessage" | "metadata" | "method" | "status" | "stripePayoutId" | "totalsRecorded" | `metadata.${string}`>, {
3367
+ by_account_id: ["accountId", "_creationTime"];
3368
+ by_account_status: ["accountId", "status", "_creationTime"];
3369
+ by_account_totals_recorded: ["accountId", "totalsRecorded", "_creationTime"];
3370
+ by_status: ["status", "_creationTime"];
3371
+ by_stripe_payout_id: ["stripePayoutId", "_creationTime"];
3372
+ }, {}, {}>;
3373
+ pendingFeeRefunds: import("convex/server").TableDefinition<import("convex/values").VObject<{
3374
+ feeCollectedAmount: number;
3375
+ feeRefundedAmount: number;
3376
+ stripePaymentIntentId: string;
3377
+ }, {
3378
+ stripePaymentIntentId: import("convex/values").VString<string, "required">;
3379
+ feeCollectedAmount: import("convex/values").VFloat64<number, "required">;
3380
+ feeRefundedAmount: import("convex/values").VFloat64<number, "required">;
3381
+ }, "required", "feeCollectedAmount" | "feeRefundedAmount" | "stripePaymentIntentId">, {
3382
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
3383
+ }, {}, {}>;
3384
+ refunds: import("convex/server").TableDefinition<import("convex/values").VObject<{
3385
+ accountId?: string | undefined;
3386
+ amount: number;
3387
+ currency: string;
3388
+ failureReason?: string | undefined;
3389
+ metadata?: any;
3390
+ reason?: "duplicate" | "expired_uncaptured_charge" | "fraudulent" | "requested_by_customer" | undefined;
3391
+ status: "canceled" | "failed" | "pending" | "requires_action" | "succeeded";
3392
+ stripeChargeId?: string | undefined;
3393
+ stripePaymentIntentId?: string | undefined;
3394
+ stripeRefundId: string;
3395
+ }, {
3396
+ stripeRefundId: import("convex/values").VString<string, "required">;
3397
+ stripePaymentIntentId: import("convex/values").VString<string | undefined, "optional">;
3398
+ stripeChargeId: import("convex/values").VString<string | undefined, "optional">;
3399
+ accountId: import("convex/values").VString<string | undefined, "optional">;
3400
+ amount: import("convex/values").VFloat64<number, "required">;
3401
+ currency: import("convex/values").VString<string, "required">;
3402
+ 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>;
3403
+ 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>;
3404
+ failureReason: import("convex/values").VString<string | undefined, "optional">;
3405
+ metadata: import("convex/values").VAny<any, "optional", string>;
3406
+ }, "required", "accountId" | "amount" | "currency" | "failureReason" | "metadata" | "reason" | "status" | "stripeChargeId" | "stripePaymentIntentId" | "stripeRefundId" | `metadata.${string}`>, {
3407
+ by_account_id: ["accountId", "_creationTime"];
3408
+ by_account_id_and_status: ["accountId", "status", "_creationTime"];
3409
+ by_account_id_and_stripe_payment_intent_id: ["accountId", "stripePaymentIntentId", "_creationTime"];
3410
+ by_account_id_and_stripe_payment_intent_id_and_status: ["accountId", "stripePaymentIntentId", "status", "_creationTime"];
3411
+ by_payment_intent_id_and_status: ["stripePaymentIntentId", "status", "_creationTime"];
3412
+ by_status: ["status", "_creationTime"];
3413
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
3414
+ by_stripe_refund_id: ["stripeRefundId", "_creationTime"];
3415
+ }, {}, {}>;
3416
+ disputes: import("convex/server").TableDefinition<import("convex/values").VObject<{
3417
+ accountId?: string | undefined;
3418
+ amount: number;
3419
+ currency: string;
3420
+ evidence?: any;
3421
+ evidenceDueBy?: string | undefined;
3422
+ isChargeRefundable: boolean;
3423
+ lastEvent?: string | undefined;
3424
+ linkedTransferIds?: string[] | undefined;
3425
+ metadata?: any;
3426
+ reason: string;
3427
+ statementDescriptor?: string | undefined;
3428
+ status: "lost" | "needs_response" | "prevented" | "under_review" | "warning_closed" | "warning_needs_response" | "warning_under_review" | "won";
3429
+ stripeChargeId?: string | undefined;
3430
+ stripeDisputeId: string;
3431
+ stripePaymentIntentId?: string | undefined;
3432
+ }, {
3433
+ stripeDisputeId: import("convex/values").VString<string, "required">;
3434
+ stripePaymentIntentId: import("convex/values").VString<string | undefined, "optional">;
3435
+ stripeChargeId: import("convex/values").VString<string | undefined, "optional">;
3436
+ accountId: import("convex/values").VString<string | undefined, "optional">;
3437
+ amount: import("convex/values").VFloat64<number, "required">;
3438
+ currency: import("convex/values").VString<string, "required">;
3439
+ 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>;
3440
+ reason: import("convex/values").VString<string, "required">;
3441
+ isChargeRefundable: import("convex/values").VBoolean<boolean, "required">;
3442
+ lastEvent: import("convex/values").VString<string | undefined, "optional">;
3443
+ evidenceDueBy: import("convex/values").VString<string | undefined, "optional">;
3444
+ evidence: import("convex/values").VAny<any, "optional", string>;
3445
+ statementDescriptor: import("convex/values").VString<string | undefined, "optional">;
3446
+ linkedTransferIds: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
3447
+ metadata: import("convex/values").VAny<any, "optional", string>;
3448
+ }, "required", "accountId" | "amount" | "currency" | "evidence" | "evidenceDueBy" | "isChargeRefundable" | "lastEvent" | "linkedTransferIds" | "metadata" | "reason" | "statementDescriptor" | "status" | "stripeChargeId" | "stripeDisputeId" | "stripePaymentIntentId" | `evidence.${string}` | `metadata.${string}`>, {
3449
+ by_account_id: ["accountId", "_creationTime"];
3450
+ by_account_id_and_status: ["accountId", "status", "_creationTime"];
3451
+ by_payment_intent_id_and_status: ["stripePaymentIntentId", "status", "_creationTime"];
3452
+ by_status: ["status", "_creationTime"];
3453
+ by_stripe_dispute_id: ["stripeDisputeId", "_creationTime"];
3454
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
3455
+ }, {}, {}>;
3456
+ transfers: import("convex/server").TableDefinition<import("convex/values").VObject<{
3457
+ amount: number;
3458
+ currency: string;
3459
+ destinationAccountId: string;
3460
+ metadata?: any;
3461
+ paymentId?: string | undefined;
3462
+ reinstatement?: boolean | undefined;
3463
+ reversalClaimedAmount?: number | undefined;
3464
+ reversalStatus?: "fully_reversed" | "partially_reversed" | undefined;
3465
+ reversedAmount?: number | undefined;
3466
+ role?: "affiliate" | "other" | "store" | undefined;
3467
+ sourceChargeId?: string | undefined;
3468
+ sourceInvoiceId?: string | undefined;
3469
+ status: "failed" | "paid" | "pending" | "reversed";
3470
+ stripeTransferId: string;
3471
+ totalsRecorded?: true | undefined;
3472
+ }, {
3473
+ stripeTransferId: import("convex/values").VString<string, "required">;
3474
+ sourceChargeId: import("convex/values").VString<string | undefined, "optional">;
3475
+ sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
3476
+ destinationAccountId: import("convex/values").VString<string, "required">;
3477
+ amount: import("convex/values").VFloat64<number, "required">;
3478
+ currency: import("convex/values").VString<string, "required">;
3479
+ 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>;
3480
+ 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>;
3481
+ reversedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
3482
+ 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>;
3483
+ paymentId: import("convex/values").VString<string | undefined, "optional">;
3484
+ reinstatement: import("convex/values").VBoolean<boolean | undefined, "optional">;
3485
+ metadata: import("convex/values").VAny<any, "optional", string>;
3486
+ totalsRecorded: import("convex/values").VLiteral<true | undefined, "optional">;
3487
+ reversalClaimedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
3488
+ }, "required", "amount" | "currency" | "destinationAccountId" | "metadata" | "paymentId" | "reinstatement" | "reversalClaimedAmount" | "reversalStatus" | "reversedAmount" | "role" | "sourceChargeId" | "sourceInvoiceId" | "status" | "stripeTransferId" | "totalsRecorded" | `metadata.${string}`>, {
3489
+ by_account_totals_recorded: ["destinationAccountId", "totalsRecorded", "_creationTime"];
3490
+ by_destination_account_id: ["destinationAccountId", "_creationTime"];
3491
+ by_source_charge_id: ["sourceChargeId", "_creationTime"];
3492
+ by_stripe_transfer_id: ["stripeTransferId", "_creationTime"];
3493
+ }, {}, {}>;
3494
+ transferReversalOps: import("convex/server").TableDefinition<import("convex/values").VObject<{
3495
+ commissionExposure?: {
3496
+ chargeAmount: number;
3497
+ disputeId?: string | undefined;
3498
+ disputeState?: "lost" | "open" | "won" | undefined;
3499
+ finalized: boolean;
3500
+ kind: "dispute" | "refund";
3501
+ principal: number;
3502
+ refundId?: string | undefined;
3503
+ refundedPrincipal?: number | undefined;
3504
+ } | undefined;
3505
+ operationId: string;
3506
+ slices: {
3507
+ from: number;
3508
+ stripeTransferId: string;
3509
+ to: number;
3510
+ }[];
3511
+ sourceChargeId: string;
3512
+ }, {
3513
+ operationId: import("convex/values").VString<string, "required">;
3514
+ sourceChargeId: import("convex/values").VString<string, "required">;
3515
+ slices: import("convex/values").VArray<{
3516
+ from: number;
3517
+ stripeTransferId: string;
3518
+ to: number;
3519
+ }[], import("convex/values").VObject<{
3520
+ from: number;
3521
+ stripeTransferId: string;
3522
+ to: number;
3523
+ }, {
3524
+ stripeTransferId: import("convex/values").VString<string, "required">;
3525
+ from: import("convex/values").VFloat64<number, "required">;
3526
+ to: import("convex/values").VFloat64<number, "required">;
3527
+ }, "required", "from" | "stripeTransferId" | "to">, "required">;
3528
+ commissionExposure: import("convex/values").VObject<{
3529
+ chargeAmount: number;
3530
+ disputeId?: string | undefined;
3531
+ disputeState?: "lost" | "open" | "won" | undefined;
3532
+ finalized: boolean;
3533
+ kind: "dispute" | "refund";
3534
+ principal: number;
3535
+ refundId?: string | undefined;
3536
+ refundedPrincipal?: number | undefined;
3537
+ } | undefined, {
3538
+ kind: import("convex/values").VUnion<"dispute" | "refund", [import("convex/values").VLiteral<"refund", "required">, import("convex/values").VLiteral<"dispute", "required">], "required", never>;
3539
+ chargeAmount: import("convex/values").VFloat64<number, "required">;
3540
+ principal: import("convex/values").VFloat64<number, "required">;
3541
+ finalized: import("convex/values").VBoolean<boolean, "required">;
3542
+ disputeState: import("convex/values").VUnion<"lost" | "open" | "won" | undefined, [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"lost", "required">, import("convex/values").VLiteral<"won", "required">], "optional", never>;
3543
+ disputeId: import("convex/values").VString<string | undefined, "optional">;
3544
+ refundedPrincipal: import("convex/values").VFloat64<number | undefined, "optional">;
3545
+ refundId: import("convex/values").VString<string | undefined, "optional">;
3546
+ }, "optional", "chargeAmount" | "disputeId" | "disputeState" | "finalized" | "kind" | "principal" | "refundId" | "refundedPrincipal">;
3547
+ }, "required", "commissionExposure" | "commissionExposure.chargeAmount" | "commissionExposure.disputeId" | "commissionExposure.disputeState" | "commissionExposure.finalized" | "commissionExposure.kind" | "commissionExposure.principal" | "commissionExposure.refundId" | "commissionExposure.refundedPrincipal" | "operationId" | "slices" | "sourceChargeId">, {
3548
+ by_operation_id: ["operationId", "_creationTime"];
3549
+ by_source_charge: ["sourceChargeId", "_creationTime"];
3550
+ }, {}, {}>;
3551
+ webhookEvents: import("convex/server").TableDefinition<import("convex/values").VObject<{
3552
+ eventType: string;
3553
+ lastError?: string | undefined;
3554
+ livemode?: boolean | undefined;
3555
+ processedAt: number;
3556
+ status: "failed" | "ignored" | "processed" | "processing";
3557
+ stripeEventId: string;
3558
+ }, {
3559
+ stripeEventId: import("convex/values").VString<string, "required">;
3560
+ eventType: import("convex/values").VString<string, "required">;
3561
+ livemode: import("convex/values").VBoolean<boolean | undefined, "optional">;
3562
+ processedAt: import("convex/values").VFloat64<number, "required">;
3563
+ 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>;
3564
+ lastError: import("convex/values").VString<string | undefined, "optional">;
3565
+ }, "required", "eventType" | "lastError" | "livemode" | "processedAt" | "status" | "stripeEventId">, {
3566
+ by_status: ["status", "_creationTime"];
3567
+ by_stripeEventId: ["stripeEventId", "_creationTime"];
3568
+ }, {}, {}>;
3569
+ }, boolean>>;
3570
+ ctx: import("../helpers.js").RunCtx;
3571
+ provider: {
3572
+ accounts: {
3573
+ listExternalAccounts: import("vitest").Mock<() => Promise<{
3574
+ data: {
3575
+ id: string;
3576
+ object: string;
3577
+ currency: string;
3578
+ default_for_currency: boolean;
3579
+ }[];
3580
+ has_more: boolean;
3581
+ }>>;
3582
+ };
3583
+ transfers: {
3584
+ retrieve: import("vitest").Mock<(id: string) => Promise<{
3585
+ id: string;
3586
+ destination: string;
3587
+ destination_payment: string;
3588
+ source_transaction: string;
3589
+ amount: number;
3590
+ currency: string;
3591
+ amount_reversed: number;
3592
+ }>>;
3593
+ listReversals: import("vitest").Mock<() => Promise<{
3594
+ data: never[];
3595
+ has_more: boolean;
3596
+ }>>;
3597
+ };
3598
+ charges: {
3599
+ retrieve: import("vitest").Mock<(id: string) => Promise<{
3600
+ id: string;
3601
+ source_transfer: string;
3602
+ amount: number;
3603
+ currency: string;
3604
+ paid: boolean;
3605
+ status: string;
3606
+ balance_transaction: string;
3607
+ }>>;
3608
+ };
3609
+ balanceTransactions: {
3610
+ list: import("vitest").Mock<(params: {
3611
+ source?: string;
3612
+ limit?: number;
3613
+ }) => Promise<{
3614
+ data: {
3615
+ id: string;
3616
+ source: string;
3617
+ amount: number;
3618
+ fee: number;
3619
+ net: number;
3620
+ currency: string;
3621
+ created: number;
3622
+ available_on: number;
3623
+ status: string;
3624
+ type: string;
3625
+ exchange_rate: null;
3626
+ }[];
3627
+ has_more: boolean;
3628
+ }>>;
3629
+ retrieve: import("vitest").Mock<(id: string) => Promise<{
3630
+ id: string;
3631
+ source: string;
3632
+ amount: number;
3633
+ fee: number;
3634
+ net: number;
3635
+ currency: string;
3636
+ created: number;
3637
+ available_on: number;
3638
+ status: string;
3639
+ type: string;
3640
+ exchange_rate: null;
3641
+ } | undefined>>;
3642
+ };
3643
+ balance: {
3644
+ retrieve: import("vitest").Mock<() => Promise<{
3645
+ available: {
3646
+ currency: string;
3647
+ amount: number;
3648
+ source_types: {
3649
+ card: number;
3650
+ };
3651
+ }[];
3652
+ pending: never[];
3653
+ }>>;
3654
+ };
3655
+ payouts: {
3656
+ list: import("vitest").Mock<() => Promise<{
3657
+ data: Record<string, unknown>[];
3658
+ has_more: boolean;
3659
+ }>>;
3660
+ retrieve: import("vitest").Mock<(id?: string) => Promise<Record<string, unknown> | undefined>>;
3661
+ create: import("vitest").Mock<(params: {
3662
+ amount: number;
3663
+ currency: string;
3664
+ metadata: object;
3665
+ }) => Promise<Record<string, unknown>>>;
3666
+ };
3667
+ };
3668
+ verify: import("vitest").Mock<() => Promise<{
3669
+ status: "verified";
3670
+ policy: {
3671
+ _creationTime: number;
3672
+ _id: import("convex/values").GenericId<"payoutPolicies">;
3673
+ accountId: string;
3674
+ country: string;
3675
+ holdDeadline?: number | undefined;
3676
+ holdingExpiry?: {
3677
+ balances?: {
3678
+ available: number;
3679
+ currency: string;
3680
+ pending: number;
3681
+ }[] | undefined;
3682
+ deadline: number;
3683
+ observedAt?: number | undefined;
3684
+ status: "balance_remaining" | "claims_unresolved" | "no_held_balance" | "unverified";
3685
+ } | undefined;
3686
+ mode: "custom" | "stripe_managed";
3687
+ operationKey: string;
3688
+ ownerKey: string;
3689
+ previousSchedule?: {
3690
+ interval: "daily" | "manual" | "monthly" | "weekly";
3691
+ monthlyDays?: number[] | undefined;
3692
+ weeklyDays?: string[] | undefined;
3693
+ } | undefined;
3694
+ revision: number;
3695
+ status: "changing" | "ready";
3696
+ thresholds: {
3697
+ amount: number;
3698
+ currency: string;
3699
+ }[];
3700
+ };
3701
+ }>>;
3702
+ run: (extra?: {}) => Promise<import("./payoutExecution.js").PayoutReleaseResult>;
3703
+ setTransactions: (rows: {
3704
+ id: string;
3705
+ source: string;
3706
+ amount: number;
3707
+ fee: number;
3708
+ net: number;
3709
+ currency: string;
3710
+ created: number;
3711
+ available_on: number;
3712
+ status: string;
3713
+ type: string;
3714
+ exchange_rate: null;
3715
+ }[]) => void;
3716
+ transactions: () => {
3717
+ id: string;
3718
+ source: string;
3719
+ amount: number;
3720
+ fee: number;
3721
+ net: number;
3722
+ currency: string;
3723
+ created: number;
3724
+ available_on: number;
3725
+ status: string;
3726
+ type: string;
3727
+ exchange_rate: null;
3728
+ }[];
3729
+ };
3730
+ adopt: () => Promise<import("./payoutAdoption.js").PayoutAdoptionResult>;
3731
+ opts: {
3732
+ accountId: string;
3733
+ ownerKey: string;
3734
+ currency: string;
3735
+ expectedRevision: number;
3736
+ payouts: {
3737
+ stripePayoutId: string;
3738
+ allocations: {
3739
+ stripeTransferId: string;
3740
+ amount: number;
3741
+ }[];
3742
+ }[];
3743
+ };
3744
+ }>;
3745
+ //# sourceMappingURL=payoutLargeAdoptionTestHelpers.d.ts.map