@fantastic.dev/better-stripe 0.34.0 → 0.37.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 +260 -0
- package/README.md +1 -1
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +664 -2
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts +332 -1
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +664 -2
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutSyncTestHelpers.d.ts +332 -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/operationEvidence.d.ts +37 -0
- package/dist/client/operationEvidence.d.ts.map +1 -0
- package/dist/client/operationEvidence.js +44 -0
- package/dist/client/operationEvidence.js.map +1 -0
- package/dist/client/publicTypes.d.ts +6 -0
- package/dist/client/publicTypes.d.ts.map +1 -1
- package/dist/client/readContracts.d.ts +31 -0
- package/dist/client/readContracts.d.ts.map +1 -1
- package/dist/client/readContracts.js +14 -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 +687 -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/pairedAdjustment.d.ts +12 -0
- package/dist/component/earnings/pairedAdjustment.d.ts.map +1 -0
- package/dist/component/earnings/pairedAdjustment.js +46 -0
- package/dist/component/earnings/pairedAdjustment.js.map +1 -0
- package/dist/component/earnings/triggers.d.ts +546 -2
- package/dist/component/earnings/triggers.d.ts.map +1 -1
- package/dist/component/earnings/triggers.js +17 -3
- 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/operationEvidence/canonical.d.ts +4 -0
- package/dist/component/operationEvidence/canonical.d.ts.map +1 -0
- package/dist/component/operationEvidence/canonical.js +8 -0
- package/dist/component/operationEvidence/canonical.js.map +1 -0
- package/dist/component/operationEvidence/helpers.d.ts +87 -0
- package/dist/component/operationEvidence/helpers.d.ts.map +1 -0
- package/dist/component/operationEvidence/helpers.js +49 -0
- package/dist/component/operationEvidence/helpers.js.map +1 -0
- package/dist/component/operationEvidence/maintenance.d.ts +88 -0
- package/dist/component/operationEvidence/maintenance.d.ts.map +1 -0
- package/dist/component/operationEvidence/maintenance.js +59 -0
- package/dist/component/operationEvidence/maintenance.js.map +1 -0
- package/dist/component/operationEvidence/mutations.d.ts +97 -0
- package/dist/component/operationEvidence/mutations.d.ts.map +1 -0
- package/dist/component/operationEvidence/mutations.js +14 -0
- package/dist/component/operationEvidence/mutations.js.map +1 -0
- package/dist/component/operationEvidence/queries.d.ts +205 -0
- package/dist/component/operationEvidence/queries.d.ts.map +1 -0
- package/dist/component/operationEvidence/queries.js +75 -0
- package/dist/component/operationEvidence/queries.js.map +1 -0
- package/dist/component/operationEvidence/schema.d.ts +536 -0
- package/dist/component/operationEvidence/schema.d.ts.map +1 -0
- package/dist/component/operationEvidence/schema.js +53 -0
- package/dist/component/operationEvidence/schema.js.map +1 -0
- 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 +58 -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/originalSeller.d.ts +5 -0
- package/dist/component/refundHistory/originalSeller.d.ts.map +1 -0
- package/dist/component/refundHistory/originalSeller.js +35 -0
- package/dist/component/refundHistory/originalSeller.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 +332 -1
- package/dist/component/schema.js +15 -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 +244 -0
- package/docs/financial-ownership.md +54 -0
- package/docs/refund-command-evidence.md +55 -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/operationEvidence.test.ts +110 -0
- package/src/client/operationEvidence.ts +92 -0
- package/src/client/publicTypes.ts +45 -0
- package/src/client/readContracts.ts +25 -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 +54 -0
- package/src/component/_generated/component.ts +797 -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/paired-adjustment.test.ts +258 -0
- package/src/component/earnings/pairedAdjustment.ts +77 -0
- package/src/component/earnings/triggers.ts +23 -11
- 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/operationEvidence/canonical.ts +10 -0
- package/src/component/operationEvidence/helpers.ts +65 -0
- package/src/component/operationEvidence/integrity.test.ts +257 -0
- package/src/component/operationEvidence/maintenance.test.ts +152 -0
- package/src/component/operationEvidence/maintenance.ts +89 -0
- package/src/component/operationEvidence/mutations.ts +14 -0
- package/src/component/operationEvidence/queries.ts +108 -0
- package/src/component/operationEvidence/reads.test.ts +140 -0
- package/src/component/operationEvidence/schema.ts +62 -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 +76 -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/original-seller-boundaries.test.ts +138 -0
- package/src/component/refundHistory/original-seller.test.ts +175 -0
- package/src/component/refundHistory/originalSeller.ts +48 -0
- package/src/component/refundHistory/queries.ts +15 -0
- package/src/component/schema.ts +28 -0
- package/src/component/settlement/mutations.ts +5 -1
- package/src/shared/refundCommandScope.ts +19 -0
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
export declare const source: import("convex/server").RegisteredQuery<"public", {
|
|
2
|
+
allocationId: import("convex/values").GenericId<"settlementAllocations">;
|
|
3
|
+
}, Promise<{
|
|
4
|
+
coverage: "unknown";
|
|
5
|
+
observation: {
|
|
6
|
+
_creationTime: number;
|
|
7
|
+
_id: import("convex/values").GenericId<"financialSourceObservations">;
|
|
8
|
+
allocationId: import("convex/values").GenericId<"settlementAllocations">;
|
|
9
|
+
continuation?: {
|
|
10
|
+
nextLeg: number;
|
|
11
|
+
state: "complete" | "held" | "indexing" | "validating";
|
|
12
|
+
validatedLegs: number;
|
|
13
|
+
} | undefined;
|
|
14
|
+
fingerprint: string;
|
|
15
|
+
generation: number;
|
|
16
|
+
indexedLegCount: number;
|
|
17
|
+
isContradictory: boolean;
|
|
18
|
+
isOverflow: boolean;
|
|
19
|
+
legCount: number;
|
|
20
|
+
observedFingerprint: string;
|
|
21
|
+
ownershipFingerprint: string;
|
|
22
|
+
producer: "settlement_allocation";
|
|
23
|
+
producerVersion: 1;
|
|
24
|
+
sourceChargeId: string;
|
|
25
|
+
} | null;
|
|
26
|
+
}>>;
|
|
27
|
+
/** Trusted host boundary; exact keys do not authorize end-user access. */
|
|
28
|
+
export declare const bucket: import("convex/server").RegisteredQuery<"public", {
|
|
29
|
+
bucketKey: string;
|
|
30
|
+
paginationOpts: {
|
|
31
|
+
id?: number;
|
|
32
|
+
endCursor?: string | null;
|
|
33
|
+
maximumRowsRead?: number;
|
|
34
|
+
maximumBytesRead?: number;
|
|
35
|
+
numItems: number;
|
|
36
|
+
cursor: string | null;
|
|
37
|
+
};
|
|
38
|
+
}, Promise<{
|
|
39
|
+
page: {
|
|
40
|
+
_creationTime: number;
|
|
41
|
+
_id: import("convex/values").GenericId<"financialSourceLegs">;
|
|
42
|
+
allocationId: import("convex/values").GenericId<"settlementAllocations">;
|
|
43
|
+
bucketKey: string;
|
|
44
|
+
legIndex: number;
|
|
45
|
+
orgId?: string | undefined;
|
|
46
|
+
ownershipStatus: "ambiguous" | "contradictory" | "registered" | "unknown";
|
|
47
|
+
registrationId?: import("convex/values").GenericId<"financialOwnership"> | undefined;
|
|
48
|
+
role: "affiliate" | "other" | "store";
|
|
49
|
+
sourceChargeId: string;
|
|
50
|
+
userId?: string | undefined;
|
|
51
|
+
}[];
|
|
52
|
+
isDone: boolean;
|
|
53
|
+
continueCursor: import("convex/server").Cursor;
|
|
54
|
+
splitCursor?: import("convex/server").Cursor | null;
|
|
55
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
56
|
+
coverage: "unknown";
|
|
57
|
+
generation: number | null;
|
|
58
|
+
}>>;
|
|
59
|
+
export declare const owner: import("convex/server").RegisteredQuery<"public", {
|
|
60
|
+
orgId?: string | undefined;
|
|
61
|
+
paginationOpts: {
|
|
62
|
+
id?: number;
|
|
63
|
+
endCursor?: string | null;
|
|
64
|
+
maximumRowsRead?: number;
|
|
65
|
+
maximumBytesRead?: number;
|
|
66
|
+
numItems: number;
|
|
67
|
+
cursor: string | null;
|
|
68
|
+
};
|
|
69
|
+
userId: string;
|
|
70
|
+
}, Promise<{
|
|
71
|
+
page: {
|
|
72
|
+
_creationTime: number;
|
|
73
|
+
_id: import("convex/values").GenericId<"financialSourceLegs">;
|
|
74
|
+
allocationId: import("convex/values").GenericId<"settlementAllocations">;
|
|
75
|
+
bucketKey: string;
|
|
76
|
+
legIndex: number;
|
|
77
|
+
orgId?: string | undefined;
|
|
78
|
+
ownershipStatus: "ambiguous" | "contradictory" | "registered" | "unknown";
|
|
79
|
+
registrationId?: import("convex/values").GenericId<"financialOwnership"> | undefined;
|
|
80
|
+
role: "affiliate" | "other" | "store";
|
|
81
|
+
sourceChargeId: string;
|
|
82
|
+
userId?: string | undefined;
|
|
83
|
+
}[];
|
|
84
|
+
isDone: boolean;
|
|
85
|
+
continueCursor: import("convex/server").Cursor;
|
|
86
|
+
splitCursor?: import("convex/server").Cursor | null;
|
|
87
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
88
|
+
coverage: "unknown";
|
|
89
|
+
generation: number | null;
|
|
90
|
+
}>>;
|
|
91
|
+
export declare const transfer: import("convex/server").RegisteredQuery<"public", {
|
|
92
|
+
transferId: import("convex/values").GenericId<"transfers">;
|
|
93
|
+
}, Promise<{
|
|
94
|
+
coverage: "unknown";
|
|
95
|
+
producerGeneration: number | null;
|
|
96
|
+
hasDeferredWork: boolean;
|
|
97
|
+
observation: {
|
|
98
|
+
_creationTime: number;
|
|
99
|
+
_id: import("convex/values").GenericId<"financialTransferObservations">;
|
|
100
|
+
bucketKey: string;
|
|
101
|
+
fingerprint: string;
|
|
102
|
+
generation: number;
|
|
103
|
+
isContradictory: boolean;
|
|
104
|
+
observedFingerprint: string;
|
|
105
|
+
orgId?: string | undefined;
|
|
106
|
+
ownershipFingerprint: string;
|
|
107
|
+
ownershipStatus: "ambiguous" | "contradictory" | "registered" | "unknown";
|
|
108
|
+
producer: "transfer_fact";
|
|
109
|
+
producerVersion: 1;
|
|
110
|
+
registrationId?: import("convex/values").GenericId<"financialOwnership"> | undefined;
|
|
111
|
+
role?: "affiliate" | "other" | "store" | undefined;
|
|
112
|
+
sourceChargeId?: string | undefined;
|
|
113
|
+
sourceInvoiceId?: string | undefined;
|
|
114
|
+
stripeTransferId: string;
|
|
115
|
+
transferId: import("convex/values").GenericId<"transfers">;
|
|
116
|
+
userId?: string | undefined;
|
|
117
|
+
} | null;
|
|
118
|
+
}>>;
|
|
119
|
+
export declare const transferBatches: import("convex/server").RegisteredQuery<"public", {
|
|
120
|
+
operationId: string;
|
|
121
|
+
paginationOpts: {
|
|
122
|
+
id?: number;
|
|
123
|
+
endCursor?: string | null;
|
|
124
|
+
maximumRowsRead?: number;
|
|
125
|
+
maximumBytesRead?: number;
|
|
126
|
+
numItems: number;
|
|
127
|
+
cursor: string | null;
|
|
128
|
+
};
|
|
129
|
+
}, Promise<{
|
|
130
|
+
page: {
|
|
131
|
+
_creationTime: number;
|
|
132
|
+
_id: import("convex/values").GenericId<"financialTransferBatches">;
|
|
133
|
+
continuation?: {
|
|
134
|
+
nextReference: number;
|
|
135
|
+
producerGeneration: number;
|
|
136
|
+
sourceFingerprint: string;
|
|
137
|
+
state: "complete" | "held" | "indexing" | "validating";
|
|
138
|
+
validatedReferences: number;
|
|
139
|
+
} | undefined;
|
|
140
|
+
fingerprint: string;
|
|
141
|
+
generation: number;
|
|
142
|
+
isContradictory: boolean;
|
|
143
|
+
isOverflow: true;
|
|
144
|
+
observedFingerprint: string;
|
|
145
|
+
operationId: string;
|
|
146
|
+
originalOperationId: import("convex/values").GenericId<"transferReversalOps">;
|
|
147
|
+
producer: "transfer_frontier_claim" | "transfer_frontier_release";
|
|
148
|
+
producerVersion: 1;
|
|
149
|
+
referenceCount: number;
|
|
150
|
+
sourceChargeId: string;
|
|
151
|
+
state: "complete" | "pending";
|
|
152
|
+
transferIds: import("convex/values").GenericId<"transfers">[];
|
|
153
|
+
}[];
|
|
154
|
+
isDone: boolean;
|
|
155
|
+
continueCursor: import("convex/server").Cursor;
|
|
156
|
+
splitCursor?: import("convex/server").Cursor | null;
|
|
157
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
158
|
+
coverage: "unknown";
|
|
159
|
+
producerGeneration: number | null;
|
|
160
|
+
hasDeferredWork: boolean;
|
|
161
|
+
}>>;
|
|
162
|
+
export declare const transferBucket: import("convex/server").RegisteredQuery<"public", {
|
|
163
|
+
bucketKey: string;
|
|
164
|
+
paginationOpts: {
|
|
165
|
+
id?: number;
|
|
166
|
+
endCursor?: string | null;
|
|
167
|
+
maximumRowsRead?: number;
|
|
168
|
+
maximumBytesRead?: number;
|
|
169
|
+
numItems: number;
|
|
170
|
+
cursor: string | null;
|
|
171
|
+
};
|
|
172
|
+
}, Promise<{
|
|
173
|
+
page: {
|
|
174
|
+
_creationTime: number;
|
|
175
|
+
_id: import("convex/values").GenericId<"financialTransferObservations">;
|
|
176
|
+
bucketKey: string;
|
|
177
|
+
fingerprint: string;
|
|
178
|
+
generation: number;
|
|
179
|
+
isContradictory: boolean;
|
|
180
|
+
observedFingerprint: string;
|
|
181
|
+
orgId?: string | undefined;
|
|
182
|
+
ownershipFingerprint: string;
|
|
183
|
+
ownershipStatus: "ambiguous" | "contradictory" | "registered" | "unknown";
|
|
184
|
+
producer: "transfer_fact";
|
|
185
|
+
producerVersion: 1;
|
|
186
|
+
registrationId?: import("convex/values").GenericId<"financialOwnership"> | undefined;
|
|
187
|
+
role?: "affiliate" | "other" | "store" | undefined;
|
|
188
|
+
sourceChargeId?: string | undefined;
|
|
189
|
+
sourceInvoiceId?: string | undefined;
|
|
190
|
+
stripeTransferId: string;
|
|
191
|
+
transferId: import("convex/values").GenericId<"transfers">;
|
|
192
|
+
userId?: string | undefined;
|
|
193
|
+
}[];
|
|
194
|
+
isDone: boolean;
|
|
195
|
+
continueCursor: import("convex/server").Cursor;
|
|
196
|
+
splitCursor?: import("convex/server").Cursor | null;
|
|
197
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
198
|
+
coverage: "unknown";
|
|
199
|
+
producerGeneration: number | null;
|
|
200
|
+
hasDeferredWork: boolean;
|
|
201
|
+
generation: number | null;
|
|
202
|
+
}>>;
|
|
203
|
+
export declare const transferOwner: import("convex/server").RegisteredQuery<"public", {
|
|
204
|
+
orgId?: string | undefined;
|
|
205
|
+
paginationOpts: {
|
|
206
|
+
id?: number;
|
|
207
|
+
endCursor?: string | null;
|
|
208
|
+
maximumRowsRead?: number;
|
|
209
|
+
maximumBytesRead?: number;
|
|
210
|
+
numItems: number;
|
|
211
|
+
cursor: string | null;
|
|
212
|
+
};
|
|
213
|
+
userId: string;
|
|
214
|
+
}, Promise<{
|
|
215
|
+
page: {
|
|
216
|
+
_creationTime: number;
|
|
217
|
+
_id: import("convex/values").GenericId<"financialTransferObservations">;
|
|
218
|
+
bucketKey: string;
|
|
219
|
+
fingerprint: string;
|
|
220
|
+
generation: number;
|
|
221
|
+
isContradictory: boolean;
|
|
222
|
+
observedFingerprint: string;
|
|
223
|
+
orgId?: string | undefined;
|
|
224
|
+
ownershipFingerprint: string;
|
|
225
|
+
ownershipStatus: "ambiguous" | "contradictory" | "registered" | "unknown";
|
|
226
|
+
producer: "transfer_fact";
|
|
227
|
+
producerVersion: 1;
|
|
228
|
+
registrationId?: import("convex/values").GenericId<"financialOwnership"> | undefined;
|
|
229
|
+
role?: "affiliate" | "other" | "store" | undefined;
|
|
230
|
+
sourceChargeId?: string | undefined;
|
|
231
|
+
sourceInvoiceId?: string | undefined;
|
|
232
|
+
stripeTransferId: string;
|
|
233
|
+
transferId: import("convex/values").GenericId<"transfers">;
|
|
234
|
+
userId?: string | undefined;
|
|
235
|
+
}[];
|
|
236
|
+
isDone: boolean;
|
|
237
|
+
continueCursor: import("convex/server").Cursor;
|
|
238
|
+
splitCursor?: import("convex/server").Cursor | null;
|
|
239
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
240
|
+
coverage: "unknown";
|
|
241
|
+
producerGeneration: number | null;
|
|
242
|
+
hasDeferredWork: boolean;
|
|
243
|
+
generation: number | null;
|
|
244
|
+
}>>;
|
|
245
|
+
export declare const transferReferences: import("convex/server").RegisteredQuery<"public", {
|
|
246
|
+
batchId: import("convex/values").GenericId<"financialTransferBatches">;
|
|
247
|
+
paginationOpts: {
|
|
248
|
+
id?: number;
|
|
249
|
+
endCursor?: string | null;
|
|
250
|
+
maximumRowsRead?: number;
|
|
251
|
+
maximumBytesRead?: number;
|
|
252
|
+
numItems: number;
|
|
253
|
+
cursor: string | null;
|
|
254
|
+
};
|
|
255
|
+
}, Promise<{
|
|
256
|
+
page: {
|
|
257
|
+
_creationTime: number;
|
|
258
|
+
_id: import("convex/values").GenericId<"financialTransferBatchReferences">;
|
|
259
|
+
batchId: import("convex/values").GenericId<"financialTransferBatches">;
|
|
260
|
+
observationGeneration: number;
|
|
261
|
+
observationId: import("convex/values").GenericId<"financialTransferObservations">;
|
|
262
|
+
observedFingerprint: string;
|
|
263
|
+
ownershipFingerprint: string;
|
|
264
|
+
position: number;
|
|
265
|
+
sourceFingerprint: string;
|
|
266
|
+
transferId: import("convex/values").GenericId<"transfers">;
|
|
267
|
+
}[];
|
|
268
|
+
isDone: boolean;
|
|
269
|
+
continueCursor: import("convex/server").Cursor;
|
|
270
|
+
splitCursor?: import("convex/server").Cursor | null;
|
|
271
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
272
|
+
coverage: "unknown";
|
|
273
|
+
producerGeneration: number | null;
|
|
274
|
+
hasDeferredWork: boolean;
|
|
275
|
+
}>>;
|
|
276
|
+
export declare const transferBatch: import("convex/server").RegisteredQuery<"public", {
|
|
277
|
+
batchId: import("convex/values").GenericId<"financialTransferBatches">;
|
|
278
|
+
}, Promise<{
|
|
279
|
+
coverage: "unknown";
|
|
280
|
+
producerGeneration: number | null;
|
|
281
|
+
hasDeferredWork: boolean;
|
|
282
|
+
batch: {
|
|
283
|
+
_creationTime: number;
|
|
284
|
+
_id: import("convex/values").GenericId<"financialTransferBatches">;
|
|
285
|
+
continuation?: {
|
|
286
|
+
nextReference: number;
|
|
287
|
+
producerGeneration: number;
|
|
288
|
+
sourceFingerprint: string;
|
|
289
|
+
state: "complete" | "held" | "indexing" | "validating";
|
|
290
|
+
validatedReferences: number;
|
|
291
|
+
} | undefined;
|
|
292
|
+
fingerprint: string;
|
|
293
|
+
generation: number;
|
|
294
|
+
isContradictory: boolean;
|
|
295
|
+
isOverflow: true;
|
|
296
|
+
observedFingerprint: string;
|
|
297
|
+
operationId: string;
|
|
298
|
+
originalOperationId: import("convex/values").GenericId<"transferReversalOps">;
|
|
299
|
+
producer: "transfer_frontier_claim" | "transfer_frontier_release";
|
|
300
|
+
producerVersion: 1;
|
|
301
|
+
referenceCount: number;
|
|
302
|
+
sourceChargeId: string;
|
|
303
|
+
state: "complete" | "pending";
|
|
304
|
+
transferIds: import("convex/values").GenericId<"transfers">[];
|
|
305
|
+
} | null;
|
|
306
|
+
}>>;
|
|
307
|
+
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/component/financialObservations/queries.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,MAAM;;;cAcH,SAAS;;;;;;;;;;;;;;;;;;;;;;GASvB,CAAC;AAUH,0EAA0E;AAC1E,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiBH,SAAS;;GAIvB,CAAC;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmBF,SAAS;;GAOvB,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoBnB,CAAC;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwB1B,CAAC;AAMH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqBzB,CAAC;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BxB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsB7B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAUxB,CAAC"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { transferReferenceDoc } from "./transferReferenceSchema.js";
|
|
2
|
+
import { transferReaderState } from "./transferBatches.js";
|
|
3
|
+
import { transferObservationDoc, transferBatchDoc } from "./transferSchema.js";
|
|
4
|
+
import { paginationOptsValidator, paginationResultValidator, } from "convex/server";
|
|
5
|
+
import { paginator } from "convex-helpers/server/pagination";
|
|
6
|
+
import { v } from "convex/values";
|
|
7
|
+
import { query } from "../_generated/server.js";
|
|
8
|
+
import { assertOwner, assertSelector } from "../financialOwnership/helpers.js";
|
|
9
|
+
import { ownerFields } from "../financialOwnership/schema.js";
|
|
10
|
+
import schema from "../schema.js";
|
|
11
|
+
import { bucketScope, observationGeneration, ownerScope, } from "./generations.js";
|
|
12
|
+
import { legDoc, sourceDoc } from "./schema.js";
|
|
13
|
+
const transferReadFields = {
|
|
14
|
+
coverage: v.literal("unknown"),
|
|
15
|
+
producerGeneration: v.union(v.number(), v.null()),
|
|
16
|
+
hasDeferredWork: v.boolean(),
|
|
17
|
+
};
|
|
18
|
+
export const source = query({
|
|
19
|
+
args: { allocationId: v.id("settlementAllocations") },
|
|
20
|
+
returns: v.object({
|
|
21
|
+
coverage: v.literal("unknown"),
|
|
22
|
+
observation: v.union(v.null(), sourceDoc),
|
|
23
|
+
}),
|
|
24
|
+
handler: async (ctx, args) => {
|
|
25
|
+
const rows = await ctx.db
|
|
26
|
+
.query("financialSourceObservations")
|
|
27
|
+
.withIndex("by_allocation_id", (q) => q.eq("allocationId", args.allocationId))
|
|
28
|
+
.take(2);
|
|
29
|
+
return {
|
|
30
|
+
coverage: "unknown",
|
|
31
|
+
observation: rows.length === 1 &&
|
|
32
|
+
Number.isSafeInteger(rows[0].generation) &&
|
|
33
|
+
rows[0].generation >= 1
|
|
34
|
+
? rows[0]
|
|
35
|
+
: null,
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
const result = v.object({
|
|
40
|
+
...paginationResultValidator(legDoc).fields,
|
|
41
|
+
coverage: v.literal("unknown"),
|
|
42
|
+
generation: v.union(v.number(), v.null()),
|
|
43
|
+
});
|
|
44
|
+
function assertPageSize(numItems) {
|
|
45
|
+
if (!Number.isInteger(numItems) || numItems < 1 || numItems > 100)
|
|
46
|
+
throw new Error("Observation page size must be between 1 and 100");
|
|
47
|
+
}
|
|
48
|
+
/** Trusted host boundary; exact keys do not authorize end-user access. */
|
|
49
|
+
export const bucket = query({
|
|
50
|
+
args: { bucketKey: v.string(), paginationOpts: paginationOptsValidator },
|
|
51
|
+
returns: result,
|
|
52
|
+
handler: async (ctx, args) => {
|
|
53
|
+
assertSelector(args.bucketKey);
|
|
54
|
+
assertPageSize(args.paginationOpts.numItems);
|
|
55
|
+
const page = await paginator(ctx.db, schema)
|
|
56
|
+
.query("financialSourceLegs")
|
|
57
|
+
.withIndex("by_bucket_key", (q) => q.eq("bucketKey", args.bucketKey))
|
|
58
|
+
.order("desc")
|
|
59
|
+
.paginate({
|
|
60
|
+
...args.paginationOpts,
|
|
61
|
+
maximumRowsRead: 200,
|
|
62
|
+
maximumBytesRead: 1_000_000,
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
...page,
|
|
66
|
+
coverage: "unknown",
|
|
67
|
+
generation: await observationGeneration(ctx, bucketScope(args.bucketKey)),
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
export const owner = query({
|
|
72
|
+
args: { ...ownerFields, paginationOpts: paginationOptsValidator },
|
|
73
|
+
returns: result,
|
|
74
|
+
handler: async (ctx, args) => {
|
|
75
|
+
assertOwner(args);
|
|
76
|
+
assertPageSize(args.paginationOpts.numItems);
|
|
77
|
+
const page = await paginator(ctx.db, schema)
|
|
78
|
+
.query("financialSourceLegs")
|
|
79
|
+
.withIndex("by_owner", (q) => q.eq("userId", args.userId).eq("orgId", args.orgId))
|
|
80
|
+
.order("desc")
|
|
81
|
+
.paginate({
|
|
82
|
+
...args.paginationOpts,
|
|
83
|
+
maximumRowsRead: 200,
|
|
84
|
+
maximumBytesRead: 1_000_000,
|
|
85
|
+
});
|
|
86
|
+
return {
|
|
87
|
+
...page,
|
|
88
|
+
coverage: "unknown",
|
|
89
|
+
generation: await observationGeneration(ctx, ownerScope(args.userId, args.orgId)),
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
export const transfer = query({
|
|
94
|
+
args: { transferId: v.id("transfers") },
|
|
95
|
+
returns: v.object({
|
|
96
|
+
...transferReadFields,
|
|
97
|
+
observation: v.union(transferObservationDoc, v.null()),
|
|
98
|
+
}),
|
|
99
|
+
handler: async (ctx, args) => {
|
|
100
|
+
const rows = await ctx.db
|
|
101
|
+
.query("financialTransferObservations")
|
|
102
|
+
.withIndex("by_transfer_id", (q) => q.eq("transferId", args.transferId))
|
|
103
|
+
.take(2);
|
|
104
|
+
const row = rows.length === 1 ? rows[0] : null;
|
|
105
|
+
return {
|
|
106
|
+
...(await transferReaderState(ctx)),
|
|
107
|
+
observation: row && Number.isSafeInteger(row.generation) && row.generation >= 1
|
|
108
|
+
? row
|
|
109
|
+
: null,
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
export const transferBatches = query({
|
|
114
|
+
args: { operationId: v.string(), paginationOpts: paginationOptsValidator },
|
|
115
|
+
returns: v.object({
|
|
116
|
+
...paginationResultValidator(transferBatchDoc).fields,
|
|
117
|
+
coverage: v.literal("unknown"),
|
|
118
|
+
hasDeferredWork: v.boolean(),
|
|
119
|
+
producerGeneration: v.union(v.number(), v.null()),
|
|
120
|
+
}),
|
|
121
|
+
handler: async (ctx, args) => {
|
|
122
|
+
assertSelector(args.operationId);
|
|
123
|
+
assertPageSize(args.paginationOpts.numItems);
|
|
124
|
+
const page = await paginator(ctx.db, schema)
|
|
125
|
+
.query("financialTransferBatches")
|
|
126
|
+
.withIndex("by_operation_id", (q) => q.eq("operationId", args.operationId))
|
|
127
|
+
.order("desc")
|
|
128
|
+
.paginate({
|
|
129
|
+
...args.paginationOpts,
|
|
130
|
+
maximumRowsRead: 200,
|
|
131
|
+
maximumBytesRead: 1_000_000,
|
|
132
|
+
});
|
|
133
|
+
return { ...page, ...(await transferReaderState(ctx)) };
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
const transferPageResult = v.object({
|
|
137
|
+
...paginationResultValidator(transferObservationDoc).fields,
|
|
138
|
+
...transferReadFields,
|
|
139
|
+
generation: v.union(v.number(), v.null()),
|
|
140
|
+
});
|
|
141
|
+
export const transferBucket = query({
|
|
142
|
+
args: { bucketKey: v.string(), paginationOpts: paginationOptsValidator },
|
|
143
|
+
returns: transferPageResult,
|
|
144
|
+
handler: async (ctx, args) => {
|
|
145
|
+
assertSelector(args.bucketKey);
|
|
146
|
+
assertPageSize(args.paginationOpts.numItems);
|
|
147
|
+
const page = await paginator(ctx.db, schema)
|
|
148
|
+
.query("financialTransferObservations")
|
|
149
|
+
.withIndex("by_bucket_key", (q) => q.eq("bucketKey", args.bucketKey))
|
|
150
|
+
.order("desc")
|
|
151
|
+
.paginate({
|
|
152
|
+
...args.paginationOpts,
|
|
153
|
+
maximumRowsRead: 200,
|
|
154
|
+
maximumBytesRead: 1_000_000,
|
|
155
|
+
});
|
|
156
|
+
return {
|
|
157
|
+
...page,
|
|
158
|
+
...(await transferReaderState(ctx)),
|
|
159
|
+
generation: await observationGeneration(ctx, bucketScope(args.bucketKey)),
|
|
160
|
+
};
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
export const transferOwner = query({
|
|
164
|
+
args: { ...ownerFields, paginationOpts: paginationOptsValidator },
|
|
165
|
+
returns: transferPageResult,
|
|
166
|
+
handler: async (ctx, args) => {
|
|
167
|
+
assertOwner(args);
|
|
168
|
+
assertPageSize(args.paginationOpts.numItems);
|
|
169
|
+
const page = await paginator(ctx.db, schema)
|
|
170
|
+
.query("financialTransferObservations")
|
|
171
|
+
.withIndex("by_owner", (q) => q.eq("userId", args.userId).eq("orgId", args.orgId))
|
|
172
|
+
.order("desc")
|
|
173
|
+
.paginate({
|
|
174
|
+
...args.paginationOpts,
|
|
175
|
+
maximumRowsRead: 200,
|
|
176
|
+
maximumBytesRead: 1_000_000,
|
|
177
|
+
});
|
|
178
|
+
return {
|
|
179
|
+
...page,
|
|
180
|
+
...(await transferReaderState(ctx)),
|
|
181
|
+
generation: await observationGeneration(ctx, ownerScope(args.userId, args.orgId)),
|
|
182
|
+
};
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
export const transferReferences = query({
|
|
186
|
+
args: {
|
|
187
|
+
batchId: v.id("financialTransferBatches"),
|
|
188
|
+
paginationOpts: paginationOptsValidator,
|
|
189
|
+
},
|
|
190
|
+
returns: v.object({
|
|
191
|
+
...paginationResultValidator(transferReferenceDoc).fields,
|
|
192
|
+
...transferReadFields,
|
|
193
|
+
}),
|
|
194
|
+
handler: async (ctx, args) => {
|
|
195
|
+
assertPageSize(args.paginationOpts.numItems);
|
|
196
|
+
const page = await paginator(ctx.db, schema)
|
|
197
|
+
.query("financialTransferBatchReferences")
|
|
198
|
+
.withIndex("by_batch_position", (q) => q.eq("batchId", args.batchId))
|
|
199
|
+
.order("asc")
|
|
200
|
+
.paginate({
|
|
201
|
+
...args.paginationOpts,
|
|
202
|
+
maximumRowsRead: 200,
|
|
203
|
+
maximumBytesRead: 1_000_000,
|
|
204
|
+
});
|
|
205
|
+
return { ...page, ...(await transferReaderState(ctx)) };
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
export const transferBatch = query({
|
|
209
|
+
args: { batchId: v.id("financialTransferBatches") },
|
|
210
|
+
returns: v.object({
|
|
211
|
+
...transferReadFields,
|
|
212
|
+
batch: v.union(transferBatchDoc, v.null()),
|
|
213
|
+
}),
|
|
214
|
+
handler: async (ctx, args) => ({
|
|
215
|
+
...(await transferReaderState(ctx)),
|
|
216
|
+
batch: await ctx.db.get("financialTransferBatches", args.batchId),
|
|
217
|
+
}),
|
|
218
|
+
});
|
|
219
|
+
//# sourceMappingURL=queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../../src/component/financialObservations/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EACL,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,kBAAkB,GAAG;IACzB,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC9B,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACjD,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE;CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC;IAC1B,IAAI,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,uBAAuB,CAAC,EAAE;IACrD,OAAO,EAAE,CAAC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