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