@voyant-travel/distribution-react 0.109.8
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/LICENSE +201 -0
- package/README.md +82 -0
- package/dist/admin/index.d.ts +30 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +65 -0
- package/dist/client.d.ts +14 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +59 -0
- package/dist/components/booking-link-detail-page.d.ts +10 -0
- package/dist/components/booking-link-detail-page.d.ts.map +1 -0
- package/dist/components/booking-link-detail-page.js +51 -0
- package/dist/components/channel-detail-page.d.ts +12 -0
- package/dist/components/channel-detail-page.d.ts.map +1 -0
- package/dist/components/channel-detail-page.js +41 -0
- package/dist/components/channel-sync-controls.d.ts +15 -0
- package/dist/components/channel-sync-controls.d.ts.map +1 -0
- package/dist/components/channel-sync-controls.js +29 -0
- package/dist/components/channel-sync-deliveries-drawer.d.ts +12 -0
- package/dist/components/channel-sync-deliveries-drawer.d.ts.map +1 -0
- package/dist/components/channel-sync-deliveries-drawer.js +18 -0
- package/dist/components/channel-sync-page-utils.d.ts +99 -0
- package/dist/components/channel-sync-page-utils.d.ts.map +1 -0
- package/dist/components/channel-sync-page-utils.js +85 -0
- package/dist/components/channel-sync-page.d.ts +4 -0
- package/dist/components/channel-sync-page.d.ts.map +1 -0
- package/dist/components/channel-sync-page.js +141 -0
- package/dist/components/channels-page.d.ts +6 -0
- package/dist/components/channels-page.d.ts.map +1 -0
- package/dist/components/channels-page.js +132 -0
- package/dist/components/commission-rule-detail-page.d.ts +10 -0
- package/dist/components/commission-rule-detail-page.d.ts.map +1 -0
- package/dist/components/commission-rule-detail-page.js +57 -0
- package/dist/components/contract-detail-page.d.ts +10 -0
- package/dist/components/contract-detail-page.d.ts.map +1 -0
- package/dist/components/contract-detail-page.js +64 -0
- package/dist/components/distribution-overview.d.ts +19 -0
- package/dist/components/distribution-overview.d.ts.map +1 -0
- package/dist/components/distribution-overview.js +13 -0
- package/dist/components/distribution-page.d.ts +26 -0
- package/dist/components/distribution-page.d.ts.map +1 -0
- package/dist/components/distribution-page.js +190 -0
- package/dist/components/distribution-section-header.d.ts +7 -0
- package/dist/components/distribution-section-header.d.ts.map +1 -0
- package/dist/components/distribution-section-header.js +6 -0
- package/dist/components/distribution-shared.d.ts +32 -0
- package/dist/components/distribution-shared.d.ts.map +1 -0
- package/dist/components/distribution-shared.js +246 -0
- package/dist/components/distribution-tabs-primary.d.ts +57 -0
- package/dist/components/distribution-tabs-primary.d.ts.map +1 -0
- package/dist/components/distribution-tabs-primary.js +89 -0
- package/dist/components/distribution-tabs-secondary.d.ts +58 -0
- package/dist/components/distribution-tabs-secondary.d.ts.map +1 -0
- package/dist/components/distribution-tabs-secondary.js +89 -0
- package/dist/components/mapping-detail-page.d.ts +10 -0
- package/dist/components/mapping-detail-page.d.ts.map +1 -0
- package/dist/components/mapping-detail-page.js +51 -0
- package/dist/components/webhook-event-detail-page.d.ts +9 -0
- package/dist/components/webhook-event-detail-page.d.ts.map +1 -0
- package/dist/components/webhook-event-detail-page.js +46 -0
- package/dist/constants.d.ts +103 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +48 -0
- package/dist/external-refs/client.d.ts +14 -0
- package/dist/external-refs/client.d.ts.map +1 -0
- package/dist/external-refs/client.js +58 -0
- package/dist/external-refs/components/entity-ref-picker.d.ts +21 -0
- package/dist/external-refs/components/entity-ref-picker.d.ts.map +1 -0
- package/dist/external-refs/components/entity-ref-picker.js +38 -0
- package/dist/external-refs/components/external-ref-dialog.d.ts +11 -0
- package/dist/external-refs/components/external-ref-dialog.d.ts.map +1 -0
- package/dist/external-refs/components/external-ref-dialog.js +120 -0
- package/dist/external-refs/components/external-refs-page.d.ts +16 -0
- package/dist/external-refs/components/external-refs-page.d.ts.map +1 -0
- package/dist/external-refs/components/external-refs-page.js +109 -0
- package/dist/external-refs/hooks/index.d.ts +3 -0
- package/dist/external-refs/hooks/index.d.ts.map +1 -0
- package/dist/external-refs/hooks/index.js +2 -0
- package/dist/external-refs/hooks/use-external-ref-mutation.d.ts +57 -0
- package/dist/external-refs/hooks/use-external-ref-mutation.d.ts.map +1 -0
- package/dist/external-refs/hooks/use-external-ref-mutation.js +40 -0
- package/dist/external-refs/hooks/use-external-refs.d.ts +26 -0
- package/dist/external-refs/hooks/use-external-refs.d.ts.map +1 -0
- package/dist/external-refs/hooks/use-external-refs.js +12 -0
- package/dist/external-refs/i18n/en.d.ts +3 -0
- package/dist/external-refs/i18n/en.d.ts.map +1 -0
- package/dist/external-refs/i18n/en.js +92 -0
- package/dist/external-refs/i18n/index.d.ts +5 -0
- package/dist/external-refs/i18n/index.d.ts.map +1 -0
- package/dist/external-refs/i18n/index.js +3 -0
- package/dist/external-refs/i18n/messages.d.ts +85 -0
- package/dist/external-refs/i18n/messages.d.ts.map +1 -0
- package/dist/external-refs/i18n/messages.js +1 -0
- package/dist/external-refs/i18n/provider.d.ts +26 -0
- package/dist/external-refs/i18n/provider.d.ts.map +1 -0
- package/dist/external-refs/i18n/provider.js +44 -0
- package/dist/external-refs/i18n/ro.d.ts +3 -0
- package/dist/external-refs/i18n/ro.d.ts.map +1 -0
- package/dist/external-refs/i18n/ro.js +92 -0
- package/dist/external-refs/index.d.ts +7 -0
- package/dist/external-refs/index.d.ts.map +1 -0
- package/dist/external-refs/index.js +6 -0
- package/dist/external-refs/provider.d.ts +2 -0
- package/dist/external-refs/provider.d.ts.map +1 -0
- package/dist/external-refs/provider.js +1 -0
- package/dist/external-refs/query-keys.d.ts +18 -0
- package/dist/external-refs/query-keys.d.ts.map +1 -0
- package/dist/external-refs/query-keys.js +6 -0
- package/dist/external-refs/query-options.d.ts +159 -0
- package/dist/external-refs/query-options.d.ts.map +1 -0
- package/dist/external-refs/query-options.js +31 -0
- package/dist/external-refs/schemas.d.ts +82 -0
- package/dist/external-refs/schemas.d.ts.map +1 -0
- package/dist/external-refs/schemas.js +20 -0
- package/dist/external-refs/ui.d.ts +5 -0
- package/dist/external-refs/ui.d.ts.map +1 -0
- package/dist/external-refs/ui.js +4 -0
- package/dist/hooks/index.d.ts +12 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +12 -0
- package/dist/hooks/use-booking-links.d.ts +20 -0
- package/dist/hooks/use-booking-links.d.ts.map +1 -0
- package/dist/hooks/use-booking-links.js +9 -0
- package/dist/hooks/use-bookings.d.ts +14 -0
- package/dist/hooks/use-bookings.d.ts.map +1 -0
- package/dist/hooks/use-bookings.js +9 -0
- package/dist/hooks/use-channel-mutation.d.ts +69 -0
- package/dist/hooks/use-channel-mutation.d.ts.map +1 -0
- package/dist/hooks/use-channel-mutation.js +49 -0
- package/dist/hooks/use-channel.d.ts +16 -0
- package/dist/hooks/use-channel.d.ts.map +1 -0
- package/dist/hooks/use-channel.js +13 -0
- package/dist/hooks/use-channels.d.ts +20 -0
- package/dist/hooks/use-channels.d.ts.map +1 -0
- package/dist/hooks/use-channels.js +9 -0
- package/dist/hooks/use-commission-rules.d.ts +23 -0
- package/dist/hooks/use-commission-rules.d.ts.map +1 -0
- package/dist/hooks/use-commission-rules.js +9 -0
- package/dist/hooks/use-contracts.d.ts +22 -0
- package/dist/hooks/use-contracts.d.ts.map +1 -0
- package/dist/hooks/use-contracts.js +9 -0
- package/dist/hooks/use-mappings.d.ts +19 -0
- package/dist/hooks/use-mappings.d.ts.map +1 -0
- package/dist/hooks/use-mappings.js +9 -0
- package/dist/hooks/use-products.d.ts +14 -0
- package/dist/hooks/use-products.d.ts.map +1 -0
- package/dist/hooks/use-products.js +9 -0
- package/dist/hooks/use-suppliers.d.ts +14 -0
- package/dist/hooks/use-suppliers.d.ts.map +1 -0
- package/dist/hooks/use-suppliers.js +9 -0
- package/dist/hooks/use-webhook-events.d.ts +21 -0
- package/dist/hooks/use-webhook-events.d.ts.map +1 -0
- package/dist/hooks/use-webhook-events.js +9 -0
- package/dist/i18n/en.d.ts +592 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +561 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/messages.d.ts +409 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/i18n/messages.js +1 -0
- package/dist/i18n/provider.d.ts +1207 -0
- package/dist/i18n/provider.d.ts.map +1 -0
- package/dist/i18n/provider.js +44 -0
- package/dist/i18n/ro.d.ts +592 -0
- package/dist/i18n/ro.d.ts.map +1 -0
- package/dist/i18n/ro.js +561 -0
- package/dist/i18n/utils.d.ts +4 -0
- package/dist/i18n/utils.d.ts.map +1 -0
- package/dist/i18n/utils.js +8 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/provider.d.ts +2 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +1 -0
- package/dist/query-keys.d.ts +61 -0
- package/dist/query-keys.d.ts.map +1 -0
- package/dist/query-keys.js +30 -0
- package/dist/query-options.d.ts +999 -0
- package/dist/query-options.d.ts.map +1 -0
- package/dist/query-options.js +219 -0
- package/dist/schemas.d.ts +615 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +144 -0
- package/dist/suppliers/admin/index.d.ts +69 -0
- package/dist/suppliers/admin/index.d.ts.map +1 -0
- package/dist/suppliers/admin/index.js +111 -0
- package/dist/suppliers/admin/pages/supplier-detail-page.d.ts +9 -0
- package/dist/suppliers/admin/pages/supplier-detail-page.d.ts.map +1 -0
- package/dist/suppliers/admin/pages/supplier-detail-page.js +11 -0
- package/dist/suppliers/admin/slots.d.ts +19 -0
- package/dist/suppliers/admin/slots.d.ts.map +1 -0
- package/dist/suppliers/admin/slots.js +18 -0
- package/dist/suppliers/admin/supplier-detail-host.d.ts +30 -0
- package/dist/suppliers/admin/supplier-detail-host.d.ts.map +1 -0
- package/dist/suppliers/admin/supplier-detail-host.js +34 -0
- package/dist/suppliers/admin/supplier-detail-skeleton.d.ts +9 -0
- package/dist/suppliers/admin/supplier-detail-skeleton.d.ts.map +1 -0
- package/dist/suppliers/admin/supplier-detail-skeleton.js +20 -0
- package/dist/suppliers/admin/suppliers-host.d.ts +11 -0
- package/dist/suppliers/admin/suppliers-host.d.ts.map +1 -0
- package/dist/suppliers/admin/suppliers-host.js +17 -0
- package/dist/suppliers/admin/suppliers-list-skeleton.d.ts +9 -0
- package/dist/suppliers/admin/suppliers-list-skeleton.d.ts.map +1 -0
- package/dist/suppliers/admin/suppliers-list-skeleton.js +24 -0
- package/dist/suppliers/client.d.ts +14 -0
- package/dist/suppliers/client.d.ts.map +1 -0
- package/dist/suppliers/client.js +59 -0
- package/dist/suppliers/components/message-format.d.ts +2 -0
- package/dist/suppliers/components/message-format.d.ts.map +1 -0
- package/dist/suppliers/components/message-format.js +3 -0
- package/dist/suppliers/components/rate-dialog.d.ts +11 -0
- package/dist/suppliers/components/rate-dialog.d.ts.map +1 -0
- package/dist/suppliers/components/rate-dialog.js +93 -0
- package/dist/suppliers/components/service-dialog.d.ts +10 -0
- package/dist/suppliers/components/service-dialog.d.ts.map +1 -0
- package/dist/suppliers/components/service-dialog.js +69 -0
- package/dist/suppliers/components/supplier-combobox.d.ts +13 -0
- package/dist/suppliers/components/supplier-combobox.d.ts.map +1 -0
- package/dist/suppliers/components/supplier-combobox.js +23 -0
- package/dist/suppliers/components/supplier-detail-page.d.ts +17 -0
- package/dist/suppliers/components/supplier-detail-page.d.ts.map +1 -0
- package/dist/suppliers/components/supplier-detail-page.js +105 -0
- package/dist/suppliers/components/supplier-dialog.d.ts +9 -0
- package/dist/suppliers/components/supplier-dialog.d.ts.map +1 -0
- package/dist/suppliers/components/supplier-dialog.js +118 -0
- package/dist/suppliers/components/supplier-service-row.d.ts +22 -0
- package/dist/suppliers/components/supplier-service-row.d.ts.map +1 -0
- package/dist/suppliers/components/supplier-service-row.js +18 -0
- package/dist/suppliers/components/suppliers-page.d.ts +10 -0
- package/dist/suppliers/components/suppliers-page.d.ts.map +1 -0
- package/dist/suppliers/components/suppliers-page.js +94 -0
- package/dist/suppliers/constants.d.ts +69 -0
- package/dist/suppliers/constants.d.ts.map +1 -0
- package/dist/suppliers/constants.js +34 -0
- package/dist/suppliers/hooks/index.d.ts +10 -0
- package/dist/suppliers/hooks/index.d.ts.map +1 -0
- package/dist/suppliers/hooks/index.js +10 -0
- package/dist/suppliers/hooks/use-supplier-mutation.d.ts +95 -0
- package/dist/suppliers/hooks/use-supplier-mutation.d.ts.map +1 -0
- package/dist/suppliers/hooks/use-supplier-mutation.js +41 -0
- package/dist/suppliers/hooks/use-supplier-note-mutation.d.ts +13 -0
- package/dist/suppliers/hooks/use-supplier-note-mutation.d.ts.map +1 -0
- package/dist/suppliers/hooks/use-supplier-note-mutation.js +20 -0
- package/dist/suppliers/hooks/use-supplier-notes.d.ts +13 -0
- package/dist/suppliers/hooks/use-supplier-notes.d.ts.map +1 -0
- package/dist/suppliers/hooks/use-supplier-notes.js +12 -0
- package/dist/suppliers/hooks/use-supplier-rate-mutation.d.ts +56 -0
- package/dist/suppliers/hooks/use-supplier-rate-mutation.d.ts.map +1 -0
- package/dist/suppliers/hooks/use-supplier-rate-mutation.js +41 -0
- package/dist/suppliers/hooks/use-supplier-service-mutation.d.ts +45 -0
- package/dist/suppliers/hooks/use-supplier-service-mutation.d.ts.map +1 -0
- package/dist/suppliers/hooks/use-supplier-service-mutation.js +44 -0
- package/dist/suppliers/hooks/use-supplier-service-rates.d.ts +20 -0
- package/dist/suppliers/hooks/use-supplier-service-rates.d.ts.map +1 -0
- package/dist/suppliers/hooks/use-supplier-service-rates.js +12 -0
- package/dist/suppliers/hooks/use-supplier-services.d.ts +19 -0
- package/dist/suppliers/hooks/use-supplier-services.d.ts.map +1 -0
- package/dist/suppliers/hooks/use-supplier-services.js +12 -0
- package/dist/suppliers/hooks/use-supplier.d.ts +38 -0
- package/dist/suppliers/hooks/use-supplier.d.ts.map +1 -0
- package/dist/suppliers/hooks/use-supplier.js +9 -0
- package/dist/suppliers/hooks/use-suppliers.d.ts +42 -0
- package/dist/suppliers/hooks/use-suppliers.d.ts.map +1 -0
- package/dist/suppliers/hooks/use-suppliers.js +9 -0
- package/dist/suppliers/i18n/en.d.ts +204 -0
- package/dist/suppliers/i18n/en.d.ts.map +1 -0
- package/dist/suppliers/i18n/en.js +203 -0
- package/dist/suppliers/i18n/index.d.ts +5 -0
- package/dist/suppliers/i18n/index.d.ts.map +1 -0
- package/dist/suppliers/i18n/index.js +3 -0
- package/dist/suppliers/i18n/messages.d.ts +187 -0
- package/dist/suppliers/i18n/messages.d.ts.map +1 -0
- package/dist/suppliers/i18n/messages.js +1 -0
- package/dist/suppliers/i18n/provider.d.ts +430 -0
- package/dist/suppliers/i18n/provider.d.ts.map +1 -0
- package/dist/suppliers/i18n/provider.js +44 -0
- package/dist/suppliers/i18n/ro.d.ts +204 -0
- package/dist/suppliers/i18n/ro.d.ts.map +1 -0
- package/dist/suppliers/i18n/ro.js +203 -0
- package/dist/suppliers/index.d.ts +9 -0
- package/dist/suppliers/index.d.ts.map +1 -0
- package/dist/suppliers/index.js +8 -0
- package/dist/suppliers/provider.d.ts +2 -0
- package/dist/suppliers/provider.d.ts.map +1 -0
- package/dist/suppliers/provider.js +1 -0
- package/dist/suppliers/query-keys.d.ts +29 -0
- package/dist/suppliers/query-keys.d.ts.map +1 -0
- package/dist/suppliers/query-keys.js +12 -0
- package/dist/suppliers/query-options.d.ts +467 -0
- package/dist/suppliers/query-options.d.ts.map +1 -0
- package/dist/suppliers/query-options.js +63 -0
- package/dist/suppliers/schemas.d.ts +363 -0
- package/dist/suppliers/schemas.d.ts.map +1 -0
- package/dist/suppliers/schemas.js +109 -0
- package/dist/suppliers/ui.d.ts +9 -0
- package/dist/suppliers/ui.d.ts.map +1 -0
- package/dist/suppliers/ui.js +8 -0
- package/dist/suppliers/utils.d.ts +4 -0
- package/dist/suppliers/utils.d.ts.map +1 -0
- package/dist/suppliers/utils.js +10 -0
- package/dist/ui.d.ts +16 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +14 -0
- package/dist/utils.d.ts +10 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +44 -0
- package/package.json +263 -0
- package/src/external-refs/styles.css +11 -0
- package/src/styles.css +11 -0
- package/src/suppliers/styles.css +11 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface CreateSupplierServiceInput {
|
|
2
|
+
serviceType: "accommodation" | "transfer" | "experience" | "guide" | "meal" | "other";
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string | null;
|
|
5
|
+
duration?: string | null;
|
|
6
|
+
capacity?: number | null;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
tags?: string[];
|
|
9
|
+
}
|
|
10
|
+
export type UpdateSupplierServiceInput = Partial<CreateSupplierServiceInput>;
|
|
11
|
+
export declare function useSupplierServiceMutation(supplierId: string): {
|
|
12
|
+
create: import("@tanstack/react-query").UseMutationResult<{
|
|
13
|
+
id: string;
|
|
14
|
+
supplierId: string;
|
|
15
|
+
serviceType: "other" | "guide" | "transfer" | "experience" | "accommodation" | "meal";
|
|
16
|
+
name: string;
|
|
17
|
+
description: string | null;
|
|
18
|
+
duration: string | null;
|
|
19
|
+
capacity: number | null;
|
|
20
|
+
active: boolean;
|
|
21
|
+
tags: string[];
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
}, Error, CreateSupplierServiceInput, unknown>;
|
|
25
|
+
update: import("@tanstack/react-query").UseMutationResult<{
|
|
26
|
+
id: string;
|
|
27
|
+
supplierId: string;
|
|
28
|
+
serviceType: "other" | "guide" | "transfer" | "experience" | "accommodation" | "meal";
|
|
29
|
+
name: string;
|
|
30
|
+
description: string | null;
|
|
31
|
+
duration: string | null;
|
|
32
|
+
capacity: number | null;
|
|
33
|
+
active: boolean;
|
|
34
|
+
tags: string[];
|
|
35
|
+
createdAt: string;
|
|
36
|
+
updatedAt: string;
|
|
37
|
+
}, Error, {
|
|
38
|
+
serviceId: string;
|
|
39
|
+
input: UpdateSupplierServiceInput;
|
|
40
|
+
}, unknown>;
|
|
41
|
+
remove: import("@tanstack/react-query").UseMutationResult<{
|
|
42
|
+
success: boolean;
|
|
43
|
+
}, Error, string, unknown>;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=use-supplier-service-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-supplier-service-mutation.d.ts","sourceRoot":"","sources":["../../../src/suppliers/hooks/use-supplier-service-mutation.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,eAAe,GAAG,UAAU,GAAG,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;IACrF,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AAE5E,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA0B5C,MAAM;eACV,0BAA0B;;;;;EAoCtC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { fetchWithValidation } from "../client.js";
|
|
4
|
+
import { useVoyantSuppliersContext } from "../provider.js";
|
|
5
|
+
import { suppliersQueryKeys } from "../query-keys.js";
|
|
6
|
+
import { deleteSuccessResponse, supplierServiceResponse } from "../schemas.js";
|
|
7
|
+
export function useSupplierServiceMutation(supplierId) {
|
|
8
|
+
const { baseUrl, fetcher } = useVoyantSuppliersContext();
|
|
9
|
+
const queryClient = useQueryClient();
|
|
10
|
+
const create = useMutation({
|
|
11
|
+
mutationFn: async (input) => {
|
|
12
|
+
const { data } = await fetchWithValidation(`/v1/suppliers/${supplierId}/services`, supplierServiceResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
13
|
+
return data;
|
|
14
|
+
},
|
|
15
|
+
onSuccess: () => {
|
|
16
|
+
void queryClient.invalidateQueries({
|
|
17
|
+
queryKey: suppliersQueryKeys.supplierServices(supplierId),
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
const update = useMutation({
|
|
22
|
+
mutationFn: async ({ serviceId, input, }) => {
|
|
23
|
+
const { data } = await fetchWithValidation(`/v1/suppliers/${supplierId}/services/${serviceId}`, supplierServiceResponse, { baseUrl, fetcher }, { method: "PATCH", body: JSON.stringify(input) });
|
|
24
|
+
return data;
|
|
25
|
+
},
|
|
26
|
+
onSuccess: () => {
|
|
27
|
+
void queryClient.invalidateQueries({
|
|
28
|
+
queryKey: suppliersQueryKeys.supplierServices(supplierId),
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
const remove = useMutation({
|
|
33
|
+
mutationFn: async (serviceId) => fetchWithValidation(`/v1/suppliers/${supplierId}/services/${serviceId}`, deleteSuccessResponse, { baseUrl, fetcher }, { method: "DELETE" }),
|
|
34
|
+
onSuccess: (_result, serviceId) => {
|
|
35
|
+
void queryClient.invalidateQueries({
|
|
36
|
+
queryKey: suppliersQueryKeys.supplierServices(supplierId),
|
|
37
|
+
});
|
|
38
|
+
queryClient.removeQueries({
|
|
39
|
+
queryKey: suppliersQueryKeys.supplierServiceRates(supplierId, serviceId),
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
return { create, update, remove };
|
|
44
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface UseSupplierServiceRatesOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function useSupplierServiceRates(supplierId: string, serviceId: string, options?: UseSupplierServiceRatesOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
serviceId: string;
|
|
8
|
+
name: string;
|
|
9
|
+
currency: string;
|
|
10
|
+
amountCents: number;
|
|
11
|
+
unit: "flat" | "per_person" | "per_group" | "per_night" | "per_vehicle";
|
|
12
|
+
validFrom: string | null;
|
|
13
|
+
validTo: string | null;
|
|
14
|
+
minPax: number | null;
|
|
15
|
+
maxPax: number | null;
|
|
16
|
+
notes: string | null;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
}[];
|
|
19
|
+
}, Error>;
|
|
20
|
+
//# sourceMappingURL=use-supplier-service-rates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-supplier-service-rates.d.ts","sourceRoot":"","sources":["../../../src/suppliers/hooks/use-supplier-service-rates.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,8BAA8B;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,8BAAmC;;;;;;;;;;;;;;;UAQ7C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantSuppliersContext } from "../provider.js";
|
|
4
|
+
import { getSupplierServiceRatesQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useSupplierServiceRates(supplierId, serviceId, options = {}) {
|
|
6
|
+
const client = useVoyantSuppliersContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getSupplierServiceRatesQueryOptions(client, supplierId, serviceId),
|
|
10
|
+
enabled: enabled && !!supplierId && !!serviceId,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface UseSupplierServicesOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function useSupplierServices(supplierId: string, options?: UseSupplierServicesOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
supplierId: string;
|
|
8
|
+
serviceType: "other" | "guide" | "transfer" | "experience" | "accommodation" | "meal";
|
|
9
|
+
name: string;
|
|
10
|
+
description: string | null;
|
|
11
|
+
duration: string | null;
|
|
12
|
+
capacity: number | null;
|
|
13
|
+
active: boolean;
|
|
14
|
+
tags: string[];
|
|
15
|
+
createdAt: string;
|
|
16
|
+
updatedAt: string;
|
|
17
|
+
}[];
|
|
18
|
+
}, Error>;
|
|
19
|
+
//# sourceMappingURL=use-supplier-services.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-supplier-services.d.ts","sourceRoot":"","sources":["../../../src/suppliers/hooks/use-supplier-services.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,0BAA+B;;;;;;;;;;;;;;UAO/F"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantSuppliersContext } from "../provider.js";
|
|
4
|
+
import { getSupplierServicesQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useSupplierServices(supplierId, options = {}) {
|
|
6
|
+
const client = useVoyantSuppliersContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getSupplierServicesQueryOptions(client, supplierId),
|
|
10
|
+
enabled: enabled && !!supplierId,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface UseSupplierOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function useSupplier(id: string, options?: UseSupplierOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
type: "other" | "guide" | "hotel" | "transfer" | "experience" | "airline" | "restaurant";
|
|
9
|
+
status: "active" | "inactive" | "pending";
|
|
10
|
+
description: string | null;
|
|
11
|
+
email: string | null;
|
|
12
|
+
phone: string | null;
|
|
13
|
+
website: string | null;
|
|
14
|
+
address: string | null;
|
|
15
|
+
city: string | null;
|
|
16
|
+
country: string | null;
|
|
17
|
+
defaultCurrency: string | null;
|
|
18
|
+
contactName: string | null;
|
|
19
|
+
contactEmail: string | null;
|
|
20
|
+
contactPhone: string | null;
|
|
21
|
+
tags: string[];
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
paymentTermsDays?: number | null | undefined;
|
|
25
|
+
reservationTimeoutMinutes?: number | null | undefined;
|
|
26
|
+
customerPaymentPolicy?: {
|
|
27
|
+
deposit: {
|
|
28
|
+
kind: "none" | "percent" | "fixed_cents";
|
|
29
|
+
percent?: number | undefined;
|
|
30
|
+
amountCents?: number | undefined;
|
|
31
|
+
};
|
|
32
|
+
minDaysBeforeDepartureForDeposit: number;
|
|
33
|
+
balanceDueDaysBeforeDeparture: number;
|
|
34
|
+
balanceDueMinDaysFromNow: number;
|
|
35
|
+
} | null | undefined;
|
|
36
|
+
};
|
|
37
|
+
}, Error>;
|
|
38
|
+
//# sourceMappingURL=use-supplier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-supplier.d.ts","sourceRoot":"","sources":["../../../src/suppliers/hooks/use-supplier.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAIvE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantSuppliersContext } from "../provider.js";
|
|
4
|
+
import { getSupplierQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useSupplier(id, options = {}) {
|
|
6
|
+
const client = useVoyantSuppliersContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({ ...getSupplierQueryOptions(client, id), enabled: enabled && !!id });
|
|
9
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { SuppliersListFilters } from "../query-keys.js";
|
|
2
|
+
export interface UseSuppliersOptions extends SuppliersListFilters {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function useSuppliers(options?: UseSuppliersOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
6
|
+
data: {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
type: "other" | "guide" | "hotel" | "transfer" | "experience" | "airline" | "restaurant";
|
|
10
|
+
status: "active" | "inactive" | "pending";
|
|
11
|
+
description: string | null;
|
|
12
|
+
email: string | null;
|
|
13
|
+
phone: string | null;
|
|
14
|
+
website: string | null;
|
|
15
|
+
address: string | null;
|
|
16
|
+
city: string | null;
|
|
17
|
+
country: string | null;
|
|
18
|
+
defaultCurrency: string | null;
|
|
19
|
+
contactName: string | null;
|
|
20
|
+
contactEmail: string | null;
|
|
21
|
+
contactPhone: string | null;
|
|
22
|
+
tags: string[];
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
paymentTermsDays?: number | null | undefined;
|
|
26
|
+
reservationTimeoutMinutes?: number | null | undefined;
|
|
27
|
+
customerPaymentPolicy?: {
|
|
28
|
+
deposit: {
|
|
29
|
+
kind: "none" | "percent" | "fixed_cents";
|
|
30
|
+
percent?: number | undefined;
|
|
31
|
+
amountCents?: number | undefined;
|
|
32
|
+
};
|
|
33
|
+
minDaysBeforeDepartureForDeposit: number;
|
|
34
|
+
balanceDueDaysBeforeDeparture: number;
|
|
35
|
+
balanceDueMinDaysFromNow: number;
|
|
36
|
+
} | null | undefined;
|
|
37
|
+
}[];
|
|
38
|
+
total: number;
|
|
39
|
+
limit: number;
|
|
40
|
+
offset: number;
|
|
41
|
+
}, Error>;
|
|
42
|
+
//# sourceMappingURL=use-suppliers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-suppliers.d.ts","sourceRoot":"","sources":["../../../src/suppliers/hooks/use-suppliers.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAG5D,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,YAAY,CAAC,OAAO,GAAE,mBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAI7D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantSuppliersContext } from "../provider.js";
|
|
4
|
+
import { getSuppliersQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useSuppliers(options = {}) {
|
|
6
|
+
const client = useVoyantSuppliersContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({ ...getSuppliersQueryOptions(client, options), enabled });
|
|
9
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
export declare const suppliersUiEn: {
|
|
2
|
+
common: {
|
|
3
|
+
edit: string;
|
|
4
|
+
delete: string;
|
|
5
|
+
add: string;
|
|
6
|
+
save: string;
|
|
7
|
+
create: string;
|
|
8
|
+
cancel: string;
|
|
9
|
+
back: string;
|
|
10
|
+
open: string;
|
|
11
|
+
active: string;
|
|
12
|
+
inactive: string;
|
|
13
|
+
none: string;
|
|
14
|
+
unknown: string;
|
|
15
|
+
maxPax: string;
|
|
16
|
+
supplierTypeLabels: {
|
|
17
|
+
hotel: string;
|
|
18
|
+
transfer: string;
|
|
19
|
+
guide: string;
|
|
20
|
+
experience: string;
|
|
21
|
+
airline: string;
|
|
22
|
+
restaurant: string;
|
|
23
|
+
other: string;
|
|
24
|
+
};
|
|
25
|
+
supplierStatusLabels: {
|
|
26
|
+
active: string;
|
|
27
|
+
inactive: string;
|
|
28
|
+
pending: string;
|
|
29
|
+
};
|
|
30
|
+
serviceTypeLabels: {
|
|
31
|
+
accommodation: string;
|
|
32
|
+
transfer: string;
|
|
33
|
+
experience: string;
|
|
34
|
+
guide: string;
|
|
35
|
+
meal: string;
|
|
36
|
+
other: string;
|
|
37
|
+
};
|
|
38
|
+
rateUnitLabels: {
|
|
39
|
+
per_person: string;
|
|
40
|
+
per_group: string;
|
|
41
|
+
per_night: string;
|
|
42
|
+
per_vehicle: string;
|
|
43
|
+
flat: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
suppliersPage: {
|
|
47
|
+
title: string;
|
|
48
|
+
description: string;
|
|
49
|
+
create: string;
|
|
50
|
+
searchPlaceholder: string;
|
|
51
|
+
summary: string;
|
|
52
|
+
previous: string;
|
|
53
|
+
next: string;
|
|
54
|
+
page: string;
|
|
55
|
+
filters: string;
|
|
56
|
+
clearFilters: string;
|
|
57
|
+
allTypes: string;
|
|
58
|
+
allStatuses: string;
|
|
59
|
+
countryPlaceholder: string;
|
|
60
|
+
currencyPlaceholder: string;
|
|
61
|
+
filterTypeLabel: string;
|
|
62
|
+
filterStatusLabel: string;
|
|
63
|
+
filterCountryLabel: string;
|
|
64
|
+
filterCurrencyLabel: string;
|
|
65
|
+
empty: string;
|
|
66
|
+
loadFailed: string;
|
|
67
|
+
columns: {
|
|
68
|
+
name: string;
|
|
69
|
+
type: string;
|
|
70
|
+
status: string;
|
|
71
|
+
city: string;
|
|
72
|
+
country: string;
|
|
73
|
+
currency: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
supplierDetailPage: {
|
|
77
|
+
backToSuppliers: string;
|
|
78
|
+
notFound: string;
|
|
79
|
+
loadFailed: string;
|
|
80
|
+
details: string;
|
|
81
|
+
contact: string;
|
|
82
|
+
noContact: string;
|
|
83
|
+
services: string;
|
|
84
|
+
addService: string;
|
|
85
|
+
noServices: string;
|
|
86
|
+
notes: string;
|
|
87
|
+
notePlaceholder: string;
|
|
88
|
+
addNote: string;
|
|
89
|
+
noNotes: string;
|
|
90
|
+
deleteSupplierConfirm: string;
|
|
91
|
+
deleteServiceConfirm: string;
|
|
92
|
+
deleteRateConfirm: string;
|
|
93
|
+
labels: {
|
|
94
|
+
type: string;
|
|
95
|
+
status: string;
|
|
96
|
+
city: string;
|
|
97
|
+
country: string;
|
|
98
|
+
currency: string;
|
|
99
|
+
reservationTimeout: string;
|
|
100
|
+
email: string;
|
|
101
|
+
phone: string;
|
|
102
|
+
website: string;
|
|
103
|
+
address: string;
|
|
104
|
+
contactName: string;
|
|
105
|
+
contactEmail: string;
|
|
106
|
+
contactPhone: string;
|
|
107
|
+
created: string;
|
|
108
|
+
updated: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
supplierCombobox: {
|
|
112
|
+
placeholder: string;
|
|
113
|
+
empty: string;
|
|
114
|
+
loading: string;
|
|
115
|
+
};
|
|
116
|
+
dialogs: {
|
|
117
|
+
supplier: {
|
|
118
|
+
newTitle: string;
|
|
119
|
+
editTitle: string;
|
|
120
|
+
nameLabel: string;
|
|
121
|
+
namePlaceholder: string;
|
|
122
|
+
typeLabel: string;
|
|
123
|
+
statusLabel: string;
|
|
124
|
+
descriptionLabel: string;
|
|
125
|
+
descriptionPlaceholder: string;
|
|
126
|
+
emailLabel: string;
|
|
127
|
+
emailPlaceholder: string;
|
|
128
|
+
phoneLabel: string;
|
|
129
|
+
phonePlaceholder: string;
|
|
130
|
+
websiteLabel: string;
|
|
131
|
+
websitePlaceholder: string;
|
|
132
|
+
addressLabel: string;
|
|
133
|
+
addressPlaceholder: string;
|
|
134
|
+
cityLabel: string;
|
|
135
|
+
cityPlaceholder: string;
|
|
136
|
+
countryLabel: string;
|
|
137
|
+
countryPlaceholder: string;
|
|
138
|
+
defaultCurrencyLabel: string;
|
|
139
|
+
defaultCurrencyPlaceholder: string;
|
|
140
|
+
reservationTimeoutLabel: string;
|
|
141
|
+
reservationTimeoutPlaceholder: string;
|
|
142
|
+
contactNameLabel: string;
|
|
143
|
+
contactNamePlaceholder: string;
|
|
144
|
+
contactEmailLabel: string;
|
|
145
|
+
contactEmailPlaceholder: string;
|
|
146
|
+
contactPhoneLabel: string;
|
|
147
|
+
contactPhonePlaceholder: string;
|
|
148
|
+
validationNameRequired: string;
|
|
149
|
+
validationIsoCurrency: string;
|
|
150
|
+
validationReservationTimeout: string;
|
|
151
|
+
};
|
|
152
|
+
service: {
|
|
153
|
+
newTitle: string;
|
|
154
|
+
editTitle: string;
|
|
155
|
+
serviceTypeLabel: string;
|
|
156
|
+
nameLabel: string;
|
|
157
|
+
namePlaceholder: string;
|
|
158
|
+
descriptionLabel: string;
|
|
159
|
+
descriptionPlaceholder: string;
|
|
160
|
+
durationLabel: string;
|
|
161
|
+
durationPlaceholder: string;
|
|
162
|
+
capacityLabel: string;
|
|
163
|
+
capacityPlaceholder: string;
|
|
164
|
+
activeLabel: string;
|
|
165
|
+
validationNameRequired: string;
|
|
166
|
+
};
|
|
167
|
+
rate: {
|
|
168
|
+
newTitle: string;
|
|
169
|
+
editTitle: string;
|
|
170
|
+
seasonNameLabel: string;
|
|
171
|
+
seasonNamePlaceholder: string;
|
|
172
|
+
currencyLabel: string;
|
|
173
|
+
currencyPlaceholder: string;
|
|
174
|
+
amountLabel: string;
|
|
175
|
+
amountPlaceholder: string;
|
|
176
|
+
unitLabel: string;
|
|
177
|
+
validFromLabel: string;
|
|
178
|
+
validToLabel: string;
|
|
179
|
+
minPaxLabel: string;
|
|
180
|
+
minPaxPlaceholder: string;
|
|
181
|
+
maxPaxLabel: string;
|
|
182
|
+
maxPaxPlaceholder: string;
|
|
183
|
+
notesLabel: string;
|
|
184
|
+
notesPlaceholder: string;
|
|
185
|
+
validationNameRequired: string;
|
|
186
|
+
validationIsoCurrency: string;
|
|
187
|
+
validationNonNegative: string;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
supplierServiceRow: {
|
|
191
|
+
rates: string;
|
|
192
|
+
addRate: string;
|
|
193
|
+
noRates: string;
|
|
194
|
+
columns: {
|
|
195
|
+
name: string;
|
|
196
|
+
amount: string;
|
|
197
|
+
unit: string;
|
|
198
|
+
valid: string;
|
|
199
|
+
pax: string;
|
|
200
|
+
};
|
|
201
|
+
validFallback: string;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
//# sourceMappingURL=en.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/suppliers/i18n/en.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0MK,CAAA"}
|