@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,326 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { useRouter } from 'next/navigation'
|
|
5
|
+
import { useQuery, useQueryClient } from '@tanstack/react-query'
|
|
6
|
+
import type { LegacyColumnDef as ColumnDef } from '@tanstack/react-table/legacy'
|
|
7
|
+
import type { SortingState } from '@tanstack/react-table'
|
|
8
|
+
import { Page, PageBody } from '@open-mercato/ui/backend/Page'
|
|
9
|
+
import { DataTable } from '@open-mercato/ui/backend/DataTable'
|
|
10
|
+
import type { FilterDef, FilterValues } from '@open-mercato/ui/backend/FilterBar'
|
|
11
|
+
import { ListEmptyState } from '@open-mercato/ui/backend/filters/ListEmptyState'
|
|
12
|
+
import { RowActions, type RowActionItem } from '@open-mercato/ui/backend/RowActions'
|
|
13
|
+
import { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'
|
|
14
|
+
import { flash } from '@open-mercato/ui/backend/FlashMessages'
|
|
15
|
+
import { useGuardedMutation } from '@open-mercato/ui/backend/injection/useGuardedMutation'
|
|
16
|
+
import { clearAllOperations } from '@open-mercato/ui/backend/operations/store'
|
|
17
|
+
import { apiCall, withScopedApiRequestHeaders } from '@open-mercato/ui/backend/utils/apiCall'
|
|
18
|
+
import { updateCrud } from '@open-mercato/ui/backend/utils/crud'
|
|
19
|
+
import { buildOptimisticLockHeader, extractOptimisticLockConflict } from '@open-mercato/ui/backend/utils/optimisticLock'
|
|
20
|
+
import { raiseCrudError } from '@open-mercato/ui/backend/utils/serverErrors'
|
|
21
|
+
import { Button } from '@open-mercato/ui/primitives/button'
|
|
22
|
+
import { useLocale, useT } from '@open-mercato/shared/lib/i18n/context'
|
|
23
|
+
import { StoreCreateDialog } from './StoreCreateDialog'
|
|
24
|
+
import { STORE_STATUS_LABELS, StoreStatusBadge } from './StoreStatusBadge'
|
|
25
|
+
import {
|
|
26
|
+
STORE_STATUSES,
|
|
27
|
+
STORES_API_PATH,
|
|
28
|
+
STORES_API_URL,
|
|
29
|
+
formatPrimaryDomain,
|
|
30
|
+
type StoreAdminRecord,
|
|
31
|
+
type StoreListResponse,
|
|
32
|
+
type StoreStatus,
|
|
33
|
+
} from './storeAdmin'
|
|
34
|
+
import { buildStoreEditHref } from './storeEditTabs'
|
|
35
|
+
import { useStoreAccess } from './useStoreAccess'
|
|
36
|
+
|
|
37
|
+
export const STORE_LIST_PAGE_SIZE = 25
|
|
38
|
+
|
|
39
|
+
const STORE_LIST_QUERY_KEY = ['ecommerce', 'stores', 'list'] as const
|
|
40
|
+
|
|
41
|
+
function isStoreStatus(value: unknown): value is StoreStatus {
|
|
42
|
+
return typeof value === 'string' && (STORE_STATUSES as readonly string[]).includes(value)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function readStatusFilter(values: FilterValues): StoreStatus | null {
|
|
46
|
+
const value = values.status
|
|
47
|
+
return isStoreStatus(value) ? value : null
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function buildListQuery(input: {
|
|
51
|
+
page: number
|
|
52
|
+
search: string
|
|
53
|
+
status: StoreStatus | null
|
|
54
|
+
sorting: SortingState
|
|
55
|
+
}): string {
|
|
56
|
+
const params = new URLSearchParams()
|
|
57
|
+
params.set('page', String(input.page))
|
|
58
|
+
params.set('pageSize', String(STORE_LIST_PAGE_SIZE))
|
|
59
|
+
const search = input.search.trim()
|
|
60
|
+
if (search) params.set('search', search)
|
|
61
|
+
if (input.status) params.set('status', input.status)
|
|
62
|
+
const sort = input.sorting[0]
|
|
63
|
+
if (sort) {
|
|
64
|
+
params.set('sortField', sort.id)
|
|
65
|
+
params.set('sortDir', sort.desc ? 'desc' : 'asc')
|
|
66
|
+
}
|
|
67
|
+
return params.toString()
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function StoreListPage() {
|
|
71
|
+
const t = useT()
|
|
72
|
+
const locale = useLocale()
|
|
73
|
+
const router = useRouter()
|
|
74
|
+
const queryClient = useQueryClient()
|
|
75
|
+
const { confirm, ConfirmDialogElement } = useConfirmDialog()
|
|
76
|
+
const { runMutation, retryLastMutation } = useGuardedMutation<Record<string, unknown>>({
|
|
77
|
+
contextId: 'ecommerce-store-list',
|
|
78
|
+
})
|
|
79
|
+
const { canManage } = useStoreAccess()
|
|
80
|
+
const [page, setPage] = React.useState(1)
|
|
81
|
+
const [search, setSearch] = React.useState('')
|
|
82
|
+
const [filterValues, setFilterValues] = React.useState<FilterValues>({})
|
|
83
|
+
const [sorting, setSorting] = React.useState<SortingState>([{ id: 'name', desc: false }])
|
|
84
|
+
const [createOpen, setCreateOpen] = React.useState(false)
|
|
85
|
+
|
|
86
|
+
const status = readStatusFilter(filterValues)
|
|
87
|
+
const query = buildListQuery({ page, search, status, sorting })
|
|
88
|
+
|
|
89
|
+
const storesQuery = useQuery({
|
|
90
|
+
queryKey: [...STORE_LIST_QUERY_KEY, query],
|
|
91
|
+
queryFn: async (): Promise<StoreListResponse> => {
|
|
92
|
+
const call = await apiCall<StoreListResponse>(`${STORES_API_URL}?${query}`, { cache: 'no-store' })
|
|
93
|
+
if (!call.ok) {
|
|
94
|
+
await raiseCrudError(call.response, t('ecommerce.backend.stores.errors.load', 'Failed to load stores.'))
|
|
95
|
+
}
|
|
96
|
+
return call.result ?? { items: [], total: 0, totalPages: 1 }
|
|
97
|
+
},
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
const refresh = React.useCallback(async () => {
|
|
101
|
+
await queryClient.invalidateQueries({ queryKey: STORE_LIST_QUERY_KEY })
|
|
102
|
+
}, [queryClient])
|
|
103
|
+
|
|
104
|
+
const dateFormatter = React.useMemo(() => new Intl.DateTimeFormat(locale, { dateStyle: 'medium' }), [locale])
|
|
105
|
+
|
|
106
|
+
const filters = React.useMemo<FilterDef[]>(
|
|
107
|
+
() => [
|
|
108
|
+
{
|
|
109
|
+
id: 'status',
|
|
110
|
+
type: 'select',
|
|
111
|
+
label: t('ecommerce.backend.stores.filters.status', 'Status'),
|
|
112
|
+
options: STORE_STATUSES.map((value) => ({
|
|
113
|
+
value,
|
|
114
|
+
label: t(STORE_STATUS_LABELS[value].key, STORE_STATUS_LABELS[value].fallback),
|
|
115
|
+
})),
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
[t],
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
const hasActiveFilters = status !== null || search.trim().length > 0
|
|
122
|
+
|
|
123
|
+
const clearFilters = React.useCallback(() => {
|
|
124
|
+
setFilterValues({})
|
|
125
|
+
setSearch('')
|
|
126
|
+
setPage(1)
|
|
127
|
+
}, [])
|
|
128
|
+
|
|
129
|
+
const handleArchive = React.useCallback(
|
|
130
|
+
async (row: StoreAdminRecord) => {
|
|
131
|
+
const confirmed = await confirm({
|
|
132
|
+
title: t('ecommerce.backend.stores.archive.confirmTitle', 'Archive store "{name}"?', { name: row.name }),
|
|
133
|
+
text: t(
|
|
134
|
+
'ecommerce.backend.stores.archive.confirmText',
|
|
135
|
+
'An archived store stops serving its storefront (HTTP 410). Its configuration and history are kept, but it cannot be unarchived.',
|
|
136
|
+
),
|
|
137
|
+
confirmText: t('ecommerce.backend.stores.archive.confirmButton', 'Archive store'),
|
|
138
|
+
variant: 'destructive',
|
|
139
|
+
})
|
|
140
|
+
if (!confirmed) return
|
|
141
|
+
const archiveError = t('ecommerce.backend.stores.errors.archive', 'Failed to archive the store.')
|
|
142
|
+
try {
|
|
143
|
+
await runMutation({
|
|
144
|
+
operation: () =>
|
|
145
|
+
withScopedApiRequestHeaders(buildOptimisticLockHeader(row.updatedAt), () =>
|
|
146
|
+
updateCrud(STORES_API_PATH, { id: row.id, status: 'archived' }, { errorMessage: archiveError }),
|
|
147
|
+
),
|
|
148
|
+
context: { retryLastMutation },
|
|
149
|
+
mutationPayload: { id: row.id, status: 'archived' },
|
|
150
|
+
})
|
|
151
|
+
clearAllOperations()
|
|
152
|
+
flash(t('ecommerce.backend.stores.flash.archived', 'Store archived'), 'success')
|
|
153
|
+
await refresh()
|
|
154
|
+
} catch (error) {
|
|
155
|
+
if (extractOptimisticLockConflict(error)) return
|
|
156
|
+
flash(error instanceof Error && error.message ? error.message : archiveError, 'error')
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
[confirm, refresh, retryLastMutation, runMutation, t],
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
const columns = React.useMemo<ColumnDef<StoreAdminRecord>[]>(
|
|
163
|
+
() => [
|
|
164
|
+
{
|
|
165
|
+
accessorKey: 'name',
|
|
166
|
+
header: t('ecommerce.backend.stores.columns.name', 'Name'),
|
|
167
|
+
enableSorting: true,
|
|
168
|
+
cell: ({ row }) => row.original.name,
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
accessorKey: 'code',
|
|
172
|
+
header: t('ecommerce.backend.stores.columns.code', 'Code'),
|
|
173
|
+
enableSorting: true,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
accessorKey: 'status',
|
|
177
|
+
header: t('ecommerce.backend.stores.columns.status', 'Status'),
|
|
178
|
+
enableSorting: true,
|
|
179
|
+
cell: ({ row }) => <StoreStatusBadge status={row.original.status} />,
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
id: 'primaryDomain',
|
|
183
|
+
header: t('ecommerce.backend.stores.columns.primaryDomain', 'Primary domain'),
|
|
184
|
+
enableSorting: false,
|
|
185
|
+
cell: ({ row }) => formatPrimaryDomain(row.original._ecommerce) ?? '—',
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: 'channel',
|
|
189
|
+
header: t('ecommerce.backend.stores.columns.channel', 'Channel'),
|
|
190
|
+
enableSorting: false,
|
|
191
|
+
cell: ({ row }) => {
|
|
192
|
+
const channel = row.original._ecommerce?.defaultChannel
|
|
193
|
+
if (channel) return channel.name
|
|
194
|
+
return (
|
|
195
|
+
<span className="text-muted-foreground">
|
|
196
|
+
{t('ecommerce.backend.stores.columns.noDefaultChannel', 'No default channel')}
|
|
197
|
+
</span>
|
|
198
|
+
)
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
accessorKey: 'createdAt',
|
|
203
|
+
header: t('ecommerce.backend.stores.columns.created', 'Created'),
|
|
204
|
+
enableSorting: true,
|
|
205
|
+
cell: ({ row }) => {
|
|
206
|
+
const value = row.original.createdAt
|
|
207
|
+
return value ? dateFormatter.format(new Date(value)) : '—'
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
[dateFormatter, t],
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
const buildRowActions = React.useCallback(
|
|
215
|
+
(row: StoreAdminRecord): RowActionItem[] => {
|
|
216
|
+
const items: RowActionItem[] = [
|
|
217
|
+
{ id: 'edit', label: t('ecommerce.backend.stores.actions.edit', 'Edit'), href: buildStoreEditHref(row.id, 'general') },
|
|
218
|
+
{ id: 'domains', label: t('ecommerce.backend.stores.actions.domains', 'Domains'), href: buildStoreEditHref(row.id, 'domains') },
|
|
219
|
+
{ id: 'channels', label: t('ecommerce.backend.stores.actions.channels', 'Channels'), href: buildStoreEditHref(row.id, 'channels') },
|
|
220
|
+
]
|
|
221
|
+
if (canManage && row.status !== 'archived') {
|
|
222
|
+
items.push({
|
|
223
|
+
id: 'archive',
|
|
224
|
+
label: t('ecommerce.backend.stores.actions.archive', 'Archive'),
|
|
225
|
+
destructive: true,
|
|
226
|
+
onSelect: () => {
|
|
227
|
+
void handleArchive(row)
|
|
228
|
+
},
|
|
229
|
+
})
|
|
230
|
+
}
|
|
231
|
+
return items
|
|
232
|
+
},
|
|
233
|
+
[canManage, handleArchive, t],
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
const createAction = canManage ? (
|
|
237
|
+
<Button type="button" onClick={() => setCreateOpen(true)}>
|
|
238
|
+
{t('ecommerce.backend.stores.actions.create', 'Create store')}
|
|
239
|
+
</Button>
|
|
240
|
+
) : null
|
|
241
|
+
|
|
242
|
+
const emptyState = (
|
|
243
|
+
<ListEmptyState
|
|
244
|
+
entityName={t('ecommerce.backend.stores.entityPlural', 'stores')}
|
|
245
|
+
title={t('ecommerce.backend.stores.empty.title', 'No stores yet')}
|
|
246
|
+
description={
|
|
247
|
+
canManage
|
|
248
|
+
? t(
|
|
249
|
+
'ecommerce.backend.stores.empty.description',
|
|
250
|
+
'A new workspace gets one draft store automatically. If this workspace existed before the Stores module was enabled, run the pending upgrade action from the dashboard to create it, or create a store now.',
|
|
251
|
+
)
|
|
252
|
+
: t(
|
|
253
|
+
'ecommerce.backend.stores.empty.descriptionReadOnly',
|
|
254
|
+
'A new workspace gets one draft store automatically. If this workspace existed before the Stores module was enabled, an administrator needs to run the pending upgrade action from the dashboard.',
|
|
255
|
+
)
|
|
256
|
+
}
|
|
257
|
+
onCreate={canManage ? () => setCreateOpen(true) : undefined}
|
|
258
|
+
createLabel={t('ecommerce.backend.stores.actions.create', 'Create store')}
|
|
259
|
+
/>
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
return (
|
|
263
|
+
<Page>
|
|
264
|
+
<PageBody>
|
|
265
|
+
<DataTable<StoreAdminRecord>
|
|
266
|
+
title={t('ecommerce.module.title', 'Stores')}
|
|
267
|
+
titleHeadingLevel={1}
|
|
268
|
+
columns={columns}
|
|
269
|
+
data={storesQuery.data?.items ?? []}
|
|
270
|
+
isLoading={storesQuery.isLoading}
|
|
271
|
+
error={storesQuery.isError ? t('ecommerce.backend.stores.errors.load', 'Failed to load stores.') : null}
|
|
272
|
+
actions={createAction}
|
|
273
|
+
searchValue={search}
|
|
274
|
+
onSearchChange={(value) => {
|
|
275
|
+
setSearch(value)
|
|
276
|
+
setPage(1)
|
|
277
|
+
}}
|
|
278
|
+
searchPlaceholder={t('ecommerce.backend.stores.search.placeholder', 'Search by name, code or slug')}
|
|
279
|
+
filters={filters}
|
|
280
|
+
filterValues={filterValues}
|
|
281
|
+
onFiltersApply={(values) => {
|
|
282
|
+
setFilterValues(values)
|
|
283
|
+
setPage(1)
|
|
284
|
+
}}
|
|
285
|
+
onFiltersClear={clearFilters}
|
|
286
|
+
filterAwareEmptyState={{
|
|
287
|
+
active: hasActiveFilters,
|
|
288
|
+
entityNamePlural: t('ecommerce.backend.stores.entityPlural', 'stores'),
|
|
289
|
+
canRemoveLast: status !== null,
|
|
290
|
+
onClearAll: clearFilters,
|
|
291
|
+
onRemoveLast: clearFilters,
|
|
292
|
+
}}
|
|
293
|
+
sorting={sorting}
|
|
294
|
+
onSortingChange={(next) => {
|
|
295
|
+
setSorting(next)
|
|
296
|
+
setPage(1)
|
|
297
|
+
}}
|
|
298
|
+
sortable
|
|
299
|
+
manualSorting
|
|
300
|
+
rowActions={(row) => <RowActions items={buildRowActions(row)} />}
|
|
301
|
+
onRowClick={(row) => router.push(buildStoreEditHref(row.id, 'general'))}
|
|
302
|
+
emptyState={emptyState}
|
|
303
|
+
pagination={{
|
|
304
|
+
page,
|
|
305
|
+
pageSize: STORE_LIST_PAGE_SIZE,
|
|
306
|
+
total: storesQuery.data?.total ?? 0,
|
|
307
|
+
totalPages: storesQuery.data?.totalPages ?? 1,
|
|
308
|
+
totalIsCapped: storesQuery.data?.totalIsCapped === true,
|
|
309
|
+
onPageChange: setPage,
|
|
310
|
+
}}
|
|
311
|
+
/>
|
|
312
|
+
{canManage ? (
|
|
313
|
+
<StoreCreateDialog
|
|
314
|
+
open={createOpen}
|
|
315
|
+
onOpenChange={setCreateOpen}
|
|
316
|
+
onCreated={async () => {
|
|
317
|
+
clearFilters()
|
|
318
|
+
await refresh()
|
|
319
|
+
}}
|
|
320
|
+
/>
|
|
321
|
+
) : null}
|
|
322
|
+
{ConfirmDialogElement}
|
|
323
|
+
</PageBody>
|
|
324
|
+
</Page>
|
|
325
|
+
)
|
|
326
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { CrudForm, type CrudField } from '@open-mercato/ui/backend/CrudForm'
|
|
5
|
+
import { flash } from '@open-mercato/ui/backend/FlashMessages'
|
|
6
|
+
import { updateCrud } from '@open-mercato/ui/backend/utils/crud'
|
|
7
|
+
import { createCrudFormError, type CrudFormError } from '@open-mercato/ui/backend/utils/serverErrors'
|
|
8
|
+
import { Alert, AlertDescription } from '@open-mercato/ui/primitives/alert'
|
|
9
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@open-mercato/ui/primitives/card'
|
|
10
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
11
|
+
import { STORES_API_PATH, type StoreAdminRecord } from './storeAdmin'
|
|
12
|
+
import {
|
|
13
|
+
buildStoreSeoInitialValues,
|
|
14
|
+
buildStoreSeoPayload,
|
|
15
|
+
remapStoreSeoFieldErrors,
|
|
16
|
+
STORE_SEO_FIELD_LIMITS,
|
|
17
|
+
storeSeoFormSchema,
|
|
18
|
+
type StoreSeoFormValues,
|
|
19
|
+
} from './storeSeo'
|
|
20
|
+
import { useStoreAccess } from './useStoreAccess'
|
|
21
|
+
|
|
22
|
+
type StoreSeoTabProps = {
|
|
23
|
+
store: StoreAdminRecord
|
|
24
|
+
reload: () => Promise<void>
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function StoreSeoTab({ store, reload }: StoreSeoTabProps) {
|
|
28
|
+
const t = useT()
|
|
29
|
+
const { canManage } = useStoreAccess()
|
|
30
|
+
const [formKey, setFormKey] = React.useState(0)
|
|
31
|
+
|
|
32
|
+
const fields = React.useMemo<CrudField[]>(
|
|
33
|
+
() => [
|
|
34
|
+
{
|
|
35
|
+
id: 'siteName',
|
|
36
|
+
type: 'text',
|
|
37
|
+
label: t('ecommerce.backend.store.seo.siteName', 'Site name'),
|
|
38
|
+
description: t(
|
|
39
|
+
'ecommerce.backend.store.seo.siteNameHint',
|
|
40
|
+
'The name of your store shown in search results and the browser tab.',
|
|
41
|
+
),
|
|
42
|
+
maxLength: STORE_SEO_FIELD_LIMITS.siteName,
|
|
43
|
+
disabled: !canManage,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'defaultMetaDescription',
|
|
47
|
+
type: 'textarea',
|
|
48
|
+
label: t('ecommerce.backend.store.seo.defaultMetaDescription', 'Default meta description'),
|
|
49
|
+
description: t(
|
|
50
|
+
'ecommerce.backend.store.seo.defaultMetaDescriptionHint',
|
|
51
|
+
'A short description of your store shown in search results when no product description is available.',
|
|
52
|
+
),
|
|
53
|
+
maxLength: STORE_SEO_FIELD_LIMITS.defaultMetaDescription,
|
|
54
|
+
disabled: !canManage,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 'googleSiteVerification',
|
|
58
|
+
type: 'text',
|
|
59
|
+
label: t('ecommerce.backend.store.seo.googleSiteVerification', 'Google site verification token'),
|
|
60
|
+
description: t(
|
|
61
|
+
'ecommerce.backend.store.seo.googleSiteVerificationHint',
|
|
62
|
+
'The token provided by Google Search Console to verify site ownership.',
|
|
63
|
+
),
|
|
64
|
+
maxLength: STORE_SEO_FIELD_LIMITS.googleSiteVerification,
|
|
65
|
+
disabled: !canManage,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: 'robotsTxt',
|
|
69
|
+
type: 'textarea',
|
|
70
|
+
label: t('ecommerce.backend.store.seo.robotsTxt', 'robots.txt'),
|
|
71
|
+
description: t(
|
|
72
|
+
'ecommerce.backend.store.seo.robotsTxtHint',
|
|
73
|
+
'Instructions for search engine crawlers on which parts of your store to index.',
|
|
74
|
+
),
|
|
75
|
+
maxLength: STORE_SEO_FIELD_LIMITS.robotsTxt,
|
|
76
|
+
disabled: !canManage,
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
[canManage, t],
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
const initialValues = React.useMemo(() => buildStoreSeoInitialValues(store), [store])
|
|
83
|
+
|
|
84
|
+
const handleSubmit = React.useCallback(
|
|
85
|
+
async (values: StoreSeoFormValues) => {
|
|
86
|
+
try {
|
|
87
|
+
await updateCrud(STORES_API_PATH, buildStoreSeoPayload(store.id, values), {
|
|
88
|
+
errorMessage: t('ecommerce.backend.store.seo.errors.save', 'Failed to save the SEO settings.'),
|
|
89
|
+
})
|
|
90
|
+
} catch (error) {
|
|
91
|
+
const failure = error as CrudFormError
|
|
92
|
+
const fieldErrors = remapStoreSeoFieldErrors(failure.fieldErrors)
|
|
93
|
+
if (!fieldErrors) throw error
|
|
94
|
+
throw createCrudFormError(failure.message, fieldErrors, { status: failure.status, details: failure.details })
|
|
95
|
+
}
|
|
96
|
+
flash(t('ecommerce.backend.store.seo.flash.saved', 'SEO settings saved'), 'success')
|
|
97
|
+
await reload()
|
|
98
|
+
},
|
|
99
|
+
[reload, store.id, t],
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
const resetForm = React.useCallback(() => setFormKey((current) => current + 1), [])
|
|
103
|
+
|
|
104
|
+
const handleKeyDown = React.useCallback(
|
|
105
|
+
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
106
|
+
if (event.key !== 'Escape' || event.defaultPrevented) return
|
|
107
|
+
resetForm()
|
|
108
|
+
},
|
|
109
|
+
[resetForm],
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<div className="space-y-6">
|
|
114
|
+
<Card>
|
|
115
|
+
<CardHeader>
|
|
116
|
+
<CardTitle>{t('ecommerce.backend.store.seo.title', 'Search engine optimization')}</CardTitle>
|
|
117
|
+
<CardDescription>
|
|
118
|
+
{t(
|
|
119
|
+
'ecommerce.backend.store.seo.description',
|
|
120
|
+
'Configure how your store appears in search results and to automated crawlers.',
|
|
121
|
+
)}
|
|
122
|
+
</CardDescription>
|
|
123
|
+
</CardHeader>
|
|
124
|
+
<CardContent className="space-y-4">
|
|
125
|
+
{canManage ? null : (
|
|
126
|
+
<Alert status="information">
|
|
127
|
+
<AlertDescription>
|
|
128
|
+
{t(
|
|
129
|
+
'ecommerce.backend.store.seo.readOnly',
|
|
130
|
+
'You can view these SEO settings but not change them. Changing them requires permission to manage stores.',
|
|
131
|
+
)}
|
|
132
|
+
</AlertDescription>
|
|
133
|
+
</Alert>
|
|
134
|
+
)}
|
|
135
|
+
<div onKeyDown={handleKeyDown}>
|
|
136
|
+
<CrudForm<StoreSeoFormValues>
|
|
137
|
+
key={`${formKey}:${store.updatedAt ?? 'new'}`}
|
|
138
|
+
schema={storeSeoFormSchema}
|
|
139
|
+
fields={fields}
|
|
140
|
+
initialValues={initialValues}
|
|
141
|
+
optimisticLockUpdatedAt={store.updatedAt}
|
|
142
|
+
submitLabel={t('ecommerce.backend.store.seo.save', 'Save SEO settings')}
|
|
143
|
+
onSubmit={handleSubmit}
|
|
144
|
+
hideFooterActions={!canManage}
|
|
145
|
+
embedded
|
|
146
|
+
/>
|
|
147
|
+
</div>
|
|
148
|
+
</CardContent>
|
|
149
|
+
</Card>
|
|
150
|
+
</div>
|
|
151
|
+
)
|
|
152
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
5
|
+
import { StatusBadge } from '@open-mercato/ui/primitives/status-badge'
|
|
6
|
+
import { STORE_STATUS_VARIANTS, type StoreStatus } from './storeAdmin'
|
|
7
|
+
|
|
8
|
+
export const STORE_STATUS_LABELS: Record<StoreStatus, { key: string; fallback: string }> = {
|
|
9
|
+
draft: { key: 'ecommerce.backend.stores.status.draft', fallback: 'Draft' },
|
|
10
|
+
active: { key: 'ecommerce.backend.stores.status.active', fallback: 'Active' },
|
|
11
|
+
archived: { key: 'ecommerce.backend.stores.status.archived', fallback: 'Archived' },
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function StoreStatusBadge({ status }: { status: StoreStatus }) {
|
|
15
|
+
const t = useT()
|
|
16
|
+
const label = STORE_STATUS_LABELS[status]
|
|
17
|
+
return (
|
|
18
|
+
<StatusBadge variant={STORE_STATUS_VARIANTS[status] ?? 'neutral'} dot>
|
|
19
|
+
{label ? t(label.key, label.fallback) : status}
|
|
20
|
+
</StatusBadge>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createIdsLookupSource,
|
|
3
|
+
lookupLabelWithCode,
|
|
4
|
+
pickLookupString,
|
|
5
|
+
} from '@open-mercato/ui/backend/inputs/lookupSources'
|
|
6
|
+
|
|
7
|
+
export type { LookupOption, LookupSource } from '@open-mercato/ui/backend/inputs/lookupSources'
|
|
8
|
+
export {
|
|
9
|
+
categoryLookupSource,
|
|
10
|
+
productLookupSource,
|
|
11
|
+
tagLookupSource,
|
|
12
|
+
} from '@open-mercato/core/modules/catalog/components/lookupSources'
|
|
13
|
+
|
|
14
|
+
export const salesChannelLookupSource = createIdsLookupSource('sales-channels', '/api/sales/channels', (item) => {
|
|
15
|
+
const value = pickLookupString(item, 'id')
|
|
16
|
+
if (!value) return null
|
|
17
|
+
return { value, label: lookupLabelWithCode(pickLookupString(item, 'name') || value, pickLookupString(item, 'code')) }
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
export const priceKindLookupSource = createIdsLookupSource('price-kinds', '/api/catalog/price-kinds', (item) => {
|
|
21
|
+
const value = pickLookupString(item, 'id')
|
|
22
|
+
if (!value) return null
|
|
23
|
+
return { value, label: lookupLabelWithCode(pickLookupString(item, 'title', 'name') || value, pickLookupString(item, 'code')) }
|
|
24
|
+
})
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { StatusBadgeVariant } from '@open-mercato/ui/primitives/status-badge'
|
|
2
|
+
import type { StoreListBindingSummary } from '../data/enrichers'
|
|
3
|
+
|
|
4
|
+
export const STORE_STATUSES = ['draft', 'active', 'archived'] as const
|
|
5
|
+
|
|
6
|
+
export type StoreStatus = (typeof STORE_STATUSES)[number]
|
|
7
|
+
|
|
8
|
+
export type StoreAdminRecord = {
|
|
9
|
+
id: string
|
|
10
|
+
organizationId?: string | null
|
|
11
|
+
tenantId?: string | null
|
|
12
|
+
code: string
|
|
13
|
+
name: string
|
|
14
|
+
slug: string
|
|
15
|
+
status: StoreStatus
|
|
16
|
+
defaultLocale: string
|
|
17
|
+
supportedLocales: string[]
|
|
18
|
+
defaultCurrencyCode: string
|
|
19
|
+
isPrimary: boolean
|
|
20
|
+
settings?: Record<string, unknown> | null
|
|
21
|
+
createdAt: string | null
|
|
22
|
+
updatedAt: string | null
|
|
23
|
+
_ecommerce?: StoreListBindingSummary
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type StoreListResponse = {
|
|
27
|
+
items: StoreAdminRecord[]
|
|
28
|
+
total: number
|
|
29
|
+
totalPages: number
|
|
30
|
+
totalIsCapped?: boolean
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const STORES_API_PATH = 'ecommerce/stores'
|
|
34
|
+
export const STORES_API_URL = `/api/${STORES_API_PATH}`
|
|
35
|
+
export const STORE_LIST_HREF = '/backend/config/ecommerce'
|
|
36
|
+
export const STORE_MANAGE_FEATURE = 'ecommerce.stores.manage'
|
|
37
|
+
export const STORE_VIEW_FEATURE = 'ecommerce.stores.view'
|
|
38
|
+
export const BRANDING_MANAGE_FEATURE = 'ecommerce.branding.manage'
|
|
39
|
+
export const DOMAINS_MANAGE_FEATURE = 'ecommerce.domains.manage'
|
|
40
|
+
export const CHANNELS_MANAGE_FEATURE = 'ecommerce.channels.manage'
|
|
41
|
+
export const AVAILABILITY_POLICIES_API_PATH = 'availability/policies'
|
|
42
|
+
export const AVAILABILITY_POLICIES_API_URL = `/api/${AVAILABILITY_POLICIES_API_PATH}`
|
|
43
|
+
export const AVAILABILITY_VIEW_FEATURE = 'availability.policies.view'
|
|
44
|
+
export const AVAILABILITY_MANAGE_FEATURE = 'availability.policies.manage'
|
|
45
|
+
|
|
46
|
+
export const STORE_STATUS_VARIANTS: Record<StoreStatus, StatusBadgeVariant> = {
|
|
47
|
+
draft: 'neutral',
|
|
48
|
+
active: 'success',
|
|
49
|
+
archived: 'warning',
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function formatPrimaryDomain(summary: StoreListBindingSummary | undefined): string | null {
|
|
53
|
+
const domain = summary?.primaryDomain
|
|
54
|
+
if (!domain) return null
|
|
55
|
+
return `${domain.hostname}${domain.pathPrefix ?? ''}`
|
|
56
|
+
}
|