@open-mercato/core 0.6.6-develop.6094.1.28b081ea16 → 0.6.6-develop.6126.1.0b9392fdae
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/.turbo/turbo-build.log +1 -1
- package/dist/generated/entities/catalog_product/index.js +52 -0
- package/dist/generated/entities/catalog_product/index.js.map +2 -2
- package/dist/generated/entities/catalog_product_variant/index.js +4 -0
- package/dist/generated/entities/catalog_product_variant/index.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +28 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/modules/catalog/api/products/route.js +103 -33
- package/dist/modules/catalog/api/products/route.js.map +2 -2
- package/dist/modules/catalog/api/variants/route.js +4 -0
- package/dist/modules/catalog/api/variants/route.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js +46 -2
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js +4 -0
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/create/page.js +2 -0
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/create/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/create/page.js +42 -2
- package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
- package/dist/modules/catalog/commands/products.js +251 -14
- package/dist/modules/catalog/commands/products.js.map +2 -2
- package/dist/modules/catalog/commands/variants.js +72 -1
- package/dist/modules/catalog/commands/variants.js.map +2 -2
- package/dist/modules/catalog/components/products/ProductComplianceSection.js +500 -0
- package/dist/modules/catalog/components/products/ProductComplianceSection.js.map +7 -0
- package/dist/modules/catalog/components/products/VariantBuilder.js +39 -1
- package/dist/modules/catalog/components/products/VariantBuilder.js.map +2 -2
- package/dist/modules/catalog/components/products/productForm.js +164 -2
- package/dist/modules/catalog/components/products/productForm.js.map +2 -2
- package/dist/modules/catalog/components/products/variantForm.js +2 -0
- package/dist/modules/catalog/components/products/variantForm.js.map +2 -2
- package/dist/modules/catalog/data/entities.js +93 -0
- package/dist/modules/catalog/data/entities.js.map +2 -2
- package/dist/modules/catalog/data/types.js +28 -0
- package/dist/modules/catalog/data/types.js.map +2 -2
- package/dist/modules/catalog/data/validators.js +100 -5
- package/dist/modules/catalog/data/validators.js.map +2 -2
- package/dist/modules/catalog/lib/gtin.js +61 -0
- package/dist/modules/catalog/lib/gtin.js.map +7 -0
- package/dist/modules/catalog/migrations/Migration20260611090000.js +17 -0
- package/dist/modules/catalog/migrations/Migration20260611090000.js.map +7 -0
- package/dist/modules/catalog/translations.js +1 -1
- package/dist/modules/catalog/translations.js.map +2 -2
- package/dist/modules/configs/api/cache/route.js +60 -10
- package/dist/modules/configs/api/cache/route.js.map +3 -3
- package/dist/modules/configs/components/CachePanel.js +52 -29
- package/dist/modules/configs/components/CachePanel.js.map +2 -2
- package/dist/modules/currencies/api/currencies/options/route.js +18 -4
- package/dist/modules/currencies/api/currencies/options/route.js.map +2 -2
- package/dist/modules/currencies/services/rateFetchingService.js +35 -18
- package/dist/modules/currencies/services/rateFetchingService.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js +16 -16
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js +1 -1
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js.map +2 -2
- package/dist/modules/customers/backend/calendar/page.js +10 -0
- package/dist/modules/customers/backend/calendar/page.js.map +7 -0
- package/dist/modules/customers/backend/calendar/page.meta.js +25 -0
- package/dist/modules/customers/backend/calendar/page.meta.js.map +7 -0
- package/dist/modules/customers/cli.js +1 -0
- package/dist/modules/customers/cli.js.map +2 -2
- package/dist/modules/customers/components/calendar/AgendaList.js +182 -0
- package/dist/modules/customers/components/calendar/AgendaList.js.map +7 -0
- package/dist/modules/customers/components/calendar/CalendarEventEditor.js +331 -0
- package/dist/modules/customers/components/calendar/CalendarEventEditor.js.map +7 -0
- package/dist/modules/customers/components/calendar/CalendarFooter.js +48 -0
- package/dist/modules/customers/components/calendar/CalendarFooter.js.map +7 -0
- package/dist/modules/customers/components/calendar/CalendarHeader.js +36 -0
- package/dist/modules/customers/components/calendar/CalendarHeader.js.map +7 -0
- package/dist/modules/customers/components/calendar/CalendarScreen.js +516 -0
- package/dist/modules/customers/components/calendar/CalendarScreen.js.map +7 -0
- package/dist/modules/customers/components/calendar/CalendarSettingsModal.js +163 -0
- package/dist/modules/customers/components/calendar/CalendarSettingsModal.js.map +7 -0
- package/dist/modules/customers/components/calendar/CalendarTabs.js +60 -0
- package/dist/modules/customers/components/calendar/CalendarTabs.js.map +7 -0
- package/dist/modules/customers/components/calendar/CalendarToolbar.js +262 -0
- package/dist/modules/customers/components/calendar/CalendarToolbar.js.map +7 -0
- package/dist/modules/customers/components/calendar/EventBlock.js +149 -0
- package/dist/modules/customers/components/calendar/EventBlock.js.map +7 -0
- package/dist/modules/customers/components/calendar/EventPeekPopover.js +72 -0
- package/dist/modules/customers/components/calendar/EventPeekPopover.js.map +7 -0
- package/dist/modules/customers/components/calendar/MonthGrid.js +214 -0
- package/dist/modules/customers/components/calendar/MonthGrid.js.map +7 -0
- package/dist/modules/customers/components/calendar/ShortcutsDialog.js +44 -0
- package/dist/modules/customers/components/calendar/ShortcutsDialog.js.map +7 -0
- package/dist/modules/customers/components/calendar/TimeGrid.js +410 -0
- package/dist/modules/customers/components/calendar/TimeGrid.js.map +7 -0
- package/dist/modules/customers/components/calendar/UpcomingCards.js +175 -0
- package/dist/modules/customers/components/calendar/UpcomingCards.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/CategoryField.js +75 -0
- package/dist/modules/customers/components/calendar/editor/CategoryField.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/LocationField.js +30 -0
- package/dist/modules/customers/components/calendar/editor/LocationField.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/PeopleField.js +135 -0
- package/dist/modules/customers/components/calendar/editor/PeopleField.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/RelatedToField.js +218 -0
- package/dist/modules/customers/components/calendar/editor/RelatedToField.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/RepeatField.js +119 -0
- package/dist/modules/customers/components/calendar/editor/RepeatField.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/ScheduleSection.js +83 -0
- package/dist/modules/customers/components/calendar/editor/ScheduleSection.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/SegmentGroup.js +44 -0
- package/dist/modules/customers/components/calendar/editor/SegmentGroup.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/hooks.js +132 -0
- package/dist/modules/customers/components/calendar/editor/hooks.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/inputs.js +160 -0
- package/dist/modules/customers/components/calendar/editor/inputs.js.map +7 -0
- package/dist/modules/customers/components/calendar/editor/lookups.js +107 -0
- package/dist/modules/customers/components/calendar/editor/lookups.js.map +7 -0
- package/dist/modules/customers/components/calendar/types.js +30 -0
- package/dist/modules/customers/components/calendar/types.js.map +7 -0
- package/dist/modules/customers/components/calendar/useCalendarItems.js +131 -0
- package/dist/modules/customers/components/calendar/useCalendarItems.js.map +7 -0
- package/dist/modules/customers/components/calendar/useCalendarPreferences.js +41 -0
- package/dist/modules/customers/components/calendar/useCalendarPreferences.js.map +7 -0
- package/dist/modules/customers/lib/calendar/categories.js +28 -0
- package/dist/modules/customers/lib/calendar/categories.js.map +7 -0
- package/dist/modules/customers/lib/calendar/conflicts.js +72 -0
- package/dist/modules/customers/lib/calendar/conflicts.js.map +7 -0
- package/dist/modules/customers/lib/calendar/editorPayload.js +271 -0
- package/dist/modules/customers/lib/calendar/editorPayload.js.map +7 -0
- package/dist/modules/customers/lib/calendar/grid.js +48 -0
- package/dist/modules/customers/lib/calendar/grid.js.map +7 -0
- package/dist/modules/customers/lib/calendar/layout.js +39 -0
- package/dist/modules/customers/lib/calendar/layout.js.map +7 -0
- package/dist/modules/customers/lib/calendar/mapItem.js +79 -0
- package/dist/modules/customers/lib/calendar/mapItem.js.map +7 -0
- package/dist/modules/customers/lib/calendar/preferences.js +71 -0
- package/dist/modules/customers/lib/calendar/preferences.js.map +7 -0
- package/dist/modules/customers/lib/calendar/range.js +46 -0
- package/dist/modules/customers/lib/calendar/range.js.map +7 -0
- package/dist/modules/customers/lib/calendar/recurrence.js +113 -0
- package/dist/modules/customers/lib/calendar/recurrence.js.map +7 -0
- package/dist/modules/dashboards/services/widgetDataService.js +5 -5
- package/dist/modules/dashboards/services/widgetDataService.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.js +61 -1
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/route.js +33 -1
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/route.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/route.js +61 -1
- package/dist/modules/dictionaries/api/[dictionaryId]/route.js.map +2 -2
- package/dist/modules/dictionaries/api/route.js +33 -1
- package/dist/modules/dictionaries/api/route.js.map +2 -2
- package/dist/modules/feature_toggles/lib/queries.js +36 -52
- package/dist/modules/feature_toggles/lib/queries.js.map +2 -2
- package/dist/modules/perspectives/api/[tableId]/[perspectiveId]/route.js +32 -1
- package/dist/modules/perspectives/api/[tableId]/[perspectiveId]/route.js.map +2 -2
- package/dist/modules/perspectives/api/[tableId]/roles/[roleId]/route.js +32 -1
- package/dist/modules/perspectives/api/[tableId]/roles/[roleId]/route.js.map +2 -2
- package/dist/modules/perspectives/api/[tableId]/route.js +73 -2
- package/dist/modules/perspectives/api/[tableId]/route.js.map +2 -2
- package/dist/modules/perspectives/services/perspectiveService.js +5 -3
- package/dist/modules/perspectives/services/perspectiveService.js.map +2 -2
- package/dist/modules/planner/api/access.js +9 -0
- package/dist/modules/planner/api/access.js.map +2 -2
- package/dist/modules/planner/api/availability-date-specific.js +22 -1
- package/dist/modules/planner/api/availability-date-specific.js.map +2 -2
- package/dist/modules/planner/api/availability-weekly.js +22 -1
- package/dist/modules/planner/api/availability-weekly.js.map +2 -2
- package/dist/modules/resources/api/resources/tags/assign/route.js +39 -0
- package/dist/modules/resources/api/resources/tags/assign/route.js.map +2 -2
- package/dist/modules/resources/api/resources/tags/unassign/route.js +39 -0
- package/dist/modules/resources/api/resources/tags/unassign/route.js.map +2 -2
- package/dist/modules/sales/api/settings/document-numbers/route.js +33 -1
- package/dist/modules/sales/api/settings/document-numbers/route.js.map +2 -2
- package/dist/modules/sales/api/settings/order-editing/route.js +35 -3
- package/dist/modules/sales/api/settings/order-editing/route.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/accept/route.js +41 -0
- package/dist/modules/staff/api/leave-requests/accept/route.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/reject/route.js +41 -0
- package/dist/modules/staff/api/leave-requests/reject/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/self/route.js +40 -0
- package/dist/modules/staff/api/team-members/self/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/assign/route.js +41 -0
- package/dist/modules/staff/api/team-members/tags/assign/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/unassign/route.js +41 -0
- package/dist/modules/staff/api/team-members/tags/unassign/route.js.map +2 -2
- package/dist/modules/translations/api/[entityType]/[entityId]/route.js +61 -1
- package/dist/modules/translations/api/[entityType]/[entityId]/route.js.map +2 -2
- package/dist/modules/translations/api/context.js +7 -0
- package/dist/modules/translations/api/context.js.map +2 -2
- package/dist/modules/translations/api/put/locales.js +33 -1
- package/dist/modules/translations/api/put/locales.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/visual-editor/page.js +6 -7
- package/dist/modules/workflows/backend/definitions/visual-editor/page.js.map +2 -2
- package/dist/modules/workflows/backend/instances/[id]/page.js.map +1 -1
- package/dist/modules/workflows/components/EdgeEditDialog.js.map +1 -1
- package/dist/modules/workflows/components/EdgeEditDialogCrudForm.js.map +1 -1
- package/dist/modules/workflows/components/NodeEditDialog.js.map +1 -1
- package/dist/modules/workflows/components/NodeEditDialogCrudForm.js.map +1 -1
- package/dist/modules/workflows/components/WorkflowGraph.js.map +1 -1
- package/dist/modules/workflows/components/WorkflowGraphImpl.js +17 -9
- package/dist/modules/workflows/components/WorkflowGraphImpl.js.map +2 -2
- package/dist/modules/workflows/components/mobile/MobileVisualEditor.js.map +1 -1
- package/dist/modules/workflows/frontend/checkout-demo/deriveCurrentStep.js +8 -0
- package/dist/modules/workflows/frontend/checkout-demo/deriveCurrentStep.js.map +7 -0
- package/dist/modules/workflows/frontend/checkout-demo/page.js +2 -20
- package/dist/modules/workflows/frontend/checkout-demo/page.js.map +2 -2
- package/dist/modules/workflows/lib/graph-utils.js +8 -0
- package/dist/modules/workflows/lib/graph-utils.js.map +2 -2
- package/generated/entities/catalog_product/index.ts +26 -0
- package/generated/entities/catalog_product_variant/index.ts +2 -0
- package/generated/entity-fields-registry.ts +28 -0
- package/package.json +7 -7
- package/src/modules/catalog/api/products/route.ts +123 -39
- package/src/modules/catalog/api/variants/route.ts +4 -0
- package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +43 -0
- package/src/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.tsx +14 -0
- package/src/modules/catalog/backend/catalog/products/[productId]/variants/create/page.tsx +2 -0
- package/src/modules/catalog/backend/catalog/products/create/page.tsx +41 -0
- package/src/modules/catalog/commands/products.ts +307 -2
- package/src/modules/catalog/commands/variants.ts +90 -1
- package/src/modules/catalog/components/products/ProductComplianceSection.tsx +497 -0
- package/src/modules/catalog/components/products/VariantBuilder.tsx +43 -0
- package/src/modules/catalog/components/products/productForm.ts +262 -0
- package/src/modules/catalog/components/products/variantForm.ts +4 -0
- package/src/modules/catalog/data/entities.ts +97 -0
- package/src/modules/catalog/data/types.ts +36 -0
- package/src/modules/catalog/data/validators.ts +159 -3
- package/src/modules/catalog/i18n/de.json +64 -0
- package/src/modules/catalog/i18n/en.json +64 -0
- package/src/modules/catalog/i18n/es.json +64 -0
- package/src/modules/catalog/i18n/pl.json +64 -0
- package/src/modules/catalog/lib/gtin.ts +66 -0
- package/src/modules/catalog/migrations/.snapshot-open-mercato.json +457 -0
- package/src/modules/catalog/migrations/Migration20260611090000.ts +17 -0
- package/src/modules/catalog/translations.ts +1 -1
- package/src/modules/configs/api/cache/route.ts +72 -10
- package/src/modules/configs/components/CachePanel.tsx +59 -29
- package/src/modules/currencies/api/currencies/options/route.ts +22 -4
- package/src/modules/currencies/services/rateFetchingService.ts +63 -26
- package/src/modules/customer_accounts/backend/customer_accounts/users/[id]/page.tsx +18 -18
- package/src/modules/customer_accounts/backend/customer_accounts/users/page.tsx +1 -1
- package/src/modules/customer_accounts/i18n/de.json +1 -1
- package/src/modules/customer_accounts/i18n/en.json +1 -1
- package/src/modules/customer_accounts/i18n/es.json +1 -1
- package/src/modules/customer_accounts/i18n/pl.json +1 -1
- package/src/modules/customers/backend/calendar/page.meta.ts +23 -0
- package/src/modules/customers/backend/calendar/page.tsx +12 -0
- package/src/modules/customers/cli.ts +1 -0
- package/src/modules/customers/components/calendar/AgendaList.tsx +219 -0
- package/src/modules/customers/components/calendar/CalendarEventEditor.tsx +386 -0
- package/src/modules/customers/components/calendar/CalendarFooter.tsx +61 -0
- package/src/modules/customers/components/calendar/CalendarHeader.tsx +40 -0
- package/src/modules/customers/components/calendar/CalendarScreen.tsx +590 -0
- package/src/modules/customers/components/calendar/CalendarSettingsModal.tsx +207 -0
- package/src/modules/customers/components/calendar/CalendarTabs.tsx +63 -0
- package/src/modules/customers/components/calendar/CalendarToolbar.tsx +295 -0
- package/src/modules/customers/components/calendar/EventBlock.tsx +205 -0
- package/src/modules/customers/components/calendar/EventPeekPopover.tsx +100 -0
- package/src/modules/customers/components/calendar/MonthGrid.tsx +236 -0
- package/src/modules/customers/components/calendar/ShortcutsDialog.tsx +57 -0
- package/src/modules/customers/components/calendar/TimeGrid.tsx +510 -0
- package/src/modules/customers/components/calendar/UpcomingCards.tsx +220 -0
- package/src/modules/customers/components/calendar/editor/CategoryField.tsx +79 -0
- package/src/modules/customers/components/calendar/editor/LocationField.tsx +37 -0
- package/src/modules/customers/components/calendar/editor/PeopleField.tsx +148 -0
- package/src/modules/customers/components/calendar/editor/RelatedToField.tsx +242 -0
- package/src/modules/customers/components/calendar/editor/RepeatField.tsx +132 -0
- package/src/modules/customers/components/calendar/editor/ScheduleSection.tsx +110 -0
- package/src/modules/customers/components/calendar/editor/SegmentGroup.tsx +50 -0
- package/src/modules/customers/components/calendar/editor/hooks.ts +162 -0
- package/src/modules/customers/components/calendar/editor/inputs.tsx +158 -0
- package/src/modules/customers/components/calendar/editor/lookups.ts +160 -0
- package/src/modules/customers/components/calendar/types.ts +163 -0
- package/src/modules/customers/components/calendar/useCalendarItems.ts +162 -0
- package/src/modules/customers/components/calendar/useCalendarPreferences.ts +52 -0
- package/src/modules/customers/i18n/de.json +195 -0
- package/src/modules/customers/i18n/en.json +195 -0
- package/src/modules/customers/i18n/es.json +195 -0
- package/src/modules/customers/i18n/pl.json +195 -0
- package/src/modules/customers/lib/calendar/categories.ts +26 -0
- package/src/modules/customers/lib/calendar/conflicts.ts +117 -0
- package/src/modules/customers/lib/calendar/editorPayload.ts +388 -0
- package/src/modules/customers/lib/calendar/grid.ts +50 -0
- package/src/modules/customers/lib/calendar/layout.ts +47 -0
- package/src/modules/customers/lib/calendar/mapItem.ts +94 -0
- package/src/modules/customers/lib/calendar/preferences.ts +95 -0
- package/src/modules/customers/lib/calendar/range.ts +45 -0
- package/src/modules/customers/lib/calendar/recurrence.ts +137 -0
- package/src/modules/dashboards/services/widgetDataService.ts +8 -6
- package/src/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.ts +61 -1
- package/src/modules/dictionaries/api/[dictionaryId]/entries/route.ts +33 -1
- package/src/modules/dictionaries/api/[dictionaryId]/route.ts +65 -1
- package/src/modules/dictionaries/api/route.ts +36 -1
- package/src/modules/feature_toggles/lib/queries.ts +41 -60
- package/src/modules/perspectives/api/[tableId]/[perspectiveId]/route.ts +34 -1
- package/src/modules/perspectives/api/[tableId]/roles/[roleId]/route.ts +34 -1
- package/src/modules/perspectives/api/[tableId]/route.ts +107 -32
- package/src/modules/perspectives/services/perspectiveService.ts +9 -5
- package/src/modules/planner/api/access.ts +9 -0
- package/src/modules/planner/api/availability-date-specific.ts +22 -1
- package/src/modules/planner/api/availability-weekly.ts +22 -1
- package/src/modules/resources/api/resources/tags/assign/route.ts +42 -0
- package/src/modules/resources/api/resources/tags/unassign/route.ts +42 -0
- package/src/modules/sales/api/settings/document-numbers/route.ts +35 -1
- package/src/modules/sales/api/settings/order-editing/route.ts +37 -3
- package/src/modules/staff/api/leave-requests/accept/route.ts +45 -0
- package/src/modules/staff/api/leave-requests/reject/route.ts +45 -0
- package/src/modules/staff/api/team-members/self/route.ts +43 -0
- package/src/modules/staff/api/team-members/tags/assign/route.ts +45 -0
- package/src/modules/staff/api/team-members/tags/unassign/route.ts +45 -0
- package/src/modules/translations/api/[entityType]/[entityId]/route.ts +65 -1
- package/src/modules/translations/api/context.ts +7 -0
- package/src/modules/translations/api/put/locales.ts +35 -1
- package/src/modules/workflows/backend/definitions/visual-editor/page.tsx +11 -9
- package/src/modules/workflows/backend/instances/[id]/page.tsx +1 -1
- package/src/modules/workflows/components/EdgeEditDialog.tsx +1 -1
- package/src/modules/workflows/components/EdgeEditDialogCrudForm.tsx +1 -1
- package/src/modules/workflows/components/NodeEditDialog.tsx +1 -1
- package/src/modules/workflows/components/NodeEditDialogCrudForm.tsx +1 -1
- package/src/modules/workflows/components/WorkflowGraph.tsx +2 -2
- package/src/modules/workflows/components/WorkflowGraphImpl.tsx +27 -13
- package/src/modules/workflows/components/mobile/MobileVisualEditor.tsx +3 -3
- package/src/modules/workflows/frontend/checkout-demo/deriveCurrentStep.ts +12 -0
- package/src/modules/workflows/frontend/checkout-demo/page.tsx +3 -23
- package/src/modules/workflows/lib/graph-utils.ts +21 -1
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
5
|
+
import { Checkbox } from "@open-mercato/ui/primitives/checkbox";
|
|
6
|
+
import { Input } from "@open-mercato/ui/primitives/input";
|
|
7
|
+
import { Label } from "@open-mercato/ui/primitives/label";
|
|
8
|
+
import {
|
|
9
|
+
Select,
|
|
10
|
+
SelectContent,
|
|
11
|
+
SelectItem,
|
|
12
|
+
SelectTrigger,
|
|
13
|
+
SelectValue
|
|
14
|
+
} from "@open-mercato/ui/primitives/select";
|
|
15
|
+
import { Textarea } from "@open-mercato/ui/primitives/textarea";
|
|
16
|
+
import {
|
|
17
|
+
CATALOG_EXCISE_CATEGORIES,
|
|
18
|
+
CATALOG_GTU_CODES,
|
|
19
|
+
CATALOG_HAZMAT_PACKING_GROUPS
|
|
20
|
+
} from "../../data/types.js";
|
|
21
|
+
const NONE_OPTION = "none";
|
|
22
|
+
function FieldError({ message }) {
|
|
23
|
+
if (!message) return null;
|
|
24
|
+
return /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: message });
|
|
25
|
+
}
|
|
26
|
+
function ProductComplianceSection({
|
|
27
|
+
values,
|
|
28
|
+
errors,
|
|
29
|
+
setValue,
|
|
30
|
+
embedded = false
|
|
31
|
+
}) {
|
|
32
|
+
const t = useT();
|
|
33
|
+
const gtuCodes = Array.isArray(values.gtuCodes) ? values.gtuCodes : [];
|
|
34
|
+
const toggleGtuCode = React.useCallback(
|
|
35
|
+
(code, checked) => {
|
|
36
|
+
const current = Array.isArray(values.gtuCodes) ? values.gtuCodes : [];
|
|
37
|
+
const next = checked ? Array.from(/* @__PURE__ */ new Set([...current, code])).sort() : current.filter((entry) => entry !== code);
|
|
38
|
+
setValue("gtuCodes", next);
|
|
39
|
+
},
|
|
40
|
+
[setValue, values.gtuCodes]
|
|
41
|
+
);
|
|
42
|
+
return /* @__PURE__ */ jsxs(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: embedded ? "space-y-6" : "space-y-6 rounded-lg border bg-card p-4",
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
48
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
49
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: t("catalog.products.compliance.codes.title", "Compliance codes (PL/EU)") }),
|
|
50
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t(
|
|
51
|
+
"catalog.products.compliance.codes.description",
|
|
52
|
+
"Classification codes used by KSeF/JPK invoices, customs declarations, and marketplace feeds."
|
|
53
|
+
) })
|
|
54
|
+
] }),
|
|
55
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
56
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
57
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-country", children: t("catalog.products.compliance.fields.countryOfOrigin", "Country of origin (ISO code)") }),
|
|
58
|
+
/* @__PURE__ */ jsx(
|
|
59
|
+
Input,
|
|
60
|
+
{
|
|
61
|
+
id: "catalog-product-compliance-country",
|
|
62
|
+
value: values.countryOfOriginCode ?? "",
|
|
63
|
+
maxLength: 2,
|
|
64
|
+
placeholder: t("catalog.products.compliance.placeholders.countryOfOrigin", "PL"),
|
|
65
|
+
onChange: (event) => setValue("countryOfOriginCode", event.target.value.toUpperCase())
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.countryOfOriginCode })
|
|
69
|
+
] }),
|
|
70
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
71
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-tax-classification", children: t("catalog.products.compliance.fields.taxClassification", "Tax classification code") }),
|
|
72
|
+
/* @__PURE__ */ jsx(
|
|
73
|
+
Input,
|
|
74
|
+
{
|
|
75
|
+
id: "catalog-product-compliance-tax-classification",
|
|
76
|
+
value: values.taxClassificationCode ?? "",
|
|
77
|
+
onChange: (event) => setValue("taxClassificationCode", event.target.value)
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.taxClassificationCode })
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
83
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-pkwiu", children: t("catalog.products.compliance.fields.pkwiu", "PKWiU code") }),
|
|
84
|
+
/* @__PURE__ */ jsx(
|
|
85
|
+
Input,
|
|
86
|
+
{
|
|
87
|
+
id: "catalog-product-compliance-pkwiu",
|
|
88
|
+
value: values.pkwiuCode ?? "",
|
|
89
|
+
onChange: (event) => setValue("pkwiuCode", event.target.value)
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.pkwiuCode })
|
|
93
|
+
] }),
|
|
94
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
95
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-cn", children: t("catalog.products.compliance.fields.cn", "CN code (Combined Nomenclature)") }),
|
|
96
|
+
/* @__PURE__ */ jsx(
|
|
97
|
+
Input,
|
|
98
|
+
{
|
|
99
|
+
id: "catalog-product-compliance-cn",
|
|
100
|
+
value: values.cnCode ?? "",
|
|
101
|
+
onChange: (event) => setValue("cnCode", event.target.value)
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.cnCode })
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2 md:col-span-2", children: [
|
|
107
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-hs", children: t("catalog.products.compliance.fields.hs", "HS code (customs tariff)") }),
|
|
108
|
+
/* @__PURE__ */ jsx(
|
|
109
|
+
Input,
|
|
110
|
+
{
|
|
111
|
+
id: "catalog-product-compliance-hs",
|
|
112
|
+
value: values.hsCode ?? "",
|
|
113
|
+
onChange: (event) => setValue("hsCode", event.target.value)
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.hsCode })
|
|
117
|
+
] })
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
120
|
+
/* @__PURE__ */ jsx(Label, { children: t("catalog.products.compliance.fields.gtuCodes", "GTU codes (JPK_V7)") }),
|
|
121
|
+
/* @__PURE__ */ jsx("div", { className: "grid gap-2 sm:grid-cols-3 md:grid-cols-4", children: CATALOG_GTU_CODES.map((code) => /* @__PURE__ */ jsxs(
|
|
122
|
+
"label",
|
|
123
|
+
{
|
|
124
|
+
className: "flex items-center gap-2 text-sm",
|
|
125
|
+
htmlFor: `catalog-product-compliance-gtu-${code}`,
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ jsx(
|
|
128
|
+
Checkbox,
|
|
129
|
+
{
|
|
130
|
+
id: `catalog-product-compliance-gtu-${code}`,
|
|
131
|
+
checked: gtuCodes.includes(code),
|
|
132
|
+
onCheckedChange: (checked) => toggleGtuCode(code, checked === true)
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
code.replace("_", " ")
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
code
|
|
139
|
+
)) }),
|
|
140
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.gtuCodes })
|
|
141
|
+
] })
|
|
142
|
+
] }),
|
|
143
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
144
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
145
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: t("catalog.products.compliance.safety.title", "Restrictions & safety") }),
|
|
146
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t(
|
|
147
|
+
"catalog.products.compliance.safety.description",
|
|
148
|
+
"Age, excise, and dangerous-goods attributes enforced by storefront, POS, and carriers."
|
|
149
|
+
) })
|
|
150
|
+
] }),
|
|
151
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
152
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
153
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-age-min", children: t("catalog.products.compliance.fields.ageMin", "Minimum buyer age") }),
|
|
154
|
+
/* @__PURE__ */ jsx(
|
|
155
|
+
Input,
|
|
156
|
+
{
|
|
157
|
+
id: "catalog-product-compliance-age-min",
|
|
158
|
+
type: "number",
|
|
159
|
+
min: 0,
|
|
160
|
+
max: 120,
|
|
161
|
+
value: values.ageMin ?? "",
|
|
162
|
+
onChange: (event) => setValue("ageMin", event.target.value)
|
|
163
|
+
}
|
|
164
|
+
),
|
|
165
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.ageMin })
|
|
166
|
+
] }),
|
|
167
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
168
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-excise-category", children: t("catalog.products.compliance.fields.exciseCategory", "Excise category") }),
|
|
169
|
+
/* @__PURE__ */ jsxs(
|
|
170
|
+
Select,
|
|
171
|
+
{
|
|
172
|
+
value: values.exciseCategory ?? NONE_OPTION,
|
|
173
|
+
onValueChange: (value) => setValue("exciseCategory", value === NONE_OPTION ? null : value),
|
|
174
|
+
children: [
|
|
175
|
+
/* @__PURE__ */ jsx(SelectTrigger, { id: "catalog-product-compliance-excise-category", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
176
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
177
|
+
/* @__PURE__ */ jsx(SelectItem, { value: NONE_OPTION, children: t("catalog.products.compliance.options.none", "None") }),
|
|
178
|
+
CATALOG_EXCISE_CATEGORIES.map((category) => /* @__PURE__ */ jsx(SelectItem, { value: category, children: t(`catalog.products.compliance.exciseCategories.${category}`, category) }, category))
|
|
179
|
+
] })
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.exciseCategory })
|
|
184
|
+
] })
|
|
185
|
+
] }),
|
|
186
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-2 sm:grid-cols-2", children: [
|
|
187
|
+
/* @__PURE__ */ jsxs(
|
|
188
|
+
"label",
|
|
189
|
+
{
|
|
190
|
+
className: "flex items-center gap-2 text-sm",
|
|
191
|
+
htmlFor: "catalog-product-compliance-excise",
|
|
192
|
+
children: [
|
|
193
|
+
/* @__PURE__ */ jsx(
|
|
194
|
+
Checkbox,
|
|
195
|
+
{
|
|
196
|
+
id: "catalog-product-compliance-excise",
|
|
197
|
+
checked: values.isExciseGood === true,
|
|
198
|
+
onCheckedChange: (checked) => setValue("isExciseGood", checked === true)
|
|
199
|
+
}
|
|
200
|
+
),
|
|
201
|
+
t("catalog.products.compliance.fields.isExciseGood", "Excise good")
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
),
|
|
205
|
+
/* @__PURE__ */ jsxs(
|
|
206
|
+
"label",
|
|
207
|
+
{
|
|
208
|
+
className: "flex items-center gap-2 text-sm",
|
|
209
|
+
htmlFor: "catalog-product-compliance-prescription",
|
|
210
|
+
children: [
|
|
211
|
+
/* @__PURE__ */ jsx(
|
|
212
|
+
Checkbox,
|
|
213
|
+
{
|
|
214
|
+
id: "catalog-product-compliance-prescription",
|
|
215
|
+
checked: values.requiresPrescription === true,
|
|
216
|
+
onCheckedChange: (checked) => setValue("requiresPrescription", checked === true)
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
t("catalog.products.compliance.fields.requiresPrescription", "Requires prescription")
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
),
|
|
223
|
+
/* @__PURE__ */ jsxs(
|
|
224
|
+
"label",
|
|
225
|
+
{
|
|
226
|
+
className: "flex items-center gap-2 text-sm",
|
|
227
|
+
htmlFor: "catalog-product-compliance-lithium",
|
|
228
|
+
children: [
|
|
229
|
+
/* @__PURE__ */ jsx(
|
|
230
|
+
Checkbox,
|
|
231
|
+
{
|
|
232
|
+
id: "catalog-product-compliance-lithium",
|
|
233
|
+
checked: values.containsLithiumBattery === true,
|
|
234
|
+
onCheckedChange: (checked) => setValue("containsLithiumBattery", checked === true)
|
|
235
|
+
}
|
|
236
|
+
),
|
|
237
|
+
t("catalog.products.compliance.fields.containsLithiumBattery", "Contains lithium battery")
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
)
|
|
241
|
+
] }),
|
|
242
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-4 md:grid-cols-3", children: [
|
|
243
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
244
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-hazmat-class", children: t("catalog.products.compliance.fields.hazmatClass", "Hazmat class (ADR)") }),
|
|
245
|
+
/* @__PURE__ */ jsx(
|
|
246
|
+
Input,
|
|
247
|
+
{
|
|
248
|
+
id: "catalog-product-compliance-hazmat-class",
|
|
249
|
+
value: values.hazmatClass ?? "",
|
|
250
|
+
onChange: (event) => setValue("hazmatClass", event.target.value)
|
|
251
|
+
}
|
|
252
|
+
),
|
|
253
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.hazmatClass })
|
|
254
|
+
] }),
|
|
255
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
256
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-un-number", children: t("catalog.products.compliance.fields.unNumber", "UN number") }),
|
|
257
|
+
/* @__PURE__ */ jsx(
|
|
258
|
+
Input,
|
|
259
|
+
{
|
|
260
|
+
id: "catalog-product-compliance-un-number",
|
|
261
|
+
placeholder: t("catalog.products.compliance.placeholders.unNumber", "UN1234"),
|
|
262
|
+
value: values.unNumber ?? "",
|
|
263
|
+
onChange: (event) => setValue("unNumber", event.target.value)
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.unNumber })
|
|
267
|
+
] }),
|
|
268
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
269
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-packing-group", children: t("catalog.products.compliance.fields.hazmatPackingGroup", "Packing group") }),
|
|
270
|
+
/* @__PURE__ */ jsxs(
|
|
271
|
+
Select,
|
|
272
|
+
{
|
|
273
|
+
value: values.hazmatPackingGroup ?? NONE_OPTION,
|
|
274
|
+
onValueChange: (value) => setValue("hazmatPackingGroup", value === NONE_OPTION ? null : value),
|
|
275
|
+
children: [
|
|
276
|
+
/* @__PURE__ */ jsx(SelectTrigger, { id: "catalog-product-compliance-packing-group", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
277
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
278
|
+
/* @__PURE__ */ jsx(SelectItem, { value: NONE_OPTION, children: t("catalog.products.compliance.options.none", "None") }),
|
|
279
|
+
CATALOG_HAZMAT_PACKING_GROUPS.map((group) => /* @__PURE__ */ jsx(SelectItem, { value: group, children: group }, group))
|
|
280
|
+
] })
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
),
|
|
284
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.hazmatPackingGroup })
|
|
285
|
+
] })
|
|
286
|
+
] })
|
|
287
|
+
] }),
|
|
288
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
289
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
290
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: t("catalog.products.compliance.logistics.title", "Availability & lifecycle") }),
|
|
291
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t(
|
|
292
|
+
"catalog.products.compliance.logistics.description",
|
|
293
|
+
"Launch, end-of-life, and selling windows plus shipping requirements."
|
|
294
|
+
) })
|
|
295
|
+
] }),
|
|
296
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
297
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
298
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-launch-at", children: t("catalog.products.compliance.fields.launchAt", "Launch date") }),
|
|
299
|
+
/* @__PURE__ */ jsx(
|
|
300
|
+
Input,
|
|
301
|
+
{
|
|
302
|
+
id: "catalog-product-compliance-launch-at",
|
|
303
|
+
type: "date",
|
|
304
|
+
value: values.launchAt ?? "",
|
|
305
|
+
onChange: (event) => setValue("launchAt", event.target.value)
|
|
306
|
+
}
|
|
307
|
+
),
|
|
308
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.launchAt })
|
|
309
|
+
] }),
|
|
310
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
311
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-eol-at", children: t("catalog.products.compliance.fields.endOfLifeAt", "End of life") }),
|
|
312
|
+
/* @__PURE__ */ jsx(
|
|
313
|
+
Input,
|
|
314
|
+
{
|
|
315
|
+
id: "catalog-product-compliance-eol-at",
|
|
316
|
+
type: "date",
|
|
317
|
+
value: values.endOfLifeAt ?? "",
|
|
318
|
+
onChange: (event) => setValue("endOfLifeAt", event.target.value)
|
|
319
|
+
}
|
|
320
|
+
),
|
|
321
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.endOfLifeAt })
|
|
322
|
+
] }),
|
|
323
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
324
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-available-from", children: t("catalog.products.compliance.fields.availableFrom", "Available from") }),
|
|
325
|
+
/* @__PURE__ */ jsx(
|
|
326
|
+
Input,
|
|
327
|
+
{
|
|
328
|
+
id: "catalog-product-compliance-available-from",
|
|
329
|
+
type: "date",
|
|
330
|
+
value: values.availableFrom ?? "",
|
|
331
|
+
onChange: (event) => setValue("availableFrom", event.target.value)
|
|
332
|
+
}
|
|
333
|
+
),
|
|
334
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.availableFrom })
|
|
335
|
+
] }),
|
|
336
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
337
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-available-until", children: t("catalog.products.compliance.fields.availableUntil", "Available until") }),
|
|
338
|
+
/* @__PURE__ */ jsx(
|
|
339
|
+
Input,
|
|
340
|
+
{
|
|
341
|
+
id: "catalog-product-compliance-available-until",
|
|
342
|
+
type: "date",
|
|
343
|
+
value: values.availableUntil ?? "",
|
|
344
|
+
onChange: (event) => setValue("availableUntil", event.target.value)
|
|
345
|
+
}
|
|
346
|
+
),
|
|
347
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.availableUntil })
|
|
348
|
+
] })
|
|
349
|
+
] }),
|
|
350
|
+
/* @__PURE__ */ jsxs(
|
|
351
|
+
"label",
|
|
352
|
+
{
|
|
353
|
+
className: "flex items-center gap-2 text-sm",
|
|
354
|
+
htmlFor: "catalog-product-compliance-requires-shipping",
|
|
355
|
+
children: [
|
|
356
|
+
/* @__PURE__ */ jsx(
|
|
357
|
+
Checkbox,
|
|
358
|
+
{
|
|
359
|
+
id: "catalog-product-compliance-requires-shipping",
|
|
360
|
+
checked: values.requiresShipping !== false,
|
|
361
|
+
onCheckedChange: (checked) => setValue("requiresShipping", checked === true)
|
|
362
|
+
}
|
|
363
|
+
),
|
|
364
|
+
t("catalog.products.compliance.fields.requiresShipping", "Requires shipping")
|
|
365
|
+
]
|
|
366
|
+
}
|
|
367
|
+
)
|
|
368
|
+
] }),
|
|
369
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
370
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
371
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: t("catalog.products.compliance.commercial.title", "Commercial terms") }),
|
|
372
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t(
|
|
373
|
+
"catalog.products.compliance.commercial.description",
|
|
374
|
+
"Order quantity constraints and quote-only selling for B2B."
|
|
375
|
+
) })
|
|
376
|
+
] }),
|
|
377
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-4 md:grid-cols-3", children: [
|
|
378
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
379
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-min-qty", children: t("catalog.products.compliance.fields.minOrderQty", "Minimum order quantity") }),
|
|
380
|
+
/* @__PURE__ */ jsx(
|
|
381
|
+
Input,
|
|
382
|
+
{
|
|
383
|
+
id: "catalog-product-compliance-min-qty",
|
|
384
|
+
type: "number",
|
|
385
|
+
min: 1,
|
|
386
|
+
value: values.minOrderQty ?? "",
|
|
387
|
+
onChange: (event) => setValue("minOrderQty", event.target.value)
|
|
388
|
+
}
|
|
389
|
+
),
|
|
390
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.minOrderQty })
|
|
391
|
+
] }),
|
|
392
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
393
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-max-qty", children: t("catalog.products.compliance.fields.maxOrderQty", "Maximum order quantity") }),
|
|
394
|
+
/* @__PURE__ */ jsx(
|
|
395
|
+
Input,
|
|
396
|
+
{
|
|
397
|
+
id: "catalog-product-compliance-max-qty",
|
|
398
|
+
type: "number",
|
|
399
|
+
min: 1,
|
|
400
|
+
value: values.maxOrderQty ?? "",
|
|
401
|
+
onChange: (event) => setValue("maxOrderQty", event.target.value)
|
|
402
|
+
}
|
|
403
|
+
),
|
|
404
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.maxOrderQty })
|
|
405
|
+
] }),
|
|
406
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
407
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-qty-increment", children: t("catalog.products.compliance.fields.orderQtyIncrement", "Quantity increment") }),
|
|
408
|
+
/* @__PURE__ */ jsx(
|
|
409
|
+
Input,
|
|
410
|
+
{
|
|
411
|
+
id: "catalog-product-compliance-qty-increment",
|
|
412
|
+
type: "number",
|
|
413
|
+
min: 1,
|
|
414
|
+
value: values.orderQtyIncrement ?? "",
|
|
415
|
+
onChange: (event) => setValue("orderQtyIncrement", event.target.value)
|
|
416
|
+
}
|
|
417
|
+
),
|
|
418
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.orderQtyIncrement })
|
|
419
|
+
] })
|
|
420
|
+
] }),
|
|
421
|
+
/* @__PURE__ */ jsxs(
|
|
422
|
+
"label",
|
|
423
|
+
{
|
|
424
|
+
className: "flex items-center gap-2 text-sm",
|
|
425
|
+
htmlFor: "catalog-product-compliance-quote-only",
|
|
426
|
+
children: [
|
|
427
|
+
/* @__PURE__ */ jsx(
|
|
428
|
+
Checkbox,
|
|
429
|
+
{
|
|
430
|
+
id: "catalog-product-compliance-quote-only",
|
|
431
|
+
checked: values.isQuoteOnly === true,
|
|
432
|
+
onCheckedChange: (checked) => setValue("isQuoteOnly", checked === true)
|
|
433
|
+
}
|
|
434
|
+
),
|
|
435
|
+
t("catalog.products.compliance.fields.isQuoteOnly", "Quote only (price on request)")
|
|
436
|
+
]
|
|
437
|
+
}
|
|
438
|
+
)
|
|
439
|
+
] }),
|
|
440
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
441
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
442
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: t("catalog.products.compliance.seo.title", "SEO") }),
|
|
443
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t(
|
|
444
|
+
"catalog.products.compliance.seo.description",
|
|
445
|
+
"Storefront metadata. Title and description are translatable per locale."
|
|
446
|
+
) })
|
|
447
|
+
] }),
|
|
448
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-4", children: [
|
|
449
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
450
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-seo-title", children: t("catalog.products.compliance.fields.seoTitle", "SEO title") }),
|
|
451
|
+
/* @__PURE__ */ jsx(
|
|
452
|
+
Input,
|
|
453
|
+
{
|
|
454
|
+
id: "catalog-product-compliance-seo-title",
|
|
455
|
+
maxLength: 255,
|
|
456
|
+
value: values.seoTitle ?? "",
|
|
457
|
+
onChange: (event) => setValue("seoTitle", event.target.value)
|
|
458
|
+
}
|
|
459
|
+
),
|
|
460
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.seoTitle })
|
|
461
|
+
] }),
|
|
462
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
463
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-seo-description", children: t("catalog.products.compliance.fields.seoDescription", "SEO description") }),
|
|
464
|
+
/* @__PURE__ */ jsx(
|
|
465
|
+
Textarea,
|
|
466
|
+
{
|
|
467
|
+
id: "catalog-product-compliance-seo-description",
|
|
468
|
+
rows: 3,
|
|
469
|
+
maxLength: 1e3,
|
|
470
|
+
value: values.seoDescription ?? "",
|
|
471
|
+
onChange: (event) => setValue("seoDescription", event.target.value)
|
|
472
|
+
}
|
|
473
|
+
),
|
|
474
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.seoDescription })
|
|
475
|
+
] }),
|
|
476
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
477
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-product-compliance-canonical-url", children: t("catalog.products.compliance.fields.canonicalUrl", "Canonical URL") }),
|
|
478
|
+
/* @__PURE__ */ jsx(
|
|
479
|
+
Input,
|
|
480
|
+
{
|
|
481
|
+
id: "catalog-product-compliance-canonical-url",
|
|
482
|
+
type: "url",
|
|
483
|
+
maxLength: 500,
|
|
484
|
+
placeholder: "https://",
|
|
485
|
+
value: values.canonicalUrl ?? "",
|
|
486
|
+
onChange: (event) => setValue("canonicalUrl", event.target.value)
|
|
487
|
+
}
|
|
488
|
+
),
|
|
489
|
+
/* @__PURE__ */ jsx(FieldError, { message: errors.canonicalUrl })
|
|
490
|
+
] })
|
|
491
|
+
] })
|
|
492
|
+
] })
|
|
493
|
+
]
|
|
494
|
+
}
|
|
495
|
+
);
|
|
496
|
+
}
|
|
497
|
+
export {
|
|
498
|
+
ProductComplianceSection
|
|
499
|
+
};
|
|
500
|
+
//# sourceMappingURL=ProductComplianceSection.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/catalog/components/products/ProductComplianceSection.tsx"],
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\nimport * as React from \"react\";\nimport { useT } from \"@open-mercato/shared/lib/i18n/context\";\nimport { Checkbox } from \"@open-mercato/ui/primitives/checkbox\";\nimport { Input } from \"@open-mercato/ui/primitives/input\";\nimport { Label } from \"@open-mercato/ui/primitives/label\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@open-mercato/ui/primitives/select\";\nimport { Textarea } from \"@open-mercato/ui/primitives/textarea\";\nimport {\n CATALOG_EXCISE_CATEGORIES,\n CATALOG_GTU_CODES,\n CATALOG_HAZMAT_PACKING_GROUPS,\n} from \"../../data/types\";\nimport type { ProductFormValues } from \"./productForm\";\n\nconst NONE_OPTION = \"none\";\n\ntype ProductComplianceSectionProps = {\n values: ProductFormValues;\n errors: Record<string, string>;\n setValue: (id: string, value: unknown) => void;\n embedded?: boolean;\n};\n\nfunction FieldError({ message }: { message?: string }) {\n if (!message) return null;\n return <p className=\"text-xs text-destructive\">{message}</p>;\n}\n\nexport function ProductComplianceSection({\n values,\n errors,\n setValue,\n embedded = false,\n}: ProductComplianceSectionProps) {\n const t = useT();\n const gtuCodes = Array.isArray(values.gtuCodes) ? values.gtuCodes : [];\n\n const toggleGtuCode = React.useCallback(\n (code: string, checked: boolean) => {\n const current = Array.isArray(values.gtuCodes) ? values.gtuCodes : [];\n const next = checked\n ? Array.from(new Set([...current, code])).sort()\n : current.filter((entry) => entry !== code);\n setValue(\"gtuCodes\", next);\n },\n [setValue, values.gtuCodes],\n );\n\n return (\n <div\n className={\n embedded ? \"space-y-6\" : \"space-y-6 rounded-lg border bg-card p-4\"\n }\n >\n <div className=\"space-y-4\">\n <div className=\"space-y-1\">\n <h3 className=\"text-sm font-semibold\">\n {t(\"catalog.products.compliance.codes.title\", \"Compliance codes (PL/EU)\")}\n </h3>\n <p className=\"text-xs text-muted-foreground\">\n {t(\n \"catalog.products.compliance.codes.description\",\n \"Classification codes used by KSeF/JPK invoices, customs declarations, and marketplace feeds.\",\n )}\n </p>\n </div>\n <div className=\"grid gap-4 md:grid-cols-2\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-country\">\n {t(\"catalog.products.compliance.fields.countryOfOrigin\", \"Country of origin (ISO code)\")}\n </Label>\n <Input\n id=\"catalog-product-compliance-country\"\n value={values.countryOfOriginCode ?? \"\"}\n maxLength={2}\n placeholder={t(\"catalog.products.compliance.placeholders.countryOfOrigin\", \"PL\")}\n onChange={(event) =>\n setValue(\"countryOfOriginCode\", event.target.value.toUpperCase())\n }\n />\n <FieldError message={errors.countryOfOriginCode} />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-tax-classification\">\n {t(\"catalog.products.compliance.fields.taxClassification\", \"Tax classification code\")}\n </Label>\n <Input\n id=\"catalog-product-compliance-tax-classification\"\n value={values.taxClassificationCode ?? \"\"}\n onChange={(event) => setValue(\"taxClassificationCode\", event.target.value)}\n />\n <FieldError message={errors.taxClassificationCode} />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-pkwiu\">\n {t(\"catalog.products.compliance.fields.pkwiu\", \"PKWiU code\")}\n </Label>\n <Input\n id=\"catalog-product-compliance-pkwiu\"\n value={values.pkwiuCode ?? \"\"}\n onChange={(event) => setValue(\"pkwiuCode\", event.target.value)}\n />\n <FieldError message={errors.pkwiuCode} />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-cn\">\n {t(\"catalog.products.compliance.fields.cn\", \"CN code (Combined Nomenclature)\")}\n </Label>\n <Input\n id=\"catalog-product-compliance-cn\"\n value={values.cnCode ?? \"\"}\n onChange={(event) => setValue(\"cnCode\", event.target.value)}\n />\n <FieldError message={errors.cnCode} />\n </div>\n <div className=\"space-y-2 md:col-span-2\">\n <Label htmlFor=\"catalog-product-compliance-hs\">\n {t(\"catalog.products.compliance.fields.hs\", \"HS code (customs tariff)\")}\n </Label>\n <Input\n id=\"catalog-product-compliance-hs\"\n value={values.hsCode ?? \"\"}\n onChange={(event) => setValue(\"hsCode\", event.target.value)}\n />\n <FieldError message={errors.hsCode} />\n </div>\n </div>\n <div className=\"space-y-2\">\n <Label>{t(\"catalog.products.compliance.fields.gtuCodes\", \"GTU codes (JPK_V7)\")}</Label>\n <div className=\"grid gap-2 sm:grid-cols-3 md:grid-cols-4\">\n {CATALOG_GTU_CODES.map((code) => (\n <label\n key={code}\n className=\"flex items-center gap-2 text-sm\"\n htmlFor={`catalog-product-compliance-gtu-${code}`}\n >\n <Checkbox\n id={`catalog-product-compliance-gtu-${code}`}\n checked={gtuCodes.includes(code)}\n onCheckedChange={(checked) => toggleGtuCode(code, checked === true)}\n />\n {code.replace(\"_\", \" \")}\n </label>\n ))}\n </div>\n <FieldError message={errors.gtuCodes} />\n </div>\n </div>\n\n <div className=\"space-y-4\">\n <div className=\"space-y-1\">\n <h3 className=\"text-sm font-semibold\">\n {t(\"catalog.products.compliance.safety.title\", \"Restrictions & safety\")}\n </h3>\n <p className=\"text-xs text-muted-foreground\">\n {t(\n \"catalog.products.compliance.safety.description\",\n \"Age, excise, and dangerous-goods attributes enforced by storefront, POS, and carriers.\",\n )}\n </p>\n </div>\n <div className=\"grid gap-4 md:grid-cols-2\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-age-min\">\n {t(\"catalog.products.compliance.fields.ageMin\", \"Minimum buyer age\")}\n </Label>\n <Input\n id=\"catalog-product-compliance-age-min\"\n type=\"number\"\n min={0}\n max={120}\n value={values.ageMin ?? \"\"}\n onChange={(event) => setValue(\"ageMin\", event.target.value)}\n />\n <FieldError message={errors.ageMin} />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-excise-category\">\n {t(\"catalog.products.compliance.fields.exciseCategory\", \"Excise category\")}\n </Label>\n <Select\n value={values.exciseCategory ?? NONE_OPTION}\n onValueChange={(value) =>\n setValue(\"exciseCategory\", value === NONE_OPTION ? null : value)\n }\n >\n <SelectTrigger id=\"catalog-product-compliance-excise-category\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={NONE_OPTION}>\n {t(\"catalog.products.compliance.options.none\", \"None\")}\n </SelectItem>\n {CATALOG_EXCISE_CATEGORIES.map((category) => (\n <SelectItem key={category} value={category}>\n {t(`catalog.products.compliance.exciseCategories.${category}`, category)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n <FieldError message={errors.exciseCategory} />\n </div>\n </div>\n <div className=\"grid gap-2 sm:grid-cols-2\">\n <label\n className=\"flex items-center gap-2 text-sm\"\n htmlFor=\"catalog-product-compliance-excise\"\n >\n <Checkbox\n id=\"catalog-product-compliance-excise\"\n checked={values.isExciseGood === true}\n onCheckedChange={(checked) => setValue(\"isExciseGood\", checked === true)}\n />\n {t(\"catalog.products.compliance.fields.isExciseGood\", \"Excise good\")}\n </label>\n <label\n className=\"flex items-center gap-2 text-sm\"\n htmlFor=\"catalog-product-compliance-prescription\"\n >\n <Checkbox\n id=\"catalog-product-compliance-prescription\"\n checked={values.requiresPrescription === true}\n onCheckedChange={(checked) => setValue(\"requiresPrescription\", checked === true)}\n />\n {t(\"catalog.products.compliance.fields.requiresPrescription\", \"Requires prescription\")}\n </label>\n <label\n className=\"flex items-center gap-2 text-sm\"\n htmlFor=\"catalog-product-compliance-lithium\"\n >\n <Checkbox\n id=\"catalog-product-compliance-lithium\"\n checked={values.containsLithiumBattery === true}\n onCheckedChange={(checked) => setValue(\"containsLithiumBattery\", checked === true)}\n />\n {t(\"catalog.products.compliance.fields.containsLithiumBattery\", \"Contains lithium battery\")}\n </label>\n </div>\n <div className=\"grid gap-4 md:grid-cols-3\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-hazmat-class\">\n {t(\"catalog.products.compliance.fields.hazmatClass\", \"Hazmat class (ADR)\")}\n </Label>\n <Input\n id=\"catalog-product-compliance-hazmat-class\"\n value={values.hazmatClass ?? \"\"}\n onChange={(event) => setValue(\"hazmatClass\", event.target.value)}\n />\n <FieldError message={errors.hazmatClass} />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-un-number\">\n {t(\"catalog.products.compliance.fields.unNumber\", \"UN number\")}\n </Label>\n <Input\n id=\"catalog-product-compliance-un-number\"\n placeholder={t(\"catalog.products.compliance.placeholders.unNumber\", \"UN1234\")}\n value={values.unNumber ?? \"\"}\n onChange={(event) => setValue(\"unNumber\", event.target.value)}\n />\n <FieldError message={errors.unNumber} />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-packing-group\">\n {t(\"catalog.products.compliance.fields.hazmatPackingGroup\", \"Packing group\")}\n </Label>\n <Select\n value={values.hazmatPackingGroup ?? NONE_OPTION}\n onValueChange={(value) =>\n setValue(\"hazmatPackingGroup\", value === NONE_OPTION ? null : value)\n }\n >\n <SelectTrigger id=\"catalog-product-compliance-packing-group\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={NONE_OPTION}>\n {t(\"catalog.products.compliance.options.none\", \"None\")}\n </SelectItem>\n {CATALOG_HAZMAT_PACKING_GROUPS.map((group) => (\n <SelectItem key={group} value={group}>\n {group}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n <FieldError message={errors.hazmatPackingGroup} />\n </div>\n </div>\n </div>\n\n <div className=\"space-y-4\">\n <div className=\"space-y-1\">\n <h3 className=\"text-sm font-semibold\">\n {t(\"catalog.products.compliance.logistics.title\", \"Availability & lifecycle\")}\n </h3>\n <p className=\"text-xs text-muted-foreground\">\n {t(\n \"catalog.products.compliance.logistics.description\",\n \"Launch, end-of-life, and selling windows plus shipping requirements.\",\n )}\n </p>\n </div>\n <div className=\"grid gap-4 md:grid-cols-2\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-launch-at\">\n {t(\"catalog.products.compliance.fields.launchAt\", \"Launch date\")}\n </Label>\n <Input\n id=\"catalog-product-compliance-launch-at\"\n type=\"date\"\n value={values.launchAt ?? \"\"}\n onChange={(event) => setValue(\"launchAt\", event.target.value)}\n />\n <FieldError message={errors.launchAt} />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-eol-at\">\n {t(\"catalog.products.compliance.fields.endOfLifeAt\", \"End of life\")}\n </Label>\n <Input\n id=\"catalog-product-compliance-eol-at\"\n type=\"date\"\n value={values.endOfLifeAt ?? \"\"}\n onChange={(event) => setValue(\"endOfLifeAt\", event.target.value)}\n />\n <FieldError message={errors.endOfLifeAt} />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-available-from\">\n {t(\"catalog.products.compliance.fields.availableFrom\", \"Available from\")}\n </Label>\n <Input\n id=\"catalog-product-compliance-available-from\"\n type=\"date\"\n value={values.availableFrom ?? \"\"}\n onChange={(event) => setValue(\"availableFrom\", event.target.value)}\n />\n <FieldError message={errors.availableFrom} />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-available-until\">\n {t(\"catalog.products.compliance.fields.availableUntil\", \"Available until\")}\n </Label>\n <Input\n id=\"catalog-product-compliance-available-until\"\n type=\"date\"\n value={values.availableUntil ?? \"\"}\n onChange={(event) => setValue(\"availableUntil\", event.target.value)}\n />\n <FieldError message={errors.availableUntil} />\n </div>\n </div>\n <label\n className=\"flex items-center gap-2 text-sm\"\n htmlFor=\"catalog-product-compliance-requires-shipping\"\n >\n <Checkbox\n id=\"catalog-product-compliance-requires-shipping\"\n checked={values.requiresShipping !== false}\n onCheckedChange={(checked) => setValue(\"requiresShipping\", checked === true)}\n />\n {t(\"catalog.products.compliance.fields.requiresShipping\", \"Requires shipping\")}\n </label>\n </div>\n\n <div className=\"space-y-4\">\n <div className=\"space-y-1\">\n <h3 className=\"text-sm font-semibold\">\n {t(\"catalog.products.compliance.commercial.title\", \"Commercial terms\")}\n </h3>\n <p className=\"text-xs text-muted-foreground\">\n {t(\n \"catalog.products.compliance.commercial.description\",\n \"Order quantity constraints and quote-only selling for B2B.\",\n )}\n </p>\n </div>\n <div className=\"grid gap-4 md:grid-cols-3\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-min-qty\">\n {t(\"catalog.products.compliance.fields.minOrderQty\", \"Minimum order quantity\")}\n </Label>\n <Input\n id=\"catalog-product-compliance-min-qty\"\n type=\"number\"\n min={1}\n value={values.minOrderQty ?? \"\"}\n onChange={(event) => setValue(\"minOrderQty\", event.target.value)}\n />\n <FieldError message={errors.minOrderQty} />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-max-qty\">\n {t(\"catalog.products.compliance.fields.maxOrderQty\", \"Maximum order quantity\")}\n </Label>\n <Input\n id=\"catalog-product-compliance-max-qty\"\n type=\"number\"\n min={1}\n value={values.maxOrderQty ?? \"\"}\n onChange={(event) => setValue(\"maxOrderQty\", event.target.value)}\n />\n <FieldError message={errors.maxOrderQty} />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-qty-increment\">\n {t(\"catalog.products.compliance.fields.orderQtyIncrement\", \"Quantity increment\")}\n </Label>\n <Input\n id=\"catalog-product-compliance-qty-increment\"\n type=\"number\"\n min={1}\n value={values.orderQtyIncrement ?? \"\"}\n onChange={(event) => setValue(\"orderQtyIncrement\", event.target.value)}\n />\n <FieldError message={errors.orderQtyIncrement} />\n </div>\n </div>\n <label\n className=\"flex items-center gap-2 text-sm\"\n htmlFor=\"catalog-product-compliance-quote-only\"\n >\n <Checkbox\n id=\"catalog-product-compliance-quote-only\"\n checked={values.isQuoteOnly === true}\n onCheckedChange={(checked) => setValue(\"isQuoteOnly\", checked === true)}\n />\n {t(\"catalog.products.compliance.fields.isQuoteOnly\", \"Quote only (price on request)\")}\n </label>\n </div>\n\n <div className=\"space-y-4\">\n <div className=\"space-y-1\">\n <h3 className=\"text-sm font-semibold\">\n {t(\"catalog.products.compliance.seo.title\", \"SEO\")}\n </h3>\n <p className=\"text-xs text-muted-foreground\">\n {t(\n \"catalog.products.compliance.seo.description\",\n \"Storefront metadata. Title and description are translatable per locale.\",\n )}\n </p>\n </div>\n <div className=\"grid gap-4\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-seo-title\">\n {t(\"catalog.products.compliance.fields.seoTitle\", \"SEO title\")}\n </Label>\n <Input\n id=\"catalog-product-compliance-seo-title\"\n maxLength={255}\n value={values.seoTitle ?? \"\"}\n onChange={(event) => setValue(\"seoTitle\", event.target.value)}\n />\n <FieldError message={errors.seoTitle} />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-seo-description\">\n {t(\"catalog.products.compliance.fields.seoDescription\", \"SEO description\")}\n </Label>\n <Textarea\n id=\"catalog-product-compliance-seo-description\"\n rows={3}\n maxLength={1000}\n value={values.seoDescription ?? \"\"}\n onChange={(event) => setValue(\"seoDescription\", event.target.value)}\n />\n <FieldError message={errors.seoDescription} />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"catalog-product-compliance-canonical-url\">\n {t(\"catalog.products.compliance.fields.canonicalUrl\", \"Canonical URL\")}\n </Label>\n <Input\n id=\"catalog-product-compliance-canonical-url\"\n type=\"url\"\n maxLength={500}\n placeholder=\"https://\"\n value={values.canonicalUrl ?? \"\"}\n onChange={(event) => setValue(\"canonicalUrl\", event.target.value)}\n />\n <FieldError message={errors.canonicalUrl} />\n </div>\n </div>\n </div>\n </div>\n );\n}\n"],
|
|
5
|
+
"mappings": ";AAiCS,cA8BD,YA9BC;AA/BT,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,gBAAgB;AACzB,SAAS,aAAa;AACtB,SAAS,aAAa;AACtB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,MAAM,cAAc;AASpB,SAAS,WAAW,EAAE,QAAQ,GAAyB;AACrD,MAAI,CAAC,QAAS,QAAO;AACrB,SAAO,oBAAC,OAAE,WAAU,4BAA4B,mBAAQ;AAC1D;AAEO,SAAS,yBAAyB;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AACb,GAAkC;AAChC,QAAM,IAAI,KAAK;AACf,QAAM,WAAW,MAAM,QAAQ,OAAO,QAAQ,IAAI,OAAO,WAAW,CAAC;AAErE,QAAM,gBAAgB,MAAM;AAAA,IAC1B,CAAC,MAA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 -16,6 +16,7 @@ import { Switch } from "@open-mercato/ui/primitives/switch";
|
|
|
16
16
|
import { ProductMediaManager } from "./ProductMediaManager.js";
|
|
17
17
|
import { MetadataEditor } from "./MetadataEditor.js";
|
|
18
18
|
import { formatTaxRateLabel } from "./productForm.js";
|
|
19
|
+
import { CATALOG_GTIN_TYPES } from "../../data/types.js";
|
|
19
20
|
import { E } from "../../../../generated/entities.ids.generated.js";
|
|
20
21
|
function VariantBuilder({
|
|
21
22
|
values,
|
|
@@ -73,7 +74,44 @@ function VariantBasicsSection({ values, setValue, errors }) {
|
|
|
73
74
|
onChange: (event) => setValue("barcode", event.target.value),
|
|
74
75
|
placeholder: t("catalog.variants.form.barcodePlaceholder", "EAN, UPC, etc.")
|
|
75
76
|
}
|
|
76
|
-
)
|
|
77
|
+
),
|
|
78
|
+
errors.barcode ? /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: errors.barcode }) : null
|
|
79
|
+
] })
|
|
80
|
+
] }),
|
|
81
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
82
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
83
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-variant-gtin-type", children: t("catalog.variants.form.gtinTypeLabel", "Identifier type (GTIN)") }),
|
|
84
|
+
/* @__PURE__ */ jsxs(
|
|
85
|
+
Select,
|
|
86
|
+
{
|
|
87
|
+
value: values.gtinType ?? "none",
|
|
88
|
+
onValueChange: (value) => setValue("gtinType", value === "none" ? null : value),
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ jsx(SelectTrigger, { id: "catalog-variant-gtin-type", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
91
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
92
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "none", children: t("catalog.variants.form.gtinTypeNone", "Untyped") }),
|
|
93
|
+
CATALOG_GTIN_TYPES.map((type) => /* @__PURE__ */ jsx(SelectItem, { value: type, children: t(`catalog.variants.form.gtinTypes.${type}`, type.toUpperCase()) }, type))
|
|
94
|
+
] })
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t(
|
|
99
|
+
"catalog.variants.form.gtinTypeHint",
|
|
100
|
+
"Typed barcodes are validated and kept unique per organization."
|
|
101
|
+
) }),
|
|
102
|
+
errors.gtinType ? /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: errors.gtinType }) : null
|
|
103
|
+
] }),
|
|
104
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
105
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "catalog-variant-hs-code", children: t("catalog.variants.form.hsCodeLabel", "HS code (customs tariff)") }),
|
|
106
|
+
/* @__PURE__ */ jsx(
|
|
107
|
+
Input,
|
|
108
|
+
{
|
|
109
|
+
id: "catalog-variant-hs-code",
|
|
110
|
+
value: values.hsCode,
|
|
111
|
+
onChange: (event) => setValue("hsCode", event.target.value)
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
errors.hsCode ? /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: errors.hsCode }) : null
|
|
77
115
|
] })
|
|
78
116
|
] }),
|
|
79
117
|
/* @__PURE__ */ jsxs("div", { className: "grid gap-4 md:grid-cols-2", children: [
|