@fantastic.dev/better-stripe 0.18.0 → 0.20.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 (53) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +8 -3
  3. package/dist/client/connect/transferReceipt.d.ts +48 -0
  4. package/dist/client/connect/transferReceipt.d.ts.map +1 -0
  5. package/dist/client/connect/transferReceipt.js +283 -0
  6. package/dist/client/connect/transferReceipt.js.map +1 -0
  7. package/dist/client/payoutPolicy.d.ts +3 -0
  8. package/dist/client/payoutPolicy.d.ts.map +1 -1
  9. package/dist/client/payoutPolicy.js +4 -0
  10. package/dist/client/payoutPolicy.js.map +1 -1
  11. package/dist/component/_generated/component.d.ts +297 -0
  12. package/dist/component/_generated/component.d.ts.map +1 -1
  13. package/dist/component/earnings/triggers.d.ts +134 -0
  14. package/dist/component/earnings/triggers.d.ts.map +1 -1
  15. package/dist/component/payoutRelease/allocation.d.ts +48 -0
  16. package/dist/component/payoutRelease/allocation.d.ts.map +1 -0
  17. package/dist/component/payoutRelease/allocation.js +98 -0
  18. package/dist/component/payoutRelease/allocation.js.map +1 -0
  19. package/dist/component/payoutRelease/helpers.d.ts +106 -0
  20. package/dist/component/payoutRelease/helpers.d.ts.map +1 -0
  21. package/dist/component/payoutRelease/helpers.js +119 -0
  22. package/dist/component/payoutRelease/helpers.js.map +1 -0
  23. package/dist/component/payoutRelease/mutations.d.ts +218 -0
  24. package/dist/component/payoutRelease/mutations.d.ts.map +1 -0
  25. package/dist/component/payoutRelease/mutations.js +254 -0
  26. package/dist/component/payoutRelease/mutations.js.map +1 -0
  27. package/dist/component/payoutRelease/queries.d.ts +84 -0
  28. package/dist/component/payoutRelease/queries.d.ts.map +1 -0
  29. package/dist/component/payoutRelease/queries.js +51 -0
  30. package/dist/component/payoutRelease/queries.js.map +1 -0
  31. package/dist/component/payoutRelease/schema.d.ts +289 -0
  32. package/dist/component/payoutRelease/schema.d.ts.map +1 -0
  33. package/dist/component/payoutRelease/schema.js +56 -0
  34. package/dist/component/payoutRelease/schema.js.map +1 -0
  35. package/dist/component/schema.d.ts +110 -0
  36. package/dist/component/schema.js +3 -0
  37. package/dist/component/schema.js.map +1 -1
  38. package/docs/settlement.md +81 -0
  39. package/package.json +1 -1
  40. package/src/client/connect/payoutAllocation.test.ts +292 -0
  41. package/src/client/connect/transferReceipt.pagination.test.ts +209 -0
  42. package/src/client/connect/transferReceipt.test.ts +520 -0
  43. package/src/client/connect/transferReceipt.ts +409 -0
  44. package/src/client/payoutPolicy.ts +13 -0
  45. package/src/component/_generated/api.ts +8 -0
  46. package/src/component/_generated/component.ts +372 -0
  47. package/src/component/payout-release.test.ts +588 -0
  48. package/src/component/payoutRelease/allocation.ts +147 -0
  49. package/src/component/payoutRelease/helpers.ts +168 -0
  50. package/src/component/payoutRelease/mutations.ts +309 -0
  51. package/src/component/payoutRelease/queries.ts +56 -0
  52. package/src/component/payoutRelease/schema.ts +69 -0
  53. package/src/component/schema.ts +6 -0
