@fantastic.dev/better-stripe 0.22.0 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +5 -3
- package/dist/client/connect/payoutActivationProof.d.ts +16 -0
- package/dist/client/connect/payoutActivationProof.d.ts.map +1 -0
- package/dist/client/connect/payoutActivationProof.js +72 -0
- package/dist/client/connect/payoutActivationProof.js.map +1 -0
- package/dist/client/connect/payoutAdoption.d.ts +35 -0
- package/dist/client/connect/payoutAdoption.d.ts.map +1 -0
- package/dist/client/connect/payoutAdoption.js +231 -0
- package/dist/client/connect/payoutAdoption.js.map +1 -0
- package/dist/client/connect/payoutAdoptionAge.d.ts +19 -0
- package/dist/client/connect/payoutAdoptionAge.d.ts.map +1 -0
- package/dist/client/connect/payoutAdoptionAge.js +56 -0
- package/dist/client/connect/payoutAdoptionAge.js.map +1 -0
- package/dist/client/connect/payoutAdoptionAllocation.d.ts +24 -0
- package/dist/client/connect/payoutAdoptionAllocation.d.ts.map +1 -0
- package/dist/client/connect/payoutAdoptionAllocation.js +78 -0
- package/dist/client/connect/payoutAdoptionAllocation.js.map +1 -0
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +2617 -0
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -0
- package/dist/client/connect/payoutAdoptionTestHelpers.js +231 -0
- package/dist/client/connect/payoutAdoptionTestHelpers.js.map +1 -0
- package/dist/client/connect/payoutReconciliation.d.ts.map +1 -1
- package/dist/client/connect/payoutReconciliation.js +4 -2
- package/dist/client/connect/payoutReconciliation.js.map +1 -1
- package/dist/client/payoutPolicy.d.ts +7 -1
- package/dist/client/payoutPolicy.d.ts.map +1 -1
- package/dist/client/payoutPolicy.js +78 -7
- package/dist/client/payoutPolicy.js.map +1 -1
- package/dist/component/_generated/component.d.ts +196 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/earnings/triggers.d.ts +38 -4
- package/dist/component/earnings/triggers.d.ts.map +1 -1
- package/dist/component/payoutPolicy/adoption.d.ts +9 -0
- package/dist/component/payoutPolicy/adoption.d.ts.map +1 -0
- package/dist/component/payoutPolicy/adoption.js +45 -0
- package/dist/component/payoutPolicy/adoption.js.map +1 -0
- package/dist/component/payoutPolicy/mutations.d.ts +96 -0
- package/dist/component/payoutPolicy/mutations.d.ts.map +1 -1
- package/dist/component/payoutPolicy/mutations.js +38 -5
- package/dist/component/payoutPolicy/mutations.js.map +1 -1
- package/dist/component/payoutPolicy/queries.d.ts +16 -0
- package/dist/component/payoutPolicy/queries.d.ts.map +1 -1
- package/dist/component/payoutPolicy/schema.d.ts +299 -2
- package/dist/component/payoutPolicy/schema.d.ts.map +1 -1
- package/dist/component/payoutPolicy/schema.js +7 -0
- package/dist/component/payoutPolicy/schema.js.map +1 -1
- package/dist/component/payoutRelease/adoption.d.ts +269 -0
- package/dist/component/payoutRelease/adoption.d.ts.map +1 -0
- package/dist/component/payoutRelease/adoption.js +197 -0
- package/dist/component/payoutRelease/adoption.js.map +1 -0
- package/dist/component/payoutRelease/helpers.d.ts +3 -0
- package/dist/component/payoutRelease/helpers.d.ts.map +1 -1
- package/dist/component/payoutRelease/helpers.js +20 -0
- package/dist/component/payoutRelease/helpers.js.map +1 -1
- package/dist/component/payoutRelease/mutations.d.ts +81 -0
- package/dist/component/payoutRelease/mutations.d.ts.map +1 -1
- package/dist/component/payoutRelease/mutations.js +6 -0
- package/dist/component/payoutRelease/mutations.js.map +1 -1
- package/dist/component/payoutRelease/observation.d.ts +18 -0
- package/dist/component/payoutRelease/observation.d.ts.map +1 -0
- package/dist/component/payoutRelease/observation.js +11 -0
- package/dist/component/payoutRelease/observation.js.map +1 -0
- package/dist/component/payoutRelease/queries.d.ts +3 -0
- package/dist/component/payoutRelease/queries.d.ts.map +1 -1
- package/dist/component/payoutRelease/schema.d.ts +8 -19
- package/dist/component/payoutRelease/schema.d.ts.map +1 -1
- package/dist/component/payoutRelease/schema.js +3 -9
- package/dist/component/payoutRelease/schema.js.map +1 -1
- package/dist/component/schema.d.ts +73 -2
- package/docs/settlement.md +127 -40
- package/package.json +1 -1
- package/src/client/connect/payoutActivationProof.ts +101 -0
- package/src/client/connect/payoutAdoption.test.ts +186 -0
- package/src/client/connect/payoutAdoption.ts +331 -0
- package/src/client/connect/payoutAdoptionAge.test.ts +89 -0
- package/src/client/connect/payoutAdoptionAge.ts +74 -0
- package/src/client/connect/payoutAdoptionAllocation.test.ts +132 -0
- package/src/client/connect/payoutAdoptionAllocation.ts +106 -0
- package/src/client/connect/payoutAdoptionTestHelpers.ts +253 -0
- package/src/client/connect/payoutReconciliation.test.ts +16 -0
- package/src/client/connect/payoutReconciliation.ts +6 -2
- package/src/client/connect/payoutReturnedAdoption.test.ts +157 -0
- package/src/client/payoutPolicy.test.ts +16 -0
- package/src/client/payoutPolicy.ts +107 -5
- package/src/component/_generated/api.ts +6 -0
- package/src/component/_generated/component.ts +192 -1
- package/src/component/payout-adoption.test.ts +272 -0
- package/src/component/payout-policy-adoption.test.ts +131 -0
- package/src/component/payoutPolicy/adoption.ts +76 -0
- package/src/component/payoutPolicy/mutations.ts +46 -3
- package/src/component/payoutPolicy/schema.ts +9 -0
- package/src/component/payoutRelease/adoption.ts +262 -0
- package/src/component/payoutRelease/helpers.ts +21 -0
- package/src/component/payoutRelease/mutations.ts +10 -0
- package/src/component/payoutRelease/observation.ts +10 -0
- package/src/component/payoutRelease/schema.ts +3 -9
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { type Infer } from "convex/values";
|
|
2
|
+
import type { MutationCtx } from "../_generated/server.js";
|
|
3
|
+
export declare const historicalArgs: {
|
|
4
|
+
accountId: import("convex/values").VString<string, "required">;
|
|
5
|
+
ownerKey: import("convex/values").VString<string, "required">;
|
|
6
|
+
expectedRevision: import("convex/values").VFloat64<number, "required">;
|
|
7
|
+
payout: import("convex/values").VObject<{
|
|
8
|
+
amount: number;
|
|
9
|
+
created: number;
|
|
10
|
+
currency: string;
|
|
11
|
+
debitFee: number;
|
|
12
|
+
debitTransactionId: string;
|
|
13
|
+
destinationId: string;
|
|
14
|
+
returnFee?: number | undefined;
|
|
15
|
+
returnTransactionId?: string | undefined;
|
|
16
|
+
status: "paid" | "returned";
|
|
17
|
+
stripePayoutId: string;
|
|
18
|
+
}, {
|
|
19
|
+
stripePayoutId: import("convex/values").VString<string, "required">;
|
|
20
|
+
amount: import("convex/values").VFloat64<number, "required">;
|
|
21
|
+
currency: import("convex/values").VString<string, "required">;
|
|
22
|
+
created: import("convex/values").VFloat64<number, "required">;
|
|
23
|
+
destinationId: import("convex/values").VString<string, "required">;
|
|
24
|
+
status: import("convex/values").VUnion<"paid" | "returned", [import("convex/values").VLiteral<"paid", "required">, import("convex/values").VLiteral<"returned", "required">], "required", never>;
|
|
25
|
+
debitTransactionId: import("convex/values").VString<string, "required">;
|
|
26
|
+
debitFee: import("convex/values").VFloat64<number, "required">;
|
|
27
|
+
returnTransactionId: import("convex/values").VString<string | undefined, "optional">;
|
|
28
|
+
returnFee: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
29
|
+
}, "required", "amount" | "created" | "currency" | "debitFee" | "debitTransactionId" | "destinationId" | "returnFee" | "returnTransactionId" | "status" | "stripePayoutId">;
|
|
30
|
+
allocations: import("convex/values").VArray<{
|
|
31
|
+
amount: number;
|
|
32
|
+
role?: "affiliate" | "other" | "store" | undefined;
|
|
33
|
+
stripeTransferId: string;
|
|
34
|
+
}[], import("convex/values").VObject<{
|
|
35
|
+
amount: number;
|
|
36
|
+
role?: "affiliate" | "other" | "store" | undefined;
|
|
37
|
+
stripeTransferId: string;
|
|
38
|
+
}, {
|
|
39
|
+
stripeTransferId: import("convex/values").VString<string, "required">;
|
|
40
|
+
amount: import("convex/values").VFloat64<number, "required">;
|
|
41
|
+
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>;
|
|
42
|
+
}, "required", "amount" | "role" | "stripeTransferId">, "required">;
|
|
43
|
+
observations: import("convex/values").VArray<{
|
|
44
|
+
currency: string;
|
|
45
|
+
ledgerFingerprint: string;
|
|
46
|
+
matureNet: number;
|
|
47
|
+
observedAt: number;
|
|
48
|
+
pendingCredits: number;
|
|
49
|
+
stripeTransferId: string;
|
|
50
|
+
transactionIds: string[];
|
|
51
|
+
}[], import("convex/values").VObject<{
|
|
52
|
+
currency: string;
|
|
53
|
+
ledgerFingerprint: string;
|
|
54
|
+
matureNet: number;
|
|
55
|
+
observedAt: number;
|
|
56
|
+
pendingCredits: number;
|
|
57
|
+
stripeTransferId: string;
|
|
58
|
+
transactionIds: string[];
|
|
59
|
+
}, {
|
|
60
|
+
stripeTransferId: import("convex/values").VString<string, "required">;
|
|
61
|
+
currency: import("convex/values").VString<string, "required">;
|
|
62
|
+
matureNet: import("convex/values").VFloat64<number, "required">;
|
|
63
|
+
pendingCredits: import("convex/values").VFloat64<number, "required">;
|
|
64
|
+
ledgerFingerprint: import("convex/values").VString<string, "required">;
|
|
65
|
+
observedAt: import("convex/values").VFloat64<number, "required">;
|
|
66
|
+
transactionIds: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
|
|
67
|
+
}, "required", "currency" | "ledgerFingerprint" | "matureNet" | "observedAt" | "pendingCredits" | "stripeTransferId" | "transactionIds">, "required">;
|
|
68
|
+
};
|
|
69
|
+
type Args = {
|
|
70
|
+
[K in keyof typeof historicalArgs]: Infer<(typeof historicalArgs)[K]>;
|
|
71
|
+
};
|
|
72
|
+
/** Trusted package observations only. Provider history and historical maturity are verified upstream. */
|
|
73
|
+
export declare function adoptHistoricalPayout(ctx: MutationCtx, args: Args): Promise<{
|
|
74
|
+
_creationTime: number;
|
|
75
|
+
_id: import("convex/values").GenericId<"payoutReleaseClaims">;
|
|
76
|
+
accountId: string;
|
|
77
|
+
allocations: {
|
|
78
|
+
amount: number;
|
|
79
|
+
role?: "affiliate" | "other" | "store" | undefined;
|
|
80
|
+
stripeTransferId: string;
|
|
81
|
+
}[];
|
|
82
|
+
amount: number;
|
|
83
|
+
attemptedAt?: number | undefined;
|
|
84
|
+
currency: string;
|
|
85
|
+
debitFee?: number | undefined;
|
|
86
|
+
debitTransactionId?: string | undefined;
|
|
87
|
+
destinationId?: string | undefined;
|
|
88
|
+
expectedRevision: number;
|
|
89
|
+
feeRevision?: number | undefined;
|
|
90
|
+
historical?: boolean | undefined;
|
|
91
|
+
observations: {
|
|
92
|
+
currency: string;
|
|
93
|
+
ledgerFingerprint: string;
|
|
94
|
+
matureNet: number;
|
|
95
|
+
observedAt: number;
|
|
96
|
+
pendingCredits: number;
|
|
97
|
+
stripeTransferId: string;
|
|
98
|
+
transactionIds: string[];
|
|
99
|
+
}[];
|
|
100
|
+
operationKey: string;
|
|
101
|
+
ownerKey: string;
|
|
102
|
+
providerFee?: number | undefined;
|
|
103
|
+
rejection?: {
|
|
104
|
+
code: "amount_too_small" | "balance_insufficient";
|
|
105
|
+
requestId: string;
|
|
106
|
+
} | undefined;
|
|
107
|
+
returnTransactionId?: string | undefined;
|
|
108
|
+
status: "canceled" | "paid" | "rejected" | "reserved" | "returned" | "submitted";
|
|
109
|
+
stripePayoutId?: string | undefined;
|
|
110
|
+
}>;
|
|
111
|
+
export declare const historicalBatchArgs: {
|
|
112
|
+
accountId: import("convex/values").VString<string, "required">;
|
|
113
|
+
ownerKey: import("convex/values").VString<string, "required">;
|
|
114
|
+
expectedRevision: import("convex/values").VFloat64<number, "required">;
|
|
115
|
+
observations: import("convex/values").VArray<{
|
|
116
|
+
currency: string;
|
|
117
|
+
ledgerFingerprint: string;
|
|
118
|
+
matureNet: number;
|
|
119
|
+
observedAt: number;
|
|
120
|
+
pendingCredits: number;
|
|
121
|
+
stripeTransferId: string;
|
|
122
|
+
transactionIds: string[];
|
|
123
|
+
}[], import("convex/values").VObject<{
|
|
124
|
+
currency: string;
|
|
125
|
+
ledgerFingerprint: string;
|
|
126
|
+
matureNet: number;
|
|
127
|
+
observedAt: number;
|
|
128
|
+
pendingCredits: number;
|
|
129
|
+
stripeTransferId: string;
|
|
130
|
+
transactionIds: string[];
|
|
131
|
+
}, {
|
|
132
|
+
stripeTransferId: import("convex/values").VString<string, "required">;
|
|
133
|
+
currency: import("convex/values").VString<string, "required">;
|
|
134
|
+
matureNet: import("convex/values").VFloat64<number, "required">;
|
|
135
|
+
pendingCredits: import("convex/values").VFloat64<number, "required">;
|
|
136
|
+
ledgerFingerprint: import("convex/values").VString<string, "required">;
|
|
137
|
+
observedAt: import("convex/values").VFloat64<number, "required">;
|
|
138
|
+
transactionIds: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
|
|
139
|
+
}, "required", "currency" | "ledgerFingerprint" | "matureNet" | "observedAt" | "pendingCredits" | "stripeTransferId" | "transactionIds">, "required">;
|
|
140
|
+
expectedClaims: import("convex/values").VArray<{
|
|
141
|
+
fingerprint: string;
|
|
142
|
+
operationKey: string;
|
|
143
|
+
}[], import("convex/values").VObject<{
|
|
144
|
+
fingerprint: string;
|
|
145
|
+
operationKey: string;
|
|
146
|
+
}, {
|
|
147
|
+
operationKey: import("convex/values").VString<string, "required">;
|
|
148
|
+
fingerprint: import("convex/values").VString<string, "required">;
|
|
149
|
+
}, "required", "fingerprint" | "operationKey">, "required">;
|
|
150
|
+
payouts: import("convex/values").VArray<{
|
|
151
|
+
allocations: {
|
|
152
|
+
amount: number;
|
|
153
|
+
role?: "affiliate" | "other" | "store" | undefined;
|
|
154
|
+
stripeTransferId: string;
|
|
155
|
+
}[];
|
|
156
|
+
payout: {
|
|
157
|
+
amount: number;
|
|
158
|
+
created: number;
|
|
159
|
+
currency: string;
|
|
160
|
+
debitFee: number;
|
|
161
|
+
debitTransactionId: string;
|
|
162
|
+
destinationId: string;
|
|
163
|
+
returnFee?: number | undefined;
|
|
164
|
+
returnTransactionId?: string | undefined;
|
|
165
|
+
status: "paid" | "returned";
|
|
166
|
+
stripePayoutId: string;
|
|
167
|
+
};
|
|
168
|
+
}[], import("convex/values").VObject<{
|
|
169
|
+
allocations: {
|
|
170
|
+
amount: number;
|
|
171
|
+
role?: "affiliate" | "other" | "store" | undefined;
|
|
172
|
+
stripeTransferId: string;
|
|
173
|
+
}[];
|
|
174
|
+
payout: {
|
|
175
|
+
amount: number;
|
|
176
|
+
created: number;
|
|
177
|
+
currency: string;
|
|
178
|
+
debitFee: number;
|
|
179
|
+
debitTransactionId: string;
|
|
180
|
+
destinationId: string;
|
|
181
|
+
returnFee?: number | undefined;
|
|
182
|
+
returnTransactionId?: string | undefined;
|
|
183
|
+
status: "paid" | "returned";
|
|
184
|
+
stripePayoutId: string;
|
|
185
|
+
};
|
|
186
|
+
}, {
|
|
187
|
+
payout: import("convex/values").VObject<{
|
|
188
|
+
amount: number;
|
|
189
|
+
created: number;
|
|
190
|
+
currency: string;
|
|
191
|
+
debitFee: number;
|
|
192
|
+
debitTransactionId: string;
|
|
193
|
+
destinationId: string;
|
|
194
|
+
returnFee?: number | undefined;
|
|
195
|
+
returnTransactionId?: string | undefined;
|
|
196
|
+
status: "paid" | "returned";
|
|
197
|
+
stripePayoutId: string;
|
|
198
|
+
}, {
|
|
199
|
+
stripePayoutId: import("convex/values").VString<string, "required">;
|
|
200
|
+
amount: import("convex/values").VFloat64<number, "required">;
|
|
201
|
+
currency: import("convex/values").VString<string, "required">;
|
|
202
|
+
created: import("convex/values").VFloat64<number, "required">;
|
|
203
|
+
destinationId: import("convex/values").VString<string, "required">;
|
|
204
|
+
status: import("convex/values").VUnion<"paid" | "returned", [import("convex/values").VLiteral<"paid", "required">, import("convex/values").VLiteral<"returned", "required">], "required", never>;
|
|
205
|
+
debitTransactionId: import("convex/values").VString<string, "required">;
|
|
206
|
+
debitFee: import("convex/values").VFloat64<number, "required">;
|
|
207
|
+
returnTransactionId: import("convex/values").VString<string | undefined, "optional">;
|
|
208
|
+
returnFee: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
209
|
+
}, "required", "amount" | "created" | "currency" | "debitFee" | "debitTransactionId" | "destinationId" | "returnFee" | "returnTransactionId" | "status" | "stripePayoutId">;
|
|
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
|
+
}, "required", "allocations" | "payout" | "payout.amount" | "payout.created" | "payout.currency" | "payout.debitFee" | "payout.debitTransactionId" | "payout.destinationId" | "payout.returnFee" | "payout.returnTransactionId" | "payout.status" | "payout.stripePayoutId">, "required">;
|
|
224
|
+
};
|
|
225
|
+
type BatchArgs = {
|
|
226
|
+
[K in keyof typeof historicalBatchArgs]: Infer<(typeof historicalBatchArgs)[K]>;
|
|
227
|
+
};
|
|
228
|
+
export declare function adoptHistoricalBatch(ctx: MutationCtx, args: BatchArgs): Promise<{
|
|
229
|
+
claims: {
|
|
230
|
+
_creationTime: number;
|
|
231
|
+
_id: import("convex/values").GenericId<"payoutReleaseClaims">;
|
|
232
|
+
accountId: string;
|
|
233
|
+
allocations: {
|
|
234
|
+
amount: number;
|
|
235
|
+
role?: "affiliate" | "other" | "store" | undefined;
|
|
236
|
+
stripeTransferId: string;
|
|
237
|
+
}[];
|
|
238
|
+
amount: number;
|
|
239
|
+
attemptedAt?: number | undefined;
|
|
240
|
+
currency: string;
|
|
241
|
+
debitFee?: number | undefined;
|
|
242
|
+
debitTransactionId?: string | undefined;
|
|
243
|
+
destinationId?: string | undefined;
|
|
244
|
+
expectedRevision: number;
|
|
245
|
+
feeRevision?: number | undefined;
|
|
246
|
+
historical?: boolean | undefined;
|
|
247
|
+
observations: {
|
|
248
|
+
currency: string;
|
|
249
|
+
ledgerFingerprint: string;
|
|
250
|
+
matureNet: number;
|
|
251
|
+
observedAt: number;
|
|
252
|
+
pendingCredits: number;
|
|
253
|
+
stripeTransferId: string;
|
|
254
|
+
transactionIds: string[];
|
|
255
|
+
}[];
|
|
256
|
+
operationKey: string;
|
|
257
|
+
ownerKey: string;
|
|
258
|
+
providerFee?: number | undefined;
|
|
259
|
+
rejection?: {
|
|
260
|
+
code: "amount_too_small" | "balance_insufficient";
|
|
261
|
+
requestId: string;
|
|
262
|
+
} | undefined;
|
|
263
|
+
returnTransactionId?: string | undefined;
|
|
264
|
+
status: "canceled" | "paid" | "rejected" | "reserved" | "returned" | "submitted";
|
|
265
|
+
stripePayoutId?: string | undefined;
|
|
266
|
+
}[];
|
|
267
|
+
}>;
|
|
268
|
+
export {};
|
|
269
|
+
//# sourceMappingURL=adoption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adoption.d.ts","sourceRoot":"","sources":["../../../src/component/payoutRelease/adoption.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAW3D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiB1B,CAAC;AACF,KAAK,IAAI,GAAG;KACT,CAAC,IAAI,MAAM,OAAO,cAAc,GAAG,KAAK,CAAC,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;CACtE,CAAC;AACF,yGAAyG;AACzG,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6KvE;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAa/B,CAAC;AACF,KAAK,SAAS,GAAG;KACd,CAAC,IAAI,MAAM,OAAO,mBAAmB,GAAG,KAAK,CAC5C,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAChC;CACF,CAAC;AACF,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiC3E"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { v } from "convex/values";
|
|
2
|
+
import { scopeFields } from "../payoutPolicy/schema.js";
|
|
3
|
+
import { readPolicy } from "../payoutPolicy/helpers.js";
|
|
4
|
+
import { observation, allocation } from "./schema.js";
|
|
5
|
+
import { add, checkSnapshot, sourceById, payoutClaimFingerprint, } from "./helpers.js";
|
|
6
|
+
import { recordFees } from "./fees.js";
|
|
7
|
+
export const historicalArgs = {
|
|
8
|
+
...scopeFields,
|
|
9
|
+
expectedRevision: v.number(),
|
|
10
|
+
payout: v.object({
|
|
11
|
+
stripePayoutId: v.string(),
|
|
12
|
+
amount: v.number(),
|
|
13
|
+
currency: v.string(),
|
|
14
|
+
created: v.number(),
|
|
15
|
+
destinationId: v.string(),
|
|
16
|
+
status: v.union(v.literal("paid"), v.literal("returned")),
|
|
17
|
+
debitTransactionId: v.string(),
|
|
18
|
+
debitFee: v.number(),
|
|
19
|
+
returnTransactionId: v.optional(v.string()),
|
|
20
|
+
returnFee: v.optional(v.number()),
|
|
21
|
+
}),
|
|
22
|
+
allocations: v.array(allocation),
|
|
23
|
+
observations: v.array(observation),
|
|
24
|
+
};
|
|
25
|
+
/** Trusted package observations only. Provider history and historical maturity are verified upstream. */
|
|
26
|
+
export async function adoptHistoricalPayout(ctx, args) {
|
|
27
|
+
const policy = await readPolicy(ctx, args);
|
|
28
|
+
if (!policy || policy.revision !== args.expectedRevision)
|
|
29
|
+
throw new Error("Historical payout policy revision changed.");
|
|
30
|
+
if (policy.mode !== "stripe_managed" || policy.status !== "ready")
|
|
31
|
+
throw new Error("Historical adoption requires an inactive automatic policy.");
|
|
32
|
+
const p = args.payout;
|
|
33
|
+
if (!/^po_\w+$/.test(p.stripePayoutId) ||
|
|
34
|
+
!/^ba_\w+$/.test(p.destinationId) ||
|
|
35
|
+
!/^[a-z]{3}$/.test(p.currency) ||
|
|
36
|
+
!Number.isSafeInteger(p.amount) ||
|
|
37
|
+
p.amount <= 0 ||
|
|
38
|
+
!Number.isSafeInteger(p.created) ||
|
|
39
|
+
p.created < 0 ||
|
|
40
|
+
p.created * 1000 > Date.now() ||
|
|
41
|
+
!Number.isSafeInteger(p.created * 1000) ||
|
|
42
|
+
!/^txn_\w+$/.test(p.debitTransactionId) ||
|
|
43
|
+
!Number.isSafeInteger(p.debitFee) ||
|
|
44
|
+
p.debitFee < 0 ||
|
|
45
|
+
(p.status === "returned"
|
|
46
|
+
? !p.returnTransactionId ||
|
|
47
|
+
!/^txn_\w+$/.test(p.returnTransactionId) ||
|
|
48
|
+
!Number.isSafeInteger(p.returnFee)
|
|
49
|
+
: p.returnTransactionId !== undefined || p.returnFee !== undefined))
|
|
50
|
+
throw new Error("Invalid historical payout receipt.");
|
|
51
|
+
const rows = await checkSnapshot(ctx, args.accountId, args.observations, true);
|
|
52
|
+
const byObservation = new Map(args.observations.map((o) => [o.stripeTransferId, o]));
|
|
53
|
+
const seen = new Set();
|
|
54
|
+
let total = 0;
|
|
55
|
+
const allocations = args.allocations
|
|
56
|
+
.map((a) => {
|
|
57
|
+
if (!Number.isSafeInteger(a.amount) ||
|
|
58
|
+
a.amount <= 0 ||
|
|
59
|
+
seen.has(a.stripeTransferId) ||
|
|
60
|
+
!rows.has(a.stripeTransferId) ||
|
|
61
|
+
byObservation.get(a.stripeTransferId)?.currency !== p.currency)
|
|
62
|
+
throw new Error("Invalid historical source allocation.");
|
|
63
|
+
seen.add(a.stripeTransferId);
|
|
64
|
+
total = add(total, a.amount);
|
|
65
|
+
const role = rows.get(a.stripeTransferId).role;
|
|
66
|
+
return {
|
|
67
|
+
stripeTransferId: a.stripeTransferId,
|
|
68
|
+
amount: a.amount,
|
|
69
|
+
...(role ? { role } : {}),
|
|
70
|
+
};
|
|
71
|
+
})
|
|
72
|
+
.sort((a, b) => a.stripeTransferId.localeCompare(b.stripeTransferId));
|
|
73
|
+
if (total !== p.amount)
|
|
74
|
+
throw new Error("Historical source allocations do not equal payout principal.");
|
|
75
|
+
const operationKey = `bs:historical:${p.stripePayoutId}`;
|
|
76
|
+
const old = await ctx.db
|
|
77
|
+
.query("payoutReleaseClaims")
|
|
78
|
+
.withIndex("by_provider_payout", (q) => q.eq("stripePayoutId", p.stripePayoutId))
|
|
79
|
+
.unique();
|
|
80
|
+
if (old) {
|
|
81
|
+
if (!old.historical ||
|
|
82
|
+
old.accountId !== args.accountId ||
|
|
83
|
+
old.ownerKey !== args.ownerKey ||
|
|
84
|
+
old.operationKey !== operationKey ||
|
|
85
|
+
old.currency !== p.currency ||
|
|
86
|
+
old.amount !== p.amount ||
|
|
87
|
+
old.destinationId !== p.destinationId ||
|
|
88
|
+
old.attemptedAt !== p.created * 1000 ||
|
|
89
|
+
old.status !== p.status ||
|
|
90
|
+
old.debitTransactionId !== p.debitTransactionId ||
|
|
91
|
+
old.debitFee !== p.debitFee ||
|
|
92
|
+
old.returnTransactionId !== p.returnTransactionId ||
|
|
93
|
+
old.providerFee !== add(p.debitFee, p.returnFee ?? 0) ||
|
|
94
|
+
JSON.stringify(old.allocations.map((a) => [a.stripeTransferId, a.amount, a.role])) !==
|
|
95
|
+
JSON.stringify(allocations.map((a) => [a.stripeTransferId, a.amount, a.role])))
|
|
96
|
+
throw new Error("Historical payout identity or source allocation changed; reconcile existing outcomes.");
|
|
97
|
+
return old;
|
|
98
|
+
}
|
|
99
|
+
for (const status of ["reserved", "submitted"]) {
|
|
100
|
+
const unresolved = await ctx.db
|
|
101
|
+
.query("payoutReleaseClaims")
|
|
102
|
+
.withIndex("by_account_status", (q) => q.eq("accountId", args.accountId).eq("status", status))
|
|
103
|
+
.first();
|
|
104
|
+
if (unresolved)
|
|
105
|
+
throw new Error("Resolve existing payout attempts before historical adoption.");
|
|
106
|
+
}
|
|
107
|
+
const history = await ctx.db
|
|
108
|
+
.query("payoutReleaseClaims")
|
|
109
|
+
.withIndex("by_account_status", (q) => q.eq("accountId", args.accountId))
|
|
110
|
+
.take(100);
|
|
111
|
+
if (history.length >= 100)
|
|
112
|
+
throw new Error("Historical payout snapshot limit exceeded.");
|
|
113
|
+
for (const a of allocations) {
|
|
114
|
+
const source = await sourceById(ctx, a.stripeTransferId);
|
|
115
|
+
if (source &&
|
|
116
|
+
(source.accountId !== args.accountId ||
|
|
117
|
+
source.ownerKey !== args.ownerKey ||
|
|
118
|
+
source.currency !== p.currency ||
|
|
119
|
+
source.reservedAmount !== 0))
|
|
120
|
+
throw new Error("Historical source allocation identity or reservations changed.");
|
|
121
|
+
const paid = p.status === "paid" ? a.amount : 0;
|
|
122
|
+
if (source)
|
|
123
|
+
await ctx.db.patch("payoutSourceAllocations", source._id, {
|
|
124
|
+
paidAmount: add(source.paidAmount, paid),
|
|
125
|
+
});
|
|
126
|
+
else
|
|
127
|
+
await ctx.db.insert("payoutSourceAllocations", {
|
|
128
|
+
accountId: args.accountId,
|
|
129
|
+
ownerKey: args.ownerKey,
|
|
130
|
+
stripeTransferId: a.stripeTransferId,
|
|
131
|
+
currency: p.currency,
|
|
132
|
+
paidAmount: paid,
|
|
133
|
+
reservedAmount: 0,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
const id = await ctx.db.insert("payoutReleaseClaims", {
|
|
137
|
+
accountId: args.accountId,
|
|
138
|
+
ownerKey: args.ownerKey,
|
|
139
|
+
operationKey,
|
|
140
|
+
expectedRevision: args.expectedRevision,
|
|
141
|
+
historical: true,
|
|
142
|
+
currency: p.currency,
|
|
143
|
+
amount: p.amount,
|
|
144
|
+
destinationId: p.destinationId,
|
|
145
|
+
allocations,
|
|
146
|
+
observations: args.observations,
|
|
147
|
+
status: p.status,
|
|
148
|
+
attemptedAt: p.created * 1000,
|
|
149
|
+
stripePayoutId: p.stripePayoutId,
|
|
150
|
+
...(p.returnTransactionId
|
|
151
|
+
? { returnTransactionId: p.returnTransactionId }
|
|
152
|
+
: {}),
|
|
153
|
+
});
|
|
154
|
+
const claim = (await ctx.db.get("payoutReleaseClaims", id));
|
|
155
|
+
await recordFees(ctx, claim, {
|
|
156
|
+
debitTransactionId: p.debitTransactionId,
|
|
157
|
+
debitFee: p.debitFee,
|
|
158
|
+
...(p.returnFee !== undefined ? { returnFee: p.returnFee } : {}),
|
|
159
|
+
}, p.status === "returned");
|
|
160
|
+
return (await ctx.db.get("payoutReleaseClaims", id));
|
|
161
|
+
}
|
|
162
|
+
export const historicalBatchArgs = {
|
|
163
|
+
...scopeFields,
|
|
164
|
+
expectedRevision: v.number(),
|
|
165
|
+
observations: v.array(observation),
|
|
166
|
+
expectedClaims: v.array(v.object({ operationKey: v.string(), fingerprint: v.string() })),
|
|
167
|
+
payouts: v.array(v.object({
|
|
168
|
+
payout: historicalArgs.payout,
|
|
169
|
+
allocations: historicalArgs.allocations,
|
|
170
|
+
})),
|
|
171
|
+
};
|
|
172
|
+
export async function adoptHistoricalBatch(ctx, args) {
|
|
173
|
+
if (!args.payouts.length || args.payouts.length > 100)
|
|
174
|
+
throw new Error("Invalid historical payout batch size.");
|
|
175
|
+
const rows = await ctx.db
|
|
176
|
+
.query("payoutReleaseClaims")
|
|
177
|
+
.withIndex("by_account_status", (q) => q.eq("accountId", args.accountId))
|
|
178
|
+
.take(101);
|
|
179
|
+
const expected = new Map(args.expectedClaims.map((c) => [c.operationKey, c.fingerprint]));
|
|
180
|
+
if (rows.length > 100 ||
|
|
181
|
+
expected.size !== args.expectedClaims.length ||
|
|
182
|
+
rows.length !== expected.size ||
|
|
183
|
+
rows.some((c) => c.ownerKey !== args.ownerKey ||
|
|
184
|
+
expected.get(c.operationKey) !== payoutClaimFingerprint(c)))
|
|
185
|
+
throw new Error("Historical payout history snapshot changed.");
|
|
186
|
+
const claims = [];
|
|
187
|
+
for (const p of args.payouts)
|
|
188
|
+
claims.push(await adoptHistoricalPayout(ctx, {
|
|
189
|
+
accountId: args.accountId,
|
|
190
|
+
ownerKey: args.ownerKey,
|
|
191
|
+
expectedRevision: args.expectedRevision,
|
|
192
|
+
observations: args.observations,
|
|
193
|
+
...p,
|
|
194
|
+
}));
|
|
195
|
+
return { claims };
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=adoption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adoption.js","sourceRoot":"","sources":["../../../src/component/payoutRelease/adoption.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAc,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,GAAG,EACH,aAAa,EACb,UAAU,EACV,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,GAAG,WAAW;IACd,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,cAA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AAE,IAAI,CAAC,QAAQ;YACvB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,GAAG,CAAC;SACL,CAAC,CACH,CAAC;IACJ,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC"}
|
|
@@ -32,6 +32,7 @@ export declare function claimByKey(ctx: MutationCtx, args: {
|
|
|
32
32
|
destinationId?: string | undefined;
|
|
33
33
|
expectedRevision: number;
|
|
34
34
|
feeRevision?: number | undefined;
|
|
35
|
+
historical?: boolean | undefined;
|
|
35
36
|
observations: {
|
|
36
37
|
currency: string;
|
|
37
38
|
ledgerFingerprint: string;
|
|
@@ -108,4 +109,6 @@ export declare function sourceById(ctx: MutationCtx, stripeTransferId: string):
|
|
|
108
109
|
stripeTransferId: string;
|
|
109
110
|
} | null>;
|
|
110
111
|
export declare function moveAllocations(ctx: MutationCtx, claim: Doc<"payoutReleaseClaims">, transition: "pay" | "release" | "return"): Promise<void>;
|
|
112
|
+
/** Stable financial identity for historical adoption and activation snapshots. */
|
|
113
|
+
export declare function payoutClaimFingerprint(c: Doc<"payoutReleaseClaims">): string;
|
|
111
114
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/component/payoutRelease/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,eAAO,MAAM,GA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AE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAapE;AACD,wBAAsB,WAAW,CAC/B,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;GAaxE;AACD,iFAAiF;AACjF,wBAAsB,aAAa,CACjC,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,KAAK,CAAC,OAAO,WAAW,CAAC,EAAE,EACzC,KAAK,EAAE,OAAO;;;;;;;;;;;;;;;;;;IAuDf;AACD,wBAAsB,UAAU,CAAC,GAAG,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM;;;;;;;;;UAK1E;AACD,wBAAsB,eAAe,CACnC,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,GAAG,CAAC,qBAAqB,CAAC,EACjC,UAAU,EAAE,KAAK,GAAG,SAAS,GAAG,QAAQ,iBA8BzC;AAED,kFAAkF;AAClF,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,GAAG,CAAC,qBAAqB,CAAC,UAkBnE"}
|
|
@@ -116,4 +116,24 @@ export async function moveAllocations(ctx, claim, transition) {
|
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
+
/** Stable financial identity for historical adoption and activation snapshots. */
|
|
120
|
+
export function payoutClaimFingerprint(c) {
|
|
121
|
+
return JSON.stringify([
|
|
122
|
+
c.accountId,
|
|
123
|
+
c.ownerKey,
|
|
124
|
+
c.operationKey,
|
|
125
|
+
c.historical ?? false,
|
|
126
|
+
c.currency,
|
|
127
|
+
c.amount,
|
|
128
|
+
c.status,
|
|
129
|
+
c.attemptedAt,
|
|
130
|
+
c.stripePayoutId,
|
|
131
|
+
c.destinationId,
|
|
132
|
+
c.debitTransactionId,
|
|
133
|
+
c.debitFee,
|
|
134
|
+
c.providerFee,
|
|
135
|
+
c.returnTransactionId,
|
|
136
|
+
c.allocations.map((a) => [a.stripeTransferId, a.amount, a.role]),
|
|
137
|
+
]);
|
|
138
|
+
}
|
|
119
139
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/component/payoutRelease/helpers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,MAAM,CAAC,MAAM,GAAG,GAAG,iBAAiB,CAAC;AACrC,MAAM,UAAU,mBAAmB,CAAC,CAAqC;IACvE,OAAO,IAAI,CAAC,SAAS,CAAC;QACpB,CAAC,CAAC,gBAAgB;QAClB,CAAC,CAAC,oBAAoB;QACtB,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,cAAc,IAAI,CAAC;QACrB,CAAC,CAAC,qBAAqB,IAAI,CAAC;QAC5B,CAAC,CAAC,aAAa,IAAI,KAAK;KACzB,CAAC,CAAC;AACL,CAAC;AACD,MAAM,UAAU,gBAAgB,CAAC,IAIhC;IACC,aAAa,CAAC,IAAI,CAAC,CAAC;IACpB,IACE,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;QACzB,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,GAAG;QAC9B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;QAEhC,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACtD,CAAC;AACD,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,GAAgB,EAChB,IAAmE;IAEnE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACvB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