@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,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/catalog/migrations/Migration20261005150824_catalog.ts"],
|
|
4
|
+
"sourcesContent": ["import { Migration } from '@mikro-orm/migrations';\n\nexport class Migration20261005150824_catalog extends Migration {\n\n override name = 'Migration20261005150824';\n\n override up(): void | Promise<void> {\n this.addSql(`create table \"catalog_price_history_entries\" (\"id\" uuid not null default gen_random_uuid(), \"tenant_id\" uuid not null, \"organization_id\" uuid not null, \"price_id\" uuid not null, \"product_id\" uuid not null, \"variant_id\" uuid null, \"offer_id\" uuid null, \"channel_id\" uuid null, \"price_kind_id\" uuid not null, \"price_kind_code\" text not null, \"currency_code\" varchar(3) not null, \"unit_price_net\" numeric(16,4) null, \"unit_price_gross\" numeric(16,4) null, \"tax_rate\" numeric(7,4) null, \"tax_amount\" numeric(16,4) null, \"min_quantity\" int null, \"max_quantity\" int null, \"starts_at\" timestamptz null, \"ends_at\" timestamptz null, \"recorded_at\" timestamptz not null, \"change_type\" text not null, \"source\" text not null, \"is_announced\" boolean null, \"idempotency_key\" text null, \"metadata\" jsonb null, primary key (\"id\"));`);\n this.addSql(`create index \"catalog_price_history_price_idx\" on \"catalog_price_history_entries\" (\"tenant_id\", \"organization_id\", \"price_id\");`);\n this.addSql(`create index \"catalog_price_history_offer_idx\" on \"catalog_price_history_entries\" (\"tenant_id\", \"organization_id\", \"offer_id\", \"price_kind_id\", \"currency_code\", \"recorded_at\" desc);`);\n this.addSql(`create index \"catalog_price_history_variant_channel_idx\" on \"catalog_price_history_entries\" (\"tenant_id\", \"organization_id\", \"variant_id\", \"channel_id\", \"price_kind_id\", \"currency_code\", \"recorded_at\" desc);`);\n this.addSql(`create index \"catalog_price_history_variant_idx\" on \"catalog_price_history_entries\" (\"tenant_id\", \"organization_id\", \"variant_id\", \"price_kind_id\", \"currency_code\", \"recorded_at\" desc);`);\n this.addSql(`create index \"catalog_price_history_product_channel_idx\" on \"catalog_price_history_entries\" (\"tenant_id\", \"organization_id\", \"product_id\", \"channel_id\", \"price_kind_id\", \"currency_code\", \"recorded_at\" desc);`);\n this.addSql(`create index \"catalog_price_history_product_idx\" on \"catalog_price_history_entries\" (\"tenant_id\", \"organization_id\", \"product_id\", \"price_kind_id\", \"currency_code\", \"recorded_at\" desc);`);\n\n this.addSql(`alter table \"catalog_price_history_entries\" add constraint \"catalog_price_history_entries_change_type_check\" check (\"change_type\" in ('create', 'update', 'delete', 'undo'));`);\n this.addSql(`alter table \"catalog_price_history_entries\" add constraint \"catalog_price_history_entries_source_check\" check (\"source\" in ('api', 'system'));`);\n this.addSql(`create unique index \"catalog_price_history_idempotency_uq\" on \"catalog_price_history_entries\" (\"tenant_id\", \"organization_id\", \"idempotency_key\") where \"idempotency_key\" is not null;`);\n\n this.addSql(`-- MANUAL DDL: immutability trigger and role restriction\nCREATE OR REPLACE FUNCTION catalog_price_history_prevent_modification() RETURNS trigger AS $$\nBEGIN\n RAISE EXCEPTION 'catalog_price_history_entries is immutable';\nEND;\n$$ LANGUAGE plpgsql;`);\n this.addSql(`-- DEPLOY RUNBOOK (production): grant the app role INSERT/SELECT only.\n-- REVOKE UPDATE, DELETE ON catalog_price_history_entries FROM <app_db_role>;\nCREATE OR REPLACE TRIGGER history_immutable\n BEFORE UPDATE OR DELETE ON catalog_price_history_entries\n FOR EACH ROW EXECUTE FUNCTION catalog_price_history_prevent_modification();`);\n }\n\n override down(): void | Promise<void> {\n this.addSql(`DROP TRIGGER IF EXISTS history_immutable ON catalog_price_history_entries;`);\n this.addSql(`DROP FUNCTION IF EXISTS catalog_price_history_prevent_modification();`);\n this.addSql(`drop table if exists \"catalog_price_history_entries\" cascade;`);\n }\n\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAEnB,MAAM,wCAAwC,UAAU;AAAA,EAAxD;AAAA;AAEL,SAAS,OAAO;AAAA;AAAA,EAEP,KAA2B;AAClC,SAAK,OAAO,gzBAAgzB;AAC5zB,SAAK,OAAO,iIAAiI;AAC7I,SAAK,OAAO,uLAAuL;AACnM,SAAK,OAAO,iNAAiN;AAC7N,SAAK,OAAO,2LAA2L;AACvM,SAAK,OAAO,iNAAiN;AAC7N,SAAK,OAAO,2LAA2L;AAEvM,SAAK,OAAO,+KAA+K;AAC3L,SAAK,OAAO,gJAAgJ;AAC5J,SAAK,OAAO,wLAAwL;AAEpM,SAAK,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,qBAKK;AACjB,SAAK,OAAO;AAAA;AAAA;AAAA;AAAA,8EAI8D;AAAA,EAC5E;AAAA,EAES,OAA6B;AACpC,SAAK,OAAO,4EAA4E;AACxF,SAAK,OAAO,uEAAuE;AACnF,SAAK,OAAO,+DAA+D;AAAA,EAC7E;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
import { findWithDecryption } from "@open-mercato/shared/lib/encryption/find";
|
|
2
|
+
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
3
|
+
import { getTelemetryRuntime } from "@open-mercato/shared/lib/telemetry/runtime";
|
|
4
|
+
import { CatalogPriceHistoryEntry } from "../data/entities.js";
|
|
5
|
+
import {
|
|
6
|
+
OMNIBUS_CONFIG_MODULE_ID,
|
|
7
|
+
OMNIBUS_CONFIG_NAME,
|
|
8
|
+
OMNIBUS_DEFAULT_LOOKBACK_DAYS,
|
|
9
|
+
OMNIBUS_PRICE_REMOVING_UNDO_COMMAND,
|
|
10
|
+
omnibusConfigSchema
|
|
11
|
+
} from "../lib/omnibusTypes.js";
|
|
12
|
+
import {
|
|
13
|
+
buildOmnibusCacheKey,
|
|
14
|
+
buildOmnibusCacheTags,
|
|
15
|
+
readOmnibusCache,
|
|
16
|
+
writeOmnibusCache
|
|
17
|
+
} from "../lib/omnibusCache.js";
|
|
18
|
+
import {
|
|
19
|
+
fetchOmnibusFirstOfferIds,
|
|
20
|
+
fetchOmnibusWindowIds
|
|
21
|
+
} from "../lib/omnibusHistoryQueries.js";
|
|
22
|
+
import { formatFixedDecimal4 } from "../lib/priceHistoryQuery.js";
|
|
23
|
+
const logger = createLogger("catalog");
|
|
24
|
+
const DAY_MS = 24 * 60 * 60 * 1e3;
|
|
25
|
+
const DECIMAL_SCALE = 4;
|
|
26
|
+
function toDate(value) {
|
|
27
|
+
if (value === null || value === void 0) return null;
|
|
28
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
29
|
+
return Number.isNaN(date.getTime()) ? null : date;
|
|
30
|
+
}
|
|
31
|
+
function truncToUtcDay(date) {
|
|
32
|
+
return date.toISOString().slice(0, 10);
|
|
33
|
+
}
|
|
34
|
+
function parseScaledDecimal(value) {
|
|
35
|
+
if (value === null) return null;
|
|
36
|
+
const match = /^(-?)(\d+)(?:\.(\d*))?$/.exec(value.trim());
|
|
37
|
+
if (!match) return null;
|
|
38
|
+
const [, sign, whole, fraction = ""] = match;
|
|
39
|
+
const scaled = BigInt(`${whole}${fraction.slice(0, DECIMAL_SCALE).padEnd(DECIMAL_SCALE, "0")}`);
|
|
40
|
+
return sign === "-" ? -scaled : scaled;
|
|
41
|
+
}
|
|
42
|
+
function priceValue(row, axis) {
|
|
43
|
+
return parseScaledDecimal(axis === "gross" ? row.unitPriceGross : row.unitPriceNet);
|
|
44
|
+
}
|
|
45
|
+
function compareChronological(left, right) {
|
|
46
|
+
const delta = Date.parse(left.recordedAt) - Date.parse(right.recordedAt);
|
|
47
|
+
if (delta !== 0) return delta;
|
|
48
|
+
return left.id < right.id ? -1 : left.id > right.id ? 1 : 0;
|
|
49
|
+
}
|
|
50
|
+
function compareByAxis(left, right, axis) {
|
|
51
|
+
const leftValue = priceValue(left, axis);
|
|
52
|
+
const rightValue = priceValue(right, axis);
|
|
53
|
+
if (leftValue === null && rightValue !== null) return 1;
|
|
54
|
+
if (leftValue !== null && rightValue === null) return -1;
|
|
55
|
+
if (leftValue !== null && rightValue !== null && leftValue !== rightValue) return leftValue < rightValue ? -1 : 1;
|
|
56
|
+
return compareChronological(left, right);
|
|
57
|
+
}
|
|
58
|
+
function isPresentedReduction(row, presented) {
|
|
59
|
+
if (!presented) return false;
|
|
60
|
+
const presentedAt = toDate(presented.recordedAt);
|
|
61
|
+
return row.priceId === presented.priceId && row.changeType === presented.changeType && presentedAt !== null && Date.parse(row.recordedAt) === presentedAt.getTime();
|
|
62
|
+
}
|
|
63
|
+
function isPriceObservation(row) {
|
|
64
|
+
if (row.changeType === "delete") return false;
|
|
65
|
+
return !(row.changeType === "undo" && row.undoneCommand === OMNIBUS_PRICE_REMOVING_UNDO_COMMAND);
|
|
66
|
+
}
|
|
67
|
+
function selectOmnibusCandidates(input) {
|
|
68
|
+
const anchorMs = input.anchor ? input.anchor.getTime() : null;
|
|
69
|
+
const pool = input.baseline ? [input.baseline, ...input.inWindow] : [...input.inWindow];
|
|
70
|
+
const candidates = pool.filter(
|
|
71
|
+
(row) => isPriceObservation(row) && !isPresentedReduction(row, input.presentedEntry) && (anchorMs === null || Date.parse(row.recordedAt) < anchorMs)
|
|
72
|
+
);
|
|
73
|
+
if (!candidates.length) {
|
|
74
|
+
return { lowestRow: null, previousRow: null, insufficientHistory: false, coverageStartAt: null };
|
|
75
|
+
}
|
|
76
|
+
const lowest = [...candidates].sort((left, right) => compareByAxis(left, right, input.axis))[0];
|
|
77
|
+
const lowestRow = priceValue(lowest, input.axis) === null ? null : lowest;
|
|
78
|
+
const baselineKept = input.baseline !== null && candidates.includes(input.baseline);
|
|
79
|
+
if (baselineKept) {
|
|
80
|
+
return { lowestRow, previousRow: input.baseline, insufficientHistory: false, coverageStartAt: null };
|
|
81
|
+
}
|
|
82
|
+
const oldest = [...candidates].sort(compareChronological)[0];
|
|
83
|
+
return { lowestRow, previousRow: oldest, insufficientHistory: true, coverageStartAt: oldest.recordedAt };
|
|
84
|
+
}
|
|
85
|
+
function toHistoryRow(entry) {
|
|
86
|
+
const recordedAt = entry.recordedAt instanceof Date ? entry.recordedAt : new Date(entry.recordedAt);
|
|
87
|
+
const undoneCommand = undoneCommandOf(entry.metadata);
|
|
88
|
+
return {
|
|
89
|
+
id: entry.id,
|
|
90
|
+
priceId: entry.priceId,
|
|
91
|
+
changeType: entry.changeType,
|
|
92
|
+
recordedAt: recordedAt.toISOString(),
|
|
93
|
+
unitPriceNet: entry.unitPriceNet ?? null,
|
|
94
|
+
unitPriceGross: entry.unitPriceGross ?? null,
|
|
95
|
+
...undoneCommand ? { undoneCommand } : {}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function undoneCommandOf(metadata) {
|
|
99
|
+
const value = metadata?.undoneCommand;
|
|
100
|
+
return typeof value === "string" ? value : null;
|
|
101
|
+
}
|
|
102
|
+
function resolveHistoryScope(context) {
|
|
103
|
+
if (context.offerId) return { column: "offer_id", id: context.offerId };
|
|
104
|
+
if (context.variantId) return { column: "variant_id", id: context.variantId };
|
|
105
|
+
if (context.productId) return { column: "product_id", id: context.productId };
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
function earlyResult(reason, presentedPriceKindId, lookbackDays, axis) {
|
|
109
|
+
return {
|
|
110
|
+
reason,
|
|
111
|
+
presentedPriceKindId,
|
|
112
|
+
lowestRow: null,
|
|
113
|
+
previousRow: null,
|
|
114
|
+
insufficientHistory: false,
|
|
115
|
+
promotionAnchorAt: null,
|
|
116
|
+
coverageStartAt: null,
|
|
117
|
+
windowStart: null,
|
|
118
|
+
windowEnd: null,
|
|
119
|
+
lookbackDays,
|
|
120
|
+
minimizationAxis: axis
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function emptyBlock(result, currencyCode, reason) {
|
|
124
|
+
return {
|
|
125
|
+
presentedPriceKindId: result.presentedPriceKindId,
|
|
126
|
+
lookbackDays: result.lookbackDays,
|
|
127
|
+
minimizationAxis: result.minimizationAxis,
|
|
128
|
+
promotionAnchorAt: result.promotionAnchorAt,
|
|
129
|
+
windowStart: result.windowStart,
|
|
130
|
+
windowEnd: result.windowEnd,
|
|
131
|
+
coverageStartAt: null,
|
|
132
|
+
lowestPriceNet: null,
|
|
133
|
+
lowestPriceGross: null,
|
|
134
|
+
previousPriceNet: null,
|
|
135
|
+
previousPriceGross: null,
|
|
136
|
+
currencyCode,
|
|
137
|
+
applicable: false,
|
|
138
|
+
applicabilityReason: reason
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function buildOmnibusBlock(result, context, presentedEntry, priceKindIsPromotion) {
|
|
142
|
+
if (result.reason === "not_in_eu_market" || result.reason === "missing_channel_context") {
|
|
143
|
+
return emptyBlock(result, context.currencyCode, result.reason);
|
|
144
|
+
}
|
|
145
|
+
if (!result.lowestRow) return emptyBlock(result, context.currencyCode, result.reason ?? "no_history");
|
|
146
|
+
const applicable = Boolean(presentedEntry?.startsAt) || Boolean(presentedEntry?.offerId) || presentedEntry?.isAnnounced === true || priceKindIsPromotion;
|
|
147
|
+
const reason = result.reason ?? (result.insufficientHistory ? "insufficient_history" : applicable ? "announced_promotion" : "not_announced");
|
|
148
|
+
return {
|
|
149
|
+
presentedPriceKindId: result.presentedPriceKindId,
|
|
150
|
+
lookbackDays: result.lookbackDays,
|
|
151
|
+
minimizationAxis: result.minimizationAxis,
|
|
152
|
+
promotionAnchorAt: result.promotionAnchorAt,
|
|
153
|
+
windowStart: result.windowStart,
|
|
154
|
+
windowEnd: result.windowEnd,
|
|
155
|
+
coverageStartAt: result.coverageStartAt,
|
|
156
|
+
lowestPriceNet: formatFixedDecimal4(result.lowestRow.unitPriceNet),
|
|
157
|
+
lowestPriceGross: formatFixedDecimal4(result.lowestRow.unitPriceGross),
|
|
158
|
+
previousPriceNet: formatFixedDecimal4(result.previousRow?.unitPriceNet ?? null),
|
|
159
|
+
previousPriceGross: formatFixedDecimal4(result.previousRow?.unitPriceGross ?? null),
|
|
160
|
+
currencyCode: context.currencyCode,
|
|
161
|
+
applicable,
|
|
162
|
+
applicabilityReason: reason
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function presentedIdentity(presented) {
|
|
166
|
+
if (!presented) return "none";
|
|
167
|
+
const recordedAt = toDate(presented.recordedAt);
|
|
168
|
+
return `${presented.priceId}|${presented.changeType}|${recordedAt ? recordedAt.toISOString() : "invalid"}`;
|
|
169
|
+
}
|
|
170
|
+
function scopeTargets(context) {
|
|
171
|
+
return { productId: context.productId ?? null, variantId: context.variantId ?? null, offerId: context.offerId ?? null };
|
|
172
|
+
}
|
|
173
|
+
class DefaultCatalogOmnibusService {
|
|
174
|
+
constructor(moduleConfigService, cache) {
|
|
175
|
+
this.moduleConfigService = moduleConfigService;
|
|
176
|
+
this.cache = cache;
|
|
177
|
+
}
|
|
178
|
+
async getConfig(scope) {
|
|
179
|
+
if (!this.moduleConfigService) return null;
|
|
180
|
+
const raw = await this.moduleConfigService.getValue(OMNIBUS_CONFIG_MODULE_ID, OMNIBUS_CONFIG_NAME, {
|
|
181
|
+
scope: { tenantId: scope.tenantId, organizationId: scope.organizationId ?? null }
|
|
182
|
+
});
|
|
183
|
+
if (raw === null || raw === void 0) return null;
|
|
184
|
+
const parsed = omnibusConfigSchema.safeParse(raw);
|
|
185
|
+
if (!parsed.success) {
|
|
186
|
+
logger.warn("[internal] catalog omnibus config is invalid; treating omnibus as disabled", {
|
|
187
|
+
tenantId: scope.tenantId,
|
|
188
|
+
organizationId: scope.organizationId ?? null,
|
|
189
|
+
issues: parsed.error.issues.map((issue) => issue.path.join("."))
|
|
190
|
+
});
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
return parsed.data;
|
|
194
|
+
}
|
|
195
|
+
resolvePresentedPriceKindId(config, channelId, fallbackPriceKindId) {
|
|
196
|
+
const channelConfig = channelId ? config.channels[channelId] : void 0;
|
|
197
|
+
return channelConfig?.presentedPriceKindId ?? config.defaultPresentedPriceKindId ?? fallbackPriceKindId ?? null;
|
|
198
|
+
}
|
|
199
|
+
async computeLowestPrice(em, context, config, presentedEntry = null) {
|
|
200
|
+
const [result] = await this.computeLowestPrices(em, [{ context, config, presentedEntry }]);
|
|
201
|
+
return result;
|
|
202
|
+
}
|
|
203
|
+
async computeLowestPrices(em, entries) {
|
|
204
|
+
const results = entries.map(() => null);
|
|
205
|
+
const prepared = [];
|
|
206
|
+
entries.forEach((entry, index) => {
|
|
207
|
+
const gated = this.prepareLookup(index, entry.context, entry.config, entry.presentedEntry ?? null);
|
|
208
|
+
if ("reason" in gated) results[index] = gated;
|
|
209
|
+
else prepared.push(gated);
|
|
210
|
+
});
|
|
211
|
+
await this.resolveOfferAnchors(em, prepared);
|
|
212
|
+
const windowed = prepared.map((lookup) => this.applyWindow(lookup));
|
|
213
|
+
const pending = [];
|
|
214
|
+
for (const lookup of windowed) {
|
|
215
|
+
const cached = await readOmnibusCache(this.cache, lookup.context.tenantId, lookup.cacheKey);
|
|
216
|
+
if (cached) results[lookup.index] = cached;
|
|
217
|
+
else pending.push(lookup);
|
|
218
|
+
}
|
|
219
|
+
if (pending.length) {
|
|
220
|
+
const computed = await this.computeFromHistory(em, pending);
|
|
221
|
+
for (let position = 0; position < pending.length; position += 1) {
|
|
222
|
+
const lookup = pending[position];
|
|
223
|
+
const result = computed[position];
|
|
224
|
+
results[lookup.index] = result;
|
|
225
|
+
await writeOmnibusCache(
|
|
226
|
+
this.cache,
|
|
227
|
+
lookup.context.tenantId,
|
|
228
|
+
lookup.cacheKey,
|
|
229
|
+
result,
|
|
230
|
+
buildOmnibusCacheTags(lookup.context, scopeTargets(lookup.context))
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return results.map((result, index) => {
|
|
235
|
+
if (result) return result;
|
|
236
|
+
const entry = entries[index];
|
|
237
|
+
return earlyResult("no_history", null, entry.config.lookbackDays, entry.config.minimizationAxis);
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
async resolveOmnibusBlock(em, context, presentedEntry = null, priceKindIsPromotion = false) {
|
|
241
|
+
const [block] = await this.resolveOmnibusBlocks(em, [{ context, presentedEntry, priceKindIsPromotion }]);
|
|
242
|
+
return block ?? null;
|
|
243
|
+
}
|
|
244
|
+
async resolveOmnibusBlocks(em, requests) {
|
|
245
|
+
const blocks = requests.map(() => null);
|
|
246
|
+
if (!requests.length) return blocks;
|
|
247
|
+
const configs = await this.loadConfigs(requests);
|
|
248
|
+
const enabled = [];
|
|
249
|
+
requests.forEach((request, index) => {
|
|
250
|
+
const config = configs.get(configKey(request.context)) ?? null;
|
|
251
|
+
if (config && config.enabled === true) enabled.push({ index, config });
|
|
252
|
+
});
|
|
253
|
+
if (!enabled.length) return blocks;
|
|
254
|
+
try {
|
|
255
|
+
const results = await this.computeLowestPrices(
|
|
256
|
+
em,
|
|
257
|
+
enabled.map(({ index, config }) => ({
|
|
258
|
+
context: requests[index].context,
|
|
259
|
+
config,
|
|
260
|
+
presentedEntry: requests[index].presentedEntry ?? null
|
|
261
|
+
}))
|
|
262
|
+
);
|
|
263
|
+
enabled.forEach(({ index }, position) => {
|
|
264
|
+
const request = requests[index];
|
|
265
|
+
blocks[index] = buildOmnibusBlock(
|
|
266
|
+
results[position],
|
|
267
|
+
request.context,
|
|
268
|
+
request.presentedEntry ?? null,
|
|
269
|
+
request.priceKindIsPromotion === true
|
|
270
|
+
);
|
|
271
|
+
});
|
|
272
|
+
} catch (err) {
|
|
273
|
+
const first = requests[enabled[0].index].context;
|
|
274
|
+
logger.error("[internal] catalog omnibus resolution failed", {
|
|
275
|
+
tenantId: first.tenantId,
|
|
276
|
+
organizationId: first.organizationId,
|
|
277
|
+
channelId: first.channelId ?? null,
|
|
278
|
+
priceKindId: first.priceKindId ?? null,
|
|
279
|
+
currencyCode: first.currencyCode,
|
|
280
|
+
requestCount: enabled.length,
|
|
281
|
+
err
|
|
282
|
+
});
|
|
283
|
+
getTelemetryRuntime()?.reportError(err, {
|
|
284
|
+
module: "catalog",
|
|
285
|
+
code: "catalog.omnibus_resolution_failed",
|
|
286
|
+
attributes: { requestCount: enabled.length }
|
|
287
|
+
});
|
|
288
|
+
return requests.map(() => null);
|
|
289
|
+
}
|
|
290
|
+
return blocks;
|
|
291
|
+
}
|
|
292
|
+
async loadConfigs(requests) {
|
|
293
|
+
const configs = /* @__PURE__ */ new Map();
|
|
294
|
+
for (const request of requests) {
|
|
295
|
+
const key = configKey(request.context);
|
|
296
|
+
if (configs.has(key)) continue;
|
|
297
|
+
configs.set(
|
|
298
|
+
key,
|
|
299
|
+
await this.getConfig({ tenantId: request.context.tenantId, organizationId: request.context.organizationId })
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
return configs;
|
|
303
|
+
}
|
|
304
|
+
prepareLookup(index, context, config, presentedEntry) {
|
|
305
|
+
const channelId = context.channelId ?? null;
|
|
306
|
+
const channelConfig = channelId ? config.channels[channelId] : void 0;
|
|
307
|
+
const lookbackDays = channelConfig?.lookbackDays ?? config.lookbackDays ?? OMNIBUS_DEFAULT_LOOKBACK_DAYS;
|
|
308
|
+
const axis = channelConfig?.minimizationAxis ?? config.minimizationAxis ?? "gross";
|
|
309
|
+
const presentedPriceKindId = this.resolvePresentedPriceKindId(config, channelId, context.priceKindId);
|
|
310
|
+
if (config.enabled !== true) return earlyResult("no_history", presentedPriceKindId, lookbackDays, axis);
|
|
311
|
+
const codes = config.enabledCountryCodes ?? [];
|
|
312
|
+
if (!codes.length) return earlyResult("not_in_eu_market", presentedPriceKindId, lookbackDays, axis);
|
|
313
|
+
if (!channelId) {
|
|
314
|
+
const mode = context.isStorefront === true ? "require_channel" : config.noChannelMode ?? "best_effort";
|
|
315
|
+
if (mode === "require_channel") {
|
|
316
|
+
return earlyResult("missing_channel_context", presentedPriceKindId, lookbackDays, axis);
|
|
317
|
+
}
|
|
318
|
+
} else {
|
|
319
|
+
const countryCode = channelConfig?.countryCode;
|
|
320
|
+
if (!countryCode || !codes.includes(countryCode)) {
|
|
321
|
+
return earlyResult("not_in_eu_market", presentedPriceKindId, lookbackDays, axis);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
const scope = resolveHistoryScope(context);
|
|
325
|
+
if (!scope || !presentedPriceKindId) return earlyResult("no_history", presentedPriceKindId, lookbackDays, axis);
|
|
326
|
+
return {
|
|
327
|
+
index,
|
|
328
|
+
context,
|
|
329
|
+
presentedEntry,
|
|
330
|
+
presentedPriceKindId,
|
|
331
|
+
scope,
|
|
332
|
+
channelId,
|
|
333
|
+
lookbackDays,
|
|
334
|
+
axis,
|
|
335
|
+
offerId: context.offerId ?? presentedEntry?.offerId ?? null,
|
|
336
|
+
anchor: toDate(presentedEntry?.startsAt ?? null),
|
|
337
|
+
now: context.now ?? /* @__PURE__ */ new Date()
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
async resolveOfferAnchors(em, prepared) {
|
|
341
|
+
const needing = prepared.filter((lookup) => lookup.anchor === null && lookup.offerId !== null);
|
|
342
|
+
if (!needing.length) return;
|
|
343
|
+
const misses = [];
|
|
344
|
+
for (const lookup of needing) {
|
|
345
|
+
const key = firstOfferCacheKey(lookup);
|
|
346
|
+
const cached = await readOmnibusCache(this.cache, lookup.context.tenantId, key);
|
|
347
|
+
if (cached) lookup.anchor = toDate(cached.recordedAt);
|
|
348
|
+
else misses.push({ lookup, key });
|
|
349
|
+
}
|
|
350
|
+
if (!misses.length) return;
|
|
351
|
+
const offerLookups = misses.map(({ lookup }) => ({
|
|
352
|
+
tenantId: lookup.context.tenantId,
|
|
353
|
+
organizationId: lookup.context.organizationId,
|
|
354
|
+
offerId: lookup.offerId,
|
|
355
|
+
priceKindId: lookup.presentedPriceKindId,
|
|
356
|
+
currencyCode: lookup.context.currencyCode,
|
|
357
|
+
channelId: lookup.channelId
|
|
358
|
+
}));
|
|
359
|
+
const ids = await fetchOmnibusFirstOfferIds(em, offerLookups);
|
|
360
|
+
const rows = await this.hydrate(em, misses.map(({ lookup }) => lookup.context), ids.filter(isPresent));
|
|
361
|
+
for (let position = 0; position < misses.length; position += 1) {
|
|
362
|
+
const { lookup, key } = misses[position];
|
|
363
|
+
const id = ids[position];
|
|
364
|
+
const row = id ? rows.get(id) ?? null : null;
|
|
365
|
+
lookup.anchor = row ? new Date(row.recordedAt) : null;
|
|
366
|
+
await writeOmnibusCache(
|
|
367
|
+
this.cache,
|
|
368
|
+
lookup.context.tenantId,
|
|
369
|
+
key,
|
|
370
|
+
{ recordedAt: row ? row.recordedAt : null },
|
|
371
|
+
buildOmnibusCacheTags(lookup.context, { ...scopeTargets(lookup.context), offerId: lookup.offerId })
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
applyWindow(lookup) {
|
|
376
|
+
const windowEnd = lookup.anchor ?? lookup.now;
|
|
377
|
+
const windowStart = new Date(windowEnd.getTime() - lookup.lookbackDays * DAY_MS);
|
|
378
|
+
const cacheKey = buildOmnibusCacheKey("lowest", [
|
|
379
|
+
lookup.context.tenantId,
|
|
380
|
+
lookup.context.organizationId,
|
|
381
|
+
`${lookup.scope.column}=${lookup.scope.id}`,
|
|
382
|
+
lookup.channelId ?? "none",
|
|
383
|
+
lookup.presentedPriceKindId,
|
|
384
|
+
lookup.context.currencyCode,
|
|
385
|
+
lookup.axis,
|
|
386
|
+
lookup.lookbackDays,
|
|
387
|
+
truncToUtcDay(windowStart),
|
|
388
|
+
lookup.anchor ? truncToUtcDay(lookup.anchor) : "none",
|
|
389
|
+
lookup.anchor ? lookup.anchor.toISOString() : "sliding",
|
|
390
|
+
presentedIdentity(lookup.presentedEntry)
|
|
391
|
+
]);
|
|
392
|
+
return { ...lookup, windowStart, windowEnd, cacheKey };
|
|
393
|
+
}
|
|
394
|
+
async computeFromHistory(em, lookups) {
|
|
395
|
+
const windowLookups = lookups.map((lookup) => ({
|
|
396
|
+
tenantId: lookup.context.tenantId,
|
|
397
|
+
organizationId: lookup.context.organizationId,
|
|
398
|
+
scopeColumn: lookup.scope.column,
|
|
399
|
+
scopeId: lookup.scope.id,
|
|
400
|
+
priceKindId: lookup.presentedPriceKindId,
|
|
401
|
+
currencyCode: lookup.context.currencyCode,
|
|
402
|
+
channelId: lookup.channelId,
|
|
403
|
+
windowStart: lookup.windowStart,
|
|
404
|
+
windowEnd: lookup.windowEnd
|
|
405
|
+
}));
|
|
406
|
+
const idSets = await fetchOmnibusWindowIds(em, windowLookups);
|
|
407
|
+
const allIds = /* @__PURE__ */ new Set();
|
|
408
|
+
for (const set of idSets) {
|
|
409
|
+
if (set.baselineId) allIds.add(set.baselineId);
|
|
410
|
+
for (const id of set.inWindowIds) allIds.add(id);
|
|
411
|
+
}
|
|
412
|
+
const rows = await this.hydrate(em, lookups.map((lookup) => lookup.context), Array.from(allIds));
|
|
413
|
+
return lookups.map((lookup, position) => {
|
|
414
|
+
const set = idSets[position];
|
|
415
|
+
const baseline = set.baselineId ? rows.get(set.baselineId) ?? null : null;
|
|
416
|
+
const inWindow = set.inWindowIds.map((id) => rows.get(id)).filter(isPresent);
|
|
417
|
+
const selection = selectOmnibusCandidates({
|
|
418
|
+
baseline,
|
|
419
|
+
inWindow,
|
|
420
|
+
presentedEntry: lookup.presentedEntry,
|
|
421
|
+
anchor: lookup.anchor,
|
|
422
|
+
axis: lookup.axis
|
|
423
|
+
});
|
|
424
|
+
return {
|
|
425
|
+
reason: null,
|
|
426
|
+
presentedPriceKindId: lookup.presentedPriceKindId,
|
|
427
|
+
lowestRow: selection.lowestRow,
|
|
428
|
+
previousRow: selection.previousRow,
|
|
429
|
+
insufficientHistory: selection.insufficientHistory,
|
|
430
|
+
promotionAnchorAt: lookup.anchor ? lookup.anchor.toISOString() : null,
|
|
431
|
+
coverageStartAt: selection.coverageStartAt,
|
|
432
|
+
windowStart: lookup.windowStart.toISOString(),
|
|
433
|
+
windowEnd: lookup.windowEnd.toISOString(),
|
|
434
|
+
lookbackDays: lookup.lookbackDays,
|
|
435
|
+
minimizationAxis: lookup.axis
|
|
436
|
+
};
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
async hydrate(em, contexts, ids) {
|
|
440
|
+
const rows = /* @__PURE__ */ new Map();
|
|
441
|
+
if (!ids.length) return rows;
|
|
442
|
+
const scopes = /* @__PURE__ */ new Map();
|
|
443
|
+
for (const context of contexts) {
|
|
444
|
+
scopes.set(configKey(context), { tenantId: context.tenantId, organizationId: context.organizationId });
|
|
445
|
+
}
|
|
446
|
+
for (const scope of scopes.values()) {
|
|
447
|
+
const entries = await findWithDecryption(
|
|
448
|
+
em,
|
|
449
|
+
CatalogPriceHistoryEntry,
|
|
450
|
+
{ id: { $in: ids }, tenantId: scope.tenantId, organizationId: scope.organizationId },
|
|
451
|
+
void 0,
|
|
452
|
+
scope
|
|
453
|
+
);
|
|
454
|
+
for (const entry of entries) rows.set(entry.id, toHistoryRow(entry));
|
|
455
|
+
}
|
|
456
|
+
return rows;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
function configKey(context) {
|
|
460
|
+
return `${context.tenantId}|${context.organizationId}`;
|
|
461
|
+
}
|
|
462
|
+
function firstOfferCacheKey(lookup) {
|
|
463
|
+
return buildOmnibusCacheKey("first-offer", [
|
|
464
|
+
lookup.context.tenantId,
|
|
465
|
+
lookup.context.organizationId,
|
|
466
|
+
lookup.offerId,
|
|
467
|
+
lookup.presentedPriceKindId,
|
|
468
|
+
lookup.context.currencyCode,
|
|
469
|
+
lookup.channelId ?? "none"
|
|
470
|
+
]);
|
|
471
|
+
}
|
|
472
|
+
function isPresent(value) {
|
|
473
|
+
return value !== null && value !== void 0;
|
|
474
|
+
}
|
|
475
|
+
export {
|
|
476
|
+
DefaultCatalogOmnibusService,
|
|
477
|
+
buildOmnibusBlock,
|
|
478
|
+
selectOmnibusCandidates
|
|
479
|
+
};
|
|
480
|
+
//# sourceMappingURL=catalogOmnibusService.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/catalog/services/catalogOmnibusService.ts"],
|
|
4
|
+
"sourcesContent": ["import type { EntityManager } from '@mikro-orm/postgresql'\nimport type { CacheStrategy } from '@open-mercato/cache'\nimport { findWithDecryption } from '@open-mercato/shared/lib/encryption/find'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\nimport { getTelemetryRuntime } from '@open-mercato/shared/lib/telemetry/runtime'\nimport type { ModuleConfigService } from '@open-mercato/core/modules/configs/lib/module-config-service'\nimport { CatalogPriceHistoryEntry } from '../data/entities'\nimport {\n OMNIBUS_CONFIG_MODULE_ID,\n OMNIBUS_CONFIG_NAME,\n OMNIBUS_DEFAULT_LOOKBACK_DAYS,\n OMNIBUS_PRICE_REMOVING_UNDO_COMMAND,\n omnibusConfigSchema,\n type OmnibusApplicabilityReason,\n type OmnibusBlock,\n type OmnibusConfig,\n type OmnibusHistoryRow,\n type OmnibusLowestPriceResult,\n type OmnibusMinimizationAxis,\n type OmnibusPresentedEntry,\n type OmnibusResolutionContext,\n type OmnibusResolutionRequest,\n} from '../lib/omnibusTypes'\nimport {\n buildOmnibusCacheKey,\n buildOmnibusCacheTags,\n readOmnibusCache,\n writeOmnibusCache,\n} from '../lib/omnibusCache'\nimport {\n fetchOmnibusFirstOfferIds,\n fetchOmnibusWindowIds,\n type OmnibusFirstOfferLookup,\n type OmnibusScopeColumn,\n type OmnibusWindowLookup,\n} from '../lib/omnibusHistoryQueries'\nimport { formatFixedDecimal4 } from '../lib/priceHistoryQuery'\n\nconst logger = createLogger('catalog')\n\nconst DAY_MS = 24 * 60 * 60 * 1000\n\nconst DECIMAL_SCALE = 4\n\nexport type OmnibusConfigScope = {\n tenantId: string\n organizationId?: string | null\n}\n\nexport interface CatalogOmnibusService {\n getConfig(scope: OmnibusConfigScope): Promise<OmnibusConfig | null>\n resolvePresentedPriceKindId(\n config: OmnibusConfig,\n channelId: string | null | undefined,\n fallbackPriceKindId?: string | null,\n ): string | null\n computeLowestPrice(\n em: EntityManager,\n context: OmnibusResolutionContext,\n config: OmnibusConfig,\n presentedEntry?: OmnibusPresentedEntry | null,\n ): Promise<OmnibusLowestPriceResult>\n computeLowestPrices(\n em: EntityManager,\n entries: Array<{ context: OmnibusResolutionContext; config: OmnibusConfig; presentedEntry?: OmnibusPresentedEntry | null }>,\n ): Promise<OmnibusLowestPriceResult[]>\n resolveOmnibusBlock(\n em: EntityManager,\n context: OmnibusResolutionContext,\n presentedEntry?: OmnibusPresentedEntry | null,\n priceKindIsPromotion?: boolean,\n ): Promise<OmnibusBlock | null>\n resolveOmnibusBlocks(em: EntityManager, requests: OmnibusResolutionRequest[]): Promise<Array<OmnibusBlock | null>>\n}\n\ntype HistoryScope = { column: OmnibusScopeColumn; id: string }\n\ntype PreparedLookup = {\n index: number\n context: OmnibusResolutionContext\n presentedEntry: OmnibusPresentedEntry | null\n presentedPriceKindId: string\n scope: HistoryScope\n channelId: string | null\n lookbackDays: number\n axis: OmnibusMinimizationAxis\n offerId: string | null\n anchor: Date | null\n now: Date\n}\n\ntype WindowedLookup = PreparedLookup & {\n windowStart: Date\n windowEnd: Date\n cacheKey: string\n}\n\ntype CachedFirstOffer = { recordedAt: string | null }\n\nfunction toDate(value: Date | string | null | undefined): Date | null {\n if (value === null || value === undefined) return null\n const date = value instanceof Date ? value : new Date(value)\n return Number.isNaN(date.getTime()) ? null : date\n}\n\nfunction truncToUtcDay(date: Date): string {\n return date.toISOString().slice(0, 10)\n}\n\nfunction parseScaledDecimal(value: string | null): bigint | null {\n if (value === null) return null\n const match = /^(-?)(\\d+)(?:\\.(\\d*))?$/.exec(value.trim())\n if (!match) return null\n const [, sign, whole, fraction = ''] = match\n const scaled = BigInt(`${whole}${fraction.slice(0, DECIMAL_SCALE).padEnd(DECIMAL_SCALE, '0')}`)\n return sign === '-' ? -scaled : scaled\n}\n\nfunction priceValue(row: OmnibusHistoryRow, axis: OmnibusMinimizationAxis): bigint | null {\n return parseScaledDecimal(axis === 'gross' ? row.unitPriceGross : row.unitPriceNet)\n}\n\nfunction compareChronological(left: OmnibusHistoryRow, right: OmnibusHistoryRow): number {\n const delta = Date.parse(left.recordedAt) - Date.parse(right.recordedAt)\n if (delta !== 0) return delta\n return left.id < right.id ? -1 : left.id > right.id ? 1 : 0\n}\n\nfunction compareByAxis(left: OmnibusHistoryRow, right: OmnibusHistoryRow, axis: OmnibusMinimizationAxis): number {\n const leftValue = priceValue(left, axis)\n const rightValue = priceValue(right, axis)\n if (leftValue === null && rightValue !== null) return 1\n if (leftValue !== null && rightValue === null) return -1\n if (leftValue !== null && rightValue !== null && leftValue !== rightValue) return leftValue < rightValue ? -1 : 1\n return compareChronological(left, right)\n}\n\nfunction isPresentedReduction(row: OmnibusHistoryRow, presented: OmnibusPresentedEntry | null): boolean {\n if (!presented) return false\n const presentedAt = toDate(presented.recordedAt)\n return (\n row.priceId === presented.priceId &&\n row.changeType === presented.changeType &&\n presentedAt !== null &&\n Date.parse(row.recordedAt) === presentedAt.getTime()\n )\n}\n\nfunction isPriceObservation(row: OmnibusHistoryRow): boolean {\n if (row.changeType === 'delete') return false\n return !(row.changeType === 'undo' && row.undoneCommand === OMNIBUS_PRICE_REMOVING_UNDO_COMMAND)\n}\n\nexport type OmnibusCandidateSelection = {\n lowestRow: OmnibusHistoryRow | null\n previousRow: OmnibusHistoryRow | null\n insufficientHistory: boolean\n coverageStartAt: string | null\n}\n\nexport function selectOmnibusCandidates(input: {\n baseline: OmnibusHistoryRow | null\n inWindow: OmnibusHistoryRow[]\n presentedEntry: OmnibusPresentedEntry | null\n anchor: Date | null\n axis: OmnibusMinimizationAxis\n}): OmnibusCandidateSelection {\n const anchorMs = input.anchor ? input.anchor.getTime() : null\n const pool = input.baseline ? [input.baseline, ...input.inWindow] : [...input.inWindow]\n const candidates = pool.filter(\n (row) =>\n isPriceObservation(row) &&\n !isPresentedReduction(row, input.presentedEntry) &&\n (anchorMs === null || Date.parse(row.recordedAt) < anchorMs),\n )\n if (!candidates.length) {\n return { lowestRow: null, previousRow: null, insufficientHistory: false, coverageStartAt: null }\n }\n const lowest = [...candidates].sort((left, right) => compareByAxis(left, right, input.axis))[0]\n const lowestRow = priceValue(lowest, input.axis) === null ? null : lowest\n const baselineKept = input.baseline !== null && candidates.includes(input.baseline)\n if (baselineKept) {\n return { lowestRow, previousRow: input.baseline, insufficientHistory: false, coverageStartAt: null }\n }\n const oldest = [...candidates].sort(compareChronological)[0]\n return { lowestRow, previousRow: oldest, insufficientHistory: true, coverageStartAt: oldest.recordedAt }\n}\n\nfunction toHistoryRow(entry: CatalogPriceHistoryEntry): OmnibusHistoryRow {\n const recordedAt = entry.recordedAt instanceof Date ? entry.recordedAt : new Date(entry.recordedAt)\n const undoneCommand = undoneCommandOf(entry.metadata)\n return {\n id: entry.id,\n priceId: entry.priceId,\n changeType: entry.changeType,\n recordedAt: recordedAt.toISOString(),\n unitPriceNet: entry.unitPriceNet ?? null,\n unitPriceGross: entry.unitPriceGross ?? null,\n ...(undoneCommand ? { undoneCommand } : {}),\n }\n}\n\nfunction undoneCommandOf(metadata: Record<string, unknown> | null | undefined): string | null {\n const value = metadata?.undoneCommand\n return typeof value === 'string' ? value : null\n}\n\nfunction resolveHistoryScope(context: OmnibusResolutionContext): HistoryScope | null {\n if (context.offerId) return { column: 'offer_id', id: context.offerId }\n if (context.variantId) return { column: 'variant_id', id: context.variantId }\n if (context.productId) return { column: 'product_id', id: context.productId }\n return null\n}\n\nfunction earlyResult(\n reason: OmnibusApplicabilityReason,\n presentedPriceKindId: string | null,\n lookbackDays: number,\n axis: OmnibusMinimizationAxis,\n): OmnibusLowestPriceResult {\n return {\n reason,\n presentedPriceKindId,\n lowestRow: null,\n previousRow: null,\n insufficientHistory: false,\n promotionAnchorAt: null,\n coverageStartAt: null,\n windowStart: null,\n windowEnd: null,\n lookbackDays,\n minimizationAxis: axis,\n }\n}\n\nfunction emptyBlock(result: OmnibusLowestPriceResult, currencyCode: string, reason: OmnibusApplicabilityReason): OmnibusBlock {\n return {\n presentedPriceKindId: result.presentedPriceKindId,\n lookbackDays: result.lookbackDays,\n minimizationAxis: result.minimizationAxis,\n promotionAnchorAt: result.promotionAnchorAt,\n windowStart: result.windowStart,\n windowEnd: result.windowEnd,\n coverageStartAt: null,\n lowestPriceNet: null,\n lowestPriceGross: null,\n previousPriceNet: null,\n previousPriceGross: null,\n currencyCode,\n applicable: false,\n applicabilityReason: reason,\n }\n}\n\nexport function buildOmnibusBlock(\n result: OmnibusLowestPriceResult,\n context: OmnibusResolutionContext,\n presentedEntry: OmnibusPresentedEntry | null,\n priceKindIsPromotion: boolean,\n): OmnibusBlock {\n if (result.reason === 'not_in_eu_market' || result.reason === 'missing_channel_context') {\n return emptyBlock(result, context.currencyCode, result.reason)\n }\n if (!result.lowestRow) return emptyBlock(result, context.currencyCode, result.reason ?? 'no_history')\n const applicable =\n Boolean(presentedEntry?.startsAt) ||\n Boolean(presentedEntry?.offerId) ||\n presentedEntry?.isAnnounced === true ||\n priceKindIsPromotion\n const reason: OmnibusApplicabilityReason =\n result.reason ?? (result.insufficientHistory ? 'insufficient_history' : applicable ? 'announced_promotion' : 'not_announced')\n return {\n presentedPriceKindId: result.presentedPriceKindId,\n lookbackDays: result.lookbackDays,\n minimizationAxis: result.minimizationAxis,\n promotionAnchorAt: result.promotionAnchorAt,\n windowStart: result.windowStart,\n windowEnd: result.windowEnd,\n coverageStartAt: result.coverageStartAt,\n lowestPriceNet: formatFixedDecimal4(result.lowestRow.unitPriceNet),\n lowestPriceGross: formatFixedDecimal4(result.lowestRow.unitPriceGross),\n previousPriceNet: formatFixedDecimal4(result.previousRow?.unitPriceNet ?? null),\n previousPriceGross: formatFixedDecimal4(result.previousRow?.unitPriceGross ?? null),\n currencyCode: context.currencyCode,\n applicable,\n applicabilityReason: reason,\n }\n}\n\nfunction presentedIdentity(presented: OmnibusPresentedEntry | null): string {\n if (!presented) return 'none'\n const recordedAt = toDate(presented.recordedAt)\n return `${presented.priceId}|${presented.changeType}|${recordedAt ? recordedAt.toISOString() : 'invalid'}`\n}\n\nfunction scopeTargets(context: OmnibusResolutionContext) {\n return { productId: context.productId ?? null, variantId: context.variantId ?? null, offerId: context.offerId ?? null }\n}\n\nexport class DefaultCatalogOmnibusService implements CatalogOmnibusService {\n constructor(\n private readonly moduleConfigService: ModuleConfigService | null,\n private readonly cache: CacheStrategy | null,\n ) {}\n\n async getConfig(scope: OmnibusConfigScope): Promise<OmnibusConfig | null> {\n if (!this.moduleConfigService) return null\n const raw = await this.moduleConfigService.getValue<unknown>(OMNIBUS_CONFIG_MODULE_ID, OMNIBUS_CONFIG_NAME, {\n scope: { tenantId: scope.tenantId, organizationId: scope.organizationId ?? null },\n })\n if (raw === null || raw === undefined) return null\n const parsed = omnibusConfigSchema.safeParse(raw)\n if (!parsed.success) {\n logger.warn('[internal] catalog omnibus config is invalid; treating omnibus as disabled', {\n tenantId: scope.tenantId,\n organizationId: scope.organizationId ?? null,\n issues: parsed.error.issues.map((issue) => issue.path.join('.')),\n })\n return null\n }\n return parsed.data\n }\n\n resolvePresentedPriceKindId(\n config: OmnibusConfig,\n channelId: string | null | undefined,\n fallbackPriceKindId?: string | null,\n ): string | null {\n const channelConfig = channelId ? config.channels[channelId] : undefined\n return channelConfig?.presentedPriceKindId ?? config.defaultPresentedPriceKindId ?? fallbackPriceKindId ?? null\n }\n\n async computeLowestPrice(\n em: EntityManager,\n context: OmnibusResolutionContext,\n config: OmnibusConfig,\n presentedEntry: OmnibusPresentedEntry | null = null,\n ): Promise<OmnibusLowestPriceResult> {\n const [result] = await this.computeLowestPrices(em, [{ context, config, presentedEntry }])\n return result\n }\n\n async computeLowestPrices(\n em: EntityManager,\n entries: Array<{ context: OmnibusResolutionContext; config: OmnibusConfig; presentedEntry?: OmnibusPresentedEntry | null }>,\n ): Promise<OmnibusLowestPriceResult[]> {\n const results: Array<OmnibusLowestPriceResult | null> = entries.map(() => null)\n const prepared: PreparedLookup[] = []\n entries.forEach((entry, index) => {\n const gated = this.prepareLookup(index, entry.context, entry.config, entry.presentedEntry ?? null)\n if ('reason' in gated) results[index] = gated\n else prepared.push(gated)\n })\n await this.resolveOfferAnchors(em, prepared)\n const windowed = prepared.map((lookup) => this.applyWindow(lookup))\n const pending: WindowedLookup[] = []\n for (const lookup of windowed) {\n const cached = await readOmnibusCache<OmnibusLowestPriceResult>(this.cache, lookup.context.tenantId, lookup.cacheKey)\n if (cached) results[lookup.index] = cached\n else pending.push(lookup)\n }\n if (pending.length) {\n const computed = await this.computeFromHistory(em, pending)\n for (let position = 0; position < pending.length; position += 1) {\n const lookup = pending[position]\n const result = computed[position]\n results[lookup.index] = result\n await writeOmnibusCache(\n this.cache,\n lookup.context.tenantId,\n lookup.cacheKey,\n result,\n buildOmnibusCacheTags(lookup.context, scopeTargets(lookup.context)),\n )\n }\n }\n return results.map((result, index) => {\n if (result) return result\n const entry = entries[index]\n return earlyResult('no_history', null, entry.config.lookbackDays, entry.config.minimizationAxis)\n })\n }\n\n async resolveOmnibusBlock(\n em: EntityManager,\n context: OmnibusResolutionContext,\n presentedEntry: OmnibusPresentedEntry | null = null,\n priceKindIsPromotion = false,\n ): Promise<OmnibusBlock | null> {\n const [block] = await this.resolveOmnibusBlocks(em, [{ context, presentedEntry, priceKindIsPromotion }])\n return block ?? null\n }\n\n async resolveOmnibusBlocks(em: EntityManager, requests: OmnibusResolutionRequest[]): Promise<Array<OmnibusBlock | null>> {\n const blocks: Array<OmnibusBlock | null> = requests.map(() => null)\n if (!requests.length) return blocks\n const configs = await this.loadConfigs(requests)\n const enabled: Array<{ index: number; config: OmnibusConfig }> = []\n requests.forEach((request, index) => {\n const config = configs.get(configKey(request.context)) ?? null\n if (config && config.enabled === true) enabled.push({ index, config })\n })\n if (!enabled.length) return blocks\n try {\n const results = await this.computeLowestPrices(\n em,\n enabled.map(({ index, config }) => ({\n context: requests[index].context,\n config,\n presentedEntry: requests[index].presentedEntry ?? null,\n })),\n )\n enabled.forEach(({ index }, position) => {\n const request = requests[index]\n blocks[index] = buildOmnibusBlock(\n results[position],\n request.context,\n request.presentedEntry ?? null,\n request.priceKindIsPromotion === true,\n )\n })\n } catch (err) {\n const first = requests[enabled[0].index].context\n logger.error('[internal] catalog omnibus resolution failed', {\n tenantId: first.tenantId,\n organizationId: first.organizationId,\n channelId: first.channelId ?? null,\n priceKindId: first.priceKindId ?? null,\n currencyCode: first.currencyCode,\n requestCount: enabled.length,\n err,\n })\n getTelemetryRuntime()?.reportError(err, {\n module: 'catalog',\n code: 'catalog.omnibus_resolution_failed',\n attributes: { requestCount: enabled.length },\n })\n return requests.map(() => null)\n }\n return blocks\n }\n\n private async loadConfigs(requests: OmnibusResolutionRequest[]): Promise<Map<string, OmnibusConfig | null>> {\n const configs = new Map<string, OmnibusConfig | null>()\n for (const request of requests) {\n const key = configKey(request.context)\n if (configs.has(key)) continue\n configs.set(\n key,\n await this.getConfig({ tenantId: request.context.tenantId, organizationId: request.context.organizationId }),\n )\n }\n return configs\n }\n\n private prepareLookup(\n index: number,\n context: OmnibusResolutionContext,\n config: OmnibusConfig,\n presentedEntry: OmnibusPresentedEntry | null,\n ): PreparedLookup | OmnibusLowestPriceResult {\n const channelId = context.channelId ?? null\n const channelConfig = channelId ? config.channels[channelId] : undefined\n const lookbackDays = channelConfig?.lookbackDays ?? config.lookbackDays ?? OMNIBUS_DEFAULT_LOOKBACK_DAYS\n const axis = channelConfig?.minimizationAxis ?? config.minimizationAxis ?? 'gross'\n const presentedPriceKindId = this.resolvePresentedPriceKindId(config, channelId, context.priceKindId)\n if (config.enabled !== true) return earlyResult('no_history', presentedPriceKindId, lookbackDays, axis)\n const codes = config.enabledCountryCodes ?? []\n if (!codes.length) return earlyResult('not_in_eu_market', presentedPriceKindId, lookbackDays, axis)\n if (!channelId) {\n const mode = context.isStorefront === true ? 'require_channel' : config.noChannelMode ?? 'best_effort'\n if (mode === 'require_channel') {\n return earlyResult('missing_channel_context', presentedPriceKindId, lookbackDays, axis)\n }\n } else {\n const countryCode = channelConfig?.countryCode\n if (!countryCode || !codes.includes(countryCode)) {\n return earlyResult('not_in_eu_market', presentedPriceKindId, lookbackDays, axis)\n }\n }\n const scope = resolveHistoryScope(context)\n if (!scope || !presentedPriceKindId) return earlyResult('no_history', presentedPriceKindId, lookbackDays, axis)\n return {\n index,\n context,\n presentedEntry,\n presentedPriceKindId,\n scope,\n channelId,\n lookbackDays,\n axis,\n offerId: context.offerId ?? presentedEntry?.offerId ?? null,\n anchor: toDate(presentedEntry?.startsAt ?? null),\n now: context.now ?? new Date(),\n }\n }\n\n private async resolveOfferAnchors(em: EntityManager, prepared: PreparedLookup[]): Promise<void> {\n const needing = prepared.filter((lookup) => lookup.anchor === null && lookup.offerId !== null)\n if (!needing.length) return\n const misses: Array<{ lookup: PreparedLookup; key: string }> = []\n for (const lookup of needing) {\n const key = firstOfferCacheKey(lookup)\n const cached = await readOmnibusCache<CachedFirstOffer>(this.cache, lookup.context.tenantId, key)\n if (cached) lookup.anchor = toDate(cached.recordedAt)\n else misses.push({ lookup, key })\n }\n if (!misses.length) return\n const offerLookups: OmnibusFirstOfferLookup[] = misses.map(({ lookup }) => ({\n tenantId: lookup.context.tenantId,\n organizationId: lookup.context.organizationId,\n offerId: lookup.offerId as string,\n priceKindId: lookup.presentedPriceKindId,\n currencyCode: lookup.context.currencyCode,\n channelId: lookup.channelId,\n }))\n const ids = await fetchOmnibusFirstOfferIds(em, offerLookups)\n const rows = await this.hydrate(em, misses.map(({ lookup }) => lookup.context), ids.filter(isPresent))\n for (let position = 0; position < misses.length; position += 1) {\n const { lookup, key } = misses[position]\n const id = ids[position]\n const row = id ? rows.get(id) ?? null : null\n lookup.anchor = row ? new Date(row.recordedAt) : null\n await writeOmnibusCache(\n this.cache,\n lookup.context.tenantId,\n key,\n { recordedAt: row ? row.recordedAt : null } satisfies CachedFirstOffer,\n buildOmnibusCacheTags(lookup.context, { ...scopeTargets(lookup.context), offerId: lookup.offerId }),\n )\n }\n }\n\n private applyWindow(lookup: PreparedLookup): WindowedLookup {\n const windowEnd = lookup.anchor ?? lookup.now\n const windowStart = new Date(windowEnd.getTime() - lookup.lookbackDays * DAY_MS)\n const cacheKey = buildOmnibusCacheKey('lowest', [\n lookup.context.tenantId,\n lookup.context.organizationId,\n `${lookup.scope.column}=${lookup.scope.id}`,\n lookup.channelId ?? 'none',\n lookup.presentedPriceKindId,\n lookup.context.currencyCode,\n lookup.axis,\n lookup.lookbackDays,\n truncToUtcDay(windowStart),\n lookup.anchor ? truncToUtcDay(lookup.anchor) : 'none',\n lookup.anchor ? lookup.anchor.toISOString() : 'sliding',\n presentedIdentity(lookup.presentedEntry),\n ])\n return { ...lookup, windowStart, windowEnd, cacheKey }\n }\n\n private async computeFromHistory(em: EntityManager, lookups: WindowedLookup[]): Promise<OmnibusLowestPriceResult[]> {\n const windowLookups: OmnibusWindowLookup[] = lookups.map((lookup) => ({\n tenantId: lookup.context.tenantId,\n organizationId: lookup.context.organizationId,\n scopeColumn: lookup.scope.column,\n scopeId: lookup.scope.id,\n priceKindId: lookup.presentedPriceKindId,\n currencyCode: lookup.context.currencyCode,\n channelId: lookup.channelId,\n windowStart: lookup.windowStart,\n windowEnd: lookup.windowEnd,\n }))\n const idSets = await fetchOmnibusWindowIds(em, windowLookups)\n const allIds = new Set<string>()\n for (const set of idSets) {\n if (set.baselineId) allIds.add(set.baselineId)\n for (const id of set.inWindowIds) allIds.add(id)\n }\n const rows = await this.hydrate(em, lookups.map((lookup) => lookup.context), Array.from(allIds))\n return lookups.map((lookup, position) => {\n const set = idSets[position]\n const baseline = set.baselineId ? rows.get(set.baselineId) ?? null : null\n const inWindow = set.inWindowIds.map((id) => rows.get(id)).filter(isPresent)\n const selection = selectOmnibusCandidates({\n baseline,\n inWindow,\n presentedEntry: lookup.presentedEntry,\n anchor: lookup.anchor,\n axis: lookup.axis,\n })\n return {\n reason: null,\n presentedPriceKindId: lookup.presentedPriceKindId,\n lowestRow: selection.lowestRow,\n previousRow: selection.previousRow,\n insufficientHistory: selection.insufficientHistory,\n promotionAnchorAt: lookup.anchor ? lookup.anchor.toISOString() : null,\n coverageStartAt: selection.coverageStartAt,\n windowStart: lookup.windowStart.toISOString(),\n windowEnd: lookup.windowEnd.toISOString(),\n lookbackDays: lookup.lookbackDays,\n minimizationAxis: lookup.axis,\n }\n })\n }\n\n private async hydrate(\n em: EntityManager,\n contexts: OmnibusResolutionContext[],\n ids: string[],\n ): Promise<Map<string, OmnibusHistoryRow>> {\n const rows = new Map<string, OmnibusHistoryRow>()\n if (!ids.length) return rows\n const scopes = new Map<string, { tenantId: string; organizationId: string }>()\n for (const context of contexts) {\n scopes.set(configKey(context), { tenantId: context.tenantId, organizationId: context.organizationId })\n }\n for (const scope of scopes.values()) {\n const entries = await findWithDecryption(\n em,\n CatalogPriceHistoryEntry,\n { id: { $in: ids }, tenantId: scope.tenantId, organizationId: scope.organizationId },\n undefined,\n scope,\n )\n for (const entry of entries) rows.set(entry.id, toHistoryRow(entry))\n }\n return rows\n }\n}\n\nfunction configKey(context: Pick<OmnibusResolutionContext, 'tenantId' | 'organizationId'>): string {\n return `${context.tenantId}|${context.organizationId}`\n}\n\nfunction firstOfferCacheKey(lookup: PreparedLookup): string {\n return buildOmnibusCacheKey('first-offer', [\n lookup.context.tenantId,\n lookup.context.organizationId,\n lookup.offerId,\n lookup.presentedPriceKindId,\n lookup.context.currencyCode,\n lookup.channelId ?? 'none',\n ])\n}\n\nfunction isPresent<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined\n}\n"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AAG,QAAQ,QAAQ,IAAI,QAAQ,cAAc;AACtD;AAEA,SAAS,mBAAmB,QAAgC;AAC1D,SAAO,qBAAqB,eAAe;AAAA,IACzC,OAAO,QAAQ;AAAA,IACf,OAAO,QAAQ;AAAA,IACf,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO,QAAQ;AAAA,IACf,OAAO,aAAa;AAAA,EACtB,CAAC;AACH;AAEA,SAAS,UAAa,OAAyC;AAC7D,SAAO,UAAU,QAAQ,UAAU;AACrC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/modules/catalog/setup.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ModuleSetupConfig } from '@open-mercato/shared/modules/setup'\nimport { seedCatalogUnits, seedCatalogPriceKinds, seedCatalogExamplesForScope } from './lib/seeds'\n\nexport const setup: ModuleSetupConfig = {\n seedDefaults: async (ctx) => {\n const scope = { tenantId: ctx.tenantId, organizationId: ctx.organizationId }\n await seedCatalogUnits(ctx.em, scope)\n await seedCatalogPriceKinds(ctx.em, scope)\n },\n\n seedExamples: async (ctx) => {\n const scope = { tenantId: ctx.tenantId, organizationId: ctx.organizationId }\n await seedCatalogExamplesForScope(ctx.em, ctx.container, scope)\n },\n\n defaultRoleFeatures: {\n admin: ['catalog.*', 'catalog.variants.manage', 'catalog.pricing.manage'],\n employee: [\n 'catalog.products.view',\n 'catalog.products.manage',\n 'catalog.categories.view',\n 'catalog.categories.manage',\n 'catalog.variants.manage',\n 'catalog.pricing.manage',\n ],\n },\n}\n\nexport default setup\n"],
|
|
5
|
-
"mappings": "AACA,SAAS,kBAAkB,uBAAuB,mCAAmC;AAE9E,MAAM,QAA2B;AAAA,EACtC,cAAc,OAAO,QAAQ;AAC3B,UAAM,QAAQ,EAAE,UAAU,IAAI,UAAU,gBAAgB,IAAI,eAAe;AAC3E,UAAM,iBAAiB,IAAI,IAAI,KAAK;AACpC,UAAM,sBAAsB,IAAI,IAAI,KAAK;AAAA,EAC3C;AAAA,EAEA,cAAc,OAAO,QAAQ;AAC3B,UAAM,QAAQ,EAAE,UAAU,IAAI,UAAU,gBAAgB,IAAI,eAAe;AAC3E,UAAM,4BAA4B,IAAI,IAAI,IAAI,WAAW,KAAK;AAAA,EAChE;AAAA,EAEA,qBAAqB;AAAA,IACnB,OAAO,CAAC,aAAa,2BAA2B,wBAAwB;AAAA,IACxE,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,gBAAQ;",
|
|
4
|
+
"sourcesContent": ["import type { ModuleSetupConfig } from '@open-mercato/shared/modules/setup'\nimport { seedCatalogUnits, seedCatalogPriceKinds, seedCatalogExamplesForScope } from './lib/seeds'\n\nexport const setup: ModuleSetupConfig = {\n seedDefaults: async (ctx) => {\n const scope = { tenantId: ctx.tenantId, organizationId: ctx.organizationId }\n await seedCatalogUnits(ctx.em, scope)\n await seedCatalogPriceKinds(ctx.em, scope)\n },\n\n seedExamples: async (ctx) => {\n const scope = { tenantId: ctx.tenantId, organizationId: ctx.organizationId }\n await seedCatalogExamplesForScope(ctx.em, ctx.container, scope)\n },\n\n defaultRoleFeatures: {\n admin: ['catalog.*', 'catalog.variants.manage', 'catalog.pricing.manage'],\n employee: [\n 'catalog.products.view',\n 'catalog.products.manage',\n 'catalog.categories.view',\n 'catalog.categories.manage',\n 'catalog.variants.manage',\n 'catalog.pricing.manage',\n 'catalog.price_history.view',\n 'catalog.settings.view',\n ],\n },\n}\n\nexport default setup\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,kBAAkB,uBAAuB,mCAAmC;AAE9E,MAAM,QAA2B;AAAA,EACtC,cAAc,OAAO,QAAQ;AAC3B,UAAM,QAAQ,EAAE,UAAU,IAAI,UAAU,gBAAgB,IAAI,eAAe;AAC3E,UAAM,iBAAiB,IAAI,IAAI,KAAK;AACpC,UAAM,sBAAsB,IAAI,IAAI,KAAK;AAAA,EAC3C;AAAA,EAEA,cAAc,OAAO,QAAQ;AAC3B,UAAM,QAAQ,EAAE,UAAU,IAAI,UAAU,gBAAgB,IAAI,eAAe;AAC3E,UAAM,4BAA4B,IAAI,IAAI,IAAI,WAAW,KAAK;AAAA,EAChE;AAAA,EAEA,qBAAqB;AAAA,IACnB,OAAO,CAAC,aAAa,2BAA2B,wBAAwB;AAAA,IACxE,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,gBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
reindexProductsForCategorySubtree
|
|
3
|
+
} from "../lib/productScopeReindex.js";
|
|
4
|
+
const metadata = {
|
|
5
|
+
event: "catalog.category.deleted",
|
|
6
|
+
persistent: true,
|
|
7
|
+
id: "catalog:product-scope-keys-category-deleted"
|
|
8
|
+
};
|
|
9
|
+
async function handle(payload, ctx) {
|
|
10
|
+
await reindexProductsForCategorySubtree(payload, ctx);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
handle as default,
|
|
14
|
+
metadata
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=product-scope-keys-category-deleted.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/catalog/subscribers/product-scope-keys-category-deleted.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n reindexProductsForCategorySubtree,\n type CategoryScopeChangePayload,\n type ProductScopeReindexContext,\n} from '../lib/productScopeReindex'\n\nexport const metadata = {\n event: 'catalog.category.deleted',\n persistent: true,\n id: 'catalog:product-scope-keys-category-deleted',\n}\n\nexport default async function handle(\n payload: CategoryScopeChangePayload,\n ctx: ProductScopeReindexContext,\n): Promise<void> {\n await reindexProductsForCategorySubtree(payload, ctx)\n}\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EACE;AAAA,OAGK;AAEA,MAAM,WAAW;AAAA,EACtB,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,IAAI;AACN;AAEA,eAAO,OACL,SACA,KACe;AACf,QAAM,kCAAkC,SAAS,GAAG;AACtD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|