@@ -0,0 +1,289 @@
1
+ export declare const observation: import("convex/values").VObject<{
2
+ currency: string;
3
+ ledgerFingerprint: string;
4
+ matureNet: number;
5
+ observedAt: number;
6
+ pendingCredits: number;
7
+ stripeTransferId: string;
8
+ transactionIds: string[];
9
+ }, {
10
+ stripeTransferId: import("convex/values").VString<string, "required">;
11
+ currency: import("convex/values").VString<string, "required">;
12
+ matureNet: import("convex/values").VFloat64<number, "required">;
13
+ pendingCredits: import("convex/values").VFloat64<number, "required">;
14
+ ledgerFingerprint: import("convex/values").VString<string, "required">;
15
+ observedAt: import("convex/values").VFloat64<number, "required">;
16
+ transactionIds: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
17
+ }, "required", "currency" | "ledgerFingerprint" | "matureNet" | "observedAt" | "pendingCredits" | "stripeTransferId" | "transactionIds">;
18
+ export declare const allocation: import("convex/values").VObject<{
19
+ amount: number;
20
+ role?: "affiliate" | "other" | "store" | undefined;
21
+ stripeTransferId: string;
22
+ }, {
23
+ stripeTransferId: import("convex/values").VString<string, "required">;
24
+ amount: import("convex/values").VFloat64<number, "required">;
25
+ 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>;
26
+ }, "required", "amount" | "role" | "stripeTransferId">;
27
+ export declare const claimFields: {
28
+ accountId: import("convex/values").VString<string, "required">;
29
+ ownerKey: import("convex/values").VString<string, "required">;
30
+ operationKey: import("convex/values").VString<string, "required">;
31
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
32
+ currency: import("convex/values").VString<string, "required">;
33
+ amount: import("convex/values").VFloat64<number, "required">;
34
+ allocations: import("convex/values").VArray<{
35
+ amount: number;
36
+ role?: "affiliate" | "other" | "store" | undefined;
37
+ stripeTransferId: string;
38
+ }[], import("convex/values").VObject<{
39
+ amount: number;
40
+ role?: "affiliate" | "other" | "store" | undefined;
41
+ stripeTransferId: string;
42
+ }, {
43
+ stripeTransferId: import("convex/values").VString<string, "required">;
44
+ amount: import("convex/values").VFloat64<number, "required">;
45
+ 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>;
46
+ }, "required", "amount" | "role" | "stripeTransferId">, "required">;
47
+ observations: import("convex/values").VArray<{
48
+ currency: string;
49
+ ledgerFingerprint: string;
50
+ matureNet: number;
51
+ observedAt: number;
52
+ pendingCredits: number;
53
+ stripeTransferId: string;
54
+ transactionIds: string[];
55
+ }[], import("convex/values").VObject<{
56
+ currency: string;
57
+ ledgerFingerprint: string;
58
+ matureNet: number;
59
+ observedAt: number;
60
+ pendingCredits: number;
61
+ stripeTransferId: string;
62
+ transactionIds: string[];
63
+ }, {
64
+ stripeTransferId: import("convex/values").VString<string, "required">;
65
+ currency: import("convex/values").VString<string, "required">;
66
+ matureNet: import("convex/values").VFloat64<number, "required">;
67
+ pendingCredits: import("convex/values").VFloat64<number, "required">;
68
+ ledgerFingerprint: import("convex/values").VString<string, "required">;
69
+ observedAt: import("convex/values").VFloat64<number, "required">;
70
+ transactionIds: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
71
+ }, "required", "currency" | "ledgerFingerprint" | "matureNet" | "observedAt" | "pendingCredits" | "stripeTransferId" | "transactionIds">, "required">;
72
+ 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>;
73
+ attemptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
74
+ stripePayoutId: import("convex/values").VString<string | undefined, "optional">;
75
+ returnTransactionId: import("convex/values").VString<string | undefined, "optional">;
76
+ rejection: import("convex/values").VObject<{
77
+ code: "amount_too_small" | "balance_insufficient";
78
+ requestId: string;
79
+ } | undefined, {
80
+ requestId: import("convex/values").VString<string, "required">;
81
+ 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>;
82
+ }, "optional", "code" | "requestId">;
83
+ };
84
+ export declare const claimDoc: import("convex/values").VObject<{
85
+ _creationTime: number;
86
+ _id: import("convex/values").GenericId<"payoutReleaseClaims">;
87
+ accountId: string;
88
+ allocations: {
89
+ amount: number;
90
+ role?: "affiliate" | "other" | "store" | undefined;
91
+ stripeTransferId: string;
92
+ }[];
93
+ amount: number;
94
+ attemptedAt?: number | undefined;
95
+ currency: string;
96
+ expectedRevision: number;
97
+ observations: {
98
+ currency: string;
99
+ ledgerFingerprint: string;
100
+ matureNet: number;
101
+ observedAt: number;
102
+ pendingCredits: number;
103
+ stripeTransferId: string;
104
+ transactionIds: string[];
105
+ }[];
106
+ operationKey: string;
107
+ ownerKey: string;
108
+ rejection?: {
109
+ code: "amount_too_small" | "balance_insufficient";
110
+ requestId: string;
111
+ } | undefined;
112
+ returnTransactionId?: string | undefined;
113
+ status: "canceled" | "paid" | "rejected" | "reserved" | "returned" | "submitted";
114
+ stripePayoutId?: string | undefined;
115
+ }, {
116
+ accountId: import("convex/values").VString<string, "required">;
117
+ ownerKey: import("convex/values").VString<string, "required">;
118
+ operationKey: import("convex/values").VString<string, "required">;
119
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
120
+ currency: import("convex/values").VString<string, "required">;
121
+ amount: import("convex/values").VFloat64<number, "required">;
122
+ allocations: import("convex/values").VArray<{
123
+ amount: number;
124
+ role?: "affiliate" | "other" | "store" | undefined;
125
+ stripeTransferId: string;
126
+ }[], import("convex/values").VObject<{
127
+ amount: number;
128
+ role?: "affiliate" | "other" | "store" | undefined;
129
+ stripeTransferId: string;
130
+ }, {
131
+ stripeTransferId: import("convex/values").VString<string, "required">;
132
+ amount: import("convex/values").VFloat64<number, "required">;
133
+ 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>;
134
+ }, "required", "amount" | "role" | "stripeTransferId">, "required">;
135
+ observations: import("convex/values").VArray<{
136
+ currency: string;
137
+ ledgerFingerprint: string;
138
+ matureNet: number;
139
+ observedAt: number;
140
+ pendingCredits: number;
141
+ stripeTransferId: string;
142
+ transactionIds: string[];
143
+ }[], import("convex/values").VObject<{
144
+ currency: string;
145
+ ledgerFingerprint: string;
146
+ matureNet: number;
147
+ observedAt: number;
148
+ pendingCredits: number;
149
+ stripeTransferId: string;
150
+ transactionIds: string[];
151
+ }, {
152
+ stripeTransferId: import("convex/values").VString<string, "required">;
153
+ currency: import("convex/values").VString<string, "required">;
154
+ matureNet: import("convex/values").VFloat64<number, "required">;
155
+ pendingCredits: import("convex/values").VFloat64<number, "required">;
156
+ ledgerFingerprint: import("convex/values").VString<string, "required">;
157
+ observedAt: import("convex/values").VFloat64<number, "required">;
158
+ transactionIds: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
159
+ }, "required", "currency" | "ledgerFingerprint" | "matureNet" | "observedAt" | "pendingCredits" | "stripeTransferId" | "transactionIds">, "required">;
160
+ 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>;
161
+ attemptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
162
+ stripePayoutId: import("convex/values").VString<string | undefined, "optional">;
163
+ returnTransactionId: import("convex/values").VString<string | undefined, "optional">;
164
+ rejection: import("convex/values").VObject<{
165
+ code: "amount_too_small" | "balance_insufficient";
166
+ requestId: string;
167
+ } | undefined, {
168
+ requestId: import("convex/values").VString<string, "required">;
169
+ 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>;
170
+ }, "optional", "code" | "requestId">;
171
+ _id: import("convex/values").VId<import("convex/values").GenericId<"payoutReleaseClaims">, "required">;
172
+ _creationTime: import("convex/values").VFloat64<number, "required">;
173
+ }, "required", "_creationTime" | "_id" | "accountId" | "allocations" | "amount" | "attemptedAt" | "currency" | "expectedRevision" | "observations" | "operationKey" | "ownerKey" | "rejection" | "rejection.code" | "rejection.requestId" | "returnTransactionId" | "status" | "stripePayoutId">;
174
+ export declare const claimsTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
175
+ accountId: string;
176
+ allocations: {
177
+ amount: number;
178
+ role?: "affiliate" | "other" | "store" | undefined;
179
+ stripeTransferId: string;
180
+ }[];
181
+ amount: number;
182
+ attemptedAt?: number | undefined;
183
+ currency: string;
184
+ expectedRevision: number;
185
+ observations: {
186
+ currency: string;
187
+ ledgerFingerprint: string;
188
+ matureNet: number;
189
+ observedAt: number;
190
+ pendingCredits: number;
191
+ stripeTransferId: string;
192
+ transactionIds: string[];
193
+ }[];
194
+ operationKey: string;
195
+ ownerKey: string;
196
+ rejection?: {
197
+ code: "amount_too_small" | "balance_insufficient";
198
+ requestId: string;
199
+ } | undefined;
200
+ returnTransactionId?: string | undefined;
201
+ status: "canceled" | "paid" | "rejected" | "reserved" | "returned" | "submitted";
202
+ stripePayoutId?: string | undefined;
203
+ }, {
204
+ accountId: import("convex/values").VString<string, "required">;
205
+ ownerKey: import("convex/values").VString<string, "required">;
206
+ operationKey: import("convex/values").VString<string, "required">;
207
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
208
+ currency: import("convex/values").VString<string, "required">;
209
+ amount: import("convex/values").VFloat64<number, "required">;
210
+ allocations: import("convex/values").VArray<{
211
+ amount: number;
212
+ role?: "affiliate" | "other" | "store" | undefined;
213
+ stripeTransferId: string;
214
+ }[], import("convex/values").VObject<{
215
+ amount: number;
216
+ role?: "affiliate" | "other" | "store" | undefined;
217
+ stripeTransferId: string;
218
+ }, {
219
+ stripeTransferId: import("convex/values").VString<string, "required">;
220
+ amount: import("convex/values").VFloat64<number, "required">;
221
+ 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>;
222
+ }, "required", "amount" | "role" | "stripeTransferId">, "required">;
223
+ observations: import("convex/values").VArray<{
224
+ currency: string;
225
+ ledgerFingerprint: string;
226
+ matureNet: number;
227
+ observedAt: number;
228
+ pendingCredits: number;
229
+ stripeTransferId: string;
230
+ transactionIds: string[];
231
+ }[], import("convex/values").VObject<{
232
+ currency: string;
233
+ ledgerFingerprint: string;
234
+ matureNet: number;
235
+ observedAt: number;
236
+ pendingCredits: number;
237
+ stripeTransferId: string;
238
+ transactionIds: string[];
239
+ }, {
240
+ stripeTransferId: import("convex/values").VString<string, "required">;
241
+ currency: import("convex/values").VString<string, "required">;
242
+ matureNet: import("convex/values").VFloat64<number, "required">;
243
+ pendingCredits: import("convex/values").VFloat64<number, "required">;
244
+ ledgerFingerprint: import("convex/values").VString<string, "required">;
245
+ observedAt: import("convex/values").VFloat64<number, "required">;
246
+ transactionIds: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
247
+ }, "required", "currency" | "ledgerFingerprint" | "matureNet" | "observedAt" | "pendingCredits" | "stripeTransferId" | "transactionIds">, "required">;
248
+ 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>;
249
+ attemptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
250
+ stripePayoutId: import("convex/values").VString<string | undefined, "optional">;
251
+ returnTransactionId: import("convex/values").VString<string | undefined, "optional">;
252
+ rejection: import("convex/values").VObject<{
253
+ code: "amount_too_small" | "balance_insufficient";
254
+ requestId: string;
255
+ } | undefined, {
256
+ requestId: import("convex/values").VString<string, "required">;
257
+ 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>;
258
+ }, "optional", "code" | "requestId">;
259
+ }, "required", "accountId" | "allocations" | "amount" | "attemptedAt" | "currency" | "expectedRevision" | "observations" | "operationKey" | "ownerKey" | "rejection" | "rejection.code" | "rejection.requestId" | "returnTransactionId" | "status" | "stripePayoutId">, {
260
+ by_account_status: ["accountId", "status", "_creationTime"];
261
+ by_operation: ["operationKey", "_creationTime"];
262
+ by_provider_payout: ["stripePayoutId", "_creationTime"];
263
+ by_rejection_request: ["rejection.requestId", "_creationTime"];
264
+ by_return_receipt: ["returnTransactionId", "_creationTime"];
265
+ }, {}, {}>;
266
+ export declare const sourcesTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
267
+ accountId: string;
268
+ currency: string;
269
+ ownerKey: string;
270
+ paidAmount: number;
271
+ reservedAmount: number;
272
+ stripeTransferId: string;
273
+ }, {
274
+ accountId: import("convex/values").VString<string, "required">;
275
+ ownerKey: import("convex/values").VString<string, "required">;
276
+ stripeTransferId: import("convex/values").VString<string, "required">;
277
+ currency: import("convex/values").VString<string, "required">;
278
+ paidAmount: import("convex/values").VFloat64<number, "required">;
279
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
280
+ }, "required", "accountId" | "currency" | "ownerKey" | "paidAmount" | "reservedAmount" | "stripeTransferId">, {
281
+ by_account: ["accountId", "_creationTime"];
282
+ by_transfer: ["stripeTransferId", "_creationTime"];
283
+ }, {}, {}>;
284
+ export declare const identity: {
285
+ accountId: import("convex/values").VString<string, "required">;
286
+ ownerKey: import("convex/values").VString<string, "required">;
287
+ operationKey: import("convex/values").VString<string, "required">;
288
+ };
289
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/component/payoutRelease/schema.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;wIAQtB,CAAC;AACH,eAAO,MAAM,UAAU;;;;;;;;sDAMrB,CAAC;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BvB,CAAC;AACF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gSAInB,CAAC;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAKiC,CAAC;AAC1D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;UAQY,CAAC;AACtC,eAAO,MAAM,QAAQ;;;;CAA+C,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { defineTable } from "convex/server";
2
+ import { v } from "convex/values";
3
+ import { scopeFields } from "../payoutPolicy/schema.js";
4
+ export const observation = v.object({
5
+ stripeTransferId: v.string(),
6
+ currency: v.string(),
7
+ matureNet: v.number(),
8
+ pendingCredits: v.number(),
9
+ ledgerFingerprint: v.string(),
10
+ observedAt: v.number(),
11
+ transactionIds: v.array(v.string()),
12
+ });
13
+ export const allocation = v.object({
14
+ stripeTransferId: v.string(),
15
+ amount: v.number(),
16
+ role: v.optional(v.union(v.literal("store"), v.literal("affiliate"), v.literal("other"))),
17
+ });
18
+ export const claimFields = {
19
+ ...scopeFields,
20
+ operationKey: v.string(),
21
+ expectedRevision: v.number(),
22
+ currency: v.string(),
23
+ amount: v.number(),
24
+ allocations: v.array(allocation),
25
+ observations: v.array(observation),
26
+ status: v.union(v.literal("reserved"), v.literal("submitted"), v.literal("paid"), v.literal("returned"), v.literal("canceled"), v.literal("rejected")),
27
+ attemptedAt: v.optional(v.number()),
28
+ stripePayoutId: v.optional(v.string()),
29
+ returnTransactionId: v.optional(v.string()),
30
+ rejection: v.optional(v.object({
31
+ requestId: v.string(),
32
+ code: v.union(v.literal("balance_insufficient"), v.literal("amount_too_small")),
33
+ })),
34
+ };
35
+ export const claimDoc = v.object({
36
+ ...claimFields,
37
+ _id: v.id("payoutReleaseClaims"),
38
+ _creationTime: v.number(),
39
+ });
40
+ export const claimsTable = defineTable(claimFields)
41
+ .index("by_operation", ["operationKey"])
42
+ .index("by_account_status", ["accountId", "status"])
43
+ .index("by_provider_payout", ["stripePayoutId"])
44
+ .index("by_return_receipt", ["returnTransactionId"])
45
+ .index("by_rejection_request", ["rejection.requestId"]);
46
+ export const sourcesTable = defineTable({
47
+ ...scopeFields,
48
+ stripeTransferId: v.string(),
49
+ currency: v.string(),
50
+ paidAmount: v.number(),
51
+ reservedAmount: v.number(),
52
+ })
53
+ .index("by_transfer", ["stripeTransferId"])
54
+ .index("by_account", ["accountId"]);
55
+ export const identity = { ...scopeFields, operationKey: v.string() };
56
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/component/payoutRelease/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC7B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CACpC,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,IAAI,EAAE,CAAC,CAAC,QAAQ,CACd,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,OA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CAAC;AACF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,GAAG,WAAW;IACd,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,qBAAqB,CAAC;IAChC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;CAC1B,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;KAChD,KAAK,CAAC,cAAc,EAAE,CAAC,cAAc,CAAC,CAAC;KACvC,KAAK,CAAC,mBAAmB,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;KACnD,KAAK,CAAC,oBAAoB,EAAE,CAAC,gBAAgB,CAAC,CAAC;KAC/C,KAAK,CAAC,mBAAmB,EAAE,CAAC,qBAAqB,CAAC,CAAC;KACnD,KAAK,CAAC,sBAAsB,EAAE,CAAC,qBAAqB,CAAC,CAAC,CAAC;AAC1D,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC;IACtC,GAAG,WAAW;IACd,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;CAC3B,CAAC;KACC,KAAK,CAAC,aAAa,EAAE,CAAC,kBAAkB,CAAC,CAAC;KAC1C,KAAK,CAAC,YAAY,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;AACtC,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,GAAG,WAAW,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC"}
@@ -1,4 +1,114 @@
1
1
  declare const _default: import("convex/server").SchemaDefinition<{
2
+ payoutReleaseClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
3
+ accountId: string;
4
+ allocations: {
5
+ amount: number;
6
+ role?: "affiliate" | "other" | "store" | undefined;
7
+ stripeTransferId: string;
8
+ }[];
9
+ amount: number;
10
+ attemptedAt?: number | undefined;
11
+ currency: string;
12
+ expectedRevision: number;
13
+ observations: {
14
+ currency: string;
15
+ ledgerFingerprint: string;
16
+ matureNet: number;
17
+ observedAt: number;
18
+ pendingCredits: number;
19
+ stripeTransferId: string;
20
+ transactionIds: string[];
21
+ }[];
22
+ operationKey: string;
23
+ ownerKey: string;
24
+ rejection?: {
25
+ code: "amount_too_small" | "balance_insufficient";
26
+ requestId: string;
27
+ } | undefined;
28
+ returnTransactionId?: string | undefined;
29
+ status: "canceled" | "paid" | "rejected" | "reserved" | "returned" | "submitted";
30
+ stripePayoutId?: string | undefined;
31
+ }, {
32
+ accountId: import("convex/values").VString<string, "required">;
33
+ ownerKey: import("convex/values").VString<string, "required">;
34
+ operationKey: import("convex/values").VString<string, "required">;
35
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
36
+ currency: import("convex/values").VString<string, "required">;
37
+ amount: import("convex/values").VFloat64<number, "required">;
38
+ allocations: import("convex/values").VArray<{
39
+ amount: number;
40
+ role?: "affiliate" | "other" | "store" | undefined;
41
+ stripeTransferId: string;
42
+ }[], import("convex/values").VObject<{
43
+ amount: number;
44
+ role?: "affiliate" | "other" | "store" | undefined;
45
+ stripeTransferId: string;
46
+ }, {
47
+ stripeTransferId: import("convex/values").VString<string, "required">;
48
+ amount: import("convex/values").VFloat64<number, "required">;
49
+ 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>;
50
+ }, "required", "amount" | "role" | "stripeTransferId">, "required">;
51
+ observations: import("convex/values").VArray<{
52
+ currency: string;
53
+ ledgerFingerprint: string;
54
+ matureNet: number;
55
+ observedAt: number;
56
+ pendingCredits: number;
57
+ stripeTransferId: string;
58
+ transactionIds: string[];
59
+ }[], import("convex/values").VObject<{
60
+ currency: string;
61
+ ledgerFingerprint: string;
62
+ matureNet: number;
63
+ observedAt: number;
64
+ pendingCredits: number;
65
+ stripeTransferId: string;
66
+ transactionIds: string[];
67
+ }, {
68
+ stripeTransferId: import("convex/values").VString<string, "required">;
69
+ currency: import("convex/values").VString<string, "required">;
70
+ matureNet: import("convex/values").VFloat64<number, "required">;
71
+ pendingCredits: import("convex/values").VFloat64<number, "required">;
72
+ ledgerFingerprint: import("convex/values").VString<string, "required">;
73
+ observedAt: import("convex/values").VFloat64<number, "required">;
74
+ transactionIds: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
75
+ }, "required", "currency" | "ledgerFingerprint" | "matureNet" | "observedAt" | "pendingCredits" | "stripeTransferId" | "transactionIds">, "required">;
76
+ 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>;
77
+ attemptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
78
+ stripePayoutId: import("convex/values").VString<string | undefined, "optional">;
79
+ returnTransactionId: import("convex/values").VString<string | undefined, "optional">;
80
+ rejection: import("convex/values").VObject<{
81
+ code: "amount_too_small" | "balance_insufficient";
82
+ requestId: string;
83
+ } | undefined, {
84
+ requestId: import("convex/values").VString<string, "required">;
85
+ 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>;
86
+ }, "optional", "code" | "requestId">;
87
+ }, "required", "accountId" | "allocations" | "amount" | "attemptedAt" | "currency" | "expectedRevision" | "observations" | "operationKey" | "ownerKey" | "rejection" | "rejection.code" | "rejection.requestId" | "returnTransactionId" | "status" | "stripePayoutId">, {
88
+ by_account_status: ["accountId", "status", "_creationTime"];
89
+ by_operation: ["operationKey", "_creationTime"];
90
+ by_provider_payout: ["stripePayoutId", "_creationTime"];
91
+ by_rejection_request: ["rejection.requestId", "_creationTime"];
92
+ by_return_receipt: ["returnTransactionId", "_creationTime"];
93
+ }, {}, {}>;
94
+ payoutSourceAllocations: import("convex/server").TableDefinition<import("convex/values").VObject<{
95
+ accountId: string;
96
+ currency: string;
97
+ ownerKey: string;
98
+ paidAmount: number;
99
+ reservedAmount: number;
100
+ stripeTransferId: string;
101
+ }, {
102
+ accountId: import("convex/values").VString<string, "required">;
103
+ ownerKey: import("convex/values").VString<string, "required">;
104
+ stripeTransferId: import("convex/values").VString<string, "required">;
105
+ currency: import("convex/values").VString<string, "required">;
106
+ paidAmount: import("convex/values").VFloat64<number, "required">;
107
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
108
+ }, "required", "accountId" | "currency" | "ownerKey" | "paidAmount" | "reservedAmount" | "stripeTransferId">, {
109
+ by_account: ["accountId", "_creationTime"];
110
+ by_transfer: ["stripeTransferId", "_creationTime"];
111
+ }, {}, {}>;
2
112
  payoutPolicies: import("convex/server").TableDefinition<import("convex/values").VObject<{
3
113
  accountId: string;
4
114
  country: string;
@@ -1,3 +1,4 @@
1
+ import { claimsTable as payoutReleaseClaimsTable, sourcesTable as payoutSourceAllocationsTable, } from "./payoutRelease/schema.js";
1
2
  import { policiesTable, operationsTable } from "./payoutPolicy/schema.js";
2
3
  import { currencyTotalsTable } from "./earnings/schema.js";
3
4
  import { claimsTable, balancesTable, groupsTable, reservationsTable, } from "./costRecovery/schema";
@@ -9,6 +10,8 @@ import { accountsTable } from "./core/schema";
9
10
  import { pricesTable, productsTable } from "./products/schema";
10
11
  import { webhookEventsTable } from "./webhooks/schema";
11
12
  export default defineSchema({
13
+ payoutReleaseClaims: payoutReleaseClaimsTable,
14
+ payoutSourceAllocations: payoutSourceAllocationsTable,
12
15
  payoutPolicies: policiesTable,
13
16
  payoutPolicyOperations: operationsTable,
14
17
  currencyTotals: currencyTotalsTable,
@@ -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IACrD,cAAc,EAAE,aAAa;IAC7B,sBAAsB,EAAE,eAAe;IACvC,cAAc,EAAE,mBAAmB;IACnC,cAAc,EAAE,WAAW;IAC3B,gBAAgB,EAAE,aAAa;IAC/B,cAAc,EAAE,WAAW;IAC3B,oBAAoB,EAAE,iBAAiB;IACvC,qBAAqB,EAAE,gBAAgB;IACvC,eAAe,EAAE,oBAAoB;IACrC,mBAAmB,EAAE,wBAAwB;IAC7C,OAAO;IACP,QAAQ,EAAE,aAAa;IAEvB,WAAW;IACX,QAAQ,EAAE,aAAa;IACvB,MAAM,EAAE,WAAW;IAEnB,UAAU;IACV,aAAa,EAAE,kBAAkB;IACjC,gBAAgB,EAAE,qBAAqB;IACvC,QAAQ,EAAE,aAAa;IAEvB,UAAU;IACV,QAAQ,EAAE,aAAa;IACvB,OAAO,EAAE,YAAY;IACrB,iBAAiB,EAAE,sBAAsB;IACzC,OAAO,EAAE,YAAY;IACrB,QAAQ,EAAE,aAAa;IACvB,SAAS,EAAE,cAAc;IACzB,mBAAmB,EAAE,wBAAwB;IAE7C,WAAW;IACX,aAAa,EAAE,kBAAkB;CAClC,CAAC,CAAC"}
@@ -218,3 +218,84 @@ numeric payout-floor field, and retained balance reserves are not payout trigger
218
218
  Sources: [payout schedules](https://docs.stripe.com/connect/manage-payout-schedule),
219
219
  [manual payout holding limits](https://docs.stripe.com/connect/manual-payouts), and
220
220
  [Dashboard control limits](https://docs.stripe.com/connect/platform-controls-for-stripe-dashboard-accounts#control-payout-timing).
221
+
222
+ ### Transactional claim ledger implementation status
223
+
224
+ The component contains `payoutRelease` claim and source-allocation tables. These
225
+ are server-side building blocks for the release boundary, with no public client
226
+ executor or scheduled bank-payout integration yet. Do not call the claim
227
+ mutation with UI totals or a transfer receipt alone. Its trusted upstream caller
228
+ must establish complete provider history, still-unpaid ownership, adoption of
229
+ prior payouts, independent liabilities, and live payout controls first.
230
+
231
+ A claim combines mature creator and affiliate entitlement within one currency.
232
+ It deducts persisted paid and reserved allocations, keeps negative entitlement
233
+ after refunds, and caps the allocation by provider availability after independent
234
+ liabilities. Sources and policy revision are checked transactionally. One
235
+ unresolved account claim blocks competing reservations. An attempted claim
236
+ cannot be canceled merely because the provider timed out. Accepted payouts keep
237
+ their allocations reserved until payment is confirmed; a failed or canceled
238
+ payout releases allocations only after its provider return transaction has been
239
+ verified upstream. Return receipt identities cannot be reused across claims. A verified create
240
+ rejection for insufficient balance or an amount below the provider floor can
241
+ release an unaccepted claim within a conservative 23-hour window. It requires
242
+ its own unique Stripe request receipt; ambiguous errors and older attempts stay
243
+ held. This window stays below Stripe's [24-hour v1 idempotency retention minimum](https://docs.stripe.com/api/idempotent_requests).
244
+
245
+ The current claim snapshot is deliberately bounded to 100 account transfer rows
246
+ and 1,000 receipt IDs per source. Larger or incomplete histories reject the whole
247
+ claim, without using partial totals. A resumable reconciliation/adoption process,
248
+ provider payout creation and receipt verification, payout-fee accounting, and
249
+ recurring release/expiry integration remain required before custom payout
250
+ minimums can be presented as an operational feature. In-memory claim tests are
251
+ not evidence of a completed Stripe bank payout.
252
+
253
+ ## Verified recipient funding receipts
254
+
255
+ Use `stripe.payoutPolicy.transferReceipt(ctx, { accountId, stripeTransferId })`
256
+ in an authorized action to read a transfer's actual recipient funding. The
257
+ reader binds the component ledger to the provider transfer, destination payment,
258
+ original balance transaction and each transfer reversal's recipient refund.
259
+ It verifies account, amount, currency and source identities, and rechecks the
260
+ transfer and ledger before publishing a result. It performs no financial writes.
261
+
262
+ A `ready` result contains exact signed recipient settlement transactions and
263
+ `totalNet`, `matureNet`, and `pendingCredits`. `sourceCurrency` describes the
264
+ original transfer; `settlementCurrency` describes the actual recipient balance.
265
+ For supported FX receipts, amounts come directly from Stripe's settlement
266
+ transactions; the reader does not calculate exchange-rate conversions. Mixed
267
+ settlement currencies or missing conversion evidence require explicit allocation.
268
+ Transaction `created` and `availableOn` values are Unix seconds; the snapshot's
269
+ `observedAt` is milliseconds.
270
+
271
+ Positive credits qualify as mature only when their provider status is available
272
+ and their availability date has passed. Pending debits first cancel the matching
273
+ pending original credit; uncovered pending debits reduce mature credit. Other
274
+ positive pending adjustments never qualify early. Signed mature debt is preserved.
275
+ For example, in one settlement currency's minor units:
276
+
277
+ | Original credit | Reversal/debit | Total net | Mature net | Pending credits |
278
+ | --------------- | -------------- | --------: | ---------: | --------------: |
279
+ | 1000 pending | 250 pending | 750 | 0 | 750 |
280
+ | 1000 available | 250 pending | 750 | 750 | 0 |
281
+ | 1000 pending | 1000 pending | 0 | 0 | 0 |
282
+ | 1000 pending | 250 available | 750 | -250 | 1000 |
283
+
284
+ This is **received credit, not still-unpaid entitlement**. Previous bank payouts,
285
+ source allocations, recovery liabilities and outstanding reservations must be
286
+ reconciled before any release. Do not pay `matureNet` directly or infer ownership
287
+ from unrelated account-wide available funds. Stripe's balance-transaction
288
+ `payout` filter maps automatic payouts only; application-created manual payouts
289
+ need a maintained allocation ledger.
290
+
291
+ The default budget is 20 provider requests; `maxRequests` accepts 1–100. Exhausted
292
+ or incomplete history returns `not_ready` without partial financial totals.
293
+ Reserved reversal claims, changing provider/ledger snapshots and unavailable
294
+ receipts also fail closed. Identity mismatches and invalid financial arithmetic
295
+ throw. Larger histories need continued reconciliation rather than treating the
296
+ missing amount as zero or silently truncating it. The original transfer ledger
297
+ remains intact for retries.
298
+
299
+ Sources: [transfer provenance](https://docs.stripe.com/api/transfers/object),
300
+ [receipt maturity](https://docs.stripe.com/api/balance_transactions/object), and
301
+ [history pagination and payout-filter limits](https://docs.stripe.com/api/balance_transactions/list).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fantastic.dev/better-stripe",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
4
4
  "description": "A Convex component for Stripe V2 Accounts API integration.",
5
5
  "keywords": [
6
6
  "stripe",