@fantastic.dev/better-stripe 0.34.0 → 0.35.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.
- package/CHANGELOG.md +35 -0
- package/README.md +1 -1
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +486 -2
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts +243 -1
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +486 -2
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutSyncTestHelpers.d.ts +243 -1
- package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/refundCommandEvidence.d.ts +14 -0
- package/dist/client/connect/refundCommandEvidence.d.ts.map +1 -0
- package/dist/client/connect/refundCommandEvidence.js +20 -0
- package/dist/client/connect/refundCommandEvidence.js.map +1 -0
- package/dist/client/connect/refundCommandNormalization.d.ts +11 -0
- package/dist/client/connect/refundCommandNormalization.d.ts.map +1 -0
- package/dist/client/connect/refundCommandNormalization.js +12 -0
- package/dist/client/connect/refundCommandNormalization.js.map +1 -0
- package/dist/client/financialObservations.d.ts +42 -0
- package/dist/client/financialObservations.d.ts.map +1 -0
- package/dist/client/financialObservations.js +58 -0
- package/dist/client/financialObservations.js.map +1 -0
- package/dist/client/financialOwnership.d.ts +52 -0
- package/dist/client/financialOwnership.d.ts.map +1 -0
- package/dist/client/financialOwnership.js +72 -0
- package/dist/client/financialOwnership.js.map +1 -0
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/observationPagination.d.ts +10 -0
- package/dist/client/observationPagination.d.ts.map +1 -0
- package/dist/client/observationPagination.js +12 -0
- package/dist/client/observationPagination.js.map +1 -0
- package/dist/client/publicTypes.d.ts +5 -0
- package/dist/client/publicTypes.d.ts.map +1 -1
- package/dist/client/readContracts.d.ts +29 -0
- package/dist/client/readContracts.d.ts.map +1 -1
- package/dist/client/readContracts.js +10 -0
- package/dist/client/readContracts.js.map +1 -1
- package/dist/client/transferObservations.d.ts +59 -0
- package/dist/client/transferObservations.d.ts.map +1 -0
- package/dist/client/transferObservations.js +82 -0
- package/dist/client/transferObservations.js.map +1 -0
- package/dist/component/_generated/component.d.ts +506 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/affiliateRecovery/mutations.d.ts.map +1 -1
- package/dist/component/affiliateRecovery/mutations.js +4 -1
- package/dist/component/affiliateRecovery/mutations.js.map +1 -1
- package/dist/component/connect/mutations.d.ts.map +1 -1
- package/dist/component/connect/mutations.js +18 -2
- package/dist/component/connect/mutations.js.map +1 -1
- package/dist/component/connect/queries.d.ts +8 -0
- package/dist/component/connect/queries.d.ts.map +1 -1
- package/dist/component/connect/reversalClaims.d.ts.map +1 -1
- package/dist/component/connect/reversalClaims.js +7 -1
- package/dist/component/connect/reversalClaims.js.map +1 -1
- package/dist/component/connect/reversalReceipts.d.ts.map +1 -1
- package/dist/component/connect/reversalReceipts.js +2 -0
- package/dist/component/connect/reversalReceipts.js.map +1 -1
- package/dist/component/connect/schema.d.ts +11 -1
- package/dist/component/connect/schema.d.ts.map +1 -1
- package/dist/component/connect/schema.js +9 -1
- package/dist/component/connect/schema.js.map +1 -1
- package/dist/component/connect/validators.d.ts +9 -1
- package/dist/component/connect/validators.d.ts.map +1 -1
- package/dist/component/connect/validators.js +2 -0
- package/dist/component/connect/validators.js.map +1 -1
- package/dist/component/earnings/triggers.d.ts +426 -2
- package/dist/component/earnings/triggers.d.ts.map +1 -1
- package/dist/component/earnings/triggers.js +7 -1
- package/dist/component/earnings/triggers.js.map +1 -1
- package/dist/component/financialObservations/continuation.d.ts +7 -0
- package/dist/component/financialObservations/continuation.d.ts.map +1 -0
- package/dist/component/financialObservations/continuation.js +131 -0
- package/dist/component/financialObservations/continuation.js.map +1 -0
- package/dist/component/financialObservations/generations.d.ts +6 -0
- package/dist/component/financialObservations/generations.d.ts.map +1 -0
- package/dist/component/financialObservations/generations.js +46 -0
- package/dist/component/financialObservations/generations.js.map +1 -0
- package/dist/component/financialObservations/mutations.d.ts +62 -0
- package/dist/component/financialObservations/mutations.d.ts.map +1 -0
- package/dist/component/financialObservations/mutations.js +69 -0
- package/dist/component/financialObservations/mutations.js.map +1 -0
- package/dist/component/financialObservations/queries.d.ts +307 -0
- package/dist/component/financialObservations/queries.d.ts.map +1 -0
- package/dist/component/financialObservations/queries.js +219 -0
- package/dist/component/financialObservations/queries.js.map +1 -0
- package/dist/component/financialObservations/schema.d.ts +182 -0
- package/dist/component/financialObservations/schema.d.ts.map +1 -0
- package/dist/component/financialObservations/schema.js +53 -0
- package/dist/component/financialObservations/schema.js.map +1 -0
- package/dist/component/financialObservations/settlement.d.ts +7 -0
- package/dist/component/financialObservations/settlement.d.ts.map +1 -0
- package/dist/component/financialObservations/settlement.js +118 -0
- package/dist/component/financialObservations/settlement.js.map +1 -0
- package/dist/component/financialObservations/settlementHelpers.d.ts +46 -0
- package/dist/component/financialObservations/settlementHelpers.d.ts.map +1 -0
- package/dist/component/financialObservations/settlementHelpers.js +70 -0
- package/dist/component/financialObservations/settlementHelpers.js.map +1 -0
- package/dist/component/financialObservations/transferBatches.d.ts +12 -0
- package/dist/component/financialObservations/transferBatches.d.ts.map +1 -0
- package/dist/component/financialObservations/transferBatches.js +76 -0
- package/dist/component/financialObservations/transferBatches.js.map +1 -0
- package/dist/component/financialObservations/transferContinuation.d.ts +5 -0
- package/dist/component/financialObservations/transferContinuation.d.ts.map +1 -0
- package/dist/component/financialObservations/transferContinuation.js +35 -0
- package/dist/component/financialObservations/transferContinuation.js.map +1 -0
- package/dist/component/financialObservations/transferContinuationState.d.ts +8 -0
- package/dist/component/financialObservations/transferContinuationState.d.ts.map +1 -0
- package/dist/component/financialObservations/transferContinuationState.js +69 -0
- package/dist/component/financialObservations/transferContinuationState.js.map +1 -0
- package/dist/component/financialObservations/transferContinuationSteps.d.ts +5 -0
- package/dist/component/financialObservations/transferContinuationSteps.d.ts.map +1 -0
- package/dist/component/financialObservations/transferContinuationSteps.js +174 -0
- package/dist/component/financialObservations/transferContinuationSteps.js.map +1 -0
- package/dist/component/financialObservations/transferHelpers.d.ts +18 -0
- package/dist/component/financialObservations/transferHelpers.d.ts.map +1 -0
- package/dist/component/financialObservations/transferHelpers.js +37 -0
- package/dist/component/financialObservations/transferHelpers.js.map +1 -0
- package/dist/component/financialObservations/transferReferenceSchema.d.ts +56 -0
- package/dist/component/financialObservations/transferReferenceSchema.d.ts.map +1 -0
- package/dist/component/financialObservations/transferReferenceSchema.js +21 -0
- package/dist/component/financialObservations/transferReferenceSchema.js.map +1 -0
- package/dist/component/financialObservations/transferSchema.d.ts +237 -0
- package/dist/component/financialObservations/transferSchema.d.ts.map +1 -0
- package/dist/component/financialObservations/transferSchema.js +65 -0
- package/dist/component/financialObservations/transferSchema.js.map +1 -0
- package/dist/component/financialObservations/transfers.d.ts +7 -0
- package/dist/component/financialObservations/transfers.d.ts.map +1 -0
- package/dist/component/financialObservations/transfers.js +79 -0
- package/dist/component/financialObservations/transfers.js.map +1 -0
- package/dist/component/financialOwnership/helpers.d.ts +37 -0
- package/dist/component/financialOwnership/helpers.d.ts.map +1 -0
- package/dist/component/financialOwnership/helpers.js +76 -0
- package/dist/component/financialOwnership/helpers.js.map +1 -0
- package/dist/component/financialOwnership/mutations.d.ts +28 -0
- package/dist/component/financialOwnership/mutations.d.ts.map +1 -0
- package/dist/component/financialOwnership/mutations.js +74 -0
- package/dist/component/financialOwnership/mutations.js.map +1 -0
- package/dist/component/financialOwnership/queries.d.ts +57 -0
- package/dist/component/financialOwnership/queries.d.ts.map +1 -0
- package/dist/component/financialOwnership/queries.js +50 -0
- package/dist/component/financialOwnership/queries.js.map +1 -0
- package/dist/component/financialOwnership/schema.d.ts +140 -0
- package/dist/component/financialOwnership/schema.d.ts.map +1 -0
- package/dist/component/financialOwnership/schema.js +35 -0
- package/dist/component/financialOwnership/schema.js.map +1 -0
- package/dist/component/payoutRelease/queries.d.ts +2 -2
- package/dist/component/payoutRelease/queries.d.ts.map +1 -1
- package/dist/component/refundHistory/commandBinding.d.ts +17 -0
- package/dist/component/refundHistory/commandBinding.d.ts.map +1 -0
- package/dist/component/refundHistory/commandBinding.js +41 -0
- package/dist/component/refundHistory/commandBinding.js.map +1 -0
- package/dist/component/refundHistory/commandEvidence.d.ts +50 -0
- package/dist/component/refundHistory/commandEvidence.d.ts.map +1 -0
- package/dist/component/refundHistory/commandEvidence.js +54 -0
- package/dist/component/refundHistory/commandEvidence.js.map +1 -0
- package/dist/component/refundHistory/commandEvidenceValidator.d.ts +89 -0
- package/dist/component/refundHistory/commandEvidenceValidator.d.ts.map +1 -0
- package/dist/component/refundHistory/commandEvidenceValidator.js +8 -0
- package/dist/component/refundHistory/commandEvidenceValidator.js.map +1 -0
- package/dist/component/refundHistory/commandFields.d.ts +8 -0
- package/dist/component/refundHistory/commandFields.d.ts.map +1 -0
- package/dist/component/refundHistory/commandFields.js +9 -0
- package/dist/component/refundHistory/commandFields.js.map +1 -0
- package/dist/component/refundHistory/mutations.d.ts +8 -0
- package/dist/component/refundHistory/mutations.d.ts.map +1 -0
- package/dist/component/refundHistory/mutations.js +25 -0
- package/dist/component/refundHistory/mutations.js.map +1 -0
- package/dist/component/refundHistory/queries.d.ts +51 -0
- package/dist/component/refundHistory/queries.d.ts.map +1 -1
- package/dist/component/refundHistory/queries.js +14 -0
- package/dist/component/refundHistory/queries.js.map +1 -1
- package/dist/component/schema.d.ts +243 -1
- package/dist/component/schema.js +12 -0
- package/dist/component/schema.js.map +1 -1
- package/dist/component/settlement/mutations.d.ts.map +1 -1
- package/dist/component/settlement/mutations.js +5 -1
- package/dist/component/settlement/mutations.js.map +1 -1
- package/dist/shared/refundCommandScope.d.ts +10 -0
- package/dist/shared/refundCommandScope.d.ts.map +1 -0
- package/dist/shared/refundCommandScope.js +9 -0
- package/dist/shared/refundCommandScope.js.map +1 -0
- package/docs/financial-observations.md +159 -0
- package/docs/financial-ownership.md +54 -0
- package/docs/refund-command-evidence.md +49 -0
- package/package.json +5 -2
- package/src/client/connect/refundCommandEvidence.ts +41 -0
- package/src/client/connect/refundCommandNormalization.ts +28 -0
- package/src/client/financialObservations.test.ts +109 -0
- package/src/client/financialObservations.ts +106 -0
- package/src/client/financialOwnership.test.ts +80 -0
- package/src/client/financialOwnership.ts +116 -0
- package/src/client/index.ts +2 -2
- package/src/client/observationPagination.ts +11 -0
- package/src/client/publicTypes.ts +37 -0
- package/src/client/readContracts.ts +21 -0
- package/src/client/refund-command-evidence.test.ts +68 -0
- package/src/client/refund-command-normalization.test.ts +61 -0
- package/src/client/transferContinuation.test.ts +94 -0
- package/src/client/transferObservations.test.ts +98 -0
- package/src/client/transferObservations.ts +180 -0
- package/src/component/_generated/api.ts +44 -0
- package/src/component/_generated/component.ts +590 -0
- package/src/component/affiliateRecovery/mutations.ts +10 -1
- package/src/component/connect/mutations.ts +29 -2
- package/src/component/connect/reversalClaims.ts +19 -1
- package/src/component/connect/reversalReceipts.ts +2 -0
- package/src/component/connect/schema.ts +9 -1
- package/src/component/connect/validators.ts +2 -0
- package/src/component/core/reset.test.ts +8 -1
- package/src/component/earnings/earnings-totals.test.ts +14 -10
- package/src/component/earnings/triggers.ts +9 -1
- package/src/component/financialObservations/continuation.test.ts +445 -0
- package/src/component/financialObservations/continuation.ts +159 -0
- package/src/component/financialObservations/generations.ts +53 -0
- package/src/component/financialObservations/mutations.ts +75 -0
- package/src/component/financialObservations/observation-boundaries.test.ts +466 -0
- package/src/component/financialObservations/queries.ts +246 -0
- package/src/component/financialObservations/schema.ts +68 -0
- package/src/component/financialObservations/settlement-observations.test.ts +86 -0
- package/src/component/financialObservations/settlement.ts +142 -0
- package/src/component/financialObservations/settlementHelpers.ts +92 -0
- package/src/component/financialObservations/transfer-batches.test.ts +61 -0
- package/src/component/financialObservations/transfer-boundaries.test.ts +116 -0
- package/src/component/financialObservations/transfer-continuation-guards.test.ts +428 -0
- package/src/component/financialObservations/transfer-continuation.test.ts +154 -0
- package/src/component/financialObservations/transfer-observations.test.ts +212 -0
- package/src/component/financialObservations/transfer-overflow.test.ts +181 -0
- package/src/component/financialObservations/transfer-writers.test.ts +162 -0
- package/src/component/financialObservations/transferBatches.ts +96 -0
- package/src/component/financialObservations/transferContinuation.ts +53 -0
- package/src/component/financialObservations/transferContinuationState.ts +85 -0
- package/src/component/financialObservations/transferContinuationSteps.ts +232 -0
- package/src/component/financialObservations/transferHelpers.ts +38 -0
- package/src/component/financialObservations/transferReferenceSchema.ts +20 -0
- package/src/component/financialObservations/transferSchema.ts +74 -0
- package/src/component/financialObservations/transfers.ts +99 -0
- package/src/component/financialOwnership/financial-ownership.test.ts +102 -0
- package/src/component/financialOwnership/helpers.ts +98 -0
- package/src/component/financialOwnership/mutations.ts +83 -0
- package/src/component/financialOwnership/ownership-boundaries.test.ts +308 -0
- package/src/component/financialOwnership/queries.ts +65 -0
- package/src/component/financialOwnership/schema.ts +35 -0
- package/src/component/refundHistory/command-evidence.test.ts +288 -0
- package/src/component/refundHistory/command-normalization-resource.test.ts +77 -0
- package/src/component/refundHistory/command-normalization.test.ts +229 -0
- package/src/component/refundHistory/command-provenance.test.ts +59 -0
- package/src/component/refundHistory/commandBinding.ts +54 -0
- package/src/component/refundHistory/commandEvidence.ts +71 -0
- package/src/component/refundHistory/commandEvidenceValidator.ts +18 -0
- package/src/component/refundHistory/commandFields.ts +9 -0
- package/src/component/refundHistory/mutations.ts +33 -0
- package/src/component/refundHistory/queries.ts +15 -0
- package/src/component/schema.ts +22 -0
- package/src/component/settlement/mutations.ts +5 -1
- package/src/shared/refundCommandScope.ts +19 -0
|
@@ -1792,6 +1792,10 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
1792
1792
|
| "fraudulent"
|
|
1793
1793
|
| "requested_by_customer"
|
|
1794
1794
|
| "expired_uncaptured_charge";
|
|
1795
|
+
refundCommandConflict?: boolean;
|
|
1796
|
+
refundCommandKey?: string;
|
|
1797
|
+
refundCommandNormalizationVersion?: 1;
|
|
1798
|
+
refundCommandObservedAt?: number;
|
|
1795
1799
|
status:
|
|
1796
1800
|
| "pending"
|
|
1797
1801
|
| "requires_action"
|
|
@@ -1954,6 +1958,10 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
1954
1958
|
| "fraudulent"
|
|
1955
1959
|
| "requested_by_customer"
|
|
1956
1960
|
| "expired_uncaptured_charge";
|
|
1961
|
+
refundCommandConflict?: boolean;
|
|
1962
|
+
refundCommandKey?: string;
|
|
1963
|
+
refundCommandNormalizationVersion?: 1;
|
|
1964
|
+
refundCommandObservedAt?: number;
|
|
1957
1965
|
status:
|
|
1958
1966
|
| "pending"
|
|
1959
1967
|
| "requires_action"
|
|
@@ -2855,6 +2863,523 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
2855
2863
|
>;
|
|
2856
2864
|
};
|
|
2857
2865
|
};
|
|
2866
|
+
financialObservations: {
|
|
2867
|
+
mutations: {
|
|
2868
|
+
resume: FunctionReference<
|
|
2869
|
+
"mutation",
|
|
2870
|
+
"internal",
|
|
2871
|
+
{ allocationId: string; expectedGeneration: number },
|
|
2872
|
+
{
|
|
2873
|
+
coverage: "unknown";
|
|
2874
|
+
observation: {
|
|
2875
|
+
_creationTime: number;
|
|
2876
|
+
_id: string;
|
|
2877
|
+
allocationId: string;
|
|
2878
|
+
continuation?: {
|
|
2879
|
+
nextLeg: number;
|
|
2880
|
+
state: "indexing" | "validating" | "complete" | "held";
|
|
2881
|
+
validatedLegs: number;
|
|
2882
|
+
};
|
|
2883
|
+
fingerprint: string;
|
|
2884
|
+
generation: number;
|
|
2885
|
+
indexedLegCount: number;
|
|
2886
|
+
isContradictory: boolean;
|
|
2887
|
+
isOverflow: boolean;
|
|
2888
|
+
legCount: number;
|
|
2889
|
+
observedFingerprint: string;
|
|
2890
|
+
ownershipFingerprint: string;
|
|
2891
|
+
producer: "settlement_allocation";
|
|
2892
|
+
producerVersion: 1;
|
|
2893
|
+
sourceChargeId: string;
|
|
2894
|
+
} | null;
|
|
2895
|
+
},
|
|
2896
|
+
Name
|
|
2897
|
+
>;
|
|
2898
|
+
resumeTransferBatch: FunctionReference<
|
|
2899
|
+
"mutation",
|
|
2900
|
+
"internal",
|
|
2901
|
+
{ batchId: string; expectedGeneration: number },
|
|
2902
|
+
{
|
|
2903
|
+
batch: {
|
|
2904
|
+
_creationTime: number;
|
|
2905
|
+
_id: string;
|
|
2906
|
+
continuation?: {
|
|
2907
|
+
nextReference: number;
|
|
2908
|
+
producerGeneration: number;
|
|
2909
|
+
sourceFingerprint: string;
|
|
2910
|
+
state: "indexing" | "validating" | "complete" | "held";
|
|
2911
|
+
validatedReferences: number;
|
|
2912
|
+
};
|
|
2913
|
+
fingerprint: string;
|
|
2914
|
+
generation: number;
|
|
2915
|
+
isContradictory: boolean;
|
|
2916
|
+
isOverflow: true;
|
|
2917
|
+
observedFingerprint: string;
|
|
2918
|
+
operationId: string;
|
|
2919
|
+
originalOperationId: string;
|
|
2920
|
+
producer: "transfer_frontier_release" | "transfer_frontier_claim";
|
|
2921
|
+
producerVersion: 1;
|
|
2922
|
+
referenceCount: number;
|
|
2923
|
+
sourceChargeId: string;
|
|
2924
|
+
state: "pending" | "complete";
|
|
2925
|
+
transferIds: Array<string>;
|
|
2926
|
+
} | null;
|
|
2927
|
+
coverage: "unknown";
|
|
2928
|
+
hasDeferredWork: boolean;
|
|
2929
|
+
producerGeneration: number | null;
|
|
2930
|
+
},
|
|
2931
|
+
Name
|
|
2932
|
+
>;
|
|
2933
|
+
};
|
|
2934
|
+
queries: {
|
|
2935
|
+
bucket: FunctionReference<
|
|
2936
|
+
"query",
|
|
2937
|
+
"internal",
|
|
2938
|
+
{
|
|
2939
|
+
bucketKey: string;
|
|
2940
|
+
paginationOpts: {
|
|
2941
|
+
cursor: string | null;
|
|
2942
|
+
endCursor?: string | null;
|
|
2943
|
+
id?: number;
|
|
2944
|
+
maximumBytesRead?: number;
|
|
2945
|
+
maximumRowsRead?: number;
|
|
2946
|
+
numItems: number;
|
|
2947
|
+
};
|
|
2948
|
+
},
|
|
2949
|
+
{
|
|
2950
|
+
continueCursor: string;
|
|
2951
|
+
coverage: "unknown";
|
|
2952
|
+
generation: number | null;
|
|
2953
|
+
isDone: boolean;
|
|
2954
|
+
page: Array<{
|
|
2955
|
+
_creationTime: number;
|
|
2956
|
+
_id: string;
|
|
2957
|
+
allocationId: string;
|
|
2958
|
+
bucketKey: string;
|
|
2959
|
+
legIndex: number;
|
|
2960
|
+
orgId?: string;
|
|
2961
|
+
ownershipStatus:
|
|
2962
|
+
"registered" | "unknown" | "ambiguous" | "contradictory";
|
|
2963
|
+
registrationId?: string;
|
|
2964
|
+
role: "store" | "affiliate" | "other";
|
|
2965
|
+
sourceChargeId: string;
|
|
2966
|
+
userId?: string;
|
|
2967
|
+
}>;
|
|
2968
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
2969
|
+
splitCursor?: string | null;
|
|
2970
|
+
},
|
|
2971
|
+
Name
|
|
2972
|
+
>;
|
|
2973
|
+
owner: FunctionReference<
|
|
2974
|
+
"query",
|
|
2975
|
+
"internal",
|
|
2976
|
+
{
|
|
2977
|
+
orgId?: string;
|
|
2978
|
+
paginationOpts: {
|
|
2979
|
+
cursor: string | null;
|
|
2980
|
+
endCursor?: string | null;
|
|
2981
|
+
id?: number;
|
|
2982
|
+
maximumBytesRead?: number;
|
|
2983
|
+
maximumRowsRead?: number;
|
|
2984
|
+
numItems: number;
|
|
2985
|
+
};
|
|
2986
|
+
userId: string;
|
|
2987
|
+
},
|
|
2988
|
+
{
|
|
2989
|
+
continueCursor: string;
|
|
2990
|
+
coverage: "unknown";
|
|
2991
|
+
generation: number | null;
|
|
2992
|
+
isDone: boolean;
|
|
2993
|
+
page: Array<{
|
|
2994
|
+
_creationTime: number;
|
|
2995
|
+
_id: string;
|
|
2996
|
+
allocationId: string;
|
|
2997
|
+
bucketKey: string;
|
|
2998
|
+
legIndex: number;
|
|
2999
|
+
orgId?: string;
|
|
3000
|
+
ownershipStatus:
|
|
3001
|
+
"registered" | "unknown" | "ambiguous" | "contradictory";
|
|
3002
|
+
registrationId?: string;
|
|
3003
|
+
role: "store" | "affiliate" | "other";
|
|
3004
|
+
sourceChargeId: string;
|
|
3005
|
+
userId?: string;
|
|
3006
|
+
}>;
|
|
3007
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
3008
|
+
splitCursor?: string | null;
|
|
3009
|
+
},
|
|
3010
|
+
Name
|
|
3011
|
+
>;
|
|
3012
|
+
source: FunctionReference<
|
|
3013
|
+
"query",
|
|
3014
|
+
"internal",
|
|
3015
|
+
{ allocationId: string },
|
|
3016
|
+
{
|
|
3017
|
+
coverage: "unknown";
|
|
3018
|
+
observation: null | {
|
|
3019
|
+
_creationTime: number;
|
|
3020
|
+
_id: string;
|
|
3021
|
+
allocationId: string;
|
|
3022
|
+
continuation?: {
|
|
3023
|
+
nextLeg: number;
|
|
3024
|
+
state: "indexing" | "validating" | "complete" | "held";
|
|
3025
|
+
validatedLegs: number;
|
|
3026
|
+
};
|
|
3027
|
+
fingerprint: string;
|
|
3028
|
+
generation: number;
|
|
3029
|
+
indexedLegCount: number;
|
|
3030
|
+
isContradictory: boolean;
|
|
3031
|
+
isOverflow: boolean;
|
|
3032
|
+
legCount: number;
|
|
3033
|
+
observedFingerprint: string;
|
|
3034
|
+
ownershipFingerprint: string;
|
|
3035
|
+
producer: "settlement_allocation";
|
|
3036
|
+
producerVersion: 1;
|
|
3037
|
+
sourceChargeId: string;
|
|
3038
|
+
};
|
|
3039
|
+
},
|
|
3040
|
+
Name
|
|
3041
|
+
>;
|
|
3042
|
+
transfer: FunctionReference<
|
|
3043
|
+
"query",
|
|
3044
|
+
"internal",
|
|
3045
|
+
{ transferId: string },
|
|
3046
|
+
{
|
|
3047
|
+
coverage: "unknown";
|
|
3048
|
+
hasDeferredWork: boolean;
|
|
3049
|
+
observation: {
|
|
3050
|
+
_creationTime: number;
|
|
3051
|
+
_id: string;
|
|
3052
|
+
bucketKey: string;
|
|
3053
|
+
fingerprint: string;
|
|
3054
|
+
generation: number;
|
|
3055
|
+
isContradictory: boolean;
|
|
3056
|
+
observedFingerprint: string;
|
|
3057
|
+
orgId?: string;
|
|
3058
|
+
ownershipFingerprint: string;
|
|
3059
|
+
ownershipStatus:
|
|
3060
|
+
"registered" | "unknown" | "ambiguous" | "contradictory";
|
|
3061
|
+
producer: "transfer_fact";
|
|
3062
|
+
producerVersion: 1;
|
|
3063
|
+
registrationId?: string;
|
|
3064
|
+
role?: "store" | "affiliate" | "other";
|
|
3065
|
+
sourceChargeId?: string;
|
|
3066
|
+
sourceInvoiceId?: string;
|
|
3067
|
+
stripeTransferId: string;
|
|
3068
|
+
transferId: string;
|
|
3069
|
+
userId?: string;
|
|
3070
|
+
} | null;
|
|
3071
|
+
producerGeneration: number | null;
|
|
3072
|
+
},
|
|
3073
|
+
Name
|
|
3074
|
+
>;
|
|
3075
|
+
transferBatch: FunctionReference<
|
|
3076
|
+
"query",
|
|
3077
|
+
"internal",
|
|
3078
|
+
{ batchId: string },
|
|
3079
|
+
{
|
|
3080
|
+
batch: {
|
|
3081
|
+
_creationTime: number;
|
|
3082
|
+
_id: string;
|
|
3083
|
+
continuation?: {
|
|
3084
|
+
nextReference: number;
|
|
3085
|
+
producerGeneration: number;
|
|
3086
|
+
sourceFingerprint: string;
|
|
3087
|
+
state: "indexing" | "validating" | "complete" | "held";
|
|
3088
|
+
validatedReferences: number;
|
|
3089
|
+
};
|
|
3090
|
+
fingerprint: string;
|
|
3091
|
+
generation: number;
|
|
3092
|
+
isContradictory: boolean;
|
|
3093
|
+
isOverflow: true;
|
|
3094
|
+
observedFingerprint: string;
|
|
3095
|
+
operationId: string;
|
|
3096
|
+
originalOperationId: string;
|
|
3097
|
+
producer: "transfer_frontier_release" | "transfer_frontier_claim";
|
|
3098
|
+
producerVersion: 1;
|
|
3099
|
+
referenceCount: number;
|
|
3100
|
+
sourceChargeId: string;
|
|
3101
|
+
state: "pending" | "complete";
|
|
3102
|
+
transferIds: Array<string>;
|
|
3103
|
+
} | null;
|
|
3104
|
+
coverage: "unknown";
|
|
3105
|
+
hasDeferredWork: boolean;
|
|
3106
|
+
producerGeneration: number | null;
|
|
3107
|
+
},
|
|
3108
|
+
Name
|
|
3109
|
+
>;
|
|
3110
|
+
transferBatches: FunctionReference<
|
|
3111
|
+
"query",
|
|
3112
|
+
"internal",
|
|
3113
|
+
{
|
|
3114
|
+
operationId: string;
|
|
3115
|
+
paginationOpts: {
|
|
3116
|
+
cursor: string | null;
|
|
3117
|
+
endCursor?: string | null;
|
|
3118
|
+
id?: number;
|
|
3119
|
+
maximumBytesRead?: number;
|
|
3120
|
+
maximumRowsRead?: number;
|
|
3121
|
+
numItems: number;
|
|
3122
|
+
};
|
|
3123
|
+
},
|
|
3124
|
+
{
|
|
3125
|
+
continueCursor: string;
|
|
3126
|
+
coverage: "unknown";
|
|
3127
|
+
hasDeferredWork: boolean;
|
|
3128
|
+
isDone: boolean;
|
|
3129
|
+
page: Array<{
|
|
3130
|
+
_creationTime: number;
|
|
3131
|
+
_id: string;
|
|
3132
|
+
continuation?: {
|
|
3133
|
+
nextReference: number;
|
|
3134
|
+
producerGeneration: number;
|
|
3135
|
+
sourceFingerprint: string;
|
|
3136
|
+
state: "indexing" | "validating" | "complete" | "held";
|
|
3137
|
+
validatedReferences: number;
|
|
3138
|
+
};
|
|
3139
|
+
fingerprint: string;
|
|
3140
|
+
generation: number;
|
|
3141
|
+
isContradictory: boolean;
|
|
3142
|
+
isOverflow: true;
|
|
3143
|
+
observedFingerprint: string;
|
|
3144
|
+
operationId: string;
|
|
3145
|
+
originalOperationId: string;
|
|
3146
|
+
producer: "transfer_frontier_release" | "transfer_frontier_claim";
|
|
3147
|
+
producerVersion: 1;
|
|
3148
|
+
referenceCount: number;
|
|
3149
|
+
sourceChargeId: string;
|
|
3150
|
+
state: "pending" | "complete";
|
|
3151
|
+
transferIds: Array<string>;
|
|
3152
|
+
}>;
|
|
3153
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
3154
|
+
producerGeneration: number | null;
|
|
3155
|
+
splitCursor?: string | null;
|
|
3156
|
+
},
|
|
3157
|
+
Name
|
|
3158
|
+
>;
|
|
3159
|
+
transferBucket: FunctionReference<
|
|
3160
|
+
"query",
|
|
3161
|
+
"internal",
|
|
3162
|
+
{
|
|
3163
|
+
bucketKey: string;
|
|
3164
|
+
paginationOpts: {
|
|
3165
|
+
cursor: string | null;
|
|
3166
|
+
endCursor?: string | null;
|
|
3167
|
+
id?: number;
|
|
3168
|
+
maximumBytesRead?: number;
|
|
3169
|
+
maximumRowsRead?: number;
|
|
3170
|
+
numItems: number;
|
|
3171
|
+
};
|
|
3172
|
+
},
|
|
3173
|
+
{
|
|
3174
|
+
continueCursor: string;
|
|
3175
|
+
coverage: "unknown";
|
|
3176
|
+
generation: number | null;
|
|
3177
|
+
hasDeferredWork: boolean;
|
|
3178
|
+
isDone: boolean;
|
|
3179
|
+
page: Array<{
|
|
3180
|
+
_creationTime: number;
|
|
3181
|
+
_id: string;
|
|
3182
|
+
bucketKey: string;
|
|
3183
|
+
fingerprint: string;
|
|
3184
|
+
generation: number;
|
|
3185
|
+
isContradictory: boolean;
|
|
3186
|
+
observedFingerprint: string;
|
|
3187
|
+
orgId?: string;
|
|
3188
|
+
ownershipFingerprint: string;
|
|
3189
|
+
ownershipStatus:
|
|
3190
|
+
"registered" | "unknown" | "ambiguous" | "contradictory";
|
|
3191
|
+
producer: "transfer_fact";
|
|
3192
|
+
producerVersion: 1;
|
|
3193
|
+
registrationId?: string;
|
|
3194
|
+
role?: "store" | "affiliate" | "other";
|
|
3195
|
+
sourceChargeId?: string;
|
|
3196
|
+
sourceInvoiceId?: string;
|
|
3197
|
+
stripeTransferId: string;
|
|
3198
|
+
transferId: string;
|
|
3199
|
+
userId?: string;
|
|
3200
|
+
}>;
|
|
3201
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
3202
|
+
producerGeneration: number | null;
|
|
3203
|
+
splitCursor?: string | null;
|
|
3204
|
+
},
|
|
3205
|
+
Name
|
|
3206
|
+
>;
|
|
3207
|
+
transferOwner: FunctionReference<
|
|
3208
|
+
"query",
|
|
3209
|
+
"internal",
|
|
3210
|
+
{
|
|
3211
|
+
orgId?: string;
|
|
3212
|
+
paginationOpts: {
|
|
3213
|
+
cursor: string | null;
|
|
3214
|
+
endCursor?: string | null;
|
|
3215
|
+
id?: number;
|
|
3216
|
+
maximumBytesRead?: number;
|
|
3217
|
+
maximumRowsRead?: number;
|
|
3218
|
+
numItems: number;
|
|
3219
|
+
};
|
|
3220
|
+
userId: string;
|
|
3221
|
+
},
|
|
3222
|
+
{
|
|
3223
|
+
continueCursor: string;
|
|
3224
|
+
coverage: "unknown";
|
|
3225
|
+
generation: number | null;
|
|
3226
|
+
hasDeferredWork: boolean;
|
|
3227
|
+
isDone: boolean;
|
|
3228
|
+
page: Array<{
|
|
3229
|
+
_creationTime: number;
|
|
3230
|
+
_id: string;
|
|
3231
|
+
bucketKey: string;
|
|
3232
|
+
fingerprint: string;
|
|
3233
|
+
generation: number;
|
|
3234
|
+
isContradictory: boolean;
|
|
3235
|
+
observedFingerprint: string;
|
|
3236
|
+
orgId?: string;
|
|
3237
|
+
ownershipFingerprint: string;
|
|
3238
|
+
ownershipStatus:
|
|
3239
|
+
"registered" | "unknown" | "ambiguous" | "contradictory";
|
|
3240
|
+
producer: "transfer_fact";
|
|
3241
|
+
producerVersion: 1;
|
|
3242
|
+
registrationId?: string;
|
|
3243
|
+
role?: "store" | "affiliate" | "other";
|
|
3244
|
+
sourceChargeId?: string;
|
|
3245
|
+
sourceInvoiceId?: string;
|
|
3246
|
+
stripeTransferId: string;
|
|
3247
|
+
transferId: string;
|
|
3248
|
+
userId?: string;
|
|
3249
|
+
}>;
|
|
3250
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
3251
|
+
producerGeneration: number | null;
|
|
3252
|
+
splitCursor?: string | null;
|
|
3253
|
+
},
|
|
3254
|
+
Name
|
|
3255
|
+
>;
|
|
3256
|
+
transferReferences: FunctionReference<
|
|
3257
|
+
"query",
|
|
3258
|
+
"internal",
|
|
3259
|
+
{
|
|
3260
|
+
batchId: string;
|
|
3261
|
+
paginationOpts: {
|
|
3262
|
+
cursor: string | null;
|
|
3263
|
+
endCursor?: string | null;
|
|
3264
|
+
id?: number;
|
|
3265
|
+
maximumBytesRead?: number;
|
|
3266
|
+
maximumRowsRead?: number;
|
|
3267
|
+
numItems: number;
|
|
3268
|
+
};
|
|
3269
|
+
},
|
|
3270
|
+
{
|
|
3271
|
+
continueCursor: string;
|
|
3272
|
+
coverage: "unknown";
|
|
3273
|
+
hasDeferredWork: boolean;
|
|
3274
|
+
isDone: boolean;
|
|
3275
|
+
page: Array<{
|
|
3276
|
+
_creationTime: number;
|
|
3277
|
+
_id: string;
|
|
3278
|
+
batchId: string;
|
|
3279
|
+
observationGeneration: number;
|
|
3280
|
+
observationId: string;
|
|
3281
|
+
observedFingerprint: string;
|
|
3282
|
+
ownershipFingerprint: string;
|
|
3283
|
+
position: number;
|
|
3284
|
+
sourceFingerprint: string;
|
|
3285
|
+
transferId: string;
|
|
3286
|
+
}>;
|
|
3287
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
3288
|
+
producerGeneration: number | null;
|
|
3289
|
+
splitCursor?: string | null;
|
|
3290
|
+
},
|
|
3291
|
+
Name
|
|
3292
|
+
>;
|
|
3293
|
+
};
|
|
3294
|
+
};
|
|
3295
|
+
financialOwnership: {
|
|
3296
|
+
mutations: {
|
|
3297
|
+
register: FunctionReference<
|
|
3298
|
+
"mutation",
|
|
3299
|
+
"internal",
|
|
3300
|
+
{
|
|
3301
|
+
bucketKey: string;
|
|
3302
|
+
kind: "stripe_account" | "logical";
|
|
3303
|
+
orgId?: string;
|
|
3304
|
+
source?: { integration: string; recordId: string };
|
|
3305
|
+
userId: string;
|
|
3306
|
+
},
|
|
3307
|
+
{
|
|
3308
|
+
coverage: "unknown";
|
|
3309
|
+
registration: {
|
|
3310
|
+
_creationTime: number;
|
|
3311
|
+
_id: string;
|
|
3312
|
+
bucketKey: string;
|
|
3313
|
+
generation: number;
|
|
3314
|
+
kind: "stripe_account" | "logical";
|
|
3315
|
+
orgId?: string;
|
|
3316
|
+
source: { integration: string; recordId: string };
|
|
3317
|
+
userId: string;
|
|
3318
|
+
};
|
|
3319
|
+
status: "registered";
|
|
3320
|
+
},
|
|
3321
|
+
Name
|
|
3322
|
+
>;
|
|
3323
|
+
};
|
|
3324
|
+
queries: {
|
|
3325
|
+
discover: FunctionReference<
|
|
3326
|
+
"query",
|
|
3327
|
+
"internal",
|
|
3328
|
+
{
|
|
3329
|
+
orgId?: string;
|
|
3330
|
+
paginationOpts: {
|
|
3331
|
+
cursor: string | null;
|
|
3332
|
+
endCursor?: string | null;
|
|
3333
|
+
id?: number;
|
|
3334
|
+
maximumBytesRead?: number;
|
|
3335
|
+
maximumRowsRead?: number;
|
|
3336
|
+
numItems: number;
|
|
3337
|
+
};
|
|
3338
|
+
userId: string;
|
|
3339
|
+
},
|
|
3340
|
+
{
|
|
3341
|
+
continueCursor: string;
|
|
3342
|
+
coverage: "unknown";
|
|
3343
|
+
generation: number;
|
|
3344
|
+
isDone: boolean;
|
|
3345
|
+
page: Array<{
|
|
3346
|
+
_creationTime: number;
|
|
3347
|
+
_id: string;
|
|
3348
|
+
bucketKey: string;
|
|
3349
|
+
generation: number;
|
|
3350
|
+
kind: "stripe_account" | "logical";
|
|
3351
|
+
orgId?: string;
|
|
3352
|
+
source: { integration: string; recordId: string };
|
|
3353
|
+
userId: string;
|
|
3354
|
+
}>;
|
|
3355
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
3356
|
+
splitCursor?: string | null;
|
|
3357
|
+
},
|
|
3358
|
+
Name
|
|
3359
|
+
>;
|
|
3360
|
+
lookup: FunctionReference<
|
|
3361
|
+
"query",
|
|
3362
|
+
"internal",
|
|
3363
|
+
{ bucketKey: string },
|
|
3364
|
+
| {
|
|
3365
|
+
coverage: "unknown";
|
|
3366
|
+
registration: {
|
|
3367
|
+
_creationTime: number;
|
|
3368
|
+
_id: string;
|
|
3369
|
+
bucketKey: string;
|
|
3370
|
+
generation: number;
|
|
3371
|
+
kind: "stripe_account" | "logical";
|
|
3372
|
+
orgId?: string;
|
|
3373
|
+
source: { integration: string; recordId: string };
|
|
3374
|
+
userId: string;
|
|
3375
|
+
};
|
|
3376
|
+
status: "registered";
|
|
3377
|
+
}
|
|
3378
|
+
| { coverage: "unknown"; status: "unknown" },
|
|
3379
|
+
Name
|
|
3380
|
+
>;
|
|
3381
|
+
};
|
|
3382
|
+
};
|
|
2858
3383
|
payoutPolicy: {
|
|
2859
3384
|
mutations: {
|
|
2860
3385
|
beginAttempt: FunctionReference<
|
|
@@ -4982,7 +5507,68 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
4982
5507
|
};
|
|
4983
5508
|
};
|
|
4984
5509
|
refundHistory: {
|
|
5510
|
+
mutations: {
|
|
5511
|
+
normalizeRefundCommandBindings: FunctionReference<
|
|
5512
|
+
"mutation",
|
|
5513
|
+
"internal",
|
|
5514
|
+
{ limit: number },
|
|
5515
|
+
{ hasMore: boolean; normalized: number },
|
|
5516
|
+
Name
|
|
5517
|
+
>;
|
|
5518
|
+
};
|
|
4985
5519
|
queries: {
|
|
5520
|
+
getRefundCommandEvidence: FunctionReference<
|
|
5521
|
+
"query",
|
|
5522
|
+
"internal",
|
|
5523
|
+
{
|
|
5524
|
+
accountId: string;
|
|
5525
|
+
commandKey: string;
|
|
5526
|
+
currency: string;
|
|
5527
|
+
stripeChargeId: string;
|
|
5528
|
+
stripePaymentIntentId: string;
|
|
5529
|
+
},
|
|
5530
|
+
| {
|
|
5531
|
+
refund: {
|
|
5532
|
+
_creationTime: number;
|
|
5533
|
+
_id: string;
|
|
5534
|
+
accountId?: string;
|
|
5535
|
+
amount: number;
|
|
5536
|
+
currency: string;
|
|
5537
|
+
failureReason?: string;
|
|
5538
|
+
metadata?: any;
|
|
5539
|
+
reason?:
|
|
5540
|
+
| "duplicate"
|
|
5541
|
+
| "fraudulent"
|
|
5542
|
+
| "requested_by_customer"
|
|
5543
|
+
| "expired_uncaptured_charge";
|
|
5544
|
+
refundCommandConflict?: boolean;
|
|
5545
|
+
refundCommandKey?: string;
|
|
5546
|
+
refundCommandNormalizationVersion?: 1;
|
|
5547
|
+
refundCommandObservedAt?: number;
|
|
5548
|
+
status:
|
|
5549
|
+
| "pending"
|
|
5550
|
+
| "requires_action"
|
|
5551
|
+
| "succeeded"
|
|
5552
|
+
| "failed"
|
|
5553
|
+
| "canceled";
|
|
5554
|
+
stripeChargeId?: string;
|
|
5555
|
+
stripePaymentIntentId?: string;
|
|
5556
|
+
stripeRefundId: string;
|
|
5557
|
+
};
|
|
5558
|
+
status: "observed";
|
|
5559
|
+
}
|
|
5560
|
+
| {
|
|
5561
|
+
reason:
|
|
5562
|
+
| "missing"
|
|
5563
|
+
| "normalization_incomplete"
|
|
5564
|
+
| "ambiguous"
|
|
5565
|
+
| "correlation_conflict"
|
|
5566
|
+
| "scope_mismatch"
|
|
5567
|
+
| "invalid_receipt";
|
|
5568
|
+
status: "unavailable";
|
|
5569
|
+
},
|
|
5570
|
+
Name
|
|
5571
|
+
>;
|
|
4986
5572
|
paginateRefunds: FunctionReference<
|
|
4987
5573
|
"query",
|
|
4988
5574
|
"internal",
|
|
@@ -5020,6 +5606,10 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
5020
5606
|
| "fraudulent"
|
|
5021
5607
|
| "requested_by_customer"
|
|
5022
5608
|
| "expired_uncaptured_charge";
|
|
5609
|
+
refundCommandConflict?: boolean;
|
|
5610
|
+
refundCommandKey?: string;
|
|
5611
|
+
refundCommandNormalizationVersion?: 1;
|
|
5612
|
+
refundCommandObservedAt?: number;
|
|
5023
5613
|
status:
|
|
5024
5614
|
| "pending"
|
|
5025
5615
|
| "requires_action"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { observeTransfer } from "../financialObservations/transfers.js";
|
|
1
2
|
import { commissionExposureValidator } from "../settlement/clawbackSchema.js";
|
|
2
3
|
import { applyObligationExposure } from "../settlement/clawbacks.js";
|
|
3
4
|
import { v } from "convex/values";
|
|
@@ -169,6 +170,10 @@ export const completeOperation = mutation({
|
|
|
169
170
|
transfer.status,
|
|
170
171
|
),
|
|
171
172
|
);
|
|
173
|
+
await observeTransfer(
|
|
174
|
+
ctx,
|
|
175
|
+
(await ctx.db.get("transfers", transfer._id))!,
|
|
176
|
+
);
|
|
172
177
|
const duplicate = await ctx.db
|
|
173
178
|
.query("affiliateReversalReceipts")
|
|
174
179
|
.withIndex("by_receipt", (q) =>
|
|
@@ -187,7 +192,7 @@ export const completeOperation = mutation({
|
|
|
187
192
|
});
|
|
188
193
|
await updateObligation(ctx, row, { ...patch, recoveredAmount: total });
|
|
189
194
|
} else {
|
|
190
|
-
await ctx.db.insert("transfers", {
|
|
195
|
+
const transferId = await ctx.db.insert("transfers", {
|
|
191
196
|
stripeTransferId: args.receiptId!,
|
|
192
197
|
sourceChargeId: row.sourceChargeId,
|
|
193
198
|
sourceInvoiceId: row.sourceInvoiceId,
|
|
@@ -199,6 +204,10 @@ export const completeOperation = mutation({
|
|
|
199
204
|
reinstatement: true,
|
|
200
205
|
metadata: { bsRecoveryOperation: op._id },
|
|
201
206
|
});
|
|
207
|
+
await observeTransfer(
|
|
208
|
+
ctx,
|
|
209
|
+
(await ctx.db.get("transfers", transferId))!,
|
|
210
|
+
);
|
|
202
211
|
await updateObligation(ctx, row, {
|
|
203
212
|
...patch,
|
|
204
213
|
restoredAmount: (row.restoredAmount ?? 0) + op.amount,
|