@voyantjs/legal-react 0.4.4 → 0.5.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/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/use-evaluate-cancellation.d.ts +46 -0
- package/dist/hooks/use-evaluate-cancellation.d.ts.map +1 -0
- package/dist/hooks/use-evaluate-cancellation.js +43 -0
- package/dist/hooks/use-resolve-policy.d.ts +73 -0
- package/dist/hooks/use-resolve-policy.d.ts.map +1 -0
- package/dist/hooks/use-resolve-policy.js +16 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/query-keys.d.ts +10 -0
- package/dist/query-keys.d.ts.map +1 -1
- package/dist/query-keys.js +1 -0
- package/dist/query-options.d.ts +261 -0
- package/dist/query-options.d.ts.map +1 -1
- package/dist/query-options.js +7 -1
- package/dist/schemas.d.ts +259 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +26 -0
- package/package.json +5 -5
package/dist/hooks/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./use-contract-template-version-mutation.js";
|
|
|
10
10
|
export * from "./use-contract-template-versions.js";
|
|
11
11
|
export * from "./use-contract-templates.js";
|
|
12
12
|
export * from "./use-contracts.js";
|
|
13
|
+
export * from "./use-evaluate-cancellation.js";
|
|
13
14
|
export * from "./use-number-series.js";
|
|
14
15
|
export * from "./use-number-series-mutation.js";
|
|
15
16
|
export * from "./use-policies.js";
|
|
@@ -22,4 +23,5 @@ export * from "./use-policy-rule-mutation.js";
|
|
|
22
23
|
export * from "./use-policy-rules.js";
|
|
23
24
|
export * from "./use-policy-version-mutation.js";
|
|
24
25
|
export * from "./use-policy-versions.js";
|
|
26
|
+
export * from "./use-resolve-policy.js";
|
|
25
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,uCAAuC,CAAA;AACrD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,sCAAsC,CAAA;AACpD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qCAAqC,CAAA;AACnD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,qCAAqC,CAAA;AACnD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,qCAAqC,CAAA;AACnD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,kCAAkC,CAAA;AAChD,cAAc,0BAA0B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,uCAAuC,CAAA;AACrD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,sCAAsC,CAAA;AACpD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qCAAqC,CAAA;AACnD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,qCAAqC,CAAA;AACnD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,oBAAoB,CAAA;AAClC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,qCAAqC,CAAA;AACnD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,kCAAkC,CAAA;AAChD,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./use-contract-template-version-mutation.js";
|
|
|
10
10
|
export * from "./use-contract-template-versions.js";
|
|
11
11
|
export * from "./use-contract-templates.js";
|
|
12
12
|
export * from "./use-contracts.js";
|
|
13
|
+
export * from "./use-evaluate-cancellation.js";
|
|
13
14
|
export * from "./use-number-series.js";
|
|
14
15
|
export * from "./use-number-series-mutation.js";
|
|
15
16
|
export * from "./use-policies.js";
|
|
@@ -22,3 +23,4 @@ export * from "./use-policy-rule-mutation.js";
|
|
|
22
23
|
export * from "./use-policy-rules.js";
|
|
23
24
|
export * from "./use-policy-version-mutation.js";
|
|
24
25
|
export * from "./use-policy-versions.js";
|
|
26
|
+
export * from "./use-resolve-policy.js";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export interface EvaluateCancellationInput {
|
|
2
|
+
daysBeforeDeparture: number;
|
|
3
|
+
totalCents: number;
|
|
4
|
+
currency?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface UseEvaluateCancellationOptions {
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Evaluates a cancellation policy as a cacheable query. Returns the refund
|
|
11
|
+
* percent/amount/type and the applied rule. Runs automatically when all of
|
|
12
|
+
* policyId/daysBeforeDeparture/totalCents are provided and `enabled` is true.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useEvaluateCancellation(policyId: string | null | undefined, input: EvaluateCancellationInput | null | undefined, options?: UseEvaluateCancellationOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
15
|
+
data: {
|
|
16
|
+
refundPercent: number;
|
|
17
|
+
refundCents: number;
|
|
18
|
+
refundType: "cash" | "credit" | "cash_or_credit" | "none";
|
|
19
|
+
appliedRule: {
|
|
20
|
+
daysBeforeDeparture: number | null;
|
|
21
|
+
refundPercent: number | null;
|
|
22
|
+
refundType: "cash" | "credit" | "cash_or_credit" | "none" | null;
|
|
23
|
+
flatAmountCents: number | null;
|
|
24
|
+
label: string | null;
|
|
25
|
+
id?: string | undefined;
|
|
26
|
+
} | null;
|
|
27
|
+
};
|
|
28
|
+
}, Error>;
|
|
29
|
+
/**
|
|
30
|
+
* Imperative mutation variant of the cancellation evaluation for cases where
|
|
31
|
+
* the caller needs to trigger evaluation manually (e.g. with ad-hoc inputs).
|
|
32
|
+
*/
|
|
33
|
+
export declare function useEvaluateCancellationMutation(policyId: string | null | undefined): import("@tanstack/react-query").UseMutationResult<{
|
|
34
|
+
refundPercent: number;
|
|
35
|
+
refundCents: number;
|
|
36
|
+
refundType: "cash" | "credit" | "cash_or_credit" | "none";
|
|
37
|
+
appliedRule: {
|
|
38
|
+
daysBeforeDeparture: number | null;
|
|
39
|
+
refundPercent: number | null;
|
|
40
|
+
refundType: "cash" | "credit" | "cash_or_credit" | "none" | null;
|
|
41
|
+
flatAmountCents: number | null;
|
|
42
|
+
label: string | null;
|
|
43
|
+
id?: string | undefined;
|
|
44
|
+
} | null;
|
|
45
|
+
}, Error, EvaluateCancellationInput, unknown>;
|
|
46
|
+
//# sourceMappingURL=use-evaluate-cancellation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-evaluate-cancellation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-evaluate-cancellation.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,yBAAyB;IACxC,mBAAmB,EAAE,MAAM,CAAA;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,8BAA8B;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,KAAK,EAAE,yBAAyB,GAAG,IAAI,GAAG,SAAS,EACnD,OAAO,GAAE,8BAAmC;;;;;;;;;;;;;;UAsB7C;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;;;;;;;;;;;;8CAiBlF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { queryOptions, useMutation, useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { fetchWithValidation } from "../client.js";
|
|
4
|
+
import { useVoyantLegalContext } from "../provider.js";
|
|
5
|
+
import { legalQueryKeys } from "../query-keys.js";
|
|
6
|
+
import { cancellationResultResponse } from "../schemas.js";
|
|
7
|
+
/**
|
|
8
|
+
* Evaluates a cancellation policy as a cacheable query. Returns the refund
|
|
9
|
+
* percent/amount/type and the applied rule. Runs automatically when all of
|
|
10
|
+
* policyId/daysBeforeDeparture/totalCents are provided and `enabled` is true.
|
|
11
|
+
*/
|
|
12
|
+
export function useEvaluateCancellation(policyId, input, options = {}) {
|
|
13
|
+
const { baseUrl, fetcher } = useVoyantLegalContext();
|
|
14
|
+
const { enabled = true } = options;
|
|
15
|
+
const shouldRun = Boolean(policyId) && Boolean(input) && enabled;
|
|
16
|
+
return useQuery({
|
|
17
|
+
...queryOptions({
|
|
18
|
+
queryKey: [...legalQueryKeys.policies(), "evaluate", policyId, input],
|
|
19
|
+
queryFn: () => {
|
|
20
|
+
if (!policyId || !input)
|
|
21
|
+
throw new Error("policyId and input required");
|
|
22
|
+
return fetchWithValidation(`/v1/admin/legal/policies/${policyId}/evaluate`, cancellationResultResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
enabled: shouldRun,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Imperative mutation variant of the cancellation evaluation for cases where
|
|
30
|
+
* the caller needs to trigger evaluation manually (e.g. with ad-hoc inputs).
|
|
31
|
+
*/
|
|
32
|
+
export function useEvaluateCancellationMutation(policyId) {
|
|
33
|
+
const { baseUrl, fetcher } = useVoyantLegalContext();
|
|
34
|
+
return useMutation({
|
|
35
|
+
mutationFn: async (input) => {
|
|
36
|
+
if (!policyId) {
|
|
37
|
+
throw new Error("policyId is required");
|
|
38
|
+
}
|
|
39
|
+
const { data } = await fetchWithValidation(`/v1/admin/legal/policies/${policyId}/evaluate`, cancellationResultResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
40
|
+
return data;
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { ResolvePolicyFilters } from "../query-keys.js";
|
|
2
|
+
export interface UseResolvePolicyOptions {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the applicable policy for the given scope (kind + productId, channelId, etc.).
|
|
7
|
+
* Typically used with `kind: "cancellation"` to find the policy that applies to a booking.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useResolvePolicy(filters: ResolvePolicyFilters, options?: UseResolvePolicyOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
10
|
+
data: {
|
|
11
|
+
policy: {
|
|
12
|
+
kind: "other" | "cancellation" | "payment" | "terms_and_conditions" | "privacy" | "refund" | "commission" | "guarantee";
|
|
13
|
+
name: string;
|
|
14
|
+
slug: string;
|
|
15
|
+
language: string;
|
|
16
|
+
id: string;
|
|
17
|
+
description: string | null;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
updatedAt: string;
|
|
20
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
21
|
+
currentVersionId?: string | null | undefined;
|
|
22
|
+
};
|
|
23
|
+
assignment: {
|
|
24
|
+
policyId: string;
|
|
25
|
+
scope: "supplier" | "channel" | "product" | "market" | "organization" | "global";
|
|
26
|
+
priority: number;
|
|
27
|
+
id: string;
|
|
28
|
+
productId: string | null;
|
|
29
|
+
channelId: string | null;
|
|
30
|
+
supplierId: string | null;
|
|
31
|
+
marketId: string | null;
|
|
32
|
+
organizationId: string | null;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
updatedAt: string;
|
|
35
|
+
validFrom?: string | null | undefined;
|
|
36
|
+
validTo?: string | null | undefined;
|
|
37
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
38
|
+
};
|
|
39
|
+
version: {
|
|
40
|
+
title: string;
|
|
41
|
+
bodyFormat: "markdown" | "html" | "plain";
|
|
42
|
+
id: string;
|
|
43
|
+
policyId: string;
|
|
44
|
+
version: number;
|
|
45
|
+
status: "draft" | "published" | "retired";
|
|
46
|
+
body: string | null;
|
|
47
|
+
publishedAt: string | null;
|
|
48
|
+
publishedBy: string | null;
|
|
49
|
+
createdAt: string;
|
|
50
|
+
updatedAt: string;
|
|
51
|
+
retiredAt?: string | null | undefined;
|
|
52
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
53
|
+
} | null;
|
|
54
|
+
rules: {
|
|
55
|
+
ruleType: "custom" | "window" | "percentage" | "flat_amount" | "date_range";
|
|
56
|
+
sortOrder: number;
|
|
57
|
+
id: string;
|
|
58
|
+
policyVersionId: string;
|
|
59
|
+
label: string | null;
|
|
60
|
+
daysBeforeDeparture: number | null;
|
|
61
|
+
refundPercent: number | null;
|
|
62
|
+
flatAmountCents: number | null;
|
|
63
|
+
currency: string | null;
|
|
64
|
+
createdAt: string;
|
|
65
|
+
updatedAt: string;
|
|
66
|
+
refundType?: "cash" | "credit" | "cash_or_credit" | "none" | null | undefined;
|
|
67
|
+
validFrom?: string | null | undefined;
|
|
68
|
+
validTo?: string | null | undefined;
|
|
69
|
+
conditions?: Record<string, unknown> | null | undefined;
|
|
70
|
+
}[];
|
|
71
|
+
} | null;
|
|
72
|
+
}, Error>;
|
|
73
|
+
//# sourceMappingURL=use-resolve-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-resolve-policy.d.ts","sourceRoot":"","sources":["../../src/hooks/use-resolve-policy.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAG5D,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,oBAAoB,EAC7B,OAAO,GAAE,uBAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAStC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantLegalContext } from "../provider.js";
|
|
4
|
+
import { getResolvePolicyQueryOptions } from "../query-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the applicable policy for the given scope (kind + productId, channelId, etc.).
|
|
7
|
+
* Typically used with `kind: "cancellation"` to find the policy that applies to a booking.
|
|
8
|
+
*/
|
|
9
|
+
export function useResolvePolicy(filters, options = {}) {
|
|
10
|
+
const { baseUrl, fetcher } = useVoyantLegalContext();
|
|
11
|
+
const { enabled = true } = options;
|
|
12
|
+
return useQuery({
|
|
13
|
+
...getResolvePolicyQueryOptions({ baseUrl, fetcher }, filters),
|
|
14
|
+
enabled: enabled && Boolean(filters.kind),
|
|
15
|
+
});
|
|
16
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { defaultFetcher, type FetchWithValidationOptions, fetchWithValidation, VoyantApiError, type VoyantFetcher, } from "./client.js";
|
|
2
2
|
export * from "./hooks/index.js";
|
|
3
3
|
export { useVoyantLegalContext, type VoyantLegalContextValue, VoyantLegalProvider, type VoyantLegalProviderProps, } from "./provider.js";
|
|
4
|
-
export { type LegalContractNumberSeriesListFilters, type LegalContractsListFilters, type LegalContractTemplatesListFilters, type LegalPoliciesListFilters, type LegalPolicyAcceptancesListFilters, type LegalPolicyAssignmentsListFilters, legalQueryKeys, } from "./query-keys.js";
|
|
5
|
-
export { getLegalContractAttachmentsQueryOptions, getLegalContractNumberSeriesDetailQueryOptions, getLegalContractNumberSeriesQueryOptions, getLegalContractQueryOptions, getLegalContractSignaturesQueryOptions, getLegalContractsQueryOptions, getLegalContractTemplateQueryOptions, getLegalContractTemplatesQueryOptions, getLegalContractTemplateVersionsQueryOptions, getLegalPoliciesQueryOptions, getLegalPolicyAcceptancesQueryOptions, getLegalPolicyAssignmentsQueryOptions, getLegalPolicyQueryOptions, getLegalPolicyRulesQueryOptions, getLegalPolicyVersionQueryOptions, getLegalPolicyVersionsQueryOptions, } from "./query-options.js";
|
|
4
|
+
export { type LegalContractNumberSeriesListFilters, type LegalContractsListFilters, type LegalContractTemplatesListFilters, type LegalPoliciesListFilters, type LegalPolicyAcceptancesListFilters, type LegalPolicyAssignmentsListFilters, legalQueryKeys, type ResolvePolicyFilters, } from "./query-keys.js";
|
|
5
|
+
export { getLegalContractAttachmentsQueryOptions, getLegalContractNumberSeriesDetailQueryOptions, getLegalContractNumberSeriesQueryOptions, getLegalContractQueryOptions, getLegalContractSignaturesQueryOptions, getLegalContractsQueryOptions, getLegalContractTemplateQueryOptions, getLegalContractTemplatesQueryOptions, getLegalContractTemplateVersionsQueryOptions, getLegalPoliciesQueryOptions, getLegalPolicyAcceptancesQueryOptions, getLegalPolicyAssignmentsQueryOptions, getLegalPolicyQueryOptions, getLegalPolicyRulesQueryOptions, getLegalPolicyVersionQueryOptions, getLegalPolicyVersionsQueryOptions, getResolvePolicyQueryOptions, } from "./query-options.js";
|
|
6
6
|
export * from "./schemas.js";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,0BAA0B,EAC/B,mBAAmB,EACnB,cAAc,EACd,KAAK,aAAa,GACnB,MAAM,aAAa,CAAA;AACpB,cAAc,kBAAkB,CAAA;AAChC,OAAO,EACL,qBAAqB,EACrB,KAAK,uBAAuB,EAC5B,mBAAmB,EACnB,KAAK,wBAAwB,GAC9B,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,KAAK,oCAAoC,EACzC,KAAK,yBAAyB,EAC9B,KAAK,iCAAiC,EACtC,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACtC,KAAK,iCAAiC,EACtC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,0BAA0B,EAC/B,mBAAmB,EACnB,cAAc,EACd,KAAK,aAAa,GACnB,MAAM,aAAa,CAAA;AACpB,cAAc,kBAAkB,CAAA;AAChC,OAAO,EACL,qBAAqB,EACrB,KAAK,uBAAuB,EAC5B,mBAAmB,EACnB,KAAK,wBAAwB,GAC9B,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,KAAK,oCAAoC,EACzC,KAAK,yBAAyB,EAC9B,KAAK,iCAAiC,EACtC,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACtC,KAAK,iCAAiC,EACtC,cAAc,EACd,KAAK,oBAAoB,GAC1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,uCAAuC,EACvC,8CAA8C,EAC9C,wCAAwC,EACxC,4BAA4B,EAC5B,sCAAsC,EACtC,6BAA6B,EAC7B,oCAAoC,EACpC,qCAAqC,EACrC,4CAA4C,EAC5C,4BAA4B,EAC5B,qCAAqC,EACrC,qCAAqC,EACrC,0BAA0B,EAC1B,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EAClC,4BAA4B,GAC7B,MAAM,oBAAoB,CAAA;AAC3B,cAAc,cAAc,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -2,5 +2,5 @@ export { defaultFetcher, fetchWithValidation, VoyantApiError, } from "./client.j
|
|
|
2
2
|
export * from "./hooks/index.js";
|
|
3
3
|
export { useVoyantLegalContext, VoyantLegalProvider, } from "./provider.js";
|
|
4
4
|
export { legalQueryKeys, } from "./query-keys.js";
|
|
5
|
-
export { getLegalContractAttachmentsQueryOptions, getLegalContractNumberSeriesDetailQueryOptions, getLegalContractNumberSeriesQueryOptions, getLegalContractQueryOptions, getLegalContractSignaturesQueryOptions, getLegalContractsQueryOptions, getLegalContractTemplateQueryOptions, getLegalContractTemplatesQueryOptions, getLegalContractTemplateVersionsQueryOptions, getLegalPoliciesQueryOptions, getLegalPolicyAcceptancesQueryOptions, getLegalPolicyAssignmentsQueryOptions, getLegalPolicyQueryOptions, getLegalPolicyRulesQueryOptions, getLegalPolicyVersionQueryOptions, getLegalPolicyVersionsQueryOptions, } from "./query-options.js";
|
|
5
|
+
export { getLegalContractAttachmentsQueryOptions, getLegalContractNumberSeriesDetailQueryOptions, getLegalContractNumberSeriesQueryOptions, getLegalContractQueryOptions, getLegalContractSignaturesQueryOptions, getLegalContractsQueryOptions, getLegalContractTemplateQueryOptions, getLegalContractTemplatesQueryOptions, getLegalContractTemplateVersionsQueryOptions, getLegalPoliciesQueryOptions, getLegalPolicyAcceptancesQueryOptions, getLegalPolicyAssignmentsQueryOptions, getLegalPolicyQueryOptions, getLegalPolicyRulesQueryOptions, getLegalPolicyVersionQueryOptions, getLegalPolicyVersionsQueryOptions, getResolvePolicyQueryOptions, } from "./query-options.js";
|
|
6
6
|
export * from "./schemas.js";
|
package/dist/query-keys.d.ts
CHANGED
|
@@ -35,6 +35,15 @@ export interface LegalPolicyAssignmentsListFilters {
|
|
|
35
35
|
limit?: number | undefined;
|
|
36
36
|
offset?: number | undefined;
|
|
37
37
|
}
|
|
38
|
+
export interface ResolvePolicyFilters {
|
|
39
|
+
kind: string;
|
|
40
|
+
productId?: string | undefined;
|
|
41
|
+
channelId?: string | undefined;
|
|
42
|
+
supplierId?: string | undefined;
|
|
43
|
+
marketId?: string | undefined;
|
|
44
|
+
organizationId?: string | undefined;
|
|
45
|
+
at?: string | undefined;
|
|
46
|
+
}
|
|
38
47
|
export interface LegalPolicyAcceptancesListFilters {
|
|
39
48
|
policyVersionId?: string | undefined;
|
|
40
49
|
personId?: string | undefined;
|
|
@@ -64,5 +73,6 @@ export declare const legalQueryKeys: {
|
|
|
64
73
|
policyRules: (versionId: string) => readonly ["legal", "policies", "rules", string];
|
|
65
74
|
policyAssignments: (filters: LegalPolicyAssignmentsListFilters) => readonly ["legal", "policies", "assignments", LegalPolicyAssignmentsListFilters];
|
|
66
75
|
policyAcceptances: (filters: LegalPolicyAcceptancesListFilters) => readonly ["legal", "policies", "acceptances", LegalPolicyAcceptancesListFilters];
|
|
76
|
+
resolvePolicy: (filters: ResolvePolicyFilters) => readonly ["legal", "policies", "resolve", ResolvePolicyFilters];
|
|
67
77
|
};
|
|
68
78
|
//# sourceMappingURL=query-keys.d.ts.map
|
package/dist/query-keys.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../src/query-keys.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,yBAAyB;IACxC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,MAAM,WAAW,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MAAM,WAAW,iCAAiC;IAChD,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,eAAO,MAAM,cAAc;;;6BAGA,yBAAyB;mBAEnC,MAAM;6BACI,MAAM;8BACL,MAAM;;6BAEP,iCAAiC;mBAE3C,MAAM;2BACE,MAAM;;iCAED,oCAAoC;6BAEvC,MAAM;;4BAEP,wBAAwB;iBAEnC,MAAM;yBACE,MAAM;6BACF,MAAM;iCACF,iCAAiC;iCAEjC,iCAAiC;6BAErC,oBAAoB;CAE9C,CAAA"}
|
package/dist/query-keys.js
CHANGED
|
@@ -19,4 +19,5 @@ export const legalQueryKeys = {
|
|
|
19
19
|
policyRules: (versionId) => [...legalQueryKeys.policies(), "rules", versionId],
|
|
20
20
|
policyAssignments: (filters) => [...legalQueryKeys.policies(), "assignments", filters],
|
|
21
21
|
policyAcceptances: (filters) => [...legalQueryKeys.policies(), "acceptances", filters],
|
|
22
|
+
resolvePolicy: (filters) => [...legalQueryKeys.policies(), "resolve", filters],
|
|
22
23
|
};
|
package/dist/query-options.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import type { UseLegalPolicyAcceptancesOptions } from "./hooks/use-policy-accept
|
|
|
13
13
|
import type { UseLegalPolicyAssignmentsOptions } from "./hooks/use-policy-assignments.js";
|
|
14
14
|
import type { UseLegalPolicyRulesOptions } from "./hooks/use-policy-rules.js";
|
|
15
15
|
import type { UseLegalPolicyVersionsOptions } from "./hooks/use-policy-versions.js";
|
|
16
|
+
import { type ResolvePolicyFilters } from "./query-keys.js";
|
|
16
17
|
export declare function getLegalContractsQueryOptions(client: FetchWithValidationOptions, options?: UseLegalContractsOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
17
18
|
data: {
|
|
18
19
|
scope: "other" | "customer" | "supplier" | "partner" | "channel";
|
|
@@ -1197,4 +1198,264 @@ export declare function getLegalPolicyAcceptancesQueryOptions(client: FetchWithV
|
|
|
1197
1198
|
[dataTagErrorSymbol]: Error;
|
|
1198
1199
|
};
|
|
1199
1200
|
};
|
|
1201
|
+
export declare function getResolvePolicyQueryOptions(client: FetchWithValidationOptions, filters: ResolvePolicyFilters): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
1202
|
+
data: {
|
|
1203
|
+
policy: {
|
|
1204
|
+
kind: "other" | "cancellation" | "payment" | "terms_and_conditions" | "privacy" | "refund" | "commission" | "guarantee";
|
|
1205
|
+
name: string;
|
|
1206
|
+
slug: string;
|
|
1207
|
+
language: string;
|
|
1208
|
+
id: string;
|
|
1209
|
+
description: string | null;
|
|
1210
|
+
createdAt: string;
|
|
1211
|
+
updatedAt: string;
|
|
1212
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1213
|
+
currentVersionId?: string | null | undefined;
|
|
1214
|
+
};
|
|
1215
|
+
assignment: {
|
|
1216
|
+
policyId: string;
|
|
1217
|
+
scope: "supplier" | "channel" | "product" | "market" | "organization" | "global";
|
|
1218
|
+
priority: number;
|
|
1219
|
+
id: string;
|
|
1220
|
+
productId: string | null;
|
|
1221
|
+
channelId: string | null;
|
|
1222
|
+
supplierId: string | null;
|
|
1223
|
+
marketId: string | null;
|
|
1224
|
+
organizationId: string | null;
|
|
1225
|
+
createdAt: string;
|
|
1226
|
+
updatedAt: string;
|
|
1227
|
+
validFrom?: string | null | undefined;
|
|
1228
|
+
validTo?: string | null | undefined;
|
|
1229
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1230
|
+
};
|
|
1231
|
+
version: {
|
|
1232
|
+
title: string;
|
|
1233
|
+
bodyFormat: "markdown" | "html" | "plain";
|
|
1234
|
+
id: string;
|
|
1235
|
+
policyId: string;
|
|
1236
|
+
version: number;
|
|
1237
|
+
status: "draft" | "published" | "retired";
|
|
1238
|
+
body: string | null;
|
|
1239
|
+
publishedAt: string | null;
|
|
1240
|
+
publishedBy: string | null;
|
|
1241
|
+
createdAt: string;
|
|
1242
|
+
updatedAt: string;
|
|
1243
|
+
retiredAt?: string | null | undefined;
|
|
1244
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1245
|
+
} | null;
|
|
1246
|
+
rules: {
|
|
1247
|
+
ruleType: "custom" | "window" | "percentage" | "flat_amount" | "date_range";
|
|
1248
|
+
sortOrder: number;
|
|
1249
|
+
id: string;
|
|
1250
|
+
policyVersionId: string;
|
|
1251
|
+
label: string | null;
|
|
1252
|
+
daysBeforeDeparture: number | null;
|
|
1253
|
+
refundPercent: number | null;
|
|
1254
|
+
flatAmountCents: number | null;
|
|
1255
|
+
currency: string | null;
|
|
1256
|
+
createdAt: string;
|
|
1257
|
+
updatedAt: string;
|
|
1258
|
+
refundType?: "cash" | "credit" | "cash_or_credit" | "none" | null | undefined;
|
|
1259
|
+
validFrom?: string | null | undefined;
|
|
1260
|
+
validTo?: string | null | undefined;
|
|
1261
|
+
conditions?: Record<string, unknown> | null | undefined;
|
|
1262
|
+
}[];
|
|
1263
|
+
} | null;
|
|
1264
|
+
}, Error, {
|
|
1265
|
+
data: {
|
|
1266
|
+
policy: {
|
|
1267
|
+
kind: "other" | "cancellation" | "payment" | "terms_and_conditions" | "privacy" | "refund" | "commission" | "guarantee";
|
|
1268
|
+
name: string;
|
|
1269
|
+
slug: string;
|
|
1270
|
+
language: string;
|
|
1271
|
+
id: string;
|
|
1272
|
+
description: string | null;
|
|
1273
|
+
createdAt: string;
|
|
1274
|
+
updatedAt: string;
|
|
1275
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1276
|
+
currentVersionId?: string | null | undefined;
|
|
1277
|
+
};
|
|
1278
|
+
assignment: {
|
|
1279
|
+
policyId: string;
|
|
1280
|
+
scope: "supplier" | "channel" | "product" | "market" | "organization" | "global";
|
|
1281
|
+
priority: number;
|
|
1282
|
+
id: string;
|
|
1283
|
+
productId: string | null;
|
|
1284
|
+
channelId: string | null;
|
|
1285
|
+
supplierId: string | null;
|
|
1286
|
+
marketId: string | null;
|
|
1287
|
+
organizationId: string | null;
|
|
1288
|
+
createdAt: string;
|
|
1289
|
+
updatedAt: string;
|
|
1290
|
+
validFrom?: string | null | undefined;
|
|
1291
|
+
validTo?: string | null | undefined;
|
|
1292
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1293
|
+
};
|
|
1294
|
+
version: {
|
|
1295
|
+
title: string;
|
|
1296
|
+
bodyFormat: "markdown" | "html" | "plain";
|
|
1297
|
+
id: string;
|
|
1298
|
+
policyId: string;
|
|
1299
|
+
version: number;
|
|
1300
|
+
status: "draft" | "published" | "retired";
|
|
1301
|
+
body: string | null;
|
|
1302
|
+
publishedAt: string | null;
|
|
1303
|
+
publishedBy: string | null;
|
|
1304
|
+
createdAt: string;
|
|
1305
|
+
updatedAt: string;
|
|
1306
|
+
retiredAt?: string | null | undefined;
|
|
1307
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1308
|
+
} | null;
|
|
1309
|
+
rules: {
|
|
1310
|
+
ruleType: "custom" | "window" | "percentage" | "flat_amount" | "date_range";
|
|
1311
|
+
sortOrder: number;
|
|
1312
|
+
id: string;
|
|
1313
|
+
policyVersionId: string;
|
|
1314
|
+
label: string | null;
|
|
1315
|
+
daysBeforeDeparture: number | null;
|
|
1316
|
+
refundPercent: number | null;
|
|
1317
|
+
flatAmountCents: number | null;
|
|
1318
|
+
currency: string | null;
|
|
1319
|
+
createdAt: string;
|
|
1320
|
+
updatedAt: string;
|
|
1321
|
+
refundType?: "cash" | "credit" | "cash_or_credit" | "none" | null | undefined;
|
|
1322
|
+
validFrom?: string | null | undefined;
|
|
1323
|
+
validTo?: string | null | undefined;
|
|
1324
|
+
conditions?: Record<string, unknown> | null | undefined;
|
|
1325
|
+
}[];
|
|
1326
|
+
} | null;
|
|
1327
|
+
}, readonly ["legal", "policies", "resolve", ResolvePolicyFilters]>, "queryFn"> & {
|
|
1328
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
1329
|
+
data: {
|
|
1330
|
+
policy: {
|
|
1331
|
+
kind: "other" | "cancellation" | "payment" | "terms_and_conditions" | "privacy" | "refund" | "commission" | "guarantee";
|
|
1332
|
+
name: string;
|
|
1333
|
+
slug: string;
|
|
1334
|
+
language: string;
|
|
1335
|
+
id: string;
|
|
1336
|
+
description: string | null;
|
|
1337
|
+
createdAt: string;
|
|
1338
|
+
updatedAt: string;
|
|
1339
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1340
|
+
currentVersionId?: string | null | undefined;
|
|
1341
|
+
};
|
|
1342
|
+
assignment: {
|
|
1343
|
+
policyId: string;
|
|
1344
|
+
scope: "supplier" | "channel" | "product" | "market" | "organization" | "global";
|
|
1345
|
+
priority: number;
|
|
1346
|
+
id: string;
|
|
1347
|
+
productId: string | null;
|
|
1348
|
+
channelId: string | null;
|
|
1349
|
+
supplierId: string | null;
|
|
1350
|
+
marketId: string | null;
|
|
1351
|
+
organizationId: string | null;
|
|
1352
|
+
createdAt: string;
|
|
1353
|
+
updatedAt: string;
|
|
1354
|
+
validFrom?: string | null | undefined;
|
|
1355
|
+
validTo?: string | null | undefined;
|
|
1356
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1357
|
+
};
|
|
1358
|
+
version: {
|
|
1359
|
+
title: string;
|
|
1360
|
+
bodyFormat: "markdown" | "html" | "plain";
|
|
1361
|
+
id: string;
|
|
1362
|
+
policyId: string;
|
|
1363
|
+
version: number;
|
|
1364
|
+
status: "draft" | "published" | "retired";
|
|
1365
|
+
body: string | null;
|
|
1366
|
+
publishedAt: string | null;
|
|
1367
|
+
publishedBy: string | null;
|
|
1368
|
+
createdAt: string;
|
|
1369
|
+
updatedAt: string;
|
|
1370
|
+
retiredAt?: string | null | undefined;
|
|
1371
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1372
|
+
} | null;
|
|
1373
|
+
rules: {
|
|
1374
|
+
ruleType: "custom" | "window" | "percentage" | "flat_amount" | "date_range";
|
|
1375
|
+
sortOrder: number;
|
|
1376
|
+
id: string;
|
|
1377
|
+
policyVersionId: string;
|
|
1378
|
+
label: string | null;
|
|
1379
|
+
daysBeforeDeparture: number | null;
|
|
1380
|
+
refundPercent: number | null;
|
|
1381
|
+
flatAmountCents: number | null;
|
|
1382
|
+
currency: string | null;
|
|
1383
|
+
createdAt: string;
|
|
1384
|
+
updatedAt: string;
|
|
1385
|
+
refundType?: "cash" | "credit" | "cash_or_credit" | "none" | null | undefined;
|
|
1386
|
+
validFrom?: string | null | undefined;
|
|
1387
|
+
validTo?: string | null | undefined;
|
|
1388
|
+
conditions?: Record<string, unknown> | null | undefined;
|
|
1389
|
+
}[];
|
|
1390
|
+
} | null;
|
|
1391
|
+
}, readonly ["legal", "policies", "resolve", ResolvePolicyFilters], never> | undefined;
|
|
1392
|
+
} & {
|
|
1393
|
+
queryKey: readonly ["legal", "policies", "resolve", ResolvePolicyFilters] & {
|
|
1394
|
+
[dataTagSymbol]: {
|
|
1395
|
+
data: {
|
|
1396
|
+
policy: {
|
|
1397
|
+
kind: "other" | "cancellation" | "payment" | "terms_and_conditions" | "privacy" | "refund" | "commission" | "guarantee";
|
|
1398
|
+
name: string;
|
|
1399
|
+
slug: string;
|
|
1400
|
+
language: string;
|
|
1401
|
+
id: string;
|
|
1402
|
+
description: string | null;
|
|
1403
|
+
createdAt: string;
|
|
1404
|
+
updatedAt: string;
|
|
1405
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1406
|
+
currentVersionId?: string | null | undefined;
|
|
1407
|
+
};
|
|
1408
|
+
assignment: {
|
|
1409
|
+
policyId: string;
|
|
1410
|
+
scope: "supplier" | "channel" | "product" | "market" | "organization" | "global";
|
|
1411
|
+
priority: number;
|
|
1412
|
+
id: string;
|
|
1413
|
+
productId: string | null;
|
|
1414
|
+
channelId: string | null;
|
|
1415
|
+
supplierId: string | null;
|
|
1416
|
+
marketId: string | null;
|
|
1417
|
+
organizationId: string | null;
|
|
1418
|
+
createdAt: string;
|
|
1419
|
+
updatedAt: string;
|
|
1420
|
+
validFrom?: string | null | undefined;
|
|
1421
|
+
validTo?: string | null | undefined;
|
|
1422
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1423
|
+
};
|
|
1424
|
+
version: {
|
|
1425
|
+
title: string;
|
|
1426
|
+
bodyFormat: "markdown" | "html" | "plain";
|
|
1427
|
+
id: string;
|
|
1428
|
+
policyId: string;
|
|
1429
|
+
version: number;
|
|
1430
|
+
status: "draft" | "published" | "retired";
|
|
1431
|
+
body: string | null;
|
|
1432
|
+
publishedAt: string | null;
|
|
1433
|
+
publishedBy: string | null;
|
|
1434
|
+
createdAt: string;
|
|
1435
|
+
updatedAt: string;
|
|
1436
|
+
retiredAt?: string | null | undefined;
|
|
1437
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1438
|
+
} | null;
|
|
1439
|
+
rules: {
|
|
1440
|
+
ruleType: "custom" | "window" | "percentage" | "flat_amount" | "date_range";
|
|
1441
|
+
sortOrder: number;
|
|
1442
|
+
id: string;
|
|
1443
|
+
policyVersionId: string;
|
|
1444
|
+
label: string | null;
|
|
1445
|
+
daysBeforeDeparture: number | null;
|
|
1446
|
+
refundPercent: number | null;
|
|
1447
|
+
flatAmountCents: number | null;
|
|
1448
|
+
currency: string | null;
|
|
1449
|
+
createdAt: string;
|
|
1450
|
+
updatedAt: string;
|
|
1451
|
+
refundType?: "cash" | "credit" | "cash_or_credit" | "none" | null | undefined;
|
|
1452
|
+
validFrom?: string | null | undefined;
|
|
1453
|
+
validTo?: string | null | undefined;
|
|
1454
|
+
conditions?: Record<string, unknown> | null | undefined;
|
|
1455
|
+
}[];
|
|
1456
|
+
} | null;
|
|
1457
|
+
};
|
|
1458
|
+
[dataTagErrorSymbol]: Error;
|
|
1459
|
+
};
|
|
1460
|
+
};
|
|
1200
1461
|
//# sourceMappingURL=query-options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-options.d.ts","sourceRoot":"","sources":["../src/query-options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,0BAA0B,EAAuB,MAAM,aAAa,CAAA;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAA;AAC7F,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAA;AAC3F,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAA;AACvF,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,2CAA2C,CAAA;AACxG,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAA;AACzF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,8BAA8B,CAAA;AACvF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAA;AACzF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAA;AACzF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAA;AAC7E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAA;AA+
|
|
1
|
+
{"version":3,"file":"query-options.d.ts","sourceRoot":"","sources":["../src/query-options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,0BAA0B,EAAuB,MAAM,aAA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MAAM,EAAE,0BAA0B,EAClC,OAAO,EAAE,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW9B"}
|
package/dist/query-options.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { queryOptions } from "@tanstack/react-query";
|
|
3
3
|
import { fetchWithValidation } from "./client.js";
|
|
4
4
|
import { legalQueryKeys } from "./query-keys.js";
|
|
5
|
-
import { legalContractAttachmentListResponse, legalContractListResponse, legalContractNumberSeriesListResponse, legalContractNumberSeriesSingleResponse, legalContractSignatureListResponse, legalContractSingleResponse, legalContractTemplateListResponse, legalContractTemplateSingleResponse, legalContractTemplateVersionListResponse, legalPolicyAcceptanceListResponse, legalPolicyAssignmentListResponse, legalPolicyListResponse, legalPolicyRuleListResponse, legalPolicySingleResponse, legalPolicyVersionListResponse, legalPolicyVersionSingleResponse, } from "./schemas.js";
|
|
5
|
+
import { legalContractAttachmentListResponse, legalContractListResponse, legalContractNumberSeriesListResponse, legalContractNumberSeriesSingleResponse, legalContractSignatureListResponse, legalContractSingleResponse, legalContractTemplateListResponse, legalContractTemplateSingleResponse, legalContractTemplateVersionListResponse, legalPolicyAcceptanceListResponse, legalPolicyAssignmentListResponse, legalPolicyListResponse, legalPolicyRuleListResponse, legalPolicySingleResponse, legalPolicyVersionListResponse, legalPolicyVersionSingleResponse, resolvedPolicyResponse, } from "./schemas.js";
|
|
6
6
|
function toQueryString(filters) {
|
|
7
7
|
const params = new URLSearchParams();
|
|
8
8
|
for (const [key, value] of Object.entries(filters)) {
|
|
@@ -150,3 +150,9 @@ export function getLegalPolicyAcceptancesQueryOptions(client, options = {}) {
|
|
|
150
150
|
queryFn: () => fetchWithValidation(`/v1/admin/legal/policies/acceptances${toQueryString(filters)}`, legalPolicyAcceptanceListResponse, client),
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
+
export function getResolvePolicyQueryOptions(client, filters) {
|
|
154
|
+
return queryOptions({
|
|
155
|
+
queryKey: legalQueryKeys.resolvePolicy(filters),
|
|
156
|
+
queryFn: () => fetchWithValidation(`/v1/admin/legal/policies/resolve${toQueryString({ ...filters })}`, resolvedPolicyResponse, client),
|
|
157
|
+
});
|
|
158
|
+
}
|
package/dist/schemas.d.ts
CHANGED
|
@@ -776,4 +776,263 @@ export declare const legalPolicyAcceptanceListResponse: z.ZodObject<{
|
|
|
776
776
|
createdAt: z.ZodString;
|
|
777
777
|
}, z.core.$strip>>;
|
|
778
778
|
}, z.core.$strip>;
|
|
779
|
+
export declare const resolvedPolicySchema: z.ZodObject<{
|
|
780
|
+
policy: z.ZodObject<{
|
|
781
|
+
kind: z.ZodEnum<{
|
|
782
|
+
other: "other";
|
|
783
|
+
cancellation: "cancellation";
|
|
784
|
+
payment: "payment";
|
|
785
|
+
terms_and_conditions: "terms_and_conditions";
|
|
786
|
+
privacy: "privacy";
|
|
787
|
+
refund: "refund";
|
|
788
|
+
commission: "commission";
|
|
789
|
+
guarantee: "guarantee";
|
|
790
|
+
}>;
|
|
791
|
+
name: z.ZodString;
|
|
792
|
+
slug: z.ZodString;
|
|
793
|
+
language: z.ZodDefault<z.ZodString>;
|
|
794
|
+
id: z.ZodString;
|
|
795
|
+
description: z.ZodNullable<z.ZodString>;
|
|
796
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
797
|
+
currentVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
798
|
+
createdAt: z.ZodString;
|
|
799
|
+
updatedAt: z.ZodString;
|
|
800
|
+
}, z.core.$strip>;
|
|
801
|
+
assignment: z.ZodObject<{
|
|
802
|
+
policyId: z.ZodString;
|
|
803
|
+
scope: z.ZodEnum<{
|
|
804
|
+
supplier: "supplier";
|
|
805
|
+
channel: "channel";
|
|
806
|
+
product: "product";
|
|
807
|
+
market: "market";
|
|
808
|
+
organization: "organization";
|
|
809
|
+
global: "global";
|
|
810
|
+
}>;
|
|
811
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
812
|
+
id: z.ZodString;
|
|
813
|
+
productId: z.ZodNullable<z.ZodString>;
|
|
814
|
+
channelId: z.ZodNullable<z.ZodString>;
|
|
815
|
+
supplierId: z.ZodNullable<z.ZodString>;
|
|
816
|
+
marketId: z.ZodNullable<z.ZodString>;
|
|
817
|
+
organizationId: z.ZodNullable<z.ZodString>;
|
|
818
|
+
validFrom: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
819
|
+
validTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
820
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
821
|
+
createdAt: z.ZodString;
|
|
822
|
+
updatedAt: z.ZodString;
|
|
823
|
+
}, z.core.$strip>;
|
|
824
|
+
version: z.ZodNullable<z.ZodObject<{
|
|
825
|
+
title: z.ZodString;
|
|
826
|
+
bodyFormat: z.ZodDefault<z.ZodEnum<{
|
|
827
|
+
markdown: "markdown";
|
|
828
|
+
html: "html";
|
|
829
|
+
plain: "plain";
|
|
830
|
+
}>>;
|
|
831
|
+
id: z.ZodString;
|
|
832
|
+
policyId: z.ZodString;
|
|
833
|
+
version: z.ZodNumber;
|
|
834
|
+
status: z.ZodEnum<{
|
|
835
|
+
draft: "draft";
|
|
836
|
+
published: "published";
|
|
837
|
+
retired: "retired";
|
|
838
|
+
}>;
|
|
839
|
+
body: z.ZodNullable<z.ZodString>;
|
|
840
|
+
publishedAt: z.ZodNullable<z.ZodString>;
|
|
841
|
+
publishedBy: z.ZodNullable<z.ZodString>;
|
|
842
|
+
retiredAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
843
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
844
|
+
createdAt: z.ZodString;
|
|
845
|
+
updatedAt: z.ZodString;
|
|
846
|
+
}, z.core.$strip>>;
|
|
847
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
848
|
+
ruleType: z.ZodEnum<{
|
|
849
|
+
custom: "custom";
|
|
850
|
+
window: "window";
|
|
851
|
+
percentage: "percentage";
|
|
852
|
+
flat_amount: "flat_amount";
|
|
853
|
+
date_range: "date_range";
|
|
854
|
+
}>;
|
|
855
|
+
sortOrder: z.ZodDefault<z.ZodNumber>;
|
|
856
|
+
id: z.ZodString;
|
|
857
|
+
policyVersionId: z.ZodString;
|
|
858
|
+
label: z.ZodNullable<z.ZodString>;
|
|
859
|
+
daysBeforeDeparture: z.ZodNullable<z.ZodNumber>;
|
|
860
|
+
refundPercent: z.ZodNullable<z.ZodNumber>;
|
|
861
|
+
refundType: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
862
|
+
cash: "cash";
|
|
863
|
+
credit: "credit";
|
|
864
|
+
cash_or_credit: "cash_or_credit";
|
|
865
|
+
none: "none";
|
|
866
|
+
}>>>;
|
|
867
|
+
flatAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
868
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
869
|
+
validFrom: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
870
|
+
validTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
871
|
+
conditions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
872
|
+
createdAt: z.ZodString;
|
|
873
|
+
updatedAt: z.ZodString;
|
|
874
|
+
}, z.core.$strip>>;
|
|
875
|
+
}, z.core.$strip>;
|
|
876
|
+
export type ResolvedPolicy = z.infer<typeof resolvedPolicySchema>;
|
|
877
|
+
export declare const resolvedPolicyResponse: z.ZodObject<{
|
|
878
|
+
data: z.ZodNullable<z.ZodObject<{
|
|
879
|
+
policy: z.ZodObject<{
|
|
880
|
+
kind: z.ZodEnum<{
|
|
881
|
+
other: "other";
|
|
882
|
+
cancellation: "cancellation";
|
|
883
|
+
payment: "payment";
|
|
884
|
+
terms_and_conditions: "terms_and_conditions";
|
|
885
|
+
privacy: "privacy";
|
|
886
|
+
refund: "refund";
|
|
887
|
+
commission: "commission";
|
|
888
|
+
guarantee: "guarantee";
|
|
889
|
+
}>;
|
|
890
|
+
name: z.ZodString;
|
|
891
|
+
slug: z.ZodString;
|
|
892
|
+
language: z.ZodDefault<z.ZodString>;
|
|
893
|
+
id: z.ZodString;
|
|
894
|
+
description: z.ZodNullable<z.ZodString>;
|
|
895
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
896
|
+
currentVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
897
|
+
createdAt: z.ZodString;
|
|
898
|
+
updatedAt: z.ZodString;
|
|
899
|
+
}, z.core.$strip>;
|
|
900
|
+
assignment: z.ZodObject<{
|
|
901
|
+
policyId: z.ZodString;
|
|
902
|
+
scope: z.ZodEnum<{
|
|
903
|
+
supplier: "supplier";
|
|
904
|
+
channel: "channel";
|
|
905
|
+
product: "product";
|
|
906
|
+
market: "market";
|
|
907
|
+
organization: "organization";
|
|
908
|
+
global: "global";
|
|
909
|
+
}>;
|
|
910
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
911
|
+
id: z.ZodString;
|
|
912
|
+
productId: z.ZodNullable<z.ZodString>;
|
|
913
|
+
channelId: z.ZodNullable<z.ZodString>;
|
|
914
|
+
supplierId: z.ZodNullable<z.ZodString>;
|
|
915
|
+
marketId: z.ZodNullable<z.ZodString>;
|
|
916
|
+
organizationId: z.ZodNullable<z.ZodString>;
|
|
917
|
+
validFrom: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
918
|
+
validTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
919
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
920
|
+
createdAt: z.ZodString;
|
|
921
|
+
updatedAt: z.ZodString;
|
|
922
|
+
}, z.core.$strip>;
|
|
923
|
+
version: z.ZodNullable<z.ZodObject<{
|
|
924
|
+
title: z.ZodString;
|
|
925
|
+
bodyFormat: z.ZodDefault<z.ZodEnum<{
|
|
926
|
+
markdown: "markdown";
|
|
927
|
+
html: "html";
|
|
928
|
+
plain: "plain";
|
|
929
|
+
}>>;
|
|
930
|
+
id: z.ZodString;
|
|
931
|
+
policyId: z.ZodString;
|
|
932
|
+
version: z.ZodNumber;
|
|
933
|
+
status: z.ZodEnum<{
|
|
934
|
+
draft: "draft";
|
|
935
|
+
published: "published";
|
|
936
|
+
retired: "retired";
|
|
937
|
+
}>;
|
|
938
|
+
body: z.ZodNullable<z.ZodString>;
|
|
939
|
+
publishedAt: z.ZodNullable<z.ZodString>;
|
|
940
|
+
publishedBy: z.ZodNullable<z.ZodString>;
|
|
941
|
+
retiredAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
942
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
943
|
+
createdAt: z.ZodString;
|
|
944
|
+
updatedAt: z.ZodString;
|
|
945
|
+
}, z.core.$strip>>;
|
|
946
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
947
|
+
ruleType: z.ZodEnum<{
|
|
948
|
+
custom: "custom";
|
|
949
|
+
window: "window";
|
|
950
|
+
percentage: "percentage";
|
|
951
|
+
flat_amount: "flat_amount";
|
|
952
|
+
date_range: "date_range";
|
|
953
|
+
}>;
|
|
954
|
+
sortOrder: z.ZodDefault<z.ZodNumber>;
|
|
955
|
+
id: z.ZodString;
|
|
956
|
+
policyVersionId: z.ZodString;
|
|
957
|
+
label: z.ZodNullable<z.ZodString>;
|
|
958
|
+
daysBeforeDeparture: z.ZodNullable<z.ZodNumber>;
|
|
959
|
+
refundPercent: z.ZodNullable<z.ZodNumber>;
|
|
960
|
+
refundType: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
961
|
+
cash: "cash";
|
|
962
|
+
credit: "credit";
|
|
963
|
+
cash_or_credit: "cash_or_credit";
|
|
964
|
+
none: "none";
|
|
965
|
+
}>>>;
|
|
966
|
+
flatAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
967
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
968
|
+
validFrom: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
969
|
+
validTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
970
|
+
conditions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
971
|
+
createdAt: z.ZodString;
|
|
972
|
+
updatedAt: z.ZodString;
|
|
973
|
+
}, z.core.$strip>>;
|
|
974
|
+
}, z.core.$strip>>;
|
|
975
|
+
}, z.core.$strip>;
|
|
976
|
+
export declare const cancellationRuleSchema: z.ZodObject<{
|
|
977
|
+
id: z.ZodOptional<z.ZodString>;
|
|
978
|
+
daysBeforeDeparture: z.ZodNullable<z.ZodNumber>;
|
|
979
|
+
refundPercent: z.ZodNullable<z.ZodNumber>;
|
|
980
|
+
refundType: z.ZodNullable<z.ZodEnum<{
|
|
981
|
+
cash: "cash";
|
|
982
|
+
credit: "credit";
|
|
983
|
+
cash_or_credit: "cash_or_credit";
|
|
984
|
+
none: "none";
|
|
985
|
+
}>>;
|
|
986
|
+
flatAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
987
|
+
label: z.ZodNullable<z.ZodString>;
|
|
988
|
+
}, z.core.$strip>;
|
|
989
|
+
export declare const cancellationResultSchema: z.ZodObject<{
|
|
990
|
+
refundPercent: z.ZodNumber;
|
|
991
|
+
refundCents: z.ZodNumber;
|
|
992
|
+
refundType: z.ZodEnum<{
|
|
993
|
+
cash: "cash";
|
|
994
|
+
credit: "credit";
|
|
995
|
+
cash_or_credit: "cash_or_credit";
|
|
996
|
+
none: "none";
|
|
997
|
+
}>;
|
|
998
|
+
appliedRule: z.ZodNullable<z.ZodObject<{
|
|
999
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1000
|
+
daysBeforeDeparture: z.ZodNullable<z.ZodNumber>;
|
|
1001
|
+
refundPercent: z.ZodNullable<z.ZodNumber>;
|
|
1002
|
+
refundType: z.ZodNullable<z.ZodEnum<{
|
|
1003
|
+
cash: "cash";
|
|
1004
|
+
credit: "credit";
|
|
1005
|
+
cash_or_credit: "cash_or_credit";
|
|
1006
|
+
none: "none";
|
|
1007
|
+
}>>;
|
|
1008
|
+
flatAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
1009
|
+
label: z.ZodNullable<z.ZodString>;
|
|
1010
|
+
}, z.core.$strip>>;
|
|
1011
|
+
}, z.core.$strip>;
|
|
1012
|
+
export type CancellationResult = z.infer<typeof cancellationResultSchema>;
|
|
1013
|
+
export declare const cancellationResultResponse: z.ZodObject<{
|
|
1014
|
+
data: z.ZodObject<{
|
|
1015
|
+
refundPercent: z.ZodNumber;
|
|
1016
|
+
refundCents: z.ZodNumber;
|
|
1017
|
+
refundType: z.ZodEnum<{
|
|
1018
|
+
cash: "cash";
|
|
1019
|
+
credit: "credit";
|
|
1020
|
+
cash_or_credit: "cash_or_credit";
|
|
1021
|
+
none: "none";
|
|
1022
|
+
}>;
|
|
1023
|
+
appliedRule: z.ZodNullable<z.ZodObject<{
|
|
1024
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1025
|
+
daysBeforeDeparture: z.ZodNullable<z.ZodNumber>;
|
|
1026
|
+
refundPercent: z.ZodNullable<z.ZodNumber>;
|
|
1027
|
+
refundType: z.ZodNullable<z.ZodEnum<{
|
|
1028
|
+
cash: "cash";
|
|
1029
|
+
credit: "credit";
|
|
1030
|
+
cash_or_credit: "cash_or_credit";
|
|
1031
|
+
none: "none";
|
|
1032
|
+
}>>;
|
|
1033
|
+
flatAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
1034
|
+
label: z.ZodNullable<z.ZodString>;
|
|
1035
|
+
}, z.core.$strip>>;
|
|
1036
|
+
}, z.core.$strip>;
|
|
1037
|
+
}, z.core.$strip>;
|
|
779
1038
|
//# sourceMappingURL=schemas.d.ts.map
|
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;;;;iBAM7D,CAAA;AAEJ,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;iBAA6B,CAAA;AAC3F,eAAO,MAAM,eAAe;;iBAAqC,CAAA;AAEjE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoBpC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;iBAc7C,CAAA;AAEF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAE7F,eAAO,MAAM,mCAAmC;;;;;;;;;;;iBAS9C,CAAA;AAEF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAA;AAE/F,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;iBAO5C,CAAA;AAEF,MAAM,MAA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,wBAAwB;;;;;;;;;;;;;;;;;;;;;;iBAKnC,CAAA;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;iBAA2C,CAAA"}
|
package/dist/schemas.js
CHANGED
|
@@ -161,3 +161,29 @@ export const legalPolicyRuleSingleResponse = singleEnvelope(legalPolicyRuleRecor
|
|
|
161
161
|
export const legalPolicyAssignmentListResponse = singleEnvelope(z.array(legalPolicyAssignmentRecordSchema));
|
|
162
162
|
export const legalPolicyAssignmentSingleResponse = singleEnvelope(legalPolicyAssignmentRecordSchema);
|
|
163
163
|
export const legalPolicyAcceptanceListResponse = singleEnvelope(z.array(legalPolicyAcceptanceRecordSchema));
|
|
164
|
+
// Resolved policy returned by GET /v1/admin/legal/policies/resolve
|
|
165
|
+
export const resolvedPolicySchema = z.object({
|
|
166
|
+
policy: legalPolicyRecordSchema,
|
|
167
|
+
assignment: legalPolicyAssignmentRecordSchema,
|
|
168
|
+
version: legalPolicyVersionRecordSchema.nullable(),
|
|
169
|
+
rules: z.array(legalPolicyRuleRecordSchema),
|
|
170
|
+
});
|
|
171
|
+
export const resolvedPolicyResponse = z.object({
|
|
172
|
+
data: resolvedPolicySchema.nullable(),
|
|
173
|
+
});
|
|
174
|
+
// Cancellation evaluation result from POST /v1/admin/legal/policies/:id/evaluate
|
|
175
|
+
export const cancellationRuleSchema = z.object({
|
|
176
|
+
id: z.string().optional(),
|
|
177
|
+
daysBeforeDeparture: z.number().int().nullable(),
|
|
178
|
+
refundPercent: z.number().int().nullable(),
|
|
179
|
+
refundType: z.enum(["cash", "credit", "cash_or_credit", "none"]).nullable(),
|
|
180
|
+
flatAmountCents: z.number().int().nullable(),
|
|
181
|
+
label: z.string().nullable(),
|
|
182
|
+
});
|
|
183
|
+
export const cancellationResultSchema = z.object({
|
|
184
|
+
refundPercent: z.number().int(),
|
|
185
|
+
refundCents: z.number().int(),
|
|
186
|
+
refundType: z.enum(["cash", "credit", "cash_or_credit", "none"]),
|
|
187
|
+
appliedRule: cancellationRuleSchema.nullable(),
|
|
188
|
+
});
|
|
189
|
+
export const cancellationResultResponse = singleEnvelope(cancellationResultSchema);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/legal-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"license": "FSL-1.1-Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react": "^19.0.0",
|
|
36
36
|
"react-dom": "^19.0.0",
|
|
37
37
|
"zod": "^4.0.0",
|
|
38
|
-
"@voyantjs/legal": "0.
|
|
38
|
+
"@voyantjs/legal": "0.5.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@tanstack/react-query": "^5.96.2",
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"typescript": "^6.0.2",
|
|
47
47
|
"vitest": "^4.1.2",
|
|
48
48
|
"zod": "^4.3.6",
|
|
49
|
-
"@voyantjs/legal": "0.
|
|
50
|
-
"@voyantjs/react": "0.
|
|
49
|
+
"@voyantjs/legal": "0.5.0",
|
|
50
|
+
"@voyantjs/react": "0.5.0",
|
|
51
51
|
"@voyantjs/voyant-typescript-config": "0.1.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@voyantjs/react": "0.
|
|
54
|
+
"@voyantjs/react": "0.5.0"
|
|
55
55
|
},
|
|
56
56
|
"files": [
|
|
57
57
|
"dist"
|