@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
package/dist/schemas.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const paginatedEnvelope = (item) => z.object({
|
|
3
|
+
data: z.array(item),
|
|
4
|
+
total: z.number().int(),
|
|
5
|
+
limit: z.number().int(),
|
|
6
|
+
offset: z.number().int(),
|
|
7
|
+
});
|
|
8
|
+
export const singleEnvelope = (item) => z.object({ data: item });
|
|
9
|
+
export const successEnvelope = z.object({ success: z.boolean() });
|
|
10
|
+
export const supplierOptionSchema = z.object({
|
|
11
|
+
id: z.string(),
|
|
12
|
+
name: z.string(),
|
|
13
|
+
});
|
|
14
|
+
export const productOptionSchema = z.object({
|
|
15
|
+
id: z.string(),
|
|
16
|
+
name: z.string(),
|
|
17
|
+
});
|
|
18
|
+
export const bookingOptionSchema = z.object({
|
|
19
|
+
id: z.string(),
|
|
20
|
+
bookingNumber: z.string(),
|
|
21
|
+
});
|
|
22
|
+
export const channelKindSchema = z.enum([
|
|
23
|
+
"direct",
|
|
24
|
+
"affiliate",
|
|
25
|
+
"ota",
|
|
26
|
+
"reseller",
|
|
27
|
+
"marketplace",
|
|
28
|
+
"api_partner",
|
|
29
|
+
"connect",
|
|
30
|
+
]);
|
|
31
|
+
export const channelStatusSchema = z.enum(["active", "inactive", "pending", "archived"]);
|
|
32
|
+
export const contractStatusSchema = z.enum(["draft", "active", "expired", "terminated"]);
|
|
33
|
+
export const paymentOwnerSchema = z.enum(["operator", "channel", "split"]);
|
|
34
|
+
export const cancellationOwnerSchema = z.enum(["operator", "channel", "mixed"]);
|
|
35
|
+
export const commissionScopeSchema = z.enum(["booking", "product", "rate", "category"]);
|
|
36
|
+
export const commissionTypeSchema = z.enum(["fixed", "percentage"]);
|
|
37
|
+
export const webhookStatusSchema = z.enum(["pending", "processed", "failed", "ignored"]);
|
|
38
|
+
export const channelRecordSchema = z.object({
|
|
39
|
+
id: z.string(),
|
|
40
|
+
name: z.string(),
|
|
41
|
+
kind: channelKindSchema,
|
|
42
|
+
status: channelStatusSchema,
|
|
43
|
+
website: z.string().nullable(),
|
|
44
|
+
contactName: z.string().nullable(),
|
|
45
|
+
contactEmail: z.string().nullable(),
|
|
46
|
+
metadata: z.record(z.string(), z.unknown()).nullable(),
|
|
47
|
+
});
|
|
48
|
+
export const channelDetailSchema = channelRecordSchema.extend({
|
|
49
|
+
createdAt: z.string(),
|
|
50
|
+
updatedAt: z.string(),
|
|
51
|
+
});
|
|
52
|
+
export const channelContractRecordSchema = z.object({
|
|
53
|
+
id: z.string(),
|
|
54
|
+
channelId: z.string(),
|
|
55
|
+
supplierId: z.string().nullable(),
|
|
56
|
+
status: contractStatusSchema,
|
|
57
|
+
startsAt: z.string(),
|
|
58
|
+
endsAt: z.string().nullable(),
|
|
59
|
+
paymentOwner: paymentOwnerSchema,
|
|
60
|
+
cancellationOwner: cancellationOwnerSchema,
|
|
61
|
+
settlementTerms: z.string().nullable(),
|
|
62
|
+
notes: z.string().nullable(),
|
|
63
|
+
});
|
|
64
|
+
export const channelContractDetailSchema = channelContractRecordSchema.extend({
|
|
65
|
+
createdAt: z.string(),
|
|
66
|
+
updatedAt: z.string(),
|
|
67
|
+
});
|
|
68
|
+
export const channelCommissionRuleRecordSchema = z.object({
|
|
69
|
+
id: z.string(),
|
|
70
|
+
contractId: z.string(),
|
|
71
|
+
scope: commissionScopeSchema,
|
|
72
|
+
productId: z.string().nullable(),
|
|
73
|
+
externalRateId: z.string().nullable(),
|
|
74
|
+
externalCategoryId: z.string().nullable(),
|
|
75
|
+
commissionType: commissionTypeSchema,
|
|
76
|
+
amountCents: z.number().int().nullable(),
|
|
77
|
+
percentBasisPoints: z.number().int().nullable(),
|
|
78
|
+
validFrom: z.string().nullable(),
|
|
79
|
+
validTo: z.string().nullable(),
|
|
80
|
+
});
|
|
81
|
+
export const channelCommissionRuleDetailSchema = channelCommissionRuleRecordSchema.extend({
|
|
82
|
+
createdAt: z.string(),
|
|
83
|
+
updatedAt: z.string(),
|
|
84
|
+
});
|
|
85
|
+
export const channelProductMappingRecordSchema = z.object({
|
|
86
|
+
id: z.string(),
|
|
87
|
+
channelId: z.string(),
|
|
88
|
+
productId: z.string(),
|
|
89
|
+
externalProductId: z.string(),
|
|
90
|
+
externalRateId: z.string().nullable(),
|
|
91
|
+
externalCategoryId: z.string().nullable(),
|
|
92
|
+
active: z.boolean(),
|
|
93
|
+
});
|
|
94
|
+
export const channelProductMappingDetailSchema = channelProductMappingRecordSchema.extend({
|
|
95
|
+
createdAt: z.string(),
|
|
96
|
+
updatedAt: z.string(),
|
|
97
|
+
});
|
|
98
|
+
export const channelBookingLinkRecordSchema = z.object({
|
|
99
|
+
id: z.string(),
|
|
100
|
+
channelId: z.string(),
|
|
101
|
+
bookingId: z.string(),
|
|
102
|
+
externalBookingId: z.string().nullable(),
|
|
103
|
+
externalReference: z.string().nullable(),
|
|
104
|
+
externalStatus: z.string().nullable(),
|
|
105
|
+
bookedAtExternal: z.string().nullable(),
|
|
106
|
+
lastSyncedAt: z.string().nullable(),
|
|
107
|
+
});
|
|
108
|
+
export const channelBookingLinkDetailSchema = channelBookingLinkRecordSchema.extend({
|
|
109
|
+
createdAt: z.string(),
|
|
110
|
+
updatedAt: z.string(),
|
|
111
|
+
});
|
|
112
|
+
export const channelWebhookEventRecordSchema = z.object({
|
|
113
|
+
id: z.string(),
|
|
114
|
+
channelId: z.string(),
|
|
115
|
+
eventType: z.string(),
|
|
116
|
+
externalEventId: z.string().nullable(),
|
|
117
|
+
payload: z.record(z.string(), z.unknown()),
|
|
118
|
+
receivedAt: z.string().nullable(),
|
|
119
|
+
processedAt: z.string().nullable(),
|
|
120
|
+
status: webhookStatusSchema,
|
|
121
|
+
errorMessage: z.string().nullable(),
|
|
122
|
+
});
|
|
123
|
+
export const channelWebhookEventDetailSchema = channelWebhookEventRecordSchema.extend({
|
|
124
|
+
createdAt: z.string(),
|
|
125
|
+
updatedAt: z.string(),
|
|
126
|
+
});
|
|
127
|
+
export const supplierListResponse = paginatedEnvelope(supplierOptionSchema);
|
|
128
|
+
export const productListResponse = paginatedEnvelope(productOptionSchema);
|
|
129
|
+
export const bookingListResponse = paginatedEnvelope(bookingOptionSchema);
|
|
130
|
+
export const channelListResponse = paginatedEnvelope(channelRecordSchema);
|
|
131
|
+
export const channelContractListResponse = paginatedEnvelope(channelContractRecordSchema);
|
|
132
|
+
export const channelCommissionRuleListResponse = paginatedEnvelope(channelCommissionRuleRecordSchema);
|
|
133
|
+
export const channelProductMappingListResponse = paginatedEnvelope(channelProductMappingRecordSchema);
|
|
134
|
+
export const channelBookingLinkListResponse = paginatedEnvelope(channelBookingLinkRecordSchema);
|
|
135
|
+
export const channelWebhookEventListResponse = paginatedEnvelope(channelWebhookEventRecordSchema);
|
|
136
|
+
export const supplierSingleResponse = singleEnvelope(supplierOptionSchema);
|
|
137
|
+
export const productSingleResponse = singleEnvelope(productOptionSchema);
|
|
138
|
+
export const bookingSingleResponse = singleEnvelope(bookingOptionSchema);
|
|
139
|
+
export const channelSingleResponse = singleEnvelope(channelDetailSchema);
|
|
140
|
+
export const channelContractSingleResponse = singleEnvelope(channelContractDetailSchema);
|
|
141
|
+
export const channelCommissionRuleSingleResponse = singleEnvelope(channelCommissionRuleDetailSchema);
|
|
142
|
+
export const channelProductMappingSingleResponse = singleEnvelope(channelProductMappingDetailSchema);
|
|
143
|
+
export const channelBookingLinkSingleResponse = singleEnvelope(channelBookingLinkDetailSchema);
|
|
144
|
+
export const channelWebhookEventSingleResponse = singleEnvelope(channelWebhookEventDetailSchema);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type AdminExtension } from "@voyant-travel/admin";
|
|
2
|
+
/**
|
|
3
|
+
* Semantic destinations the suppliers admin surfaces navigate to
|
|
4
|
+
* (packaged-admin RFC §4.7). The supplier pages link between the list and
|
|
5
|
+
* the detail page, so instead of importing a host route tree they resolve
|
|
6
|
+
* these keys through `useAdminHref`/`useAdminNavigate` from
|
|
7
|
+
* `@voyant-travel/admin`. Hosts register one resolver per key
|
|
8
|
+
* (`satisfies AdminDestinationResolvers`).
|
|
9
|
+
*
|
|
10
|
+
* `supplier.detail` is also declared by `@voyant-travel/catalog-react/admin` and
|
|
11
|
+
* `@voyant-travel/finance-react/admin` — interface merging requires the member shape
|
|
12
|
+
* to stay identical across packages.
|
|
13
|
+
*/
|
|
14
|
+
declare module "@voyant-travel/admin" {
|
|
15
|
+
interface AdminDestinations {
|
|
16
|
+
/** The suppliers list page. */
|
|
17
|
+
"supplier.list": Record<string, never>;
|
|
18
|
+
/** A supplier's detail page. */
|
|
19
|
+
"supplier.detail": {
|
|
20
|
+
supplierId: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export { supplierDetailPaymentPolicySlot } from "./slots.js";
|
|
25
|
+
export type { SupplierDetailHostProps, SupplierDetailHostSlotContext, } from "./supplier-detail-host.js";
|
|
26
|
+
export { SupplierDetailSkeleton } from "./supplier-detail-skeleton.js";
|
|
27
|
+
export { SuppliersListSkeleton } from "./suppliers-list-skeleton.js";
|
|
28
|
+
export interface CreateSuppliersAdminExtensionOptions {
|
|
29
|
+
/** Mount path of the supplier pages inside the admin workspace. Default `/suppliers`. */
|
|
30
|
+
basePath?: string;
|
|
31
|
+
/** Localized page titles. Defaults are the English operator nav labels. */
|
|
32
|
+
labels?: {
|
|
33
|
+
suppliers?: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The suppliers admin contribution (packaged-admin RFC Phase 3,
|
|
38
|
+
* `@voyant-travel/<domain>-ui/admin` convention).
|
|
39
|
+
*
|
|
40
|
+
* NAVIGATION: deliberately none. The Suppliers nav item is part of the BASE
|
|
41
|
+
* operator navigation — see `createOperatorAdminNavigation` in
|
|
42
|
+
* `@voyant-travel/admin` — so contributing nav entries here would duplicate it.
|
|
43
|
+
* If the base nav ever drops the suppliers item, this extension is where the
|
|
44
|
+
* entry moves.
|
|
45
|
+
*
|
|
46
|
+
* ROUTES: contributions carry the FULL route implementation (packaged-admin
|
|
47
|
+
* RFC §4.2/§4.8) — lazy `page` module loaders, data loaders fed by the
|
|
48
|
+
* host-supplied {@link AdminRouteLoaderContext} (QueryClient + runtime +
|
|
49
|
+
* params), per-route SSR mode, and pending skeletons. Hosts bind them into
|
|
50
|
+
* their code-assembled admin route tree; no per-route host files needed.
|
|
51
|
+
* The pages stay code-split because each contribution's `page` dynamically
|
|
52
|
+
* imports the specific host/page module — never the admin barrel — so the
|
|
53
|
+
* heavy page chunks load on navigation, not with workspace chrome.
|
|
54
|
+
* {@link SuppliersHost} mounts as a zero-prop page; the detail page reads
|
|
55
|
+
* the supplier id from {@link AdminRoutePageProps} via the default-exported
|
|
56
|
+
* wrapper in `./pages/`. The list carries no URL search state (filters stay
|
|
57
|
+
* local), so no `validateSearch` contracts. The pages bind to their data
|
|
58
|
+
* wiring (the shared suppliers provider context) and resolve every
|
|
59
|
+
* cross-route link through the semantic destinations declared above — no
|
|
60
|
+
* app RPC client, no host route tree.
|
|
61
|
+
*
|
|
62
|
+
* WIDGETS: none contributed, but {@link SupplierDetailHost} exposes the
|
|
63
|
+
* `supplier.details.payment-policy` slot ({@link
|
|
64
|
+
* supplierDetailPaymentPolicySlot}) — the §4.7 cycle resolution that lets
|
|
65
|
+
* `@voyant-travel/finance-react/ui` (which depends on this package) contribute the
|
|
66
|
+
* finance-owned customer-payment-policy card to the supplier detail page.
|
|
67
|
+
*/
|
|
68
|
+
export declare function createSuppliersAdminExtension(options?: CreateSuppliersAdminExtensionOptions): AdminExtension;
|
|
69
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/suppliers/admin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,sBAAsB,CAAA;AAU7B;;;;;;;;;;;GAWG;AACH,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,iBAAiB;QACzB,+BAA+B;QAC/B,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;QACtC,gCAAgC;QAChC,iBAAiB,EAAE;YAAE,UAAU,EAAE,MAAM,CAAA;SAAE,CAAA;KAC1C;CACF;AAWD,OAAO,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAA;AAC5D,YAAY,EACV,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAEpE,MAAM,WAAW,oCAAoC;IACnD,yFAAyF;IACzF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2EAA2E;IAC3E,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAA;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,oCAAyC,GACjD,cAAc,CAkEhB"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { adminRoutePageModule, defineAdminExtension, } from "@voyant-travel/admin";
|
|
2
|
+
// Lean statics only: the client module (fetcher) and the skeletons. Query
|
|
3
|
+
// options resolve via dynamic import inside the loaders so the suppliers
|
|
4
|
+
// data layer (client + response schemas) stays out of the workspace-chrome
|
|
5
|
+
// chunk that evaluates this factory.
|
|
6
|
+
import { defaultFetcher } from "../client.js";
|
|
7
|
+
import { SupplierDetailSkeleton } from "./supplier-detail-skeleton.js";
|
|
8
|
+
import { SuppliersListSkeleton } from "./suppliers-list-skeleton.js";
|
|
9
|
+
// Packaged admin hosts (packaged-admin RFC Phase 3): the supplier pages
|
|
10
|
+
// bound to their data wiring + semantic-destination navigation. Host route
|
|
11
|
+
// files only bind route params onto these.
|
|
12
|
+
//
|
|
13
|
+
// Endgame rule (packaged-admin RFC §4.8): this barrel re-exports NO page
|
|
14
|
+
// or host component values — it is evaluated with the workspace chrome, so
|
|
15
|
+
// a static host re-export would pin the heavy page modules into the entry
|
|
16
|
+
// chunk. Hosts import from their specific modules; only their TYPES
|
|
17
|
+
// re-export here, plus the lean slot id and skeletons.
|
|
18
|
+
export { supplierDetailPaymentPolicySlot } from "./slots.js";
|
|
19
|
+
export { SupplierDetailSkeleton } from "./supplier-detail-skeleton.js";
|
|
20
|
+
export { SuppliersListSkeleton } from "./suppliers-list-skeleton.js";
|
|
21
|
+
/**
|
|
22
|
+
* The suppliers admin contribution (packaged-admin RFC Phase 3,
|
|
23
|
+
* `@voyant-travel/<domain>-ui/admin` convention).
|
|
24
|
+
*
|
|
25
|
+
* NAVIGATION: deliberately none. The Suppliers nav item is part of the BASE
|
|
26
|
+
* operator navigation — see `createOperatorAdminNavigation` in
|
|
27
|
+
* `@voyant-travel/admin` — so contributing nav entries here would duplicate it.
|
|
28
|
+
* If the base nav ever drops the suppliers item, this extension is where the
|
|
29
|
+
* entry moves.
|
|
30
|
+
*
|
|
31
|
+
* ROUTES: contributions carry the FULL route implementation (packaged-admin
|
|
32
|
+
* RFC §4.2/§4.8) — lazy `page` module loaders, data loaders fed by the
|
|
33
|
+
* host-supplied {@link AdminRouteLoaderContext} (QueryClient + runtime +
|
|
34
|
+
* params), per-route SSR mode, and pending skeletons. Hosts bind them into
|
|
35
|
+
* their code-assembled admin route tree; no per-route host files needed.
|
|
36
|
+
* The pages stay code-split because each contribution's `page` dynamically
|
|
37
|
+
* imports the specific host/page module — never the admin barrel — so the
|
|
38
|
+
* heavy page chunks load on navigation, not with workspace chrome.
|
|
39
|
+
* {@link SuppliersHost} mounts as a zero-prop page; the detail page reads
|
|
40
|
+
* the supplier id from {@link AdminRoutePageProps} via the default-exported
|
|
41
|
+
* wrapper in `./pages/`. The list carries no URL search state (filters stay
|
|
42
|
+
* local), so no `validateSearch` contracts. The pages bind to their data
|
|
43
|
+
* wiring (the shared suppliers provider context) and resolve every
|
|
44
|
+
* cross-route link through the semantic destinations declared above — no
|
|
45
|
+
* app RPC client, no host route tree.
|
|
46
|
+
*
|
|
47
|
+
* WIDGETS: none contributed, but {@link SupplierDetailHost} exposes the
|
|
48
|
+
* `supplier.details.payment-policy` slot ({@link
|
|
49
|
+
* supplierDetailPaymentPolicySlot}) — the §4.7 cycle resolution that lets
|
|
50
|
+
* `@voyant-travel/finance-react/ui` (which depends on this package) contribute the
|
|
51
|
+
* finance-owned customer-payment-policy card to the supplier detail page.
|
|
52
|
+
*/
|
|
53
|
+
export function createSuppliersAdminExtension(options = {}) {
|
|
54
|
+
const { basePath = "/suppliers", labels = {} } = options;
|
|
55
|
+
const { suppliers = "Suppliers" } = labels;
|
|
56
|
+
return defineAdminExtension({
|
|
57
|
+
id: "suppliers",
|
|
58
|
+
routes: [
|
|
59
|
+
{
|
|
60
|
+
id: "suppliers-index",
|
|
61
|
+
path: basePath,
|
|
62
|
+
title: suppliers,
|
|
63
|
+
// Route-backed destination (RFC §4.7 endgame): the key resolves by
|
|
64
|
+
// pure path interpolation of this route, so the host's resolver is
|
|
65
|
+
// generated (`voyant admin generate --destinations`).
|
|
66
|
+
destination: "supplier.list",
|
|
67
|
+
ssr: "data-only",
|
|
68
|
+
page: () => import("./suppliers-host.js").then((module) => adminRoutePageModule(module.SuppliersHost)),
|
|
69
|
+
// Dynamic import on purpose: the query options pull the suppliers
|
|
70
|
+
// data layer (client + response schemas), and a static import here
|
|
71
|
+
// would pin it into the workspace-chrome chunk that evaluates this
|
|
72
|
+
// factory.
|
|
73
|
+
loader: async ({ queryClient, runtime }) => {
|
|
74
|
+
const { getSuppliersQueryOptions } = await import("../query-options.js");
|
|
75
|
+
return queryClient.ensureQueryData(getSuppliersQueryOptions(loaderClient(runtime)));
|
|
76
|
+
},
|
|
77
|
+
pendingComponent: SuppliersListSkeleton,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: "suppliers-detail",
|
|
81
|
+
path: `${basePath}/$id`,
|
|
82
|
+
title: suppliers,
|
|
83
|
+
destination: "supplier.detail",
|
|
84
|
+
destinationParams: { id: "supplierId" },
|
|
85
|
+
page: () => import("./pages/supplier-detail-page.js"),
|
|
86
|
+
loader: async ({ queryClient, runtime, params }) => {
|
|
87
|
+
const id = params.id;
|
|
88
|
+
if (!id)
|
|
89
|
+
return;
|
|
90
|
+
// Dynamic import on purpose — see the suppliers index loader above.
|
|
91
|
+
const { getSupplierNotesQueryOptions, getSupplierQueryOptions, getSupplierServiceRatesQueryOptions, getSupplierServicesQueryOptions, } = await import("../query-options.js");
|
|
92
|
+
const client = loaderClient(runtime);
|
|
93
|
+
const servicesData = await queryClient.ensureQueryData(getSupplierServicesQueryOptions(client, id));
|
|
94
|
+
await Promise.all([
|
|
95
|
+
queryClient.ensureQueryData(getSupplierQueryOptions(client, id)),
|
|
96
|
+
queryClient.ensureQueryData(getSupplierNotesQueryOptions(client, id)),
|
|
97
|
+
...servicesData.data.map((service) => queryClient.ensureQueryData(getSupplierServiceRatesQueryOptions(client, id, service.id))),
|
|
98
|
+
]);
|
|
99
|
+
},
|
|
100
|
+
pendingComponent: SupplierDetailSkeleton,
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Bridge the host-supplied {@link AdminRouteRuntime} (optional fetcher) to
|
|
107
|
+
* the required-fetcher client contract the supplier query options take.
|
|
108
|
+
*/
|
|
109
|
+
function loaderClient(runtime) {
|
|
110
|
+
return { baseUrl: runtime.baseUrl, fetcher: runtime.fetcher ?? defaultFetcher };
|
|
111
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AdminRoutePageProps } from "@voyant-travel/admin";
|
|
2
|
+
/**
|
|
3
|
+
* Param-taking page for the `suppliers-detail` contribution: reads the
|
|
4
|
+
* supplier id off {@link AdminRoutePageProps} and binds it onto the packaged
|
|
5
|
+
* host. Resolved lazily through the contribution's `page` loader so the
|
|
6
|
+
* detail page lands in its own chunk.
|
|
7
|
+
*/
|
|
8
|
+
export default function SupplierDetailPage({ params }: AdminRoutePageProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=supplier-detail-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supplier-detail-page.d.ts","sourceRoot":"","sources":["../../../../src/suppliers/admin/pages/supplier-detail-page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAI/D;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,mBAAmB,2CAEzE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { SupplierDetailHost } from "../supplier-detail-host.js";
|
|
3
|
+
/**
|
|
4
|
+
* Param-taking page for the `suppliers-detail` contribution: reads the
|
|
5
|
+
* supplier id off {@link AdminRoutePageProps} and binds it onto the packaged
|
|
6
|
+
* host. Resolved lazily through the contribution's `page` loader so the
|
|
7
|
+
* detail page lands in its own chunk.
|
|
8
|
+
*/
|
|
9
|
+
export default function SupplierDetailPage({ params }) {
|
|
10
|
+
return _jsx(SupplierDetailHost, { id: params.id ?? "" });
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Widget slot ids exposed by the suppliers admin host pages.
|
|
3
|
+
*
|
|
4
|
+
* Kept in their own module (no component imports) so slot-id consumers —
|
|
5
|
+
* other domains' admin extension factories, which live in the host's
|
|
6
|
+
* eagerly-evaluated workspace-chrome chunk — can import them without
|
|
7
|
+
* pulling the heavy supplier detail host into the entry graph.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Widget slot rendered as the supplier detail page's customer-payment-policy
|
|
11
|
+
* card (packaged-admin RFC §4.7 cycle resolution): `@voyant-travel/finance-react/ui`
|
|
12
|
+
* depends on this package, so the host cannot import the finance-owned
|
|
13
|
+
* payment-policy form/preview directly — instead finance's admin extension
|
|
14
|
+
* contributes a widget targeting this slot and the host renders the section
|
|
15
|
+
* whenever a contribution exists. Widgets receive
|
|
16
|
+
* `SupplierDetailHostSlotContext` as props.
|
|
17
|
+
*/
|
|
18
|
+
export declare const supplierDetailPaymentPolicySlot = "supplier.details.payment-policy";
|
|
19
|
+
//# sourceMappingURL=slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../../src/suppliers/admin/slots.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,+BAA+B,oCAAoC,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Widget slot ids exposed by the suppliers admin host pages.
|
|
3
|
+
*
|
|
4
|
+
* Kept in their own module (no component imports) so slot-id consumers —
|
|
5
|
+
* other domains' admin extension factories, which live in the host's
|
|
6
|
+
* eagerly-evaluated workspace-chrome chunk — can import them without
|
|
7
|
+
* pulling the heavy supplier detail host into the entry graph.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Widget slot rendered as the supplier detail page's customer-payment-policy
|
|
11
|
+
* card (packaged-admin RFC §4.7 cycle resolution): `@voyant-travel/finance-react/ui`
|
|
12
|
+
* depends on this package, so the host cannot import the finance-owned
|
|
13
|
+
* payment-policy form/preview directly — instead finance's admin extension
|
|
14
|
+
* contributes a widget targeting this slot and the host renders the section
|
|
15
|
+
* whenever a contribution exists. Widgets receive
|
|
16
|
+
* `SupplierDetailHostSlotContext` as props.
|
|
17
|
+
*/
|
|
18
|
+
export const supplierDetailPaymentPolicySlot = "supplier.details.payment-policy";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Supplier, UpdateSupplierInput } from "../index.js";
|
|
2
|
+
import { supplierDetailPaymentPolicySlot } from "./slots.js";
|
|
3
|
+
export { supplierDetailPaymentPolicySlot };
|
|
4
|
+
/**
|
|
5
|
+
* Render context handed to widget contributions targeting
|
|
6
|
+
* {@link supplierDetailPaymentPolicySlot}. Mirrors the canonical page's
|
|
7
|
+
* `renderCustomerPaymentPolicy` args: the supplier plus the page-owned
|
|
8
|
+
* update mutation so contributed cards persist without re-deriving it.
|
|
9
|
+
*/
|
|
10
|
+
export interface SupplierDetailHostSlotContext {
|
|
11
|
+
supplier: Supplier;
|
|
12
|
+
updateSupplier: (input: UpdateSupplierInput) => Promise<Supplier>;
|
|
13
|
+
isUpdating: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface SupplierDetailHostProps {
|
|
16
|
+
id: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Packaged admin host for the canonical `SupplierDetailPage` (packaged-admin
|
|
20
|
+
* RFC Phase 3). Owns everything package-clean:
|
|
21
|
+
*
|
|
22
|
+
* - Cross-route links resolve through semantic destinations (RFC §4.7):
|
|
23
|
+
* back/deleted navigate to `"supplier.list"` — no host route tree import.
|
|
24
|
+
* - Locale comes from the admin chrome (`useLocale`).
|
|
25
|
+
* - The customer-payment-policy section mounts through
|
|
26
|
+
* {@link supplierDetailPaymentPolicySlot} whenever a widget contribution
|
|
27
|
+
* targets it (finance-ui contributes its card there).
|
|
28
|
+
*/
|
|
29
|
+
export declare function SupplierDetailHost({ id }: SupplierDetailHostProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=supplier-detail-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supplier-detail-host.d.ts","sourceRoot":"","sources":["../../../src/suppliers/admin/supplier-detail-host.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAA;AAM5D,OAAO,EAAE,+BAA+B,EAAE,CAAA;AAE1C;;;;;GAKG;AACH,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,EAAE,QAAQ,CAAA;IAClB,cAAc,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;IACjE,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAA;CACX;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,EAAE,EAAE,uBAAuB,2CA6BjE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { AdminWidgetSlotRenderer, resolveAdminWidgets, useAdminExtensions, useAdminNavigate, useLocale, } from "@voyant-travel/admin";
|
|
4
|
+
import { SupplierDetailPage } from "../components/supplier-detail-page.js";
|
|
5
|
+
import { supplierDetailPaymentPolicySlot } from "./slots.js";
|
|
6
|
+
// The slot id lives in `./slots.js` — a lean, component-free module — so
|
|
7
|
+
// other domains' admin extension factories (evaluated with workspace chrome)
|
|
8
|
+
// can import it without pulling this host into the entry chunk.
|
|
9
|
+
// Re-exported here for backwards compatibility.
|
|
10
|
+
export { supplierDetailPaymentPolicySlot };
|
|
11
|
+
/**
|
|
12
|
+
* Packaged admin host for the canonical `SupplierDetailPage` (packaged-admin
|
|
13
|
+
* RFC Phase 3). Owns everything package-clean:
|
|
14
|
+
*
|
|
15
|
+
* - Cross-route links resolve through semantic destinations (RFC §4.7):
|
|
16
|
+
* back/deleted navigate to `"supplier.list"` — no host route tree import.
|
|
17
|
+
* - Locale comes from the admin chrome (`useLocale`).
|
|
18
|
+
* - The customer-payment-policy section mounts through
|
|
19
|
+
* {@link supplierDetailPaymentPolicySlot} whenever a widget contribution
|
|
20
|
+
* targets it (finance-ui contributes its card there).
|
|
21
|
+
*/
|
|
22
|
+
export function SupplierDetailHost({ id }) {
|
|
23
|
+
const { resolvedLocale } = useLocale();
|
|
24
|
+
const navigateTo = useAdminNavigate();
|
|
25
|
+
// Finance (or any extension that may not be imported by this package)
|
|
26
|
+
// contributes the payment-policy card as widget contributions; the section
|
|
27
|
+
// renders only when at least one widget targets the slot.
|
|
28
|
+
const adminExtensions = useAdminExtensions();
|
|
29
|
+
const hasPaymentPolicyWidgets = resolveAdminWidgets({ slot: supplierDetailPaymentPolicySlot, extensions: adminExtensions })
|
|
30
|
+
.length > 0;
|
|
31
|
+
return (_jsx(SupplierDetailPage, { id: id, locale: resolvedLocale, onBack: () => navigateTo("supplier.list", {}), onDeleted: () => navigateTo("supplier.list", {}), renderCustomerPaymentPolicy: hasPaymentPolicyWidgets
|
|
32
|
+
? (context) => (_jsx(AdminWidgetSlotRenderer, { slot: supplierDetailPaymentPolicySlot, props: { ...context } }))
|
|
33
|
+
: undefined }));
|
|
34
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout-matched route-level placeholder for `SupplierDetailPage`:
|
|
3
|
+
* - Back button + name + status pill + edit/delete actions
|
|
4
|
+
* - 2-col summary cards (Supplier Details + Primary Contact)
|
|
5
|
+
* - Services card (full width) with expandable rows
|
|
6
|
+
* - Notes card (full width)
|
|
7
|
+
*/
|
|
8
|
+
export declare function SupplierDetailSkeleton(): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=supplier-detail-skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supplier-detail-skeleton.d.ts","sourceRoot":"","sources":["../../../src/suppliers/admin/supplier-detail-skeleton.tsx"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wBAAgB,sBAAsB,4CA6CrC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Card, CardContent, CardHeader } from "@voyant-travel/ui/components/card";
|
|
4
|
+
import { Skeleton } from "@voyant-travel/ui/components/skeleton";
|
|
5
|
+
/**
|
|
6
|
+
* Layout-matched route-level placeholder for `SupplierDetailPage`:
|
|
7
|
+
* - Back button + name + status pill + edit/delete actions
|
|
8
|
+
* - 2-col summary cards (Supplier Details + Primary Contact)
|
|
9
|
+
* - Services card (full width) with expandable rows
|
|
10
|
+
* - Notes card (full width)
|
|
11
|
+
*/
|
|
12
|
+
export function SupplierDetailSkeleton() {
|
|
13
|
+
return (_jsxs("div", { className: "flex flex-col gap-6 p-6", children: [_jsx(Header, {}), _jsxs("div", { className: "grid gap-4 lg:grid-cols-2", children: [_jsx(SummaryCard, { titleWidth: "w-36", rows: 8 }), _jsx(SummaryCard, { titleWidth: "w-32", rows: 7 })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "flex flex-row items-center justify-between", children: [_jsx(Skeleton, { className: "h-5 w-20" }), _jsx(Skeleton, { className: "h-8 w-28" })] }), _jsx(CardContent, { className: "flex flex-col gap-2", children: Array.from({ length: 3 }, (_, index) => `service-${index}`).map((key) => (_jsxs("div", { className: "flex items-center gap-3 rounded-lg border px-4 py-3", children: [_jsx(Skeleton, { className: "h-4 w-4" }), _jsx(Skeleton, { className: "h-4 w-48" }), _jsx(Skeleton, { className: "h-5 w-16 rounded-full" }), _jsx("div", { className: "flex-1" }), _jsx(Skeleton, { className: "h-4 w-20" }), _jsx(Skeleton, { className: "h-8 w-8 rounded" })] }, key))) })] }), _jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx(Skeleton, { className: "h-5 w-16" }) }), _jsxs(CardContent, { className: "space-y-3", children: [_jsx(Skeleton, { className: "h-20 w-full" }), _jsxs("div", { className: "space-y-2", children: [_jsx(Skeleton, { className: "h-4 w-full" }), _jsx(Skeleton, { className: "h-4 w-3/4" })] })] })] })] }));
|
|
14
|
+
}
|
|
15
|
+
function Header() {
|
|
16
|
+
return (_jsxs("div", { className: "flex items-center gap-4", children: [_jsx(Skeleton, { className: "h-9 w-9 rounded-md" }), _jsxs("div", { className: "flex-1 space-y-2", children: [_jsx(Skeleton, { className: "h-7 w-64" }), _jsx("div", { className: "flex gap-2", children: _jsx(Skeleton, { className: "h-5 w-16 rounded-full" }) })] }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Skeleton, { className: "h-9 w-20" }), _jsx(Skeleton, { className: "h-9 w-24" })] })] }));
|
|
17
|
+
}
|
|
18
|
+
function SummaryCard({ titleWidth, rows }) {
|
|
19
|
+
return (_jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx(Skeleton, { className: `h-5 ${titleWidth}` }) }), _jsx(CardContent, { className: "grid gap-3", children: Array.from({ length: rows }, (_, index) => `row-${index}`).map((key) => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Skeleton, { className: "h-3.5 w-24" }), _jsx(Skeleton, { className: "h-3.5 w-32" })] }, key))) })] }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Packaged admin host for `SuppliersPage` (packaged-admin RFC Phase 3).
|
|
3
|
+
*
|
|
4
|
+
* No host route tree is imported — opening a supplier resolves the
|
|
5
|
+
* `"supplier.detail"` semantic destination (RFC §4.7) through the resolvers
|
|
6
|
+
* the workspace shell registered. The page keeps its filter/sort/paging
|
|
7
|
+
* state locally (no URL search contract), so the host takes no props and
|
|
8
|
+
* route files can attach it as a zero-prop `component:` directly.
|
|
9
|
+
*/
|
|
10
|
+
export declare function SuppliersHost(): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=suppliers-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suppliers-host.d.ts","sourceRoot":"","sources":["../../../src/suppliers/admin/suppliers-host.tsx"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,wBAAgB,aAAa,4CAQ5B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useAdminNavigate } from "@voyant-travel/admin";
|
|
4
|
+
import { SuppliersPage } from "../components/suppliers-page.js";
|
|
5
|
+
/**
|
|
6
|
+
* Packaged admin host for `SuppliersPage` (packaged-admin RFC Phase 3).
|
|
7
|
+
*
|
|
8
|
+
* No host route tree is imported — opening a supplier resolves the
|
|
9
|
+
* `"supplier.detail"` semantic destination (RFC §4.7) through the resolvers
|
|
10
|
+
* the workspace shell registered. The page keeps its filter/sort/paging
|
|
11
|
+
* state locally (no URL search contract), so the host takes no props and
|
|
12
|
+
* route files can attach it as a zero-prop `component:` directly.
|
|
13
|
+
*/
|
|
14
|
+
export function SuppliersHost() {
|
|
15
|
+
const navigateTo = useAdminNavigate();
|
|
16
|
+
return (_jsx(SuppliersPage, { onSupplierOpen: (supplier) => navigateTo("supplier.detail", { supplierId: supplier.id }) }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route-level placeholder for the suppliers list. Mirrors `SuppliersPage`:
|
|
3
|
+
* - Page title + description
|
|
4
|
+
* - Filter row: search input (left), Filters button, "New Supplier" (right)
|
|
5
|
+
* - 5-column table: Name / Type / Status / Country / Currency
|
|
6
|
+
* - Summary + pagination footer
|
|
7
|
+
*/
|
|
8
|
+
export declare function SuppliersListSkeleton(): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=suppliers-list-skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suppliers-list-skeleton.d.ts","sourceRoot":"","sources":["../../../src/suppliers/admin/suppliers-list-skeleton.tsx"],"names":[],"mappings":"AAcA;;;;;;GAMG;AACH,wBAAgB,qBAAqB,4CAuDpC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Skeleton } from "@voyant-travel/ui/components/skeleton";
|
|
4
|
+
import { useSuppliersUiMessagesOrDefault } from "../i18n/index.js";
|
|
5
|
+
const COLUMNS = [
|
|
6
|
+
{ id: "name", width: "w-40" },
|
|
7
|
+
{ id: "type", width: "w-20" },
|
|
8
|
+
{ id: "status", width: "w-16" },
|
|
9
|
+
{ id: "country", width: "w-20" },
|
|
10
|
+
{ id: "currency", width: "w-12" },
|
|
11
|
+
];
|
|
12
|
+
/**
|
|
13
|
+
* Route-level placeholder for the suppliers list. Mirrors `SuppliersPage`:
|
|
14
|
+
* - Page title + description
|
|
15
|
+
* - Filter row: search input (left), Filters button, "New Supplier" (right)
|
|
16
|
+
* - 5-column table: Name / Type / Status / Country / Currency
|
|
17
|
+
* - Summary + pagination footer
|
|
18
|
+
*/
|
|
19
|
+
export function SuppliersListSkeleton() {
|
|
20
|
+
const messages = useSuppliersUiMessagesOrDefault();
|
|
21
|
+
const columns = messages.suppliersPage.columns;
|
|
22
|
+
const titles = [columns.name, columns.type, columns.status, columns.country, columns.currency];
|
|
23
|
+
return (_jsxs("div", { className: "flex flex-col gap-6 p-6", children: [_jsxs("div", { className: "space-y-2", children: [_jsx(Skeleton, { className: "h-7 w-28" }), _jsx(Skeleton, { className: "h-4 w-80" })] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(Skeleton, { className: "h-9 min-w-[14rem] flex-1" }), _jsx(Skeleton, { className: "h-9 w-24" }), _jsx("div", { className: "ml-auto", children: _jsx(Skeleton, { className: "h-9 w-36" }) })] }), _jsx("div", { className: "overflow-hidden rounded-md border", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { className: "bg-muted/40 text-left text-muted-foreground", children: _jsx("tr", { children: titles.map((title) => (_jsx("th", { className: "px-4 py-3 font-medium", children: title }, title))) }) }), _jsx("tbody", { children: Array.from({ length: 8 }, (_, rowIndex) => `row-${rowIndex}`).map((rowKey) => (_jsx("tr", { className: "border-t", children: COLUMNS.map((column) => (_jsx("td", { className: "px-4 py-3", children: _jsx(Skeleton, { className: `h-4 ${column.width}` }) }, `${rowKey}-${column.id}`))) }, rowKey))) })] }) }), _jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [_jsx(Skeleton, { className: "h-4 w-44" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Skeleton, { className: "h-8 w-20" }), _jsx(Skeleton, { className: "h-4 w-20" }), _jsx(Skeleton, { className: "h-8 w-16" })] })] })] }));
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
export type VoyantFetcher = (url: string, init?: RequestInit) => Promise<Response>;
|
|
3
|
+
export declare const defaultFetcher: VoyantFetcher;
|
|
4
|
+
export declare class VoyantApiError extends Error {
|
|
5
|
+
readonly status: number;
|
|
6
|
+
readonly body: unknown;
|
|
7
|
+
constructor(message: string, status: number, body: unknown);
|
|
8
|
+
}
|
|
9
|
+
export interface FetchWithValidationOptions {
|
|
10
|
+
baseUrl: string;
|
|
11
|
+
fetcher: VoyantFetcher;
|
|
12
|
+
}
|
|
13
|
+
export declare function fetchWithValidation<TOut>(path: string, schema: z.ZodType<TOut>, options: FetchWithValidationOptions, init?: RequestInit): Promise<TOut>;
|
|
14
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/suppliers/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAE5B,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;AAElF,eAAO,MAAM,cAAc,EAAE,aACoB,CAAA;AAEjD,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;gBAEV,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO;CAM3D;AAcD,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,aAAa,CAAA;CACvB;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAC5C,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EACvB,OAAO,EAAE,0BAA0B,EACnC,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC,IAAI,CAAC,CAiCf"}
|