@open-mercato/core 0.9.1-develop.7474.1.51db10479d → 0.9.1-develop.7475.1.28ca93ed97
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 +2 -2
- package/dist/generated/entities/catalog_price_history_entry/index.js +53 -0
- package/dist/generated/entities/catalog_price_history_entry/index.js.map +7 -0
- package/dist/generated/entities/customer_group_terms/index.js +2 -0
- package/dist/generated/entities/customer_group_terms/index.js.map +2 -2
- package/dist/generated/entities/ecommerce_store/index.js +33 -0
- package/dist/generated/entities/ecommerce_store/index.js.map +7 -0
- package/dist/generated/entities/ecommerce_store_channel_binding/index.js +29 -0
- package/dist/generated/entities/ecommerce_store_channel_binding/index.js.map +7 -0
- package/dist/generated/entities/ecommerce_store_domain_binding/index.js +23 -0
- package/dist/generated/entities/ecommerce_store_domain_binding/index.js.map +7 -0
- package/dist/generated/entities.ids.generated.js +8 -1
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +72 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/helpers/integration/customerGroupsFixtures.js.map +2 -2
- package/dist/modules/catalog/acl.js +8 -1
- package/dist/modules/catalog/acl.js.map +2 -2
- package/dist/modules/catalog/api/config/omnibus/route.js +184 -0
- package/dist/modules/catalog/api/config/omnibus/route.js.map +7 -0
- package/dist/modules/catalog/api/prices/history/route.js +131 -0
- package/dist/modules/catalog/api/prices/history/route.js.map +7 -0
- package/dist/modules/catalog/api/prices/omnibus-preview/route.js +184 -0
- package/dist/modules/catalog/api/prices/omnibus-preview/route.js.map +7 -0
- package/dist/modules/catalog/api/products/route.js +54 -245
- package/dist/modules/catalog/api/products/route.js.map +3 -3
- package/dist/modules/catalog/api/tags/route.js +6 -0
- package/dist/modules/catalog/api/tags/route.js.map +2 -2
- package/dist/modules/catalog/backend/config/catalog/page.js +3 -1
- package/dist/modules/catalog/backend/config/catalog/page.js.map +2 -2
- package/dist/modules/catalog/cli.js +80 -2
- package/dist/modules/catalog/cli.js.map +2 -2
- package/dist/modules/catalog/commands/categories.js +51 -2
- package/dist/modules/catalog/commands/categories.js.map +2 -2
- package/dist/modules/catalog/commands/prices.js +43 -1
- package/dist/modules/catalog/commands/prices.js.map +2 -2
- package/dist/modules/catalog/commands/products.js +71 -0
- package/dist/modules/catalog/commands/products.js.map +2 -2
- package/dist/modules/catalog/commands/variants.js +7 -0
- package/dist/modules/catalog/commands/variants.js.map +2 -2
- package/dist/modules/catalog/components/OmnibusSettings.js +703 -0
- package/dist/modules/catalog/components/OmnibusSettings.js.map +7 -0
- package/dist/modules/catalog/components/PriceEditorOmnibusRow.js +152 -0
- package/dist/modules/catalog/components/PriceEditorOmnibusRow.js.map +7 -0
- package/dist/modules/catalog/components/lookupSources.js +31 -0
- package/dist/modules/catalog/components/lookupSources.js.map +7 -0
- package/dist/modules/catalog/components/prices/PriceScopeSelectors.js +8 -2
- package/dist/modules/catalog/components/prices/PriceScopeSelectors.js.map +2 -2
- package/dist/modules/catalog/components/products/VariantBuilder.js +11 -1
- package/dist/modules/catalog/components/products/VariantBuilder.js.map +2 -2
- package/dist/modules/catalog/data/entities.js +122 -1
- package/dist/modules/catalog/data/entities.js.map +2 -2
- package/dist/modules/catalog/data/validators.js +78 -0
- package/dist/modules/catalog/data/validators.js.map +2 -2
- package/dist/modules/catalog/di.js +18 -0
- package/dist/modules/catalog/di.js.map +2 -2
- package/dist/modules/catalog/lib/omnibus.js +285 -0
- package/dist/modules/catalog/lib/omnibus.js.map +7 -0
- package/dist/modules/catalog/lib/omnibusBackfill.js +146 -0
- package/dist/modules/catalog/lib/omnibusBackfill.js.map +7 -0
- package/dist/modules/catalog/lib/omnibusCache.js +89 -0
- package/dist/modules/catalog/lib/omnibusCache.js.map +7 -0
- package/dist/modules/catalog/lib/omnibusConfig.js +64 -0
- package/dist/modules/catalog/lib/omnibusConfig.js.map +7 -0
- package/dist/modules/catalog/lib/omnibusHistoryQueries.js +191 -0
- package/dist/modules/catalog/lib/omnibusHistoryQueries.js.map +7 -0
- package/dist/modules/catalog/lib/omnibusPresentedEntry.js +73 -0
- package/dist/modules/catalog/lib/omnibusPresentedEntry.js.map +7 -0
- package/dist/modules/catalog/lib/omnibusProductListEnrichment.js +94 -0
- package/dist/modules/catalog/lib/omnibusProductListEnrichment.js.map +7 -0
- package/dist/modules/catalog/lib/omnibusTypes.js +115 -0
- package/dist/modules/catalog/lib/omnibusTypes.js.map +7 -0
- package/dist/modules/catalog/lib/optionSchemaTranslations.js +55 -0
- package/dist/modules/catalog/lib/optionSchemaTranslations.js.map +7 -0
- package/dist/modules/catalog/lib/priceHistoryQuery.js +103 -0
- package/dist/modules/catalog/lib/priceHistoryQuery.js.map +7 -0
- package/dist/modules/catalog/lib/pricing.js +26 -2
- package/dist/modules/catalog/lib/pricing.js.map +2 -2
- package/dist/modules/catalog/lib/productFilters.js +273 -0
- package/dist/modules/catalog/lib/productFilters.js.map +7 -0
- package/dist/modules/catalog/lib/productScopeKeys.js +105 -0
- package/dist/modules/catalog/lib/productScopeKeys.js.map +7 -0
- package/dist/modules/catalog/lib/productScopeReindex.js +73 -0
- package/dist/modules/catalog/lib/productScopeReindex.js.map +7 -0
- package/dist/modules/catalog/migrations/Migration20261005105352_catalog.js +39 -0
- package/dist/modules/catalog/migrations/Migration20261005105352_catalog.js.map +7 -0
- package/dist/modules/catalog/migrations/Migration20261005150824_catalog.js +39 -0
- package/dist/modules/catalog/migrations/Migration20261005150824_catalog.js.map +7 -0
- package/dist/modules/catalog/services/catalogOmnibusService.js +480 -0
- package/dist/modules/catalog/services/catalogOmnibusService.js.map +7 -0
- package/dist/modules/catalog/setup.js +3 -1
- package/dist/modules/catalog/setup.js.map +2 -2
- package/dist/modules/catalog/subscribers/product-scope-keys-category-deleted.js +16 -0
- package/dist/modules/catalog/subscribers/product-scope-keys-category-deleted.js.map +7 -0
- package/dist/modules/catalog/subscribers/product-scope-keys-category-updated.js +17 -0
- package/dist/modules/catalog/subscribers/product-scope-keys-category-updated.js.map +7 -0
- package/dist/modules/catalog/translations.js +10 -0
- package/dist/modules/catalog/translations.js.map +2 -2
- package/dist/modules/configs/lib/upgrade-actions.js +28 -0
- package/dist/modules/configs/lib/upgrade-actions.js.map +2 -2
- package/dist/modules/customer_groups/api/customer-groups/[id]/terms/route.js +5 -0
- package/dist/modules/customer_groups/api/customer-groups/[id]/terms/route.js.map +2 -2
- package/dist/modules/customer_groups/components/CustomerGroupTermsSection.js +111 -3
- package/dist/modules/customer_groups/components/CustomerGroupTermsSection.js.map +2 -2
- package/dist/modules/customer_groups/components/customerGroupAssortmentScope.js +43 -0
- package/dist/modules/customer_groups/components/customerGroupAssortmentScope.js.map +7 -0
- package/dist/modules/customer_groups/data/entities.js +3 -0
- package/dist/modules/customer_groups/data/entities.js.map +2 -2
- package/dist/modules/customer_groups/data/validators.js +9 -0
- package/dist/modules/customer_groups/data/validators.js.map +2 -2
- package/dist/modules/customer_groups/migrations/Migration20261005110250_customer_groups.js +17 -0
- package/dist/modules/customer_groups/migrations/Migration20261005110250_customer_groups.js.map +7 -0
- package/dist/modules/customer_groups/services/customerGroupsService.js +62 -15
- package/dist/modules/customer_groups/services/customerGroupsService.js.map +2 -2
- package/dist/modules/ecommerce/acl.js +13 -0
- package/dist/modules/ecommerce/acl.js.map +7 -0
- package/dist/modules/ecommerce/api/domain-mappings/route.js +72 -0
- package/dist/modules/ecommerce/api/domain-mappings/route.js.map +7 -0
- package/dist/modules/ecommerce/api/openapi.js +27 -0
- package/dist/modules/ecommerce/api/openapi.js.map +7 -0
- package/dist/modules/ecommerce/api/store-channel-bindings/[id]/assortment-count/route.js +109 -0
- package/dist/modules/ecommerce/api/store-channel-bindings/[id]/assortment-count/route.js.map +7 -0
- package/dist/modules/ecommerce/api/store-channel-bindings/crud.js +265 -0
- package/dist/modules/ecommerce/api/store-channel-bindings/crud.js.map +7 -0
- package/dist/modules/ecommerce/api/store-channel-bindings/route.js +67 -0
- package/dist/modules/ecommerce/api/store-channel-bindings/route.js.map +7 -0
- package/dist/modules/ecommerce/api/store-domain-bindings/crud.js +296 -0
- package/dist/modules/ecommerce/api/store-domain-bindings/crud.js.map +7 -0
- package/dist/modules/ecommerce/api/store-domain-bindings/route.js +73 -0
- package/dist/modules/ecommerce/api/store-domain-bindings/route.js.map +7 -0
- package/dist/modules/ecommerce/api/storefront/categories/[slug]/route.js +87 -0
- package/dist/modules/ecommerce/api/storefront/categories/[slug]/route.js.map +7 -0
- package/dist/modules/ecommerce/api/storefront/categories/openapiSchemas.js +50 -0
- package/dist/modules/ecommerce/api/storefront/categories/openapiSchemas.js.map +7 -0
- package/dist/modules/ecommerce/api/storefront/categories/route.js +75 -0
- package/dist/modules/ecommerce/api/storefront/categories/route.js.map +7 -0
- package/dist/modules/ecommerce/api/storefront/context/route.js +163 -0
- package/dist/modules/ecommerce/api/storefront/context/route.js.map +7 -0
- package/dist/modules/ecommerce/api/storefront/products/[idOrHandle]/route.js +87 -0
- package/dist/modules/ecommerce/api/storefront/products/[idOrHandle]/route.js.map +7 -0
- package/dist/modules/ecommerce/api/storefront/products/openapiSchemas.js +177 -0
- package/dist/modules/ecommerce/api/storefront/products/openapiSchemas.js.map +7 -0
- package/dist/modules/ecommerce/api/storefront/products/route.js +78 -0
- package/dist/modules/ecommerce/api/storefront/products/route.js.map +7 -0
- package/dist/modules/ecommerce/api/storefront/search/suggest/openapiSchemas.js +25 -0
- package/dist/modules/ecommerce/api/storefront/search/suggest/openapiSchemas.js.map +7 -0
- package/dist/modules/ecommerce/api/storefront/search/suggest/route.js +75 -0
- package/dist/modules/ecommerce/api/storefront/search/suggest/route.js.map +7 -0
- package/dist/modules/ecommerce/api/storefront/storefrontRouteSupport.js +58 -0
- package/dist/modules/ecommerce/api/storefront/storefrontRouteSupport.js.map +7 -0
- package/dist/modules/ecommerce/api/stores/[id]/branding/route.js +183 -0
- package/dist/modules/ecommerce/api/stores/[id]/branding/route.js.map +7 -0
- package/dist/modules/ecommerce/api/stores/[id]/preview-branding/route.js +92 -0
- package/dist/modules/ecommerce/api/stores/[id]/preview-branding/route.js.map +7 -0
- package/dist/modules/ecommerce/api/stores/crud.js +401 -0
- package/dist/modules/ecommerce/api/stores/crud.js.map +7 -0
- package/dist/modules/ecommerce/api/stores/route.js +64 -0
- package/dist/modules/ecommerce/api/stores/route.js.map +7 -0
- package/dist/modules/ecommerce/backend/config/ecommerce/[id]/page.js +9 -0
- package/dist/modules/ecommerce/backend/config/ecommerce/[id]/page.js.map +7 -0
- package/dist/modules/ecommerce/backend/config/ecommerce/[id]/page.meta.js +16 -0
- package/dist/modules/ecommerce/backend/config/ecommerce/[id]/page.meta.js.map +7 -0
- package/dist/modules/ecommerce/backend/config/ecommerce/page.js +9 -0
- package/dist/modules/ecommerce/backend/config/ecommerce/page.js.map +7 -0
- package/dist/modules/ecommerce/backend/config/ecommerce/page.meta.js +16 -0
- package/dist/modules/ecommerce/backend/config/ecommerce/page.meta.js.map +7 -0
- package/dist/modules/ecommerce/commands/stores.js +110 -0
- package/dist/modules/ecommerce/commands/stores.js.map +7 -0
- package/dist/modules/ecommerce/components/ChannelAssortmentCount.js +90 -0
- package/dist/modules/ecommerce/components/ChannelAssortmentCount.js.map +7 -0
- package/dist/modules/ecommerce/components/ChannelBindingFormSections.js +33 -0
- package/dist/modules/ecommerce/components/ChannelBindingFormSections.js.map +7 -0
- package/dist/modules/ecommerce/components/ChannelLookupPicker.js +11 -0
- package/dist/modules/ecommerce/components/ChannelLookupPicker.js.map +7 -0
- package/dist/modules/ecommerce/components/DomainStatusWarning.js +24 -0
- package/dist/modules/ecommerce/components/DomainStatusWarning.js.map +7 -0
- package/dist/modules/ecommerce/components/StoreAvailabilityDefaultsSection.js +190 -0
- package/dist/modules/ecommerce/components/StoreAvailabilityDefaultsSection.js.map +7 -0
- package/dist/modules/ecommerce/components/StoreBrandingControls.js +67 -0
- package/dist/modules/ecommerce/components/StoreBrandingControls.js.map +7 -0
- package/dist/modules/ecommerce/components/StoreBrandingPreview.js +69 -0
- package/dist/modules/ecommerce/components/StoreBrandingPreview.js.map +7 -0
- package/dist/modules/ecommerce/components/StoreBrandingTab.js +218 -0
- package/dist/modules/ecommerce/components/StoreBrandingTab.js.map +7 -0
- package/dist/modules/ecommerce/components/StoreChannelBindingDialog.js +270 -0
- package/dist/modules/ecommerce/components/StoreChannelBindingDialog.js.map +7 -0
- package/dist/modules/ecommerce/components/StoreChannelsTab.js +313 -0
- package/dist/modules/ecommerce/components/StoreChannelsTab.js.map +7 -0
- package/dist/modules/ecommerce/components/StoreCreateDialog.js +164 -0
- package/dist/modules/ecommerce/components/StoreCreateDialog.js.map +7 -0
- package/dist/modules/ecommerce/components/StoreDomainBindingDialog.js +162 -0
- package/dist/modules/ecommerce/components/StoreDomainBindingDialog.js.map +7 -0
- package/dist/modules/ecommerce/components/StoreDomainsTab.js +357 -0
- package/dist/modules/ecommerce/components/StoreDomainsTab.js.map +7 -0
- package/dist/modules/ecommerce/components/StoreEditPage.js +155 -0
- package/dist/modules/ecommerce/components/StoreEditPage.js.map +7 -0
- package/dist/modules/ecommerce/components/StoreGeneralTab.js +167 -0
- package/dist/modules/ecommerce/components/StoreGeneralTab.js.map +7 -0
- package/dist/modules/ecommerce/components/StoreListPage.js +290 -0
- package/dist/modules/ecommerce/components/StoreListPage.js.map +7 -0
- package/dist/modules/ecommerce/components/StoreSeoTab.js +132 -0
- package/dist/modules/ecommerce/components/StoreSeoTab.js.map +7 -0
- package/dist/modules/ecommerce/components/StoreStatusBadge.js +20 -0
- package/dist/modules/ecommerce/components/StoreStatusBadge.js.map +7 -0
- package/dist/modules/ecommerce/components/channelLookups.js +28 -0
- package/dist/modules/ecommerce/components/channelLookups.js.map +7 -0
- package/dist/modules/ecommerce/components/storeAdmin.js +41 -0
- package/dist/modules/ecommerce/components/storeAdmin.js.map +7 -0
- package/dist/modules/ecommerce/components/storeBrandingForm.js +197 -0
- package/dist/modules/ecommerce/components/storeBrandingForm.js.map +7 -0
- package/dist/modules/ecommerce/components/storeChannels.js +140 -0
- package/dist/modules/ecommerce/components/storeChannels.js.map +7 -0
- package/dist/modules/ecommerce/components/storeDomains.js +167 -0
- package/dist/modules/ecommerce/components/storeDomains.js.map +7 -0
- package/dist/modules/ecommerce/components/storeEditTabs.js +62 -0
- package/dist/modules/ecommerce/components/storeEditTabs.js.map +7 -0
- package/dist/modules/ecommerce/components/storeGeneral.js +95 -0
- package/dist/modules/ecommerce/components/storeGeneral.js.map +7 -0
- package/dist/modules/ecommerce/components/storeSeo.js +69 -0
- package/dist/modules/ecommerce/components/storeSeo.js.map +7 -0
- package/dist/modules/ecommerce/components/useChannelAssortmentCount.js +45 -0
- package/dist/modules/ecommerce/components/useChannelAssortmentCount.js.map +7 -0
- package/dist/modules/ecommerce/components/useStoreAccess.js +28 -0
- package/dist/modules/ecommerce/components/useStoreAccess.js.map +7 -0
- package/dist/modules/ecommerce/data/enrichers.js +157 -0
- package/dist/modules/ecommerce/data/enrichers.js.map +7 -0
- package/dist/modules/ecommerce/data/entities.js +197 -0
- package/dist/modules/ecommerce/data/entities.js.map +7 -0
- package/dist/modules/ecommerce/data/validators.js +406 -0
- package/dist/modules/ecommerce/data/validators.js.map +7 -0
- package/dist/modules/ecommerce/di.js +11 -0
- package/dist/modules/ecommerce/di.js.map +7 -0
- package/dist/modules/ecommerce/events.js +27 -0
- package/dist/modules/ecommerce/events.js.map +7 -0
- package/dist/modules/ecommerce/index.js +16 -0
- package/dist/modules/ecommerce/index.js.map +7 -0
- package/dist/modules/ecommerce/lib/assortmentCount.js +112 -0
- package/dist/modules/ecommerce/lib/assortmentCount.js.map +7 -0
- package/dist/modules/ecommerce/lib/brandingStyles.js +184 -0
- package/dist/modules/ecommerce/lib/brandingStyles.js.map +7 -0
- package/dist/modules/ecommerce/lib/buyerContext.js +284 -0
- package/dist/modules/ecommerce/lib/buyerContext.js.map +7 -0
- package/dist/modules/ecommerce/lib/cacheInvalidation.js +186 -0
- package/dist/modules/ecommerce/lib/cacheInvalidation.js.map +7 -0
- package/dist/modules/ecommerce/lib/cacheKeys.js +236 -0
- package/dist/modules/ecommerce/lib/cacheKeys.js.map +7 -0
- package/dist/modules/ecommerce/lib/createConflictRecheck.js +29 -0
- package/dist/modules/ecommerce/lib/createConflictRecheck.js.map +7 -0
- package/dist/modules/ecommerce/lib/crudEvents.js +94 -0
- package/dist/modules/ecommerce/lib/crudEvents.js.map +7 -0
- package/dist/modules/ecommerce/lib/crudSupport.js +64 -0
- package/dist/modules/ecommerce/lib/crudSupport.js.map +7 -0
- package/dist/modules/ecommerce/lib/domainBindingRebind.js +99 -0
- package/dist/modules/ecommerce/lib/domainBindingRebind.js.map +7 -0
- package/dist/modules/ecommerce/lib/domainMappingSummaries.js +39 -0
- package/dist/modules/ecommerce/lib/domainMappingSummaries.js.map +7 -0
- package/dist/modules/ecommerce/lib/exclusiveFlag.js +57 -0
- package/dist/modules/ecommerce/lib/exclusiveFlag.js.map +7 -0
- package/dist/modules/ecommerce/lib/references.js +70 -0
- package/dist/modules/ecommerce/lib/references.js.map +7 -0
- package/dist/modules/ecommerce/lib/seedDraftStore.js +99 -0
- package/dist/modules/ecommerce/lib/seedDraftStore.js.map +7 -0
- package/dist/modules/ecommerce/lib/storeBindingCascade.js +109 -0
- package/dist/modules/ecommerce/lib/storeBindingCascade.js.map +7 -0
- package/dist/modules/ecommerce/lib/storeBranding.js +40 -0
- package/dist/modules/ecommerce/lib/storeBranding.js.map +7 -0
- package/dist/modules/ecommerce/lib/storeBrandingRoute.js +76 -0
- package/dist/modules/ecommerce/lib/storeBrandingRoute.js.map +7 -0
- package/dist/modules/ecommerce/lib/storeContext.js +393 -0
- package/dist/modules/ecommerce/lib/storeContext.js.map +7 -0
- package/dist/modules/ecommerce/lib/storeContextService.js +43 -0
- package/dist/modules/ecommerce/lib/storeContextService.js.map +7 -0
- package/dist/modules/ecommerce/lib/storeLocale.js +60 -0
- package/dist/modules/ecommerce/lib/storeLocale.js.map +7 -0
- package/dist/modules/ecommerce/lib/storeNotifications.js +41 -0
- package/dist/modules/ecommerce/lib/storeNotifications.js.map +7 -0
- package/dist/modules/ecommerce/lib/storefrontCatalogSupport.js +248 -0
- package/dist/modules/ecommerce/lib/storefrontCatalogSupport.js.map +7 -0
- package/dist/modules/ecommerce/lib/storefrontCategories.js +241 -0
- package/dist/modules/ecommerce/lib/storefrontCategories.js.map +7 -0
- package/dist/modules/ecommerce/lib/storefrontCategoryCache.js +71 -0
- package/dist/modules/ecommerce/lib/storefrontCategoryCache.js.map +7 -0
- package/dist/modules/ecommerce/lib/storefrontDetail.js +447 -0
- package/dist/modules/ecommerce/lib/storefrontDetail.js.map +7 -0
- package/dist/modules/ecommerce/lib/storefrontFacets.js +441 -0
- package/dist/modules/ecommerce/lib/storefrontFacets.js.map +7 -0
- package/dist/modules/ecommerce/lib/storefrontOptionFilter.js +15 -0
- package/dist/modules/ecommerce/lib/storefrontOptionFilter.js.map +7 -0
- package/dist/modules/ecommerce/lib/storefrontPricing.js +393 -0
- package/dist/modules/ecommerce/lib/storefrontPricing.js.map +7 -0
- package/dist/modules/ecommerce/lib/storefrontProductCache.js +90 -0
- package/dist/modules/ecommerce/lib/storefrontProductCache.js.map +7 -0
- package/dist/modules/ecommerce/lib/storefrontProductScope.js +107 -0
- package/dist/modules/ecommerce/lib/storefrontProductScope.js.map +7 -0
- package/dist/modules/ecommerce/lib/storefrontProducts.js +670 -0
- package/dist/modules/ecommerce/lib/storefrontProducts.js.map +7 -0
- package/dist/modules/ecommerce/lib/storefrontQuery.js +156 -0
- package/dist/modules/ecommerce/lib/storefrontQuery.js.map +7 -0
- package/dist/modules/ecommerce/lib/storefrontRateLimit.js +99 -0
- package/dist/modules/ecommerce/lib/storefrontRateLimit.js.map +7 -0
- package/dist/modules/ecommerce/lib/storefrontSearch.js +303 -0
- package/dist/modules/ecommerce/lib/storefrontSearch.js.map +7 -0
- package/dist/modules/ecommerce/lib/storefrontSearchCache.js +35 -0
- package/dist/modules/ecommerce/lib/storefrontSearchCache.js.map +7 -0
- package/dist/modules/ecommerce/lib/subscriberSupport.js +33 -0
- package/dist/modules/ecommerce/lib/subscriberSupport.js.map +7 -0
- package/dist/modules/ecommerce/lib/types.js +1 -0
- package/dist/modules/ecommerce/lib/types.js.map +7 -0
- package/dist/modules/ecommerce/migrations/Migration20261005113233_ecommerce.js +32 -0
- package/dist/modules/ecommerce/migrations/Migration20261005113233_ecommerce.js.map +7 -0
- package/dist/modules/ecommerce/migrations/Migration20261006112733_ecommerce.js +17 -0
- package/dist/modules/ecommerce/migrations/Migration20261006112733_ecommerce.js.map +7 -0
- package/dist/modules/ecommerce/notifications.client.js +47 -0
- package/dist/modules/ecommerce/notifications.client.js.map +7 -0
- package/dist/modules/ecommerce/notifications.js +48 -0
- package/dist/modules/ecommerce/notifications.js.map +7 -0
- package/dist/modules/ecommerce/search.js +83 -0
- package/dist/modules/ecommerce/search.js.map +7 -0
- package/dist/modules/ecommerce/setup.js +17 -0
- package/dist/modules/ecommerce/setup.js.map +7 -0
- package/dist/modules/ecommerce/subscribers/assortment-empty-notifications.js +14 -0
- package/dist/modules/ecommerce/subscribers/assortment-empty-notifications.js.map +7 -0
- package/dist/modules/ecommerce/subscribers/availability-policy-cache-invalidation.js +14 -0
- package/dist/modules/ecommerce/subscribers/availability-policy-cache-invalidation.js.map +7 -0
- package/dist/modules/ecommerce/subscribers/catalog-category-cache-invalidation.js +14 -0
- package/dist/modules/ecommerce/subscribers/catalog-category-cache-invalidation.js.map +7 -0
- package/dist/modules/ecommerce/subscribers/catalog-price-cache-invalidation.js +14 -0
- package/dist/modules/ecommerce/subscribers/catalog-price-cache-invalidation.js.map +7 -0
- package/dist/modules/ecommerce/subscribers/catalog-product-cache-invalidation.js +14 -0
- package/dist/modules/ecommerce/subscribers/catalog-product-cache-invalidation.js.map +7 -0
- package/dist/modules/ecommerce/subscribers/catalog-variant-cache-invalidation.js +14 -0
- package/dist/modules/ecommerce/subscribers/catalog-variant-cache-invalidation.js.map +7 -0
- package/dist/modules/ecommerce/subscribers/customer-group-cache-invalidation.js +14 -0
- package/dist/modules/ecommerce/subscribers/customer-group-cache-invalidation.js.map +7 -0
- package/dist/modules/ecommerce/subscribers/customer-group-membership-cache-invalidation.js +14 -0
- package/dist/modules/ecommerce/subscribers/customer-group-membership-cache-invalidation.js.map +7 -0
- package/dist/modules/ecommerce/subscribers/customer-group-terms-cache-invalidation.js +14 -0
- package/dist/modules/ecommerce/subscribers/customer-group-terms-cache-invalidation.js.map +7 -0
- package/dist/modules/ecommerce/subscribers/customer-user-deleted-cache-invalidation.js +14 -0
- package/dist/modules/ecommerce/subscribers/customer-user-deleted-cache-invalidation.js.map +7 -0
- package/dist/modules/ecommerce/subscribers/customer-user-updated-cache-invalidation.js +14 -0
- package/dist/modules/ecommerce/subscribers/customer-user-updated-cache-invalidation.js.map +7 -0
- package/dist/modules/ecommerce/subscribers/domain-binding-rebind.js +16 -0
- package/dist/modules/ecommerce/subscribers/domain-binding-rebind.js.map +7 -0
- package/dist/modules/ecommerce/subscribers/domain-mapping-cache-invalidation.js +14 -0
- package/dist/modules/ecommerce/subscribers/domain-mapping-cache-invalidation.js.map +7 -0
- package/dist/modules/ecommerce/subscribers/store-cache-invalidation.js +14 -0
- package/dist/modules/ecommerce/subscribers/store-cache-invalidation.js.map +7 -0
- package/dist/modules/ecommerce/subscribers/store-channel-binding-cache-invalidation.js +14 -0
- package/dist/modules/ecommerce/subscribers/store-channel-binding-cache-invalidation.js.map +7 -0
- package/dist/modules/ecommerce/subscribers/store-domain-binding-cache-invalidation.js +14 -0
- package/dist/modules/ecommerce/subscribers/store-domain-binding-cache-invalidation.js.map +7 -0
- package/dist/modules/ecommerce/subscribers/store-notifications.js +14 -0
- package/dist/modules/ecommerce/subscribers/store-notifications.js.map +7 -0
- package/dist/modules/query_index/lib/batch.js +23 -9
- package/dist/modules/query_index/lib/batch.js.map +2 -2
- package/dist/modules/query_index/lib/doc-enrichers.js +212 -0
- package/dist/modules/query_index/lib/doc-enrichers.js.map +7 -0
- package/dist/modules/query_index/lib/document.js +2 -0
- package/dist/modules/query_index/lib/document.js.map +2 -2
- package/dist/modules/query_index/lib/engine.js +68 -1
- package/dist/modules/query_index/lib/engine.js.map +2 -2
- package/dist/modules/query_index/lib/indexer.js +7 -0
- package/dist/modules/query_index/lib/indexer.js.map +2 -2
- package/dist/modules/query_index/lib/search-tokens.js +2 -0
- package/dist/modules/query_index/lib/search-tokens.js.map +2 -2
- package/dist/modules/query_index/migrations/Migration20261005201500_query_index.js +17 -0
- package/dist/modules/query_index/migrations/Migration20261005201500_query_index.js.map +7 -0
- package/dist/modules/translations/components/TranslationManager.js +3 -3
- package/dist/modules/translations/components/TranslationManager.js.map +2 -2
- package/dist/modules/translations/data/validators.js +1 -1
- package/dist/modules/translations/data/validators.js.map +1 -1
- package/dist/modules/translations/lib/batch.js +21 -1
- package/dist/modules/translations/lib/batch.js.map +2 -2
- package/dist/modules/translations/lib/helpers.js +3 -0
- package/dist/modules/translations/lib/helpers.js.map +2 -2
- package/dist/modules/translations/lib/resolve-field-list.js +14 -2
- package/dist/modules/translations/lib/resolve-field-list.js.map +2 -2
- package/generated/entities/catalog_price_history_entry/index.ts +25 -0
- package/generated/entities/customer_group_terms/index.ts +1 -0
- package/generated/entities/ecommerce_store/index.ts +15 -0
- package/generated/entities/ecommerce_store_channel_binding/index.ts +13 -0
- package/generated/entities/ecommerce_store_domain_binding/index.ts +10 -0
- package/generated/entities.ids.generated.ts +8 -1
- package/generated/entity-fields-registry.ts +72 -0
- package/package.json +7 -7
- package/src/helpers/integration/customerGroupsFixtures.ts +2 -0
- package/src/modules/auth/i18n/de.json +8 -0
- package/src/modules/auth/i18n/en.json +8 -0
- package/src/modules/auth/i18n/es.json +8 -0
- package/src/modules/auth/i18n/ko.json +8 -0
- package/src/modules/auth/i18n/pl.json +8 -0
- package/src/modules/catalog/AGENTS.md +5 -2
- package/src/modules/catalog/acl.ts +7 -0
- package/src/modules/catalog/api/config/omnibus/route.ts +204 -0
- package/src/modules/catalog/api/prices/history/route.ts +139 -0
- package/src/modules/catalog/api/prices/omnibus-preview/route.ts +202 -0
- package/src/modules/catalog/api/products/route.ts +53 -308
- package/src/modules/catalog/api/tags/route.ts +6 -0
- package/src/modules/catalog/backend/config/catalog/page.tsx +2 -0
- package/src/modules/catalog/cli.ts +84 -1
- package/src/modules/catalog/commands/categories.ts +54 -2
- package/src/modules/catalog/commands/prices.ts +43 -1
- package/src/modules/catalog/commands/products.ts +84 -1
- package/src/modules/catalog/commands/variants.ts +7 -0
- package/src/modules/catalog/components/OmnibusSettings.tsx +832 -0
- package/src/modules/catalog/components/PriceEditorOmnibusRow.tsx +219 -0
- package/src/modules/catalog/components/lookupSources.ts +29 -0
- package/src/modules/catalog/components/prices/PriceScopeSelectors.tsx +9 -0
- package/src/modules/catalog/components/products/VariantBuilder.tsx +9 -0
- package/src/modules/catalog/data/entities.ts +123 -1
- package/src/modules/catalog/data/validators.ts +118 -0
- package/src/modules/catalog/di.ts +23 -0
- package/src/modules/catalog/i18n/de.json +77 -0
- package/src/modules/catalog/i18n/en.json +77 -0
- package/src/modules/catalog/i18n/es.json +77 -0
- package/src/modules/catalog/i18n/ko.json +77 -0
- package/src/modules/catalog/i18n/pl.json +77 -0
- package/src/modules/catalog/lib/omnibus.ts +406 -0
- package/src/modules/catalog/lib/omnibusBackfill.ts +198 -0
- package/src/modules/catalog/lib/omnibusCache.ts +111 -0
- package/src/modules/catalog/lib/omnibusConfig.ts +73 -0
- package/src/modules/catalog/lib/omnibusHistoryQueries.ts +248 -0
- package/src/modules/catalog/lib/omnibusPresentedEntry.ts +76 -0
- package/src/modules/catalog/lib/omnibusProductListEnrichment.ts +125 -0
- package/src/modules/catalog/lib/omnibusTypes.ts +202 -0
- package/src/modules/catalog/lib/optionSchemaTranslations.ts +55 -0
- package/src/modules/catalog/lib/priceHistoryQuery.ts +155 -0
- package/src/modules/catalog/lib/pricing.ts +42 -4
- package/src/modules/catalog/lib/productFilters.ts +349 -0
- package/src/modules/catalog/lib/productScopeKeys.ts +162 -0
- package/src/modules/catalog/lib/productScopeReindex.ts +139 -0
- package/src/modules/catalog/migrations/.snapshot-open-mercato.json +572 -0
- package/src/modules/catalog/migrations/Migration20261005105352_catalog.ts +39 -0
- package/src/modules/catalog/migrations/Migration20261005150824_catalog.ts +39 -0
- package/src/modules/catalog/services/catalogOmnibusService.ts +642 -0
- package/src/modules/catalog/setup.ts +2 -0
- package/src/modules/catalog/subscribers/product-scope-keys-category-deleted.ts +18 -0
- package/src/modules/catalog/subscribers/product-scope-keys-category-updated.ts +19 -0
- package/src/modules/catalog/translations.ts +12 -0
- package/src/modules/configs/i18n/de.json +5 -1
- package/src/modules/configs/i18n/en.json +5 -1
- package/src/modules/configs/i18n/es.json +5 -1
- package/src/modules/configs/i18n/ko.json +5 -1
- package/src/modules/configs/i18n/pl.json +5 -1
- package/src/modules/configs/lib/upgrade-actions.ts +35 -0
- package/src/modules/customer_groups/api/customer-groups/[id]/terms/route.ts +7 -0
- package/src/modules/customer_groups/components/CustomerGroupTermsSection.tsx +124 -2
- package/src/modules/customer_groups/components/customerGroupAssortmentScope.ts +46 -0
- package/src/modules/customer_groups/data/entities.ts +4 -0
- package/src/modules/customer_groups/data/validators.ts +14 -0
- package/src/modules/customer_groups/i18n/de.json +12 -0
- package/src/modules/customer_groups/i18n/en.json +12 -0
- package/src/modules/customer_groups/i18n/es.json +12 -0
- package/src/modules/customer_groups/i18n/ko.json +12 -0
- package/src/modules/customer_groups/i18n/pl.json +12 -0
- package/src/modules/customer_groups/migrations/.snapshot-open-mercato.json +17 -0
- package/src/modules/customer_groups/migrations/Migration20261005110250_customer_groups.ts +15 -0
- package/src/modules/customer_groups/services/customerGroupsService.ts +74 -23
- package/src/modules/ecommerce/acl.ts +9 -0
- package/src/modules/ecommerce/api/domain-mappings/route.ts +76 -0
- package/src/modules/ecommerce/api/openapi.ts +28 -0
- package/src/modules/ecommerce/api/store-channel-bindings/[id]/assortment-count/route.ts +141 -0
- package/src/modules/ecommerce/api/store-channel-bindings/crud.ts +283 -0
- package/src/modules/ecommerce/api/store-channel-bindings/route.ts +67 -0
- package/src/modules/ecommerce/api/store-domain-bindings/crud.ts +324 -0
- package/src/modules/ecommerce/api/store-domain-bindings/route.ts +73 -0
- package/src/modules/ecommerce/api/storefront/categories/[slug]/route.ts +94 -0
- package/src/modules/ecommerce/api/storefront/categories/openapiSchemas.ts +63 -0
- package/src/modules/ecommerce/api/storefront/categories/route.ts +78 -0
- package/src/modules/ecommerce/api/storefront/context/route.ts +203 -0
- package/src/modules/ecommerce/api/storefront/products/[idOrHandle]/route.ts +94 -0
- package/src/modules/ecommerce/api/storefront/products/openapiSchemas.ts +193 -0
- package/src/modules/ecommerce/api/storefront/products/route.ts +81 -0
- package/src/modules/ecommerce/api/storefront/search/suggest/openapiSchemas.ts +25 -0
- package/src/modules/ecommerce/api/storefront/search/suggest/route.ts +78 -0
- package/src/modules/ecommerce/api/storefront/storefrontRouteSupport.ts +68 -0
- package/src/modules/ecommerce/api/stores/[id]/branding/route.ts +205 -0
- package/src/modules/ecommerce/api/stores/[id]/preview-branding/route.ts +99 -0
- package/src/modules/ecommerce/api/stores/crud.ts +457 -0
- package/src/modules/ecommerce/api/stores/route.ts +66 -0
- package/src/modules/ecommerce/backend/config/ecommerce/[id]/page.meta.ts +12 -0
- package/src/modules/ecommerce/backend/config/ecommerce/[id]/page.tsx +5 -0
- package/src/modules/ecommerce/backend/config/ecommerce/page.meta.ts +12 -0
- package/src/modules/ecommerce/backend/config/ecommerce/page.tsx +5 -0
- package/src/modules/ecommerce/commands/stores.ts +154 -0
- package/src/modules/ecommerce/components/ChannelAssortmentCount.tsx +138 -0
- package/src/modules/ecommerce/components/ChannelBindingFormSections.tsx +40 -0
- package/src/modules/ecommerce/components/ChannelLookupPicker.tsx +5 -0
- package/src/modules/ecommerce/components/DomainStatusWarning.tsx +32 -0
- package/src/modules/ecommerce/components/StoreAvailabilityDefaultsSection.tsx +219 -0
- package/src/modules/ecommerce/components/StoreBrandingControls.tsx +73 -0
- package/src/modules/ecommerce/components/StoreBrandingPreview.tsx +77 -0
- package/src/modules/ecommerce/components/StoreBrandingTab.tsx +242 -0
- package/src/modules/ecommerce/components/StoreChannelBindingDialog.tsx +306 -0
- package/src/modules/ecommerce/components/StoreChannelsTab.tsx +375 -0
- package/src/modules/ecommerce/components/StoreCreateDialog.tsx +204 -0
- package/src/modules/ecommerce/components/StoreDomainBindingDialog.tsx +198 -0
- package/src/modules/ecommerce/components/StoreDomainsTab.tsx +426 -0
- package/src/modules/ecommerce/components/StoreEditPage.tsx +193 -0
- package/src/modules/ecommerce/components/StoreGeneralTab.tsx +189 -0
- package/src/modules/ecommerce/components/StoreListPage.tsx +326 -0
- package/src/modules/ecommerce/components/StoreSeoTab.tsx +152 -0
- package/src/modules/ecommerce/components/StoreStatusBadge.tsx +22 -0
- package/src/modules/ecommerce/components/channelLookups.ts +24 -0
- package/src/modules/ecommerce/components/storeAdmin.ts +56 -0
- package/src/modules/ecommerce/components/storeBrandingForm.ts +230 -0
- package/src/modules/ecommerce/components/storeChannels.ts +210 -0
- package/src/modules/ecommerce/components/storeDomains.ts +221 -0
- package/src/modules/ecommerce/components/storeEditTabs.tsx +76 -0
- package/src/modules/ecommerce/components/storeGeneral.ts +155 -0
- package/src/modules/ecommerce/components/storeSeo.ts +78 -0
- package/src/modules/ecommerce/components/useChannelAssortmentCount.ts +67 -0
- package/src/modules/ecommerce/components/useStoreAccess.ts +36 -0
- package/src/modules/ecommerce/data/enrichers.ts +213 -0
- package/src/modules/ecommerce/data/entities.ts +168 -0
- package/src/modules/ecommerce/data/validators.ts +587 -0
- package/src/modules/ecommerce/di.ts +9 -0
- package/src/modules/ecommerce/events.ts +27 -0
- package/src/modules/ecommerce/i18n/de.json +341 -0
- package/src/modules/ecommerce/i18n/en.json +341 -0
- package/src/modules/ecommerce/i18n/es.json +341 -0
- package/src/modules/ecommerce/i18n/ko.json +341 -0
- package/src/modules/ecommerce/i18n/pl.json +341 -0
- package/src/modules/ecommerce/index.ts +14 -0
- package/src/modules/ecommerce/lib/assortmentCount.ts +175 -0
- package/src/modules/ecommerce/lib/brandingStyles.ts +215 -0
- package/src/modules/ecommerce/lib/buyerContext.ts +401 -0
- package/src/modules/ecommerce/lib/cacheInvalidation.ts +302 -0
- package/src/modules/ecommerce/lib/cacheKeys.ts +340 -0
- package/src/modules/ecommerce/lib/createConflictRecheck.ts +31 -0
- package/src/modules/ecommerce/lib/crudEvents.ts +128 -0
- package/src/modules/ecommerce/lib/crudSupport.ts +85 -0
- package/src/modules/ecommerce/lib/domainBindingRebind.ts +138 -0
- package/src/modules/ecommerce/lib/domainMappingSummaries.ts +71 -0
- package/src/modules/ecommerce/lib/exclusiveFlag.ts +90 -0
- package/src/modules/ecommerce/lib/references.ts +93 -0
- package/src/modules/ecommerce/lib/seedDraftStore.ts +125 -0
- package/src/modules/ecommerce/lib/storeBindingCascade.ts +138 -0
- package/src/modules/ecommerce/lib/storeBranding.ts +48 -0
- package/src/modules/ecommerce/lib/storeBrandingRoute.ts +91 -0
- package/src/modules/ecommerce/lib/storeContext.ts +669 -0
- package/src/modules/ecommerce/lib/storeContextService.ts +71 -0
- package/src/modules/ecommerce/lib/storeLocale.ts +88 -0
- package/src/modules/ecommerce/lib/storeNotifications.ts +55 -0
- package/src/modules/ecommerce/lib/storefrontCatalogSupport.ts +427 -0
- package/src/modules/ecommerce/lib/storefrontCategories.ts +419 -0
- package/src/modules/ecommerce/lib/storefrontCategoryCache.ts +113 -0
- package/src/modules/ecommerce/lib/storefrontDetail.ts +654 -0
- package/src/modules/ecommerce/lib/storefrontFacets.ts +697 -0
- package/src/modules/ecommerce/lib/storefrontOptionFilter.ts +44 -0
- package/src/modules/ecommerce/lib/storefrontPricing.ts +583 -0
- package/src/modules/ecommerce/lib/storefrontProductCache.ts +126 -0
- package/src/modules/ecommerce/lib/storefrontProductScope.ts +181 -0
- package/src/modules/ecommerce/lib/storefrontProducts.ts +963 -0
- package/src/modules/ecommerce/lib/storefrontQuery.ts +215 -0
- package/src/modules/ecommerce/lib/storefrontRateLimit.ts +126 -0
- package/src/modules/ecommerce/lib/storefrontSearch.ts +454 -0
- package/src/modules/ecommerce/lib/storefrontSearchCache.ts +49 -0
- package/src/modules/ecommerce/lib/subscriberSupport.ts +41 -0
- package/src/modules/ecommerce/lib/types.ts +69 -0
- package/src/modules/ecommerce/migrations/.snapshot-open-mercato.json +829 -0
- package/src/modules/ecommerce/migrations/Migration20261005113233_ecommerce.ts +32 -0
- package/src/modules/ecommerce/migrations/Migration20261006112733_ecommerce.ts +15 -0
- package/src/modules/ecommerce/notifications.client.ts +46 -0
- package/src/modules/ecommerce/notifications.ts +46 -0
- package/src/modules/ecommerce/search.ts +93 -0
- package/src/modules/ecommerce/setup.ts +15 -0
- package/src/modules/ecommerce/subscribers/assortment-empty-notifications.ts +12 -0
- package/src/modules/ecommerce/subscribers/availability-policy-cache-invalidation.ts +12 -0
- package/src/modules/ecommerce/subscribers/catalog-category-cache-invalidation.ts +12 -0
- package/src/modules/ecommerce/subscribers/catalog-price-cache-invalidation.ts +12 -0
- package/src/modules/ecommerce/subscribers/catalog-product-cache-invalidation.ts +12 -0
- package/src/modules/ecommerce/subscribers/catalog-variant-cache-invalidation.ts +12 -0
- package/src/modules/ecommerce/subscribers/customer-group-cache-invalidation.ts +12 -0
- package/src/modules/ecommerce/subscribers/customer-group-membership-cache-invalidation.ts +12 -0
- package/src/modules/ecommerce/subscribers/customer-group-terms-cache-invalidation.ts +12 -0
- package/src/modules/ecommerce/subscribers/customer-user-deleted-cache-invalidation.ts +12 -0
- package/src/modules/ecommerce/subscribers/customer-user-updated-cache-invalidation.ts +12 -0
- package/src/modules/ecommerce/subscribers/domain-binding-rebind.ts +14 -0
- package/src/modules/ecommerce/subscribers/domain-mapping-cache-invalidation.ts +12 -0
- package/src/modules/ecommerce/subscribers/store-cache-invalidation.ts +12 -0
- package/src/modules/ecommerce/subscribers/store-channel-binding-cache-invalidation.ts +12 -0
- package/src/modules/ecommerce/subscribers/store-domain-binding-cache-invalidation.ts +12 -0
- package/src/modules/ecommerce/subscribers/store-notifications.ts +12 -0
- package/src/modules/query_index/lib/batch.ts +25 -9
- package/src/modules/query_index/lib/doc-enrichers.ts +306 -0
- package/src/modules/query_index/lib/document.ts +2 -0
- package/src/modules/query_index/lib/engine.ts +58 -1
- package/src/modules/query_index/lib/indexer.ts +8 -0
- package/src/modules/query_index/lib/search-tokens.ts +2 -0
- package/src/modules/query_index/migrations/Migration20261005201500_query_index.ts +42 -0
- package/src/modules/translations/components/TranslationManager.tsx +3 -3
- package/src/modules/translations/data/validators.ts +1 -1
- package/src/modules/translations/lib/batch.ts +47 -0
- package/src/modules/translations/lib/helpers.ts +4 -0
- package/src/modules/translations/lib/resolve-field-list.ts +16 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const metadata = {
|
|
2
|
+
requireAuth: true,
|
|
3
|
+
requireFeatures: ["ecommerce.stores.view"],
|
|
4
|
+
pageTitle: "Stores",
|
|
5
|
+
pageTitleKey: "ecommerce.module.title",
|
|
6
|
+
pageGroup: "Module Configs",
|
|
7
|
+
pageGroupKey: "settings.sections.moduleConfigs",
|
|
8
|
+
pageOrder: 25,
|
|
9
|
+
pageContext: "settings",
|
|
10
|
+
icon: "store",
|
|
11
|
+
breadcrumb: [{ label: "Stores", labelKey: "ecommerce.module.title" }]
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
metadata
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=page.meta.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/modules/ecommerce/backend/config/ecommerce/page.meta.ts"],
|
|
4
|
+
"sourcesContent": ["export const metadata = {\n requireAuth: true,\n requireFeatures: ['ecommerce.stores.view'],\n pageTitle: 'Stores',\n pageTitleKey: 'ecommerce.module.title',\n pageGroup: 'Module Configs',\n pageGroupKey: 'settings.sections.moduleConfigs',\n pageOrder: 25,\n pageContext: 'settings' as const,\n icon: 'store',\n breadcrumb: [{ label: 'Stores', labelKey: 'ecommerce.module.title' }],\n} as const\n"],
|
|
5
|
+
"mappings": "AAAO,MAAM,WAAW;AAAA,EACtB,aAAa;AAAA,EACb,iBAAiB,CAAC,uBAAuB;AAAA,EACzC,WAAW;AAAA,EACX,cAAc;AAAA,EACd,WAAW;AAAA,EACX,cAAc;AAAA,EACd,WAAW;AAAA,EACX,aAAa;AAAA,EACb,MAAM;AAAA,EACN,YAAY,CAAC,EAAE,OAAO,UAAU,UAAU,yBAAyB,CAAC;AACtE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { registerCommand } from "@open-mercato/shared/lib/commands";
|
|
2
|
+
import { buildChanges } from "@open-mercato/shared/lib/commands/helpers";
|
|
3
|
+
import { ensureOrganizationScope, ensureTenantScope } from "@open-mercato/shared/lib/commands/scope";
|
|
4
|
+
import { extractUndoPayload } from "@open-mercato/shared/lib/commands/undo";
|
|
5
|
+
import { CrudHttpError } from "@open-mercato/shared/lib/crud/errors";
|
|
6
|
+
import { enforceCommandOptimisticLockWithGuards } from "@open-mercato/shared/lib/crud/optimistic-lock-command";
|
|
7
|
+
import { findOneWithDecryption } from "@open-mercato/shared/lib/encryption/find";
|
|
8
|
+
import { resolveTranslations } from "@open-mercato/shared/lib/i18n/server";
|
|
9
|
+
import { EcommerceStore } from "../data/entities.js";
|
|
10
|
+
import { ecommerceStoreBrandingSchema } from "../data/validators.js";
|
|
11
|
+
import { announceStoreBrandingUpdated } from "../lib/crudEvents.js";
|
|
12
|
+
import {
|
|
13
|
+
compactBranding,
|
|
14
|
+
mergeBrandingIntoSettings,
|
|
15
|
+
STORE_BRANDING_RESOURCE_KIND,
|
|
16
|
+
STORE_BRANDING_UPDATE_COMMAND_ID
|
|
17
|
+
} from "../lib/storeBranding.js";
|
|
18
|
+
const BRANDING_CHANGE_KEYS = ["branding"];
|
|
19
|
+
async function loadStore(em, scope) {
|
|
20
|
+
return findOneWithDecryption(
|
|
21
|
+
em,
|
|
22
|
+
EcommerceStore,
|
|
23
|
+
{ id: scope.id, tenantId: scope.tenantId, organizationId: scope.organizationId, deletedAt: null },
|
|
24
|
+
void 0,
|
|
25
|
+
{ tenantId: scope.tenantId, organizationId: scope.organizationId }
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function toSnapshot(store) {
|
|
29
|
+
return {
|
|
30
|
+
id: store.id,
|
|
31
|
+
tenantId: store.tenantId,
|
|
32
|
+
organizationId: store.organizationId,
|
|
33
|
+
branding: compactBranding(store.settings?.branding ?? {}),
|
|
34
|
+
updatedAt: store.updatedAt.toISOString()
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
async function loadSnapshot(ctx, scope) {
|
|
38
|
+
const em = ctx.container.resolve("em").fork();
|
|
39
|
+
const store = await loadStore(em, scope);
|
|
40
|
+
return store ? toSnapshot(store) : null;
|
|
41
|
+
}
|
|
42
|
+
const updateStoreBrandingCommand = {
|
|
43
|
+
id: STORE_BRANDING_UPDATE_COMMAND_ID,
|
|
44
|
+
async prepare(input, ctx) {
|
|
45
|
+
ensureTenantScope(ctx, input.tenantId);
|
|
46
|
+
ensureOrganizationScope(ctx, input.organizationId);
|
|
47
|
+
const snapshot = await loadSnapshot(ctx, input);
|
|
48
|
+
return snapshot ? { before: snapshot } : {};
|
|
49
|
+
},
|
|
50
|
+
async execute(input, ctx) {
|
|
51
|
+
ensureTenantScope(ctx, input.tenantId);
|
|
52
|
+
ensureOrganizationScope(ctx, input.organizationId);
|
|
53
|
+
const branding = compactBranding(ecommerceStoreBrandingSchema.parse(input.branding));
|
|
54
|
+
const em = ctx.container.resolve("em").fork();
|
|
55
|
+
const store = await loadStore(em, input);
|
|
56
|
+
if (!store) {
|
|
57
|
+
const { translate } = await resolveTranslations();
|
|
58
|
+
throw new CrudHttpError(404, {
|
|
59
|
+
error: translate("ecommerce.errors.storeNotFound", "The selected store does not exist in this organization.")
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
await enforceCommandOptimisticLockWithGuards(ctx.container, {
|
|
63
|
+
resourceKind: STORE_BRANDING_RESOURCE_KIND,
|
|
64
|
+
resourceId: store.id,
|
|
65
|
+
current: store.updatedAt,
|
|
66
|
+
request: ctx.request
|
|
67
|
+
});
|
|
68
|
+
store.settings = mergeBrandingIntoSettings(store.settings, branding);
|
|
69
|
+
await em.flush();
|
|
70
|
+
await announceStoreBrandingUpdated(ctx.container, store);
|
|
71
|
+
return { id: store.id, updatedAt: store.updatedAt.toISOString(), branding };
|
|
72
|
+
},
|
|
73
|
+
async captureAfter(input, _result, ctx) {
|
|
74
|
+
return loadSnapshot(ctx, input);
|
|
75
|
+
},
|
|
76
|
+
async buildLog({ snapshots, input }) {
|
|
77
|
+
const before = snapshots.before;
|
|
78
|
+
const after = snapshots.after;
|
|
79
|
+
if (!before || !after) return null;
|
|
80
|
+
const { translate } = await resolveTranslations();
|
|
81
|
+
return {
|
|
82
|
+
actionLabel: translate("ecommerce.audit.stores.branding.update", "Update store branding"),
|
|
83
|
+
resourceKind: STORE_BRANDING_RESOURCE_KIND,
|
|
84
|
+
resourceId: before.id,
|
|
85
|
+
tenantId: input.tenantId,
|
|
86
|
+
organizationId: input.organizationId,
|
|
87
|
+
snapshotBefore: before,
|
|
88
|
+
snapshotAfter: after,
|
|
89
|
+
changes: buildChanges(before, after, BRANDING_CHANGE_KEYS),
|
|
90
|
+
payload: {
|
|
91
|
+
undo: { before, after }
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
async undo({ logEntry, ctx }) {
|
|
96
|
+
const payload = extractUndoPayload(logEntry);
|
|
97
|
+
const before = payload?.before;
|
|
98
|
+
if (!before) return;
|
|
99
|
+
ensureTenantScope(ctx, before.tenantId);
|
|
100
|
+
ensureOrganizationScope(ctx, before.organizationId);
|
|
101
|
+
const em = ctx.container.resolve("em").fork();
|
|
102
|
+
const store = await loadStore(em, before);
|
|
103
|
+
if (!store) return;
|
|
104
|
+
store.settings = mergeBrandingIntoSettings(store.settings, before.branding);
|
|
105
|
+
await em.flush();
|
|
106
|
+
await announceStoreBrandingUpdated(ctx.container, store);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
registerCommand(updateStoreBrandingCommand);
|
|
110
|
+
//# sourceMappingURL=stores.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/ecommerce/commands/stores.ts"],
|
|
4
|
+
"sourcesContent": ["import type { EntityManager } from '@mikro-orm/postgresql'\nimport { registerCommand } from '@open-mercato/shared/lib/commands'\nimport type { CommandHandler } from '@open-mercato/shared/lib/commands'\nimport { buildChanges } from '@open-mercato/shared/lib/commands/helpers'\nimport { ensureOrganizationScope, ensureTenantScope } from '@open-mercato/shared/lib/commands/scope'\nimport { extractUndoPayload } from '@open-mercato/shared/lib/commands/undo'\nimport { CrudHttpError } from '@open-mercato/shared/lib/crud/errors'\nimport { enforceCommandOptimisticLockWithGuards } from '@open-mercato/shared/lib/crud/optimistic-lock-command'\nimport { findOneWithDecryption } from '@open-mercato/shared/lib/encryption/find'\nimport { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'\nimport { EcommerceStore } from '../data/entities'\nimport { ecommerceStoreBrandingSchema, type EcommerceStoreBranding } from '../data/validators'\nimport { announceStoreBrandingUpdated } from '../lib/crudEvents'\nimport {\n compactBranding,\n mergeBrandingIntoSettings,\n STORE_BRANDING_RESOURCE_KIND,\n STORE_BRANDING_UPDATE_COMMAND_ID,\n} from '../lib/storeBranding'\n\nexport type StoreBrandingUpdateInput = {\n id: string\n tenantId: string\n organizationId: string\n branding: EcommerceStoreBranding\n}\n\nexport type StoreBrandingUpdateResult = {\n id: string\n updatedAt: string\n branding: EcommerceStoreBranding\n}\n\ntype StoreBrandingSnapshot = {\n id: string\n tenantId: string\n organizationId: string\n branding: EcommerceStoreBranding\n updatedAt: string\n}\n\ntype StoreBrandingUndoPayload = {\n before?: StoreBrandingSnapshot | null\n after?: StoreBrandingSnapshot | null\n}\n\nconst BRANDING_CHANGE_KEYS = ['branding'] as const\n\nasync function loadStore(\n em: EntityManager,\n scope: { id: string; tenantId: string; organizationId: string },\n): Promise<EcommerceStore | null> {\n return findOneWithDecryption(\n em,\n EcommerceStore,\n { id: scope.id, tenantId: scope.tenantId, organizationId: scope.organizationId, deletedAt: null },\n undefined,\n { tenantId: scope.tenantId, organizationId: scope.organizationId },\n )\n}\n\nfunction toSnapshot(store: EcommerceStore): StoreBrandingSnapshot {\n return {\n id: store.id,\n tenantId: store.tenantId,\n organizationId: store.organizationId,\n branding: compactBranding(store.settings?.branding ?? {}),\n updatedAt: store.updatedAt.toISOString(),\n }\n}\n\nasync function loadSnapshot(\n ctx: { container: { resolve: (name: string) => unknown } },\n scope: { id: string; tenantId: string; organizationId: string },\n): Promise<StoreBrandingSnapshot | null> {\n const em = (ctx.container.resolve('em') as EntityManager).fork()\n const store = await loadStore(em, scope)\n return store ? toSnapshot(store) : null\n}\n\nconst updateStoreBrandingCommand: CommandHandler<StoreBrandingUpdateInput, StoreBrandingUpdateResult> = {\n id: STORE_BRANDING_UPDATE_COMMAND_ID,\n\n async prepare(input, ctx) {\n ensureTenantScope(ctx, input.tenantId)\n ensureOrganizationScope(ctx, input.organizationId)\n const snapshot = await loadSnapshot(ctx, input)\n return snapshot ? { before: snapshot } : {}\n },\n\n async execute(input, ctx) {\n ensureTenantScope(ctx, input.tenantId)\n ensureOrganizationScope(ctx, input.organizationId)\n const branding = compactBranding(ecommerceStoreBrandingSchema.parse(input.branding))\n const em = (ctx.container.resolve('em') as EntityManager).fork()\n const store = await loadStore(em, input)\n if (!store) {\n const { translate } = await resolveTranslations()\n throw new CrudHttpError(404, {\n error: translate('ecommerce.errors.storeNotFound', 'The selected store does not exist in this organization.'),\n })\n }\n await enforceCommandOptimisticLockWithGuards(ctx.container, {\n resourceKind: STORE_BRANDING_RESOURCE_KIND,\n resourceId: store.id,\n current: store.updatedAt,\n request: ctx.request,\n })\n store.settings = mergeBrandingIntoSettings(store.settings, branding)\n await em.flush()\n await announceStoreBrandingUpdated(ctx.container, store)\n return { id: store.id, updatedAt: store.updatedAt.toISOString(), branding }\n },\n\n async captureAfter(input, _result, ctx) {\n return loadSnapshot(ctx, input)\n },\n\n async buildLog({ snapshots, input }) {\n const before = snapshots.before as StoreBrandingSnapshot | undefined\n const after = snapshots.after as StoreBrandingSnapshot | undefined\n if (!before || !after) return null\n const { translate } = await resolveTranslations()\n return {\n actionLabel: translate('ecommerce.audit.stores.branding.update', 'Update store branding'),\n resourceKind: STORE_BRANDING_RESOURCE_KIND,\n resourceId: before.id,\n tenantId: input.tenantId,\n organizationId: input.organizationId,\n snapshotBefore: before,\n snapshotAfter: after,\n changes: buildChanges(before, after, BRANDING_CHANGE_KEYS),\n payload: {\n undo: { before, after } satisfies StoreBrandingUndoPayload,\n },\n }\n },\n\n async undo({ logEntry, ctx }) {\n const payload = extractUndoPayload<StoreBrandingUndoPayload>(logEntry)\n const before = payload?.before\n if (!before) return\n ensureTenantScope(ctx, before.tenantId)\n ensureOrganizationScope(ctx, before.organizationId)\n const em = (ctx.container.resolve('em') as EntityManager).fork()\n const store = await loadStore(em, before)\n if (!store) return\n store.settings = mergeBrandingIntoSettings(store.settings, before.branding)\n await em.flush()\n await announceStoreBrandingUpdated(ctx.container, store)\n },\n}\n\nregisterCommand(updateStoreBrandingCommand)\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,uBAAuB;AAEhC,SAAS,oBAAoB;AAC7B,SAAS,yBAAyB,yBAAyB;AAC3D,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAC9B,SAAS,8CAA8C;AACvD,SAAS,6BAA6B;AACtC,SAAS,2BAA2B;AACpC,SAAS,sBAAsB;AAC/B,SAAS,oCAAiE;AAC1E,SAAS,oCAAoC;AAC7C;AAAA,E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;AACtC,4BAAwB,KAAK,OAAO,cAAc;AAClD,UAAM,KAAM,IAAI,UAAU,QAAQ,IAAI,EAAoB,KAAK;AAC/D,UAAM,QAAQ,MAAM,UAAU,IAAI,MAAM;AACxC,QAAI,CAAC,MAAO;AACZ,UAAM,WAAW,0BAA0B,MAAM,UAAU,OAAO,QAAQ;AAC1E,UAAM,GAAG,MAAM;AACf,UAAM,6BAA6B,IAAI,WAAW,KAAK;AAAA,EACzD;AACF;AAEA,gBAAgB,0BAA0B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Alert, AlertDescription, AlertTitle } from "@open-mercato/ui/primitives/alert";
|
|
5
|
+
import { Spinner } from "@open-mercato/ui/primitives/spinner";
|
|
6
|
+
import { useLocale, useT } from "@open-mercato/shared/lib/i18n/context";
|
|
7
|
+
import { useChannelAssortmentCount } from "./useChannelAssortmentCount.js";
|
|
8
|
+
function useCountFormatter() {
|
|
9
|
+
const locale = useLocale();
|
|
10
|
+
const formatter = React.useMemo(() => new Intl.NumberFormat(locale), [locale]);
|
|
11
|
+
return React.useCallback((value) => formatter.format(value), [formatter]);
|
|
12
|
+
}
|
|
13
|
+
function describeAuthenticationGate(result, t, format) {
|
|
14
|
+
if (result.reducedByAuthentication) {
|
|
15
|
+
return t(
|
|
16
|
+
"ecommerce.backend.store.channels.count.reducedByAuthentication",
|
|
17
|
+
"0 products for anonymous visitors because sign-in is required; {count} without that requirement.",
|
|
18
|
+
{ count: format(result.countWithoutAuthentication) }
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
return t(
|
|
22
|
+
"ecommerce.backend.store.channels.count.authenticationEmpty",
|
|
23
|
+
"0 products visible to anonymous visitors: sign-in is required, and the scope matches no products even without that requirement."
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
function ChannelAssortmentCountPanel({ state, unrestricted }) {
|
|
27
|
+
const t = useT();
|
|
28
|
+
const format = useCountFormatter();
|
|
29
|
+
if (state.status === "idle") {
|
|
30
|
+
return /* @__PURE__ */ jsx(Alert, { status: "information", children: /* @__PURE__ */ jsx(AlertDescription, { children: t(
|
|
31
|
+
"ecommerce.backend.store.channels.count.saveFirst",
|
|
32
|
+
"Save the binding to see how many products it shows. After that, the count updates as you change the scope."
|
|
33
|
+
) }) });
|
|
34
|
+
}
|
|
35
|
+
if (state.status === "error") {
|
|
36
|
+
return /* @__PURE__ */ jsx(Alert, { status: "warning", children: /* @__PURE__ */ jsx(AlertDescription, { children: t("ecommerce.backend.store.channels.count.error", "The product count is unavailable right now.") }) });
|
|
37
|
+
}
|
|
38
|
+
if (state.status === "loading") {
|
|
39
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 rounded-md border border-border p-3 text-sm text-muted-foreground", "aria-live": "polite", children: [
|
|
40
|
+
/* @__PURE__ */ jsx(Spinner, { size: "sm" }),
|
|
41
|
+
t("ecommerce.backend.store.channels.count.loading", "Counting products\u2026")
|
|
42
|
+
] });
|
|
43
|
+
}
|
|
44
|
+
const { result } = state;
|
|
45
|
+
const headline = result.requireAuthentication ? describeAuthenticationGate(result, t, format) : unrestricted ? t("ecommerce.backend.store.channels.count.unrestricted", "All products in this channel's catalog: {count}.", {
|
|
46
|
+
count: format(result.count)
|
|
47
|
+
}) : t("ecommerce.backend.store.channels.count.restricted", "Products matching this scope: {count}.", {
|
|
48
|
+
count: format(result.count)
|
|
49
|
+
});
|
|
50
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-2", "aria-live": "polite", "data-testid": "channel-assortment-count", children: [
|
|
51
|
+
result.requireAuthentication ? /* @__PURE__ */ jsxs(Alert, { status: "warning", children: [
|
|
52
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: t("ecommerce.backend.store.channels.count.title", "Live product count") }),
|
|
53
|
+
/* @__PURE__ */ jsx(AlertDescription, { children: headline })
|
|
54
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "space-y-1 rounded-md border border-border p-3", children: [
|
|
55
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
56
|
+
t("ecommerce.backend.store.channels.count.title", "Live product count"),
|
|
57
|
+
state.refreshing ? /* @__PURE__ */ jsx(Spinner, { size: "sm" }) : null
|
|
58
|
+
] }),
|
|
59
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm", children: headline })
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t(
|
|
62
|
+
"ecommerce.backend.store.channels.count.basis",
|
|
63
|
+
"Counted for an anonymous visitor, including the default customer group's own restrictions. Unsaved changes are counted too."
|
|
64
|
+
) }),
|
|
65
|
+
result.unindexedCount > 0 ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t(
|
|
66
|
+
"ecommerce.backend.store.channels.count.unindexed",
|
|
67
|
+
"{count} active products are not indexed for visibility yet. Under a restricted scope they stay hidden and are not counted until indexing catches up.",
|
|
68
|
+
{ count: format(result.unindexedCount) }
|
|
69
|
+
) }) : null
|
|
70
|
+
] });
|
|
71
|
+
}
|
|
72
|
+
function ChannelAssortmentCountCell({ bindingId, updatedAt }) {
|
|
73
|
+
const t = useT();
|
|
74
|
+
const format = useCountFormatter();
|
|
75
|
+
const state = useChannelAssortmentCount(bindingId, null, 0, updatedAt ?? null);
|
|
76
|
+
if (state.status === "loading" || state.status === "idle") return /* @__PURE__ */ jsx(Spinner, { size: "sm" });
|
|
77
|
+
if (state.status === "error") return /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
78
|
+
const { result } = state;
|
|
79
|
+
if (result.requireAuthentication) {
|
|
80
|
+
return /* @__PURE__ */ jsx("span", { children: result.reducedByAuthentication ? t("ecommerce.backend.store.channels.count.cellReduced", "0 ({count} without the sign-in requirement)", {
|
|
81
|
+
count: format(result.countWithoutAuthentication)
|
|
82
|
+
}) : format(0) });
|
|
83
|
+
}
|
|
84
|
+
return /* @__PURE__ */ jsx("span", { children: format(result.count) });
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
ChannelAssortmentCountCell,
|
|
88
|
+
ChannelAssortmentCountPanel
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=ChannelAssortmentCount.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/ecommerce/components/ChannelAssortmentCount.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { Alert, AlertDescription, AlertTitle } from '@open-mercato/ui/primitives/alert'\nimport { Spinner } from '@open-mercato/ui/primitives/spinner'\nimport { useLocale, useT } from '@open-mercato/shared/lib/i18n/context'\nimport { useChannelAssortmentCount, type AssortmentCountState } from './useChannelAssortmentCount'\nimport type { AssortmentCountResult } from './storeChannels'\n\ntype Translate = ReturnType<typeof useT>\n\nfunction useCountFormatter(): (value: number) => string {\n const locale = useLocale()\n const formatter = React.useMemo(() => new Intl.NumberFormat(locale), [locale])\n return React.useCallback((value: number) => formatter.format(value), [formatter])\n}\n\nfunction describeAuthenticationGate(result: AssortmentCountResult, t: Translate, format: (value: number) => string): string {\n if (result.reducedByAuthentication) {\n return t(\n 'ecommerce.backend.store.channels.count.reducedByAuthentication',\n '0 products for anonymous visitors because sign-in is required; {count} without that requirement.',\n { count: format(result.countWithoutAuthentication) },\n )\n }\n return t(\n 'ecommerce.backend.store.channels.count.authenticationEmpty',\n '0 products visible to anonymous visitors: sign-in is required, and the scope matches no products even without that requirement.',\n )\n}\n\ntype ChannelAssortmentCountPanelProps = {\n state: AssortmentCountState\n unrestricted: boolean\n}\n\nexport function ChannelAssortmentCountPanel({ state, unrestricted }: ChannelAssortmentCountPanelProps) {\n const t = useT()\n const format = useCountFormatter()\n\n if (state.status === 'idle') {\n return (\n <Alert status=\"information\">\n <AlertDescription>\n {t(\n 'ecommerce.backend.store.channels.count.saveFirst',\n 'Save the binding to see how many products it shows. After that, the count updates as you change the scope.',\n )}\n </AlertDescription>\n </Alert>\n )\n }\n\n if (state.status === 'error') {\n return (\n <Alert status=\"warning\">\n <AlertDescription>\n {t('ecommerce.backend.store.channels.count.error', 'The product count is unavailable right now.')}\n </AlertDescription>\n </Alert>\n )\n }\n\n if (state.status === 'loading') {\n return (\n <div className=\"flex items-center gap-2 rounded-md border border-border p-3 text-sm text-muted-foreground\" aria-live=\"polite\">\n <Spinner size=\"sm\" />\n {t('ecommerce.backend.store.channels.count.loading', 'Counting products\u2026')}\n </div>\n )\n }\n\n const { result } = state\n const headline = result.requireAuthentication\n ? describeAuthenticationGate(result, t, format)\n : unrestricted\n ? t('ecommerce.backend.store.channels.count.unrestricted', \"All products in this channel's catalog: {count}.\", {\n count: format(result.count),\n })\n : t('ecommerce.backend.store.channels.count.restricted', 'Products matching this scope: {count}.', {\n count: format(result.count),\n })\n\n return (\n <div className=\"space-y-2\" aria-live=\"polite\" data-testid=\"channel-assortment-count\">\n {result.requireAuthentication ? (\n <Alert status=\"warning\">\n <AlertTitle>{t('ecommerce.backend.store.channels.count.title', 'Live product count')}</AlertTitle>\n <AlertDescription>{headline}</AlertDescription>\n </Alert>\n ) : (\n <div className=\"space-y-1 rounded-md border border-border p-3\">\n <div className=\"flex items-center gap-2 text-sm font-medium\">\n {t('ecommerce.backend.store.channels.count.title', 'Live product count')}\n {state.refreshing ? <Spinner size=\"sm\" /> : null}\n </div>\n <p className=\"text-sm\">{headline}</p>\n </div>\n )}\n <p className=\"text-xs text-muted-foreground\">\n {t(\n 'ecommerce.backend.store.channels.count.basis',\n \"Counted for an anonymous visitor, including the default customer group's own restrictions. Unsaved changes are counted too.\",\n )}\n </p>\n {result.unindexedCount > 0 ? (\n <p className=\"text-xs text-muted-foreground\">\n {t(\n 'ecommerce.backend.store.channels.count.unindexed',\n '{count} active products are not indexed for visibility yet. Under a restricted scope they stay hidden and are not counted until indexing catches up.',\n { count: format(result.unindexedCount) },\n )}\n </p>\n ) : null}\n </div>\n )\n}\n\nexport function ChannelAssortmentCountCell({ bindingId, updatedAt }: { bindingId: string; updatedAt?: string | null }) {\n const t = useT()\n const format = useCountFormatter()\n const state = useChannelAssortmentCount(bindingId, null, 0, updatedAt ?? null)\n if (state.status === 'loading' || state.status === 'idle') return <Spinner size=\"sm\" />\n if (state.status === 'error') return <span className=\"text-muted-foreground\">\u2014</span>\n const { result } = state\n if (result.requireAuthentication) {\n return (\n <span>\n {result.reducedByAuthentication\n ? t('ecommerce.backend.store.channels.count.cellReduced', '0 ({count} without the sign-in requirement)', {\n count: format(result.countWithoutAuthentication),\n })\n : format(0)}\n </span>\n )\n }\n return <span>{format(result.count)}</span>\n}\n"],
|
|
5
|
+
"mappings": ";AA2CQ,cAsBF,YAtBE;AAzCR,YAAY,WAAW;AACvB,SAAS,OAAO,kBAAkB,kBAAkB;AACpD,SAAS,eAAe;AACxB,SAAS,WAAW,YAAY;AAChC,SAAS,iCAA4D;AAKrE,SAAS,oBAA+C;AACtD,QAAM,SAAS,UAAU;AACzB,QAAM,YAAY,MAAM,QAAQ,MAAM,IAAI,KAAK,aAAa,MAAM,GAAG,CAAC,MAAM,CAAC;AAC7E,SAAO,MAAM,YAAY,CAAC,UAAkB,UAAU,OAAO,KAAK,GAAG,CAAC,SAAS,CAAC;AAClF;AAEA,SAAS,2BAA2B,QAA+B,GAAc,QAA2C;AAC1H,MAAI,OAAO,yBAAyB;AAClC,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,EAAE,OAAO,OAAO,OAAO,0BAA0B,EAAE;AAAA,IACrD;AAAA,EACF;AACA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;AAOO,SAAS,4BAA4B,EAAE,OAAO,aAAa,GAAqC;AACrG,QAAM,IAAI,KAAK;AACf,QAAM,SAAS,kBAAkB;AAEjC,MAAI,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AAU,iCACV;AAAA,MACC;AAAA,MACA;AAAA,MACA,EAAE,OAAO,OAAO,OAAO,cAAc,EAAE;AAAA,IACzC,GACF,IACE;AAAA,KACN;AAEJ;AAEO,SAAS,2BAA2B,EAAE,WAAW,UAAU,GAAqD;AACrH,QAAM,IAAI,KAAK;AACf,QAAM,SAAS,kBAAkB;AACjC,QAAM,QAAQ,0BAA0B,WAAW,MAAM,GAAG,aAAa,IAAI;AAC7E,MAAI,MAAM,WAAW,aAAa,MAAM,WAAW,OAAQ,QAAO,oBAAC,WAAQ,MAAK,MAAK;AACrF,MAAI,MAAM,WAAW,QAAS,QAAO,oBAAC,UAAK,WAAU,yBAAwB,oBAAC;AAC9E,QAAM,EAAE,OAAO,IAAI;AACnB,MAAI,OAAO,uBAAuB;AAChC,WACE,oBAAC,UACE,iBAAO,0BACJ,EAAE,sDAAsD,+CAA+C;AAAA,MACrG,OAAO,OAAO,OAAO,0BAA0B;AAAA,IACjD,CAAC,IACD,OAAO,CAAC,GACd;AAAA,EAEJ;AACA,SAAO,oBAAC,UAAM,iBAAO,OAAO,KAAK,GAAE;AACrC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Alert, AlertDescription } from "@open-mercato/ui/primitives/alert";
|
|
4
|
+
import { useLocale, useT } from "@open-mercato/shared/lib/i18n/context";
|
|
5
|
+
import { ChannelAssortmentCountPanel } from "./ChannelAssortmentCount.js";
|
|
6
|
+
import { buildAssortmentCountDraft, isPriceSortFallback, PRICE_SORT_CAP } from "./storeChannels.js";
|
|
7
|
+
import { useChannelAssortmentCount } from "./useChannelAssortmentCount.js";
|
|
8
|
+
function ChannelBindingLiveCount({ bindingId, values }) {
|
|
9
|
+
const draft = buildAssortmentCountDraft(values);
|
|
10
|
+
const state = useChannelAssortmentCount(bindingId, draft);
|
|
11
|
+
return /* @__PURE__ */ jsx(ChannelAssortmentCountPanel, { state, unrestricted: draft.scope === null });
|
|
12
|
+
}
|
|
13
|
+
function PriceSortFallbackConsequence({ values }) {
|
|
14
|
+
const t = useT();
|
|
15
|
+
const locale = useLocale();
|
|
16
|
+
const cap = new Intl.NumberFormat(locale).format(PRICE_SORT_CAP);
|
|
17
|
+
const fallback = isPriceSortFallback(values.priceSortFallback) ? values.priceSortFallback : "approximate";
|
|
18
|
+
const text = fallback === "unavailable" ? t(
|
|
19
|
+
"ecommerce.backend.store.channels.priceSortFallback.unavailableConsequence",
|
|
20
|
+
"When more than {cap} products match, price sorting is withdrawn on this channel: price ascending and descending are no longer offered, and a buyer arriving on a shared price-sorted link gets the catalogue in the default order rather than an error.",
|
|
21
|
+
{ cap }
|
|
22
|
+
) : t(
|
|
23
|
+
"ecommerce.backend.store.channels.priceSortFallback.approximateConsequence",
|
|
24
|
+
"When more than {cap} products match, the price order is computed from the default price kind, not from the buyer's own prices. The only signal is a response header no shopper sees, so contract-priced buyers may see an order that does not match what they pay.",
|
|
25
|
+
{ cap }
|
|
26
|
+
);
|
|
27
|
+
return /* @__PURE__ */ jsx(Alert, { status: "information", "data-testid": "price-sort-fallback-consequence", children: /* @__PURE__ */ jsx(AlertDescription, { children: text }) });
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
ChannelBindingLiveCount,
|
|
31
|
+
PriceSortFallbackConsequence
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=ChannelBindingFormSections.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/ecommerce/components/ChannelBindingFormSections.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { Alert, AlertDescription } from '@open-mercato/ui/primitives/alert'\nimport { useLocale, useT } from '@open-mercato/shared/lib/i18n/context'\nimport { ChannelAssortmentCountPanel } from './ChannelAssortmentCount'\nimport { buildAssortmentCountDraft, isPriceSortFallback, PRICE_SORT_CAP } from './storeChannels'\nimport { useChannelAssortmentCount } from './useChannelAssortmentCount'\n\ntype FormValuesProps = { values: Record<string, unknown> }\n\nexport function ChannelBindingLiveCount({ bindingId, values }: FormValuesProps & { bindingId: string | null }) {\n const draft = buildAssortmentCountDraft(values)\n const state = useChannelAssortmentCount(bindingId, draft)\n return <ChannelAssortmentCountPanel state={state} unrestricted={draft.scope === null} />\n}\n\nexport function PriceSortFallbackConsequence({ values }: FormValuesProps) {\n const t = useT()\n const locale = useLocale()\n const cap = new Intl.NumberFormat(locale).format(PRICE_SORT_CAP)\n const fallback = isPriceSortFallback(values.priceSortFallback) ? values.priceSortFallback : 'approximate'\n const text =\n fallback === 'unavailable'\n ? t(\n 'ecommerce.backend.store.channels.priceSortFallback.unavailableConsequence',\n 'When more than {cap} products match, price sorting is withdrawn on this channel: price ascending and descending are no longer offered, and a buyer arriving on a shared price-sorted link gets the catalogue in the default order rather than an error.',\n { cap },\n )\n : t(\n 'ecommerce.backend.store.channels.priceSortFallback.approximateConsequence',\n \"When more than {cap} products match, the price order is computed from the default price kind, not from the buyer's own prices. The only signal is a response header no shopper sees, so contract-priced buyers may see an order that does not match what they pay.\",\n { cap },\n )\n return (\n <Alert status=\"information\" data-testid=\"price-sort-fallback-consequence\">\n <AlertDescription>{text}</AlertDescription>\n </Alert>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAcS;AAXT,SAAS,OAAO,wBAAwB;AACxC,SAAS,WAAW,YAAY;AAChC,SAAS,mCAAmC;AAC5C,SAAS,2BAA2B,qBAAqB,sBAAsB;AAC/E,SAAS,iCAAiC;AAInC,SAAS,wBAAwB,EAAE,WAAW,OAAO,GAAmD;AAC7G,QAAM,QAAQ,0BAA0B,MAAM;AAC9C,QAAM,QAAQ,0BAA0B,WAAW,KAAK;AACxD,SAAO,oBAAC,+BAA4B,OAAc,cAAc,MAAM,UAAU,MAAM;AACxF;AAEO,SAAS,6BAA6B,EAAE,OAAO,GAAoB;AACxE,QAAM,IAAI,KAAK;AACf,QAAM,SAAS,UAAU;AACzB,QAAM,MAAM,IAAI,KAAK,aAAa,MAAM,EAAE,OAAO,cAAc;AAC/D,QAAM,WAAW,oBAAoB,OAAO,iBAAiB,IAAI,OAAO,oBAAoB;AAC5F,QAAM,OACJ,aAAa,gBACT;AAAA,IACE;AAAA,IACA;AAAA,IACA,EAAE,IAAI;AAAA,EACR,IACA;AAAA,IACE;AAAA,IACA;AAAA,IACA,EAAE,IAAI;AAAA,EACR;AACN,SACE,oBAAC,SAAM,QAAO,eAAc,eAAY,mCACtC,8BAAC,oBAAkB,gBAAK,GAC1B;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LookupMultiPicker,
|
|
3
|
+
LookupSinglePicker,
|
|
4
|
+
useLookupLabelMap
|
|
5
|
+
} from "@open-mercato/ui/backend/inputs/LookupPickers";
|
|
6
|
+
export {
|
|
7
|
+
LookupMultiPicker as ChannelLookupMultiPicker,
|
|
8
|
+
LookupSinglePicker as ChannelLookupSinglePicker,
|
|
9
|
+
useLookupLabelMap
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=ChannelLookupPicker.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/ecommerce/components/ChannelLookupPicker.tsx"],
|
|
4
|
+
"sourcesContent": ["export {\n LookupMultiPicker as ChannelLookupMultiPicker,\n LookupSinglePicker as ChannelLookupSinglePicker,\n useLookupLabelMap,\n} from '@open-mercato/ui/backend/inputs/LookupPickers'\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EACuB;AAAA,EACC;AAAA,EACtB;AAAA,OACK;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
4
|
+
import { Alert, AlertDescription } from "@open-mercato/ui/primitives/alert";
|
|
5
|
+
import { describeDomainStatus, isServingStatus } from "./storeDomains.js";
|
|
6
|
+
function DomainStatusWarning({ status, hostname, appearance = "inline" }) {
|
|
7
|
+
const t = useT();
|
|
8
|
+
if (isServingStatus(status)) return null;
|
|
9
|
+
const described = describeDomainStatus(status);
|
|
10
|
+
const statusLabel = described.key ? t(described.key, described.fallback) : described.fallback;
|
|
11
|
+
const message = t(
|
|
12
|
+
"ecommerce.backend.store.domains.warning.notServing",
|
|
13
|
+
"This domain is {status}. Only an active domain serves, so the store does not answer at {hostname} yet.",
|
|
14
|
+
{ status: statusLabel, hostname }
|
|
15
|
+
);
|
|
16
|
+
if (appearance === "alert") {
|
|
17
|
+
return /* @__PURE__ */ jsx(Alert, { status: "warning", children: /* @__PURE__ */ jsx(AlertDescription, { children: message }) });
|
|
18
|
+
}
|
|
19
|
+
return /* @__PURE__ */ jsx("p", { className: "text-xs text-status-warning-text", children: message });
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
DomainStatusWarning
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=DomainStatusWarning.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/ecommerce/components/DomainStatusWarning.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { Alert, AlertDescription } from '@open-mercato/ui/primitives/alert'\nimport { describeDomainStatus, isServingStatus } from './storeDomains'\n\ntype DomainStatusWarningProps = {\n status: string\n hostname: string\n appearance?: 'alert' | 'inline'\n}\n\nexport function DomainStatusWarning({ status, hostname, appearance = 'inline' }: DomainStatusWarningProps) {\n const t = useT()\n if (isServingStatus(status)) return null\n const described = describeDomainStatus(status)\n const statusLabel = described.key ? t(described.key, described.fallback) : described.fallback\n const message = t(\n 'ecommerce.backend.store.domains.warning.notServing',\n 'This domain is {status}. Only an active domain serves, so the store does not answer at {hostname} yet.',\n { status: statusLabel, hostname },\n )\n if (appearance === 'alert') {\n return (\n <Alert status=\"warning\">\n <AlertDescription>{message}</AlertDescription>\n </Alert>\n )\n }\n return <p className=\"text-xs text-status-warning-text\">{message}</p>\n}\n"],
|
|
5
|
+
"mappings": ";AA0BQ;AAvBR,SAAS,YAAY;AACrB,SAAS,OAAO,wBAAwB;AACxC,SAAS,sBAAsB,uBAAuB;AAQ/C,SAAS,oBAAoB,EAAE,QAAQ,UAAU,aAAa,SAAS,GAA6B;AACzG,QAAM,IAAI,KAAK;AACf,MAAI,gBAAgB,MAAM,EAAG,QAAO;AACpC,QAAM,YAAY,qBAAqB,MAAM;AAC7C,QAAM,cAAc,UAAU,MAAM,EAAE,UAAU,KAAK,UAAU,QAAQ,IAAI,UAAU;AACrF,QAAM,UAAU;AAAA,IACd;AAAA,IACA;AAAA,IACA,EAAE,QAAQ,aAAa,SAAS;AAAA,EAClC;AACA,MAAI,eAAe,SAAS;AAC1B,WACE,oBAAC,SAAM,QAAO,WACZ,8BAAC,oBAAkB,mBAAQ,GAC7B;AAAA,EAEJ;AACA,SAAO,oBAAC,OAAE,WAAU,oCAAoC,mBAAQ;AAClE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
5
|
+
import { CrudForm } from "@open-mercato/ui/backend/CrudForm";
|
|
6
|
+
import { ErrorMessage, LoadingMessage } from "@open-mercato/ui/backend/detail";
|
|
7
|
+
import { flash } from "@open-mercato/ui/backend/FlashMessages";
|
|
8
|
+
import { apiCall } from "@open-mercato/ui/backend/utils/apiCall";
|
|
9
|
+
import { createCrud, updateCrud } from "@open-mercato/ui/backend/utils/crud";
|
|
10
|
+
import { createCrudFormError, raiseCrudError } from "@open-mercato/ui/backend/utils/serverErrors";
|
|
11
|
+
import { Alert, AlertDescription } from "@open-mercato/ui/primitives/alert";
|
|
12
|
+
import { Button } from "@open-mercato/ui/primitives/button";
|
|
13
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@open-mercato/ui/primitives/card";
|
|
14
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
15
|
+
import { AVAILABILITY_POLICIES_API_PATH, AVAILABILITY_POLICIES_API_URL } from "./storeAdmin.js";
|
|
16
|
+
import {
|
|
17
|
+
availabilityDefaultsFormSchema,
|
|
18
|
+
buildAvailabilityCreatePayload,
|
|
19
|
+
buildAvailabilityInitialValues,
|
|
20
|
+
buildAvailabilityUpdatePayload,
|
|
21
|
+
isStoreDefaultPolicy
|
|
22
|
+
} from "./storeGeneral.js";
|
|
23
|
+
import { useStoreAccess } from "./useStoreAccess.js";
|
|
24
|
+
const POLICY_PAGE_SIZE = 100;
|
|
25
|
+
async function fetchStoreDefaultPolicy(storeId, translate) {
|
|
26
|
+
for (let page = 1; ; page += 1) {
|
|
27
|
+
const params = new URLSearchParams({
|
|
28
|
+
storeId,
|
|
29
|
+
page: String(page),
|
|
30
|
+
pageSize: String(POLICY_PAGE_SIZE),
|
|
31
|
+
sortField: "createdAt",
|
|
32
|
+
sortDir: "asc"
|
|
33
|
+
});
|
|
34
|
+
const call = await apiCall(`${AVAILABILITY_POLICIES_API_URL}?${params.toString()}`, {
|
|
35
|
+
cache: "no-store"
|
|
36
|
+
});
|
|
37
|
+
if (!call.ok) {
|
|
38
|
+
await raiseCrudError(
|
|
39
|
+
call.response,
|
|
40
|
+
translate("ecommerce.backend.store.availability.errors.load", "Failed to load the availability defaults.")
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
const match = (call.result?.items ?? []).find((item) => isStoreDefaultPolicy(item, storeId));
|
|
44
|
+
if (match) return match;
|
|
45
|
+
if (page >= (call.result?.totalPages ?? 1)) return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function StoreAvailabilityDefaultsSection({ store }) {
|
|
49
|
+
const t = useT();
|
|
50
|
+
const queryClient = useQueryClient();
|
|
51
|
+
const { canManage, canViewAvailability, canManageAvailability } = useStoreAccess();
|
|
52
|
+
const queryKey = React.useMemo(() => ["ecommerce", "stores", "availability-default", store.id], [store.id]);
|
|
53
|
+
const [formKey, setFormKey] = React.useState(0);
|
|
54
|
+
const policyQuery = useQuery({
|
|
55
|
+
queryKey,
|
|
56
|
+
enabled: canViewAvailability,
|
|
57
|
+
queryFn: async () => ({ policy: await fetchStoreDefaultPolicy(store.id, t) })
|
|
58
|
+
});
|
|
59
|
+
const editable = canManage && canManageAvailability;
|
|
60
|
+
const policy = policyQuery.data?.policy ?? null;
|
|
61
|
+
const readOnlyReason = React.useMemo(() => {
|
|
62
|
+
if (!canViewAvailability) {
|
|
63
|
+
return t(
|
|
64
|
+
"ecommerce.backend.store.availability.readOnly.noView",
|
|
65
|
+
"You do not have access to availability policies, so the store defaults cannot be shown."
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
if (!canManage) {
|
|
69
|
+
return t(
|
|
70
|
+
"ecommerce.backend.store.availability.readOnly.noStoreManage",
|
|
71
|
+
"You can view these defaults but not change them. Changing them requires permission to manage stores."
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
if (!canManageAvailability) {
|
|
75
|
+
return t(
|
|
76
|
+
"ecommerce.backend.store.availability.readOnly.noAvailabilityManage",
|
|
77
|
+
"You can view these defaults but not change them. Saving them requires permission to manage availability policies."
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}, [canManage, canManageAvailability, canViewAvailability, t]);
|
|
82
|
+
const fields = React.useMemo(
|
|
83
|
+
() => [
|
|
84
|
+
{
|
|
85
|
+
id: "hideWhenOutOfStock",
|
|
86
|
+
type: "checkbox",
|
|
87
|
+
label: t("ecommerce.backend.store.availability.hideWhenOutOfStock", "Hide out-of-stock products"),
|
|
88
|
+
description: t(
|
|
89
|
+
"ecommerce.backend.store.availability.hideWhenOutOfStockHint",
|
|
90
|
+
"Products with no stock left are not shown in this store."
|
|
91
|
+
),
|
|
92
|
+
disabled: !editable
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: "allowBackorder",
|
|
96
|
+
type: "checkbox",
|
|
97
|
+
label: t("ecommerce.backend.store.availability.allowBackorder", "Allow backorders"),
|
|
98
|
+
description: t(
|
|
99
|
+
"ecommerce.backend.store.availability.allowBackorderHint",
|
|
100
|
+
"Shoppers can order products that are out of stock."
|
|
101
|
+
),
|
|
102
|
+
disabled: !editable
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: "backorderLeadTimeDays",
|
|
106
|
+
type: "number",
|
|
107
|
+
label: t("ecommerce.backend.store.availability.leadTime", "Backorder lead time (days)"),
|
|
108
|
+
description: t(
|
|
109
|
+
"ecommerce.backend.store.availability.leadTimeHint",
|
|
110
|
+
"How many days a backordered product takes to ship. Required while backorders are allowed."
|
|
111
|
+
),
|
|
112
|
+
visibleWhen: { field: "allowBackorder", equals: true },
|
|
113
|
+
disabled: !editable,
|
|
114
|
+
layout: "half"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
[editable, t]
|
|
118
|
+
);
|
|
119
|
+
const initialValues = React.useMemo(() => buildAvailabilityInitialValues(policy), [policy]);
|
|
120
|
+
const refresh = React.useCallback(async () => {
|
|
121
|
+
await queryClient.invalidateQueries({ queryKey });
|
|
122
|
+
setFormKey((current) => current + 1);
|
|
123
|
+
}, [queryClient, queryKey]);
|
|
124
|
+
const handleSubmit = React.useCallback(
|
|
125
|
+
async (values) => {
|
|
126
|
+
const errorMessage = t("ecommerce.backend.store.availability.errors.save", "Failed to save the availability defaults.");
|
|
127
|
+
if (policy) {
|
|
128
|
+
await updateCrud(AVAILABILITY_POLICIES_API_PATH, buildAvailabilityUpdatePayload(policy.id, values), { errorMessage });
|
|
129
|
+
} else {
|
|
130
|
+
const payload = buildAvailabilityCreatePayload(store, values);
|
|
131
|
+
if (!payload) throw createCrudFormError(errorMessage);
|
|
132
|
+
await createCrud(AVAILABILITY_POLICIES_API_PATH, payload, { errorMessage });
|
|
133
|
+
}
|
|
134
|
+
flash(t("ecommerce.backend.store.availability.flash.saved", "Availability defaults saved"), "success");
|
|
135
|
+
await refresh();
|
|
136
|
+
},
|
|
137
|
+
[policy, refresh, store, t]
|
|
138
|
+
);
|
|
139
|
+
const handleKeyDown = React.useCallback((event) => {
|
|
140
|
+
if (event.key !== "Escape" || event.defaultPrevented) return;
|
|
141
|
+
setFormKey((current) => current + 1);
|
|
142
|
+
}, []);
|
|
143
|
+
const renderBody = () => {
|
|
144
|
+
if (!canViewAvailability) return null;
|
|
145
|
+
if (policyQuery.isLoading) {
|
|
146
|
+
return /* @__PURE__ */ jsx(LoadingMessage, { label: t("ecommerce.backend.store.availability.loading", "Loading availability defaults...") });
|
|
147
|
+
}
|
|
148
|
+
if (policyQuery.isError) {
|
|
149
|
+
return /* @__PURE__ */ jsx(
|
|
150
|
+
ErrorMessage,
|
|
151
|
+
{
|
|
152
|
+
label: t("ecommerce.backend.store.availability.errors.load", "Failed to load the availability defaults."),
|
|
153
|
+
action: /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => void policyQuery.refetch(), children: t("ecommerce.backend.store.actions.retry", "Retry") })
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
return /* @__PURE__ */ jsx("div", { onKeyDown: handleKeyDown, children: /* @__PURE__ */ jsx(
|
|
158
|
+
CrudForm,
|
|
159
|
+
{
|
|
160
|
+
schema: availabilityDefaultsFormSchema,
|
|
161
|
+
fields,
|
|
162
|
+
initialValues,
|
|
163
|
+
optimisticLockUpdatedAt: policy?.updatedAt ?? null,
|
|
164
|
+
submitLabel: t("ecommerce.backend.store.availability.save", "Save availability defaults"),
|
|
165
|
+
onSubmit: handleSubmit,
|
|
166
|
+
hideFooterActions: !editable,
|
|
167
|
+
embedded: true
|
|
168
|
+
},
|
|
169
|
+
`${formKey}:${policy?.updatedAt ?? "new"}`
|
|
170
|
+
) });
|
|
171
|
+
};
|
|
172
|
+
return /* @__PURE__ */ jsxs(Card, { children: [
|
|
173
|
+
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
174
|
+
/* @__PURE__ */ jsx(CardTitle, { children: t("ecommerce.backend.store.availability.title", "Availability defaults") }),
|
|
175
|
+
/* @__PURE__ */ jsx(CardDescription, { children: t(
|
|
176
|
+
"ecommerce.backend.store.availability.description",
|
|
177
|
+
"Default stock rules for every product in this store. A policy set on a product or variant overrides these defaults, so those policies only need to describe exceptions."
|
|
178
|
+
) })
|
|
179
|
+
] }),
|
|
180
|
+
/* @__PURE__ */ jsxs(CardContent, { className: "space-y-4", children: [
|
|
181
|
+
readOnlyReason ? /* @__PURE__ */ jsx(Alert, { status: "information", children: /* @__PURE__ */ jsx(AlertDescription, { children: readOnlyReason }) }) : null,
|
|
182
|
+
renderBody()
|
|
183
|
+
] })
|
|
184
|
+
] });
|
|
185
|
+
}
|
|
186
|
+
export {
|
|
187
|
+
StoreAvailabilityDefaultsSection,
|
|
188
|
+
fetchStoreDefaultPolicy
|
|
189
|
+
};
|
|
190
|
+
//# sourceMappingURL=StoreAvailabilityDefaultsSection.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/ecommerce/components/StoreAvailabilityDefaultsSection.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { useQuery, useQueryClient } from '@tanstack/react-query'\nimport { CrudForm, type CrudField } from '@open-mercato/ui/backend/CrudForm'\nimport { ErrorMessage, LoadingMessage } from '@open-mercato/ui/backend/detail'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { apiCall } from '@open-mercato/ui/backend/utils/apiCall'\nimport { createCrud, updateCrud } from '@open-mercato/ui/backend/utils/crud'\nimport { createCrudFormError, raiseCrudError } from '@open-mercato/ui/backend/utils/serverErrors'\nimport { Alert, AlertDescription } from '@open-mercato/ui/primitives/alert'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@open-mercato/ui/primitives/card'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { AVAILABILITY_POLICIES_API_PATH, AVAILABILITY_POLICIES_API_URL, type StoreAdminRecord } from './storeAdmin'\nimport {\n availabilityDefaultsFormSchema,\n buildAvailabilityCreatePayload,\n buildAvailabilityInitialValues,\n buildAvailabilityUpdatePayload,\n isStoreDefaultPolicy,\n type AvailabilityDefaultsFormValues,\n type PolicyListResponse,\n type StoreDefaultPolicy,\n} from './storeGeneral'\nimport { useStoreAccess } from './useStoreAccess'\n\nconst POLICY_PAGE_SIZE = 100\n\ntype Translate = (key: string, fallback?: string) => string\n\nexport async function fetchStoreDefaultPolicy(storeId: string, translate: Translate): Promise<StoreDefaultPolicy | null> {\n for (let page = 1; ; page += 1) {\n const params = new URLSearchParams({\n storeId,\n page: String(page),\n pageSize: String(POLICY_PAGE_SIZE),\n sortField: 'createdAt',\n sortDir: 'asc',\n })\n const call = await apiCall<PolicyListResponse>(`${AVAILABILITY_POLICIES_API_URL}?${params.toString()}`, {\n cache: 'no-store',\n })\n if (!call.ok) {\n await raiseCrudError(\n call.response,\n translate('ecommerce.backend.store.availability.errors.load', 'Failed to load the availability defaults.'),\n )\n }\n const match = (call.result?.items ?? []).find((item) => isStoreDefaultPolicy(item, storeId))\n if (match) return match\n if (page >= (call.result?.totalPages ?? 1)) return null\n }\n}\n\ntype StoreAvailabilityDefaultsSectionProps = {\n store: StoreAdminRecord\n}\n\nexport function StoreAvailabilityDefaultsSection({ store }: StoreAvailabilityDefaultsSectionProps) {\n const t = useT()\n const queryClient = useQueryClient()\n const { canManage, canViewAvailability, canManageAvailability } = useStoreAccess()\n const queryKey = React.useMemo(() => ['ecommerce', 'stores', 'availability-default', store.id], [store.id])\n const [formKey, setFormKey] = React.useState(0)\n\n const policyQuery = useQuery({\n queryKey,\n enabled: canViewAvailability,\n queryFn: async () => ({ policy: await fetchStoreDefaultPolicy(store.id, t) }),\n })\n\n const editable = canManage && canManageAvailability\n const policy = policyQuery.data?.policy ?? null\n\n const readOnlyReason = React.useMemo(() => {\n if (!canViewAvailability) {\n return t(\n 'ecommerce.backend.store.availability.readOnly.noView',\n 'You do not have access to availability policies, so the store defaults cannot be shown.',\n )\n }\n if (!canManage) {\n return t(\n 'ecommerce.backend.store.availability.readOnly.noStoreManage',\n 'You can view these defaults but not change them. Changing them requires permission to manage stores.',\n )\n }\n if (!canManageAvailability) {\n return t(\n 'ecommerce.backend.store.availability.readOnly.noAvailabilityManage',\n 'You can view these defaults but not change them. Saving them requires permission to manage availability policies.',\n )\n }\n return null\n }, [canManage, canManageAvailability, canViewAvailability, t])\n\n const fields = React.useMemo<CrudField[]>(\n () => [\n {\n id: 'hideWhenOutOfStock',\n type: 'checkbox',\n label: t('ecommerce.backend.store.availability.hideWhenOutOfStock', 'Hide out-of-stock products'),\n description: t(\n 'ecommerce.backend.store.availability.hideWhenOutOfStockHint',\n 'Products with no stock left are not shown in this store.',\n ),\n disabled: !editable,\n },\n {\n id: 'allowBackorder',\n type: 'checkbox',\n label: t('ecommerce.backend.store.availability.allowBackorder', 'Allow backorders'),\n description: t(\n 'ecommerce.backend.store.availability.allowBackorderHint',\n 'Shoppers can order products that are out of stock.',\n ),\n disabled: !editable,\n },\n {\n id: 'backorderLeadTimeDays',\n type: 'number',\n label: t('ecommerce.backend.store.availability.leadTime', 'Backorder lead time (days)'),\n description: t(\n 'ecommerce.backend.store.availability.leadTimeHint',\n 'How many days a backordered product takes to ship. Required while backorders are allowed.',\n ),\n visibleWhen: { field: 'allowBackorder', equals: true },\n disabled: !editable,\n layout: 'half',\n },\n ],\n [editable, t],\n )\n\n const initialValues = React.useMemo(() => buildAvailabilityInitialValues(policy), [policy])\n\n const refresh = React.useCallback(async () => {\n await queryClient.invalidateQueries({ queryKey })\n setFormKey((current) => current + 1)\n }, [queryClient, queryKey])\n\n const handleSubmit = React.useCallback(\n async (values: AvailabilityDefaultsFormValues) => {\n const errorMessage = t('ecommerce.backend.store.availability.errors.save', 'Failed to save the availability defaults.')\n if (policy) {\n await updateCrud(AVAILABILITY_POLICIES_API_PATH, buildAvailabilityUpdatePayload(policy.id, values), { errorMessage })\n } else {\n const payload = buildAvailabilityCreatePayload(store, values)\n if (!payload) throw createCrudFormError(errorMessage)\n await createCrud(AVAILABILITY_POLICIES_API_PATH, payload, { errorMessage })\n }\n flash(t('ecommerce.backend.store.availability.flash.saved', 'Availability defaults saved'), 'success')\n await refresh()\n },\n [policy, refresh, store, t],\n )\n\n const handleKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'Escape' || event.defaultPrevented) return\n setFormKey((current) => current + 1)\n }, [])\n\n const renderBody = () => {\n if (!canViewAvailability) return null\n if (policyQuery.isLoading) {\n return <LoadingMessage label={t('ecommerce.backend.store.availability.loading', 'Loading availability defaults...')} />\n }\n if (policyQuery.isError) {\n return (\n <ErrorMessage\n label={t('ecommerce.backend.store.availability.errors.load', 'Failed to load the availability defaults.')}\n action={\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={() => void policyQuery.refetch()}>\n {t('ecommerce.backend.store.actions.retry', 'Retry')}\n </Button>\n }\n />\n )\n }\n return (\n <div onKeyDown={handleKeyDown}>\n <CrudForm<AvailabilityDefaultsFormValues>\n key={`${formKey}:${policy?.updatedAt ?? 'new'}`}\n schema={availabilityDefaultsFormSchema}\n fields={fields}\n initialValues={initialValues}\n optimisticLockUpdatedAt={policy?.updatedAt ?? null}\n submitLabel={t('ecommerce.backend.store.availability.save', 'Save availability defaults')}\n onSubmit={handleSubmit}\n hideFooterActions={!editable}\n embedded\n />\n </div>\n )\n }\n\n return (\n <Card>\n <CardHeader>\n <CardTitle>{t('ecommerce.backend.store.availability.title', 'Availability defaults')}</CardTitle>\n <CardDescription>\n {t(\n 'ecommerce.backend.store.availability.description',\n 'Default stock rules for every product in this store. A policy set on a product or variant overrides these defaults, so those policies only need to describe exceptions.',\n )}\n </CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n {readOnlyReason ? (\n <Alert status=\"information\">\n <AlertDescription>{readOnlyReason}</AlertDescription>\n </Alert>\n ) : null}\n {renderBody()}\n </CardContent>\n </Card>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAsKa,cAiCP,YAjCO;AApKb,YAAY,WAAW;AACvB,SAAS,UAAU,sBAAsB;AACzC,SAAS,gBAAgC;AACzC,SAAS,cAAc,sBAAsB;AAC7C,SAAS,aAAa;AACtB,SAAS,eAAe;AACxB,SAAS,YAAY,kBAAkB;AACvC,SAAS,qBAAqB,sBAAsB;AACpD,SAAS,OAAO,wBAAwB;AACxC,SAAS,cAAc;AACvB,SAAS,MAAM,aAAa,iBAAiB,YAAY,iBAAiB;AAC1E,SAAS,YAAY;AACrB,SAAS,gCAAgC,qCAA4D;AACrG;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP,SAAS,sBAAsB;AAE/B,MAAM,mBAAmB;AAIzB,eAAsB,wBAAwB,SAAiB,WAA0D;AACvH,WAAS,OAAO,KAAK,QAAQ,GAAG;AAC9B,UAAM,SAAS,IAAI,gBAAgB;AAAA,MACjC;AAAA,MACA,MAAM,OAAO,IAAI;AAAA,MACjB,UAAU,OAAO,gBAAgB;AAAA,MACjC,WAAW;AAAA,MACX,SAAS;AAAA,IACX,CAAC;AACD,UAAM,OAAO,MAAM,QAA4B,GAAG,6BAA6B,IAAI,OAAO,SAAS,CAAC,IAAI;AAAA,MACtG,OAAO;AAAA,IACT,CAAC;AACD,QAAI,CAAC,KAA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