From 4f4ee82a0a0e049c68c054e41c2b462690c0e626 Mon Sep 17 00:00:00 2001 From: Alexander Kovalenko Date: Tue, 11 Jun 2024 12:56:10 +0300 Subject: [PATCH] chore: removed merchant package (#23) * Removed merchant package. * Updated deps. Removed merchant brand from entry component. --------- Co-authored-by: Alexander Kovalenko --- apps/storefront/.env.template | 5 +- apps/storefront/dependencies.sh | 2 +- apps/storefront/src/app.ts | 2 - apps/storybook/.storybook/app/build.ts | 2 - apps/storybook/dependencies.sh | 2 +- libs/domain/cart/entry/src/entry.component.ts | 13 - libs/domain/merchant/.constants.ts | 1 - libs/domain/merchant/CHANGELOG.md | 24 -- libs/domain/merchant/README.md | 7 - libs/domain/merchant/offer-list/index.ts | 3 - .../offer-list/offer-list.component.spec.ts | 92 ------- .../offer-list/offer-list.component.ts | 115 -------- .../merchant/offer-list/offer-list.def.ts | 9 - .../merchant/offer-list/offer-list.schema.ts | 8 - .../merchant/offer-list/offer-list.styles.ts | 25 -- .../offer-list/stories/demo.stories.ts | 27 -- libs/domain/merchant/offer/index.ts | 3 - .../merchant/offer/offer.component.spec.ts | 94 ------- libs/domain/merchant/offer/offer.component.ts | 68 ----- libs/domain/merchant/offer/offer.def.ts | 7 - libs/domain/merchant/offer/offer.schema.ts | 8 - libs/domain/merchant/offer/offer.styles.ts | 50 ---- .../merchant/offer/stories/static.stories.ts | 29 -- libs/domain/merchant/package.json | 37 --- libs/domain/merchant/project.json | 51 ---- libs/domain/merchant/schedule/index.ts | 3 - .../schedule/schedule.component.spec.ts | 258 ------------------ .../merchant/schedule/schedule.component.ts | 136 --------- libs/domain/merchant/schedule/schedule.def.ts | 9 - .../merchant/schedule/schedule.model.ts | 19 -- .../merchant/schedule/schedule.schema.ts | 30 -- .../merchant/schedule/schedule.styles.ts | 22 -- .../merchant/schedule/stories/demo.stories.ts | 48 ---- .../schedule/stories/static.stories.ts | 20 -- libs/domain/merchant/schedule/util.ts | 27 -- libs/domain/merchant/services/index.ts | 1 - .../adapter/default-merchant.adapter.spec.ts | 99 ------- .../src/adapter/default-merchant.adapter.ts | 43 --- .../merchant/services/src/adapter/index.ts | 2 - .../services/src/adapter/normalizers/index.ts | 4 - .../normalizers/merchant-list.normalizer.ts | 18 -- .../normalizers/merchant.normalizer.ts | 80 ------ .../src/adapter/normalizers/models.ts | 15 - .../adapter/normalizers/offer.normalizer.ts | 44 --- .../src/default-merchant.service.spec.ts | 130 --------- .../services/src/default-merchant.service.ts | 31 --- libs/domain/merchant/services/src/index.ts | 4 - .../merchant/services/src/product/index.ts | 1 - .../src/product/product.normalizer.ts | 24 -- .../merchant/services/src/resolvers/index.ts | 1 - .../services/src/resolvers/offer.resolver.ts | 34 --- libs/domain/merchant/src/components.ts | 3 - libs/domain/merchant/src/entity.ts | 1 - libs/domain/merchant/src/feature.ts | 12 - libs/domain/merchant/src/index.ts | 7 - libs/domain/merchant/src/mixins/index.ts | 1 - .../merchant/src/mixins/merchant.mixin.ts | 49 ---- libs/domain/merchant/src/mocks/feature.ts | 26 -- libs/domain/merchant/src/mocks/index.ts | 3 - .../merchant/src/mocks/merchant.service.ts | 128 --------- .../merchant/src/mocks/product.service.ts | 95 ------- libs/domain/merchant/src/models/index.ts | 3 - .../merchant/src/models/merchant.model.api.ts | 69 ----- .../merchant/src/models/merchant.model.ts | 70 ----- .../domain/merchant/src/models/offer.model.ts | 10 - libs/domain/merchant/src/presets/index.ts | 1 - .../merchant/src/presets/merchant-page.ts | 190 ------------- libs/domain/merchant/src/product/index.ts | 2 - .../merchant/src/product/product.model.ts | 8 - libs/domain/merchant/src/product/providers.ts | 28 -- libs/domain/merchant/src/product/query.ts | 42 --- .../merchant/src/services/adapter/index.ts | 2 - .../src/services/adapter/merchant-includes.ts | 12 - .../src/services/adapter/merchant.adapter.ts | 28 -- libs/domain/merchant/src/services/index.ts | 5 - .../merchant/src/services/jsonld/index.ts | 14 - .../merchant/src/services/jsonld/model.ts | 13 - .../src/services/jsonld/offers.jsonld.ts | 38 --- .../merchant/src/services/merchant.context.ts | 56 ---- .../merchant/src/services/merchant.service.ts | 19 -- .../domain/merchant/src/services/providers.ts | 91 ------ .../merchant/src/services/state/effects.ts | 29 -- .../merchant/src/services/state/index.ts | 2 - .../merchant/src/services/state/queries.ts | 27 -- libs/domain/merchant/tsconfig.lib.json | 4 - libs/domain/merchant/tsconfig.spec.json | 4 - libs/domain/merchant/vitest.config.ts | 3 - libs/lerna.json | 3 +- libs/template/labs/src/feature.ts | 2 - .../template/labs/src/i18n/translations/en.ts | 8 - libs/template/labs/src/index.ts | 1 - libs/template/labs/src/merchants/index.ts | 44 --- .../storefront/experience/experience-data.ts | 2 - .../storefront/experience/pages/index.ts | 1 - .../experience/pages/merchant-page.ts | 38 --- tsconfig.base.json | 14 - workspace.json | 1 - 97 files changed, 4 insertions(+), 2992 deletions(-) delete mode 100644 libs/domain/merchant/.constants.ts delete mode 100644 libs/domain/merchant/CHANGELOG.md delete mode 100644 libs/domain/merchant/README.md delete mode 100644 libs/domain/merchant/offer-list/index.ts delete mode 100644 libs/domain/merchant/offer-list/offer-list.component.spec.ts delete mode 100644 libs/domain/merchant/offer-list/offer-list.component.ts delete mode 100644 libs/domain/merchant/offer-list/offer-list.def.ts delete mode 100644 libs/domain/merchant/offer-list/offer-list.schema.ts delete mode 100644 libs/domain/merchant/offer-list/offer-list.styles.ts delete mode 100644 libs/domain/merchant/offer-list/stories/demo.stories.ts delete mode 100644 libs/domain/merchant/offer/index.ts delete mode 100644 libs/domain/merchant/offer/offer.component.spec.ts delete mode 100644 libs/domain/merchant/offer/offer.component.ts delete mode 100644 libs/domain/merchant/offer/offer.def.ts delete mode 100644 libs/domain/merchant/offer/offer.schema.ts delete mode 100644 libs/domain/merchant/offer/offer.styles.ts delete mode 100644 libs/domain/merchant/offer/stories/static.stories.ts delete mode 100644 libs/domain/merchant/package.json delete mode 100644 libs/domain/merchant/project.json delete mode 100644 libs/domain/merchant/schedule/index.ts delete mode 100644 libs/domain/merchant/schedule/schedule.component.spec.ts delete mode 100644 libs/domain/merchant/schedule/schedule.component.ts delete mode 100644 libs/domain/merchant/schedule/schedule.def.ts delete mode 100644 libs/domain/merchant/schedule/schedule.model.ts delete mode 100644 libs/domain/merchant/schedule/schedule.schema.ts delete mode 100644 libs/domain/merchant/schedule/schedule.styles.ts delete mode 100644 libs/domain/merchant/schedule/stories/demo.stories.ts delete mode 100644 libs/domain/merchant/schedule/stories/static.stories.ts delete mode 100644 libs/domain/merchant/schedule/util.ts delete mode 100644 libs/domain/merchant/services/index.ts delete mode 100644 libs/domain/merchant/services/src/adapter/default-merchant.adapter.spec.ts delete mode 100644 libs/domain/merchant/services/src/adapter/default-merchant.adapter.ts delete mode 100644 libs/domain/merchant/services/src/adapter/index.ts delete mode 100644 libs/domain/merchant/services/src/adapter/normalizers/index.ts delete mode 100644 libs/domain/merchant/services/src/adapter/normalizers/merchant-list.normalizer.ts delete mode 100644 libs/domain/merchant/services/src/adapter/normalizers/merchant.normalizer.ts delete mode 100644 libs/domain/merchant/services/src/adapter/normalizers/models.ts delete mode 100644 libs/domain/merchant/services/src/adapter/normalizers/offer.normalizer.ts delete mode 100644 libs/domain/merchant/services/src/default-merchant.service.spec.ts delete mode 100644 libs/domain/merchant/services/src/default-merchant.service.ts delete mode 100644 libs/domain/merchant/services/src/index.ts delete mode 100644 libs/domain/merchant/services/src/product/index.ts delete mode 100644 libs/domain/merchant/services/src/product/product.normalizer.ts delete mode 100644 libs/domain/merchant/services/src/resolvers/index.ts delete mode 100644 libs/domain/merchant/services/src/resolvers/offer.resolver.ts delete mode 100644 libs/domain/merchant/src/components.ts delete mode 100644 libs/domain/merchant/src/entity.ts delete mode 100644 libs/domain/merchant/src/feature.ts delete mode 100644 libs/domain/merchant/src/index.ts delete mode 100644 libs/domain/merchant/src/mixins/index.ts delete mode 100644 libs/domain/merchant/src/mixins/merchant.mixin.ts delete mode 100644 libs/domain/merchant/src/mocks/feature.ts delete mode 100644 libs/domain/merchant/src/mocks/index.ts delete mode 100644 libs/domain/merchant/src/mocks/merchant.service.ts delete mode 100644 libs/domain/merchant/src/mocks/product.service.ts delete mode 100644 libs/domain/merchant/src/models/index.ts delete mode 100644 libs/domain/merchant/src/models/merchant.model.api.ts delete mode 100644 libs/domain/merchant/src/models/merchant.model.ts delete mode 100644 libs/domain/merchant/src/models/offer.model.ts delete mode 100644 libs/domain/merchant/src/presets/index.ts delete mode 100644 libs/domain/merchant/src/presets/merchant-page.ts delete mode 100644 libs/domain/merchant/src/product/index.ts delete mode 100644 libs/domain/merchant/src/product/product.model.ts delete mode 100644 libs/domain/merchant/src/product/providers.ts delete mode 100644 libs/domain/merchant/src/product/query.ts delete mode 100644 libs/domain/merchant/src/services/adapter/index.ts delete mode 100644 libs/domain/merchant/src/services/adapter/merchant-includes.ts delete mode 100644 libs/domain/merchant/src/services/adapter/merchant.adapter.ts delete mode 100644 libs/domain/merchant/src/services/index.ts delete mode 100644 libs/domain/merchant/src/services/jsonld/index.ts delete mode 100644 libs/domain/merchant/src/services/jsonld/model.ts delete mode 100644 libs/domain/merchant/src/services/jsonld/offers.jsonld.ts delete mode 100644 libs/domain/merchant/src/services/merchant.context.ts delete mode 100644 libs/domain/merchant/src/services/merchant.service.ts delete mode 100644 libs/domain/merchant/src/services/providers.ts delete mode 100644 libs/domain/merchant/src/services/state/effects.ts delete mode 100644 libs/domain/merchant/src/services/state/index.ts delete mode 100644 libs/domain/merchant/src/services/state/queries.ts delete mode 100644 libs/domain/merchant/tsconfig.lib.json delete mode 100644 libs/domain/merchant/tsconfig.spec.json delete mode 100644 libs/domain/merchant/vitest.config.ts delete mode 100644 libs/template/labs/src/merchants/index.ts delete mode 100644 libs/template/presets/storefront/experience/pages/merchant-page.ts diff --git a/apps/storefront/.env.template b/apps/storefront/.env.template index fdf115255..99c659ab2 100644 --- a/apps/storefront/.env.template +++ b/apps/storefront/.env.template @@ -38,9 +38,6 @@ ORYX_CONTENTFUL_SPACE= # Default preset is b2c (storefront). ORYX_PRESET= -# If set - adds merchant features to the storefront -ORYX_MERCHANT= - # Used to set a feature level, available options: latest, 1.0, 1.1, etc. Only major and minor versions should be used. ORYX_FEATURE_VERSION=latest @@ -50,4 +47,4 @@ ORYX_STRAPI_TOKEN= ORYX_STRAPI_API_URL= # Set to true to enable the multi-cart feature. -ORYX_MULTI_CART= \ No newline at end of file +ORYX_MULTI_CART= diff --git a/apps/storefront/dependencies.sh b/apps/storefront/dependencies.sh index 0a49cdab9..eba07c72f 100644 --- a/apps/storefront/dependencies.sh +++ b/apps/storefront/dependencies.sh @@ -1 +1 @@ -DEPENDENCIES="apps/storefront/* libs/base/di/* libs/base/ui/* libs/base/utilities/* libs/domain/cart/* libs/domain/checkout/* libs/domain/content/* libs/domain/merchant/* libs/domain/order/* libs/domain/product/* libs/domain/search/* libs/domain/site/* libs/domain/user/* libs/platform/auth/* libs/platform/core/* libs/platform/experience/* libs/platform/form/* libs/platform/i18n/* libs/platform/indexed-db/* libs/platform/offline/* libs/platform/push-notification/* libs/platform/router/* libs/template/application/* libs/template/labs/* libs/template/presets/* libs/template/resources/* libs/template/themes/*" +DEPENDENCIES="apps/storefront/* libs/base/di/* libs/base/ui/* libs/base/utilities/* libs/domain/cart/* libs/domain/checkout/* libs/domain/content/* libs/domain/order/* libs/domain/product/* libs/domain/search/* libs/domain/site/* libs/domain/user/* libs/platform/auth/* libs/platform/core/* libs/platform/experience/* libs/platform/form/* libs/platform/i18n/* libs/platform/indexed-db/* libs/platform/offline/* libs/platform/push-notification/* libs/platform/router/* libs/template/application/* libs/template/labs/* libs/template/presets/* libs/template/resources/* libs/template/themes/*" \ No newline at end of file diff --git a/apps/storefront/src/app.ts b/apps/storefront/src/app.ts index 8930a1c74..83fe054e2 100644 --- a/apps/storefront/src/app.ts +++ b/apps/storefront/src/app.ts @@ -1,7 +1,6 @@ import { appBuilder } from '@spryker-oryx/application'; import { multiCartFeature } from '@spryker-oryx/cart'; import { labsFeatures } from '@spryker-oryx/labs'; -import { merchantFeature } from '@spryker-oryx/merchant'; import { b2bStorefrontFeatures } from '@spryker-oryx/presets/b2b-storefront'; import { storefrontFeatures } from '@spryker-oryx/presets/storefront'; import { storefrontTheme } from '@spryker-oryx/themes'; @@ -15,7 +14,6 @@ const features = [ ...storefrontFeatures, ...(env.ORYX_MULTI_CART ? [multiCartFeature] : []), ]), - ...(env.ORYX_MERCHANT ? [merchantFeature] : []), ...(env.ORYX_LABS ? labsFeatures : []), ]; diff --git a/apps/storybook/.storybook/app/build.ts b/apps/storybook/.storybook/app/build.ts index 4be9eb0d0..b83947d90 100644 --- a/apps/storybook/.storybook/app/build.ts +++ b/apps/storybook/.storybook/app/build.ts @@ -8,7 +8,6 @@ import { mockCoreFeature } from '@spryker-oryx/core/mocks'; import { mockExperienceFeature } from '@spryker-oryx/experience/mocks'; import { formFeature } from '@spryker-oryx/form'; import { I18nFeature } from '@spryker-oryx/i18n'; -import { mockMerchantFeature } from '@spryker-oryx/merchant/mocks'; import { mockOfflineFeature } from '@spryker-oryx/offline/mocks'; import { mockOrderFeature } from '@spryker-oryx/order/mocks'; import { mockProductFeature } from '@spryker-oryx/product/mocks'; @@ -52,7 +51,6 @@ const builder = appBuilder() .withFeature(contentFeature) .withFeature(mockOfflineFeature) .withFeature(mockProductFeature) - .withFeature(mockMerchantFeature) .withFeature(mockSearchFeature) .withFeature(mockSiteFeature) .withFeature(mockUserFeature) diff --git a/apps/storybook/dependencies.sh b/apps/storybook/dependencies.sh index 4aab638df..6faa8d3a7 100644 --- a/apps/storybook/dependencies.sh +++ b/apps/storybook/dependencies.sh @@ -1 +1 @@ -DEPENDENCIES="apps/storybook/* libs/base/di/* libs/base/ui/* libs/base/utilities/* libs/domain/cart/* libs/domain/checkout/* libs/domain/content/* libs/domain/merchant/* libs/domain/order/* libs/domain/product/* libs/domain/search/* libs/domain/site/* libs/domain/user/* libs/platform/auth/* libs/platform/core/* libs/platform/experience/* libs/platform/form/* libs/platform/i18n/* libs/platform/indexed-db/* libs/platform/offline/* libs/platform/push-notification/* libs/platform/router/* libs/template/application/* libs/template/presets/* libs/template/resources/* libs/template/themes/*" +DEPENDENCIES="apps/storybook/* libs/base/di/* libs/base/ui/* libs/base/utilities/* libs/domain/cart/* libs/domain/checkout/* libs/domain/content/* libs/domain/order/* libs/domain/product/* libs/domain/search/* libs/domain/site/* libs/domain/user/* libs/platform/auth/* libs/platform/core/* libs/platform/experience/* libs/platform/form/* libs/platform/i18n/* libs/platform/indexed-db/* libs/platform/offline/* libs/platform/push-notification/* libs/platform/router/* libs/template/application/* libs/template/presets/* libs/template/resources/* libs/template/themes/*" \ No newline at end of file diff --git a/libs/domain/cart/entry/src/entry.component.ts b/libs/domain/cart/entry/src/entry.component.ts index 92143cdff..ff17d3dba 100644 --- a/libs/domain/cart/entry/src/entry.component.ts +++ b/libs/domain/cart/entry/src/entry.component.ts @@ -3,7 +3,6 @@ import { resolve } from '@spryker-oryx/di'; import { ContentMixin, defaultOptions } from '@spryker-oryx/experience'; import { PRODUCT, - Product, ProductContext, ProductMediaContainerSize, ProductMixin, @@ -146,18 +145,6 @@ export class CartEntryComponent maxLines: featureVersion >= '1.4' ? 1 : undefined, } as ProductTitleOptions} > - ${featureVersion >= '1.4' && - (this.$product() as Product & { merchantId: string })?.merchantId - ? html`} - ` - : html``} ${when( this.$options()?.enableItemId, () => html`` diff --git a/libs/domain/merchant/.constants.ts b/libs/domain/merchant/.constants.ts deleted file mode 100644 index 4bdb26a98..000000000 --- a/libs/domain/merchant/.constants.ts +++ /dev/null @@ -1 +0,0 @@ -export const storybookPrefix = 'Merchant'; diff --git a/libs/domain/merchant/CHANGELOG.md b/libs/domain/merchant/CHANGELOG.md deleted file mode 100644 index 462f65c0b..000000000 --- a/libs/domain/merchant/CHANGELOG.md +++ /dev/null @@ -1,24 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -# 1.4.0 (2024-01-16) - - -### Features - -* context and entity improvements ([#1062](https://github.com/spryker/oryx/issues/1062)) ([80feadb](https://github.com/spryker/oryx/commit/80feadb757e17fda62b3d568eefbfb0803493fe7)) -* local context fallback ([#1026](https://github.com/spryker/oryx/issues/1026)) ([3b26f93](https://github.com/spryker/oryx/commit/3b26f9326609ccf5bc77ce97230631cc10989f20)) -* Added collapsible layout plugin ([#1034](https://github.com/spryker/oryx/issues/1034)) ([40e7c3c](https://github.com/spryker/oryx/commit/40e7c3c5314cb84e26000218cc711278c7e70f35)) -* Added data list component ([#1050](https://github.com/spryker/oryx/issues/1050)) ([1464fc9](https://github.com/spryker/oryx/commit/1464fc931b3b5d915c144aaa9805781e652b141a)) -* Added dropdown layout plugin ([#1047](https://github.com/spryker/oryx/issues/1047)) ([3237033](https://github.com/spryker/oryx/commit/32370335756a2050629d7b659a90aba185889173)) -* Added entity link component ([#1022](https://github.com/spryker/oryx/issues/1022)) ([116775f](https://github.com/spryker/oryx/commit/116775f4d60ad34fb0c8025bec2cd5835e3fb473)) -* Added entity text component ([#1010](https://github.com/spryker/oryx/issues/1010)) ([8dc9c31](https://github.com/spryker/oryx/commit/8dc9c315ad028304db76541dbaa6bc7386a23725)) -* entity image component ([#1008](https://github.com/spryker/oryx/issues/1008)) ([ea043a2](https://github.com/spryker/oryx/commit/ea043a2683a913650310e54e1ece01700358cdc3)) -* link support for entity text ([#1024](https://github.com/spryker/oryx/issues/1024)) ([8e8a12d](https://github.com/spryker/oryx/commit/8e8a12dfc3c4aa2fd35f373922c77366640e5600)) -* Added merchant package. ([#1004](https://github.com/spryker/oryx/issues/1004)) ([aed0610](https://github.com/spryker/oryx/commit/aed0610d2b1d4f2664209e867914bd906f1b8ee7)) -* Added merchant schedule component ([#979](https://github.com/spryker/oryx/issues/979)) ([d41a8e4](https://github.com/spryker/oryx/commit/d41a8e49d0293073516d1607dd582d01d5e3d3c2)) -* Added product offers component ([#1025](https://github.com/spryker/oryx/issues/1025)) ([0c074ea](https://github.com/spryker/oryx/commit/0c074ea0bbd95e2357d94a9991511a21e3d36d1a)) -* accessible collapsible component ([#1043](https://github.com/spryker/oryx/issues/1043)) ([2113bda](https://github.com/spryker/oryx/commit/2113bdaf819d1cf59769788db887e221174b5df0)) -* persisted collapsible open state ([#1049](https://github.com/spryker/oryx/issues/1049)) ([e56a778](https://github.com/spryker/oryx/commit/e56a778e694bebbe65bc8c7d787c50ed8f89c3ed)) diff --git a/libs/domain/merchant/README.md b/libs/domain/merchant/README.md deleted file mode 100644 index 764e90980..000000000 --- a/libs/domain/merchant/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Oryx Merchant package - -Provides components and services related to merchant feature for marketplace scenarios. - -## Installation - -`npm install @spryker-oryx/merchant` diff --git a/libs/domain/merchant/offer-list/index.ts b/libs/domain/merchant/offer-list/index.ts deleted file mode 100644 index cde274c35..000000000 --- a/libs/domain/merchant/offer-list/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './offer-list.component'; -export * from './offer-list.schema'; -export * from './offer-list.styles'; diff --git a/libs/domain/merchant/offer-list/offer-list.component.spec.ts b/libs/domain/merchant/offer-list/offer-list.component.spec.ts deleted file mode 100644 index cf0bd6fe2..000000000 --- a/libs/domain/merchant/offer-list/offer-list.component.spec.ts +++ /dev/null @@ -1,92 +0,0 @@ -import { fixture } from '@open-wc/testing-helpers'; -import { ContextService, DefaultContextService } from '@spryker-oryx/core'; -import { createInjector, destroyInjector } from '@spryker-oryx/di'; -import { ProductService } from '@spryker-oryx/product'; -import { mockProductProviders } from '@spryker-oryx/product/mocks'; -import { LinkService } from '@spryker-oryx/site'; -import { useComponent } from '@spryker-oryx/utilities'; -import { html } from 'lit'; -import { of } from 'rxjs'; -import { MockMerchantProductService } from '../src/mocks'; -import { MerchantOfferListComponent } from './offer-list.component'; -import { merchantOfferListComponent } from './offer-list.def'; - -class MockLinkService implements Partial { - get = vi.fn().mockReturnValue(of('/product/123')); -} - -describe('MerchantOfferListComponent', () => { - let element: MerchantOfferListComponent; - - beforeAll(async () => { - mockFeatureVersion('1.4'); - await useComponent(merchantOfferListComponent); - }); - - beforeEach(async () => { - createInjector({ - providers: [ - ...mockProductProviders, - { - provide: ProductService, - useClass: MockMerchantProductService, - }, - { - provide: ContextService, - useClass: DefaultContextService, - }, - { - provide: LinkService, - useClass: MockLinkService, - }, - ], - }); - }); - - afterEach(() => destroyInjector()); - - describe('when the component is rendered', () => { - beforeEach(async () => { - element = await fixture( - html`` - ); - }); - - it('passes the a11y audit', async () => { - await expect(element).shadowDom.to.be.accessible(); - }); - }); - - describe('when the product has offers', () => { - beforeEach(async () => { - element = await fixture( - html`` - ); - }); - - it('passes the a11y audit', async () => { - await expect(element).shadowDom.to.be.accessible(); - }); - - it('should render a link with radio input and offer for each offer', () => { - expect(element).toContainElement( - 'a input[value="offer-1"] + oryx-merchant-offer' - ); - expect(element).toContainElement( - 'a input[value="offer-2"] + oryx-merchant-offer' - ); - }); - }); - - describe('when the product has no offers', () => { - beforeEach(async () => { - element = await fixture( - html`` - ); - }); - - it('should not render anything', () => { - expect(element).not.toContainElement('*:not(style)'); - }); - }); -}); diff --git a/libs/domain/merchant/offer-list/offer-list.component.ts b/libs/domain/merchant/offer-list/offer-list.component.ts deleted file mode 100644 index a41e06166..000000000 --- a/libs/domain/merchant/offer-list/offer-list.component.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { resolve } from '@spryker-oryx/di'; -import { ContentMixin } from '@spryker-oryx/experience'; -import { PRODUCT, ProductMixin, ProductService } from '@spryker-oryx/product'; -import { LinkService, RouteType } from '@spryker-oryx/router'; -import { computed, elementEffect, hydrate } from '@spryker-oryx/utilities'; -import { HTMLTemplateResult, LitElement, TemplateResult, html } from 'lit'; -import { queryAll } from 'lit/decorators.js'; -import { repeat } from 'lit/directives/repeat.js'; -import { Observable, combineLatest, map } from 'rxjs'; -import { ProductOffer } from '../src/models'; -import { merchantOffersStyles } from './offer-list.styles'; - -@hydrate({ context: PRODUCT }) -export class MerchantOfferListComponent extends ProductMixin( - ContentMixin(LitElement) -) { - static styles = merchantOffersStyles; - - protected linkService = resolve(LinkService); - protected productService = resolve(ProductService, null); - - @queryAll('input') protected inputElements?: HTMLInputElement[]; - - /** - * Resolves the current offer from the product context. - */ - protected $current = computed(() => { - const { offer: offerId } = this.$productQualifier() ?? {}; - let selected = this.$product()?.offers?.find( - (offer) => offer.id === offerId - ); - if (!selected) - selected = this.$product()?.offers?.find((offer) => offer.isDefault); - return selected; - }); - - @elementEffect() - protected selectRadioElements = (): void => { - const current = this.$current()?.id; - setTimeout(() => { - this.inputElements?.forEach((el) => { - el.checked = el.value === current; - el.dispatchEvent(new Event('change', { bubbles: true })); - }); - }, 0); - }; - - protected $offers = computed(() => { - const product = this.$product(); - if (!product?.offers?.length) - return undefined as unknown as Observable; - - return combineLatest( - product.offers.map((offer) => - this.linkService - .get({ - type: RouteType.Product, - qualifier: { sku: product.sku, offer: offer.id }, - }) - .pipe(map((link) => ({ ...offer, link }))) - ) - ); - }); - - protected override render(): TemplateResult | void { - const offers = this.$offers(); - - if (!offers || offers.length < 2) return; - - return html` - ${repeat( - offers, - (offer) => offer.id, - (offer) => this.renderOffer(offer) - )} - `; - } - - protected renderOffer( - offer: ProductOffer & { link: string | undefined } - ): HTMLTemplateResult | void { - return html` - ', { - offer: offer.id, - })} - tabindex="-1" - > - - ', { - offer: offer.id, - })} - value=${offer.id} - ?checked=${offer.id === this.$current()?.id} - @click=${this.onClick} - /> - - - - `; - } - - protected onClick(ev: MouseEvent): void { - if (ev.metaKey) { - ev.preventDefault(); - (ev.target as HTMLInputElement) - ?.closest('a') - ?.dispatchEvent(new MouseEvent('click', { metaKey: true })); - } - } -} diff --git a/libs/domain/merchant/offer-list/offer-list.def.ts b/libs/domain/merchant/offer-list/offer-list.def.ts deleted file mode 100644 index ffc02896c..000000000 --- a/libs/domain/merchant/offer-list/offer-list.def.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { componentDef } from '@spryker-oryx/utilities'; - -export const merchantOfferListComponent = componentDef({ - name: 'oryx-merchant-offer-list', - impl: () => - import('./offer-list.component').then((m) => m.MerchantOfferListComponent), - schema: () => - import('./offer-list.schema').then((m) => m.merchantOfferListSchema), -}); diff --git a/libs/domain/merchant/offer-list/offer-list.schema.ts b/libs/domain/merchant/offer-list/offer-list.schema.ts deleted file mode 100644 index 40e94d7e0..000000000 --- a/libs/domain/merchant/offer-list/offer-list.schema.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ContentComponentSchema } from '@spryker-oryx/experience'; -import { MerchantOfferListComponent } from './offer-list.component'; - -export const merchantOfferListSchema: ContentComponentSchema = - { - name: 'Offer list', - group: 'Merchant', - }; diff --git a/libs/domain/merchant/offer-list/offer-list.styles.ts b/libs/domain/merchant/offer-list/offer-list.styles.ts deleted file mode 100644 index e875888d1..000000000 --- a/libs/domain/merchant/offer-list/offer-list.styles.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { css } from 'lit'; - -export const merchantOffersStyles = css` - a { - display: block; - text-decoration: none; - } - - a:not(:last-of-type) { - margin-block-end: 16px; - } - - oryx-radio { - align-items: start; - margin-block-start: 2px; - } - - input { - margin-block-start: 2px; - } - - input::after { - z-index: 1; - } -`; diff --git a/libs/domain/merchant/offer-list/stories/demo.stories.ts b/libs/domain/merchant/offer-list/stories/demo.stories.ts deleted file mode 100644 index 6c9fe23c6..000000000 --- a/libs/domain/merchant/offer-list/stories/demo.stories.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { ContextService } from '@spryker-oryx/core'; -import { resolve } from '@spryker-oryx/di'; -import { PRODUCT, ProductComponentProperties } from '@spryker-oryx/product'; -import { Meta, Story } from '@storybook/web-components'; -import { TemplateResult, html } from 'lit'; -import { storybookPrefix } from '../../.constants'; - -export default { - title: `${storybookPrefix}/Offer List`, - args: { sku: 'mp-1' }, - argTypes: {}, - parameters: { chromatic: { disableSnapshot: true } }, -} as Meta; - -type Props = { offerId?: string } & ProductComponentProperties; - -const Template: Story = (props: Props): TemplateResult => { - const { sku } = props; - resolve(ContextService).provide(document.body, PRODUCT, { - sku, - }); - return html` - - `; -}; - -export const Static = Template.bind({}); diff --git a/libs/domain/merchant/offer/index.ts b/libs/domain/merchant/offer/index.ts deleted file mode 100644 index f05445e96..000000000 --- a/libs/domain/merchant/offer/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './offer.component'; -export * from './offer.schema'; -export * from './offer.styles'; diff --git a/libs/domain/merchant/offer/offer.component.spec.ts b/libs/domain/merchant/offer/offer.component.spec.ts deleted file mode 100644 index a91788563..000000000 --- a/libs/domain/merchant/offer/offer.component.spec.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { fixture } from '@open-wc/testing-helpers'; -import { createInjector, destroyInjector } from '@spryker-oryx/di'; -import { ProductService } from '@spryker-oryx/product'; -import { mockProductProviders } from '@spryker-oryx/product/mocks'; -import { useComponent } from '@spryker-oryx/utilities'; -import { html } from 'lit'; -import { MockMerchantProductService } from '../src/mocks/product.service'; -import { MerchantOfferComponent } from './offer.component'; -import { merchantOfferComponent } from './offer.def'; - -describe('MerchantOfferComponent', () => { - let element: MerchantOfferComponent; - - beforeAll(async () => { - mockFeatureVersion('1.4'); - await useComponent(merchantOfferComponent); - }); - - beforeEach(async () => { - createInjector({ - providers: [ - ...mockProductProviders, - - { - provide: ProductService, - useClass: MockMerchantProductService, - }, - ], - }); - }); - - afterEach(() => destroyInjector()); - - describe('when there is an offer', () => { - beforeEach(async () => { - element = await fixture( - html`` - ); - }); - - it('should render the offer price', () => { - expect(element).toContainElement('oryx-product-price'); - }); - - it('should render the delivery time', () => { - expect(element).toContainElement('.delivery-time'); - }); - - it('should render the product availability', () => { - expect(element).toContainElement('oryx-product-availability'); - }); - }); - - describe('when the merchant has no delivery time', () => { - beforeEach(async () => { - element = await fixture( - html`` - ); - }); - - it('should render the offer price', () => { - expect(element).toContainElement('oryx-product-price'); - }); - - it('should render the delivery time', () => { - expect(element).not.toContainElement('.delivery-time'); - }); - - it('should render the product availability', () => { - expect(element).toContainElement('oryx-product-availability'); - }); - }); - - describe('when there is no offer', () => { - beforeEach(async () => { - element = await fixture( - html`` - ); - }); - - it('should not render any content', () => { - expect(element).not.toContainElement('*:not(style)'); - }); - }); -}); diff --git a/libs/domain/merchant/offer/offer.component.ts b/libs/domain/merchant/offer/offer.component.ts deleted file mode 100644 index e3d2479cc..000000000 --- a/libs/domain/merchant/offer/offer.component.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { ContentMixin } from '@spryker-oryx/experience'; -import { LitElement, TemplateResult, html } from 'lit'; - -import { ContextController } from '@spryker-oryx/core'; -import { PRODUCT, ProductMixin } from '@spryker-oryx/product'; -import { IconTypes } from '@spryker-oryx/ui/icon'; -import { - Size, - computed, - elementEffect, - hydrate, - signalAware, - signalProperty, -} from '@spryker-oryx/utilities'; -import { when } from 'lit/directives/when.js'; -import { merchantOfferStyles } from './offer.styles'; - -@hydrate({ context: PRODUCT }) -@signalAware() -export class MerchantOfferComponent extends ProductMixin( - ContentMixin(LitElement) -) { - static styles = merchantOfferStyles; - - @signalProperty() protected offerId?: string; - - protected contextController = new ContextController(this); - - @elementEffect() - protected setProductContext = (): void => { - const sku = this.$product()?.sku; - this.contextController.provide(PRODUCT, { - sku, - offer: this.offerId, - }); - }; - - protected $offer = computed(() => { - return this.$product()?.offers?.find((offer) => offer.id === this.offerId); - }); - - protected override render(): TemplateResult | void { - const offer = this.$offer(); - if (!offer) return; - - return html` - ${offer.merchant.name} - - - - ${when( - offer.merchant.deliveryTime, - () => html` - - - ${offer.merchant.deliveryTime} - - ` - )} - - - `; - } -} diff --git a/libs/domain/merchant/offer/offer.def.ts b/libs/domain/merchant/offer/offer.def.ts deleted file mode 100644 index 10a9ea205..000000000 --- a/libs/domain/merchant/offer/offer.def.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { componentDef } from '@spryker-oryx/utilities'; - -export const merchantOfferComponent = componentDef({ - name: 'oryx-merchant-offer', - impl: () => import('./offer.component').then((m) => m.MerchantOfferComponent), - schema: () => import('./offer.schema').then((m) => m.merchantOfferSchema), -}); diff --git a/libs/domain/merchant/offer/offer.schema.ts b/libs/domain/merchant/offer/offer.schema.ts deleted file mode 100644 index 99e78864e..000000000 --- a/libs/domain/merchant/offer/offer.schema.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ContentComponentSchema } from '@spryker-oryx/experience'; -import { MerchantOfferComponent } from './offer.component'; - -export const merchantOfferSchema: ContentComponentSchema = - { - name: 'Offer', - group: 'Merchant', - }; diff --git a/libs/domain/merchant/offer/offer.styles.ts b/libs/domain/merchant/offer/offer.styles.ts deleted file mode 100644 index eafc958b0..000000000 --- a/libs/domain/merchant/offer/offer.styles.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { css } from 'lit'; - -export const merchantOfferStyles = css` - :host { - container-type: inline-size; - display: grid; - grid-template-columns: auto auto; - align-items: center; - gap: 8px; - text-decoration: none; - color: var(--oryx-color-neutral-12); - } - - @container (max-width: 300px) { - oryx-heading { - grid-column: 1 / -1; - } - - oryx-product-price, - oryx-product-availability { - grid-column: 1 / -1; - } - } - - @container (min-width: 301px) { - oryx-product-price, - oryx-product-availability { - justify-self: end; - } - - oryx-product-availability { - grid-column: 2; - } - } - - oryx-product-price { - display: flex; - } - - oryx-product-price::part(original), - oryx-product-price::part(sales) { - font-size: initial; - } - - .delivery-time { - display: flex; - align-items: center; - gap: 4px; - } -`; diff --git a/libs/domain/merchant/offer/stories/static.stories.ts b/libs/domain/merchant/offer/stories/static.stories.ts deleted file mode 100644 index ff9b828f5..000000000 --- a/libs/domain/merchant/offer/stories/static.stories.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Meta, Story } from '@storybook/web-components'; -import { TemplateResult, html } from 'lit'; -import { storybookPrefix } from '../../.constants'; - -export default { - title: `${storybookPrefix}/Offer List Item`, -} as Meta; - -const Template: Story = (): TemplateResult => { - return html` -

Full width

- -

No stock, discounted

- - -

Available in stock

- - -

300px width

-
-

No stock, discounted

- -

Available in stock

- -
- `; -}; - -export const Static = Template.bind({}); diff --git a/libs/domain/merchant/package.json b/libs/domain/merchant/package.json deleted file mode 100644 index 784c0f589..000000000 --- a/libs/domain/merchant/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@spryker-oryx/merchant", - "type": "module", - "version": "1.4.0", - "description": "Merchant features for Oryx applications", - "author": "Spryker Systems GmbH", - "license": "See license in LICENSE", - "files": [ - "**/*" - ], - "main": "./src/index.js", - "typings": "./src/index.d.ts", - "publishConfig": { - "access": "public" - }, - "exports": { - "./mocks": { - "types": "./src/mocks/index.d.ts", - "default": "./src/mocks/index.js" - } - }, - "dependencies": { - "@spryker-oryx/core": "1.4.0", - "@spryker-oryx/di": "1.4.0", - "@spryker-oryx/experience": "1.4.0", - "@spryker-oryx/product": "1.4.0", - "@spryker-oryx/router": "1.4.0", - "@spryker-oryx/site": "1.4.0", - "@spryker-oryx/ui": "1.4.0", - "@spryker-oryx/utilities": "1.4.0" - }, - "peerDependencies": { - "lit": "^2.4.0", - "rxjs": "^7.5.0", - "tslib": "^2.4.0" - } -} diff --git a/libs/domain/merchant/project.json b/libs/domain/merchant/project.json deleted file mode 100644 index 4495172b1..000000000 --- a/libs/domain/merchant/project.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "$schema": "../../../node_modules/nx/schemas/project-schema.json", - "projectType": "library", - "sourceRoot": "libs/domain/merchant", - "prefix": "fes", - "targets": { - "build": { - "executor": "./tools/executors/components-library:build" - }, - "paths": { - "executor": "./tools/executors/components-library:paths" - }, - "test": { - "executor": "./tools/executors/oryx-vite:vitest" - }, - "lint": { - "executor": "@nrwl/linter:eslint", - "options": { - "lintFilePatterns": ["libs/domain/merchant/**/*.ts"] - }, - "outputs": ["{options.outputFile}"] - }, - "storybook": { - "executor": "@nrwl/storybook:storybook", - "options": { - "uiFramework": "@storybook/web-components", - "port": 4400, - "config": { - "configFolder": "libs/domain/merchant/.storybook" - }, - "staticDir": ["libs/domain/merchant/public"] - }, - "configurations": { - "ci": { - "quiet": true - } - } - }, - "stylelint": { - "executor": "nx-stylelint:lint", - "outputs": ["{options.outputFile}"], - "options": { - "lintFilePatterns": [ - "libs/domain/merchant/**/*.css", - "libs/domain/merchant/**/*.styles.ts" - ] - } - } - }, - "tags": ["layer:domain"] -} diff --git a/libs/domain/merchant/schedule/index.ts b/libs/domain/merchant/schedule/index.ts deleted file mode 100644 index b3ad7eb84..000000000 --- a/libs/domain/merchant/schedule/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './schedule.component'; -export * from './schedule.schema'; -export * from './schedule.styles'; diff --git a/libs/domain/merchant/schedule/schedule.component.spec.ts b/libs/domain/merchant/schedule/schedule.component.spec.ts deleted file mode 100644 index 6543c32e7..000000000 --- a/libs/domain/merchant/schedule/schedule.component.spec.ts +++ /dev/null @@ -1,258 +0,0 @@ -import { fixture } from '@open-wc/testing-helpers'; -import { ContextService, DefaultContextService } from '@spryker-oryx/core'; -import { createInjector, destroyInjector } from '@spryker-oryx/di'; -import { i18n, useComponent } from '@spryker-oryx/utilities'; -import { html } from 'lit'; -import { of } from 'rxjs'; -import { MERCHANT, Merchant, MerchantService } from '../src'; -import { MerchantScheduleComponent } from './schedule.component'; -import { merchantScheduleComponent } from './schedule.def'; - -class MockMerchantService implements Partial { - get = vi.fn(); -} - -const twoWeeksAgo = new Date(new Date().setDate(new Date().getDate() - 14)); -const oneWeeksAgo = new Date(new Date().setDate(new Date().getDate() - 7)); -const oneWeeksAhead = new Date(new Date().setDate(new Date().getDate() + 7)); -const twoWeeksAhead = new Date(new Date().setDate(new Date().getDate() + 14)); - -const mockMerchant: Partial = { - id: '1', - schedule: { - weekdays: [ - { - day: 'monday', - times: [ - { from: '07:00:00.000000', to: '13:00:00.000000' }, - { from: '14:00:00.000000', to: '20:00:00.000000' }, - ], - }, - { - day: 'tuesday', - times: [{ from: '07:00:00.000000', to: '20:00:00.000000' }], - }, - { - day: 'wednesday', - times: [{ from: '07:00:00.000000', to: '20:00:00.000000' }], - }, - { - day: 'thursday', - times: [{ from: '07:00:00.000000', to: '20:00:00.000000' }], - }, - { - day: 'friday', - times: [{ from: '07:00:00.000000', to: '20:00:00.000000' }], - }, - { - day: 'saturday', - times: [{ from: '07:00:00.000000', to: '20:00:00.000000' }], - }, - { - day: 'sunday', - }, - ], - dates: [ - { date: twoWeeksAgo.toString() }, - { date: oneWeeksAgo.toString() }, - { date: oneWeeksAhead.toString() }, - { date: twoWeeksAhead.toString() }, - ], - }, -}; - -describe('MerchantScheduleComponent', () => { - let element: MerchantScheduleComponent; - let merchantService: MockMerchantService; - - beforeAll(async () => { - await useComponent(merchantScheduleComponent); - }); - - beforeEach(async () => { - const injector = createInjector({ - providers: [ - { - provide: MerchantService, - useClass: MockMerchantService, - }, - { - provide: ContextService, - useClass: DefaultContextService, - }, - ], - }); - - merchantService = injector.inject(MerchantService); - const contextService = injector.inject(ContextService); - contextService.provide(document.body, MERCHANT, { id: '1' }); - }); - - afterEach(() => { - destroyInjector(); - }); - - describe('when no schedule is provided', () => { - beforeEach(async () => { - merchantService.get.mockReturnValue(of({ id: '1' })); - - element = await fixture( - html`` - ); - }); - - it('should not render any heading', () => { - expect(element).not.toContainElement('oryx-heading'); - }); - - it('should not render any slots', () => { - expect(element).not.toContainElement('ul'); - }); - }); - - describe('when a schedule is provided', () => { - beforeEach(async () => { - merchantService.get.mockReturnValue(of(mockMerchant)); - }); - - beforeEach(async () => { - element = await fixture( - html`` - ); - }); - - it('should render the weekdays heading', () => { - const headings = element.shadowRoot?.querySelectorAll('oryx-heading'); - expect(headings?.[0].textContent).toContain( - i18n('merchant.schedule.weekdays') - ); - }); - - it('should render oryx-site-day elements', () => { - expect(element).toContainElement('ul li oryx-site-day'); - }); - - it('should render the dates heading', () => { - const headings = element.shadowRoot?.querySelectorAll('oryx-heading'); - expect(headings?.[1].textContent).toContain( - i18n('merchant.schedule.dates') - ); - }); - - it('should render oryx-site-date elements', () => { - expect(element).toContainElement('ul li oryx-date'); - }); - - describe('when the weeksBefore = 0 and weeksAfter = 2', () => { - beforeEach(async () => { - element = await fixture( - html`` - ); - }); - - it('should render only the future dates', () => { - const dates = element.shadowRoot?.querySelectorAll('oryx-date'); - expect(dates?.length).toBe(2); - }); - }); - - describe('when the weeksBefore = 1 and weeksAfter = 2', () => { - beforeEach(async () => { - element = await fixture( - html`` - ); - }); - - it('should render 1 past date and 2 future', () => { - const dates = element.shadowRoot?.querySelectorAll('oryx-date'); - expect(dates?.length).toBe(3); - }); - }); - - describe('when the weeksBefore = 2 and weeksAfter = 2', () => { - beforeEach(async () => { - element = await fixture( - html`` - ); - }); - - it('should render 2 past date and 2 future', () => { - const dates = element.shadowRoot?.querySelectorAll('oryx-date'); - expect(dates?.length).toBe(4); - }); - }); - - describe('when the weeksBefore = 0 and weeksBefore = 0', () => { - beforeEach(async () => { - element = await fixture( - html`` - ); - }); - - it('should render only the future dates', () => { - const dates = element.shadowRoot?.querySelectorAll('oryx-date'); - expect(dates?.length).toBe(0); - }); - }); - - describe('when the weeksBefore = 0 and weeksAfter = 2', () => { - beforeEach(async () => { - element = await fixture( - html`` - ); - }); - - it('should render 2 past date and 2 future', () => { - const dates = element.shadowRoot?.querySelectorAll('oryx-date'); - expect(dates?.length).toBe(2); - }); - }); - - describe('when the weeksBefore = 0 and weeksAfter = 1', () => { - beforeEach(async () => { - element = await fixture( - html`` - ); - }); - - it('should render 2 past date and 2 future', () => { - const dates = element.shadowRoot?.querySelectorAll('oryx-date'); - expect(dates?.length).toBe(1); - }); - }); - - describe('when the weeksBefore = 1 and weeksAfter = 1', () => { - beforeEach(async () => { - element = await fixture( - html`` - ); - }); - - it('should render 2 past date and 2 future', () => { - const dates = element.shadowRoot?.querySelectorAll('oryx-date'); - expect(dates?.length).toBe(2); - }); - }); - }); -}); diff --git a/libs/domain/merchant/schedule/schedule.component.ts b/libs/domain/merchant/schedule/schedule.component.ts deleted file mode 100644 index b36a5b415..000000000 --- a/libs/domain/merchant/schedule/schedule.component.ts +++ /dev/null @@ -1,136 +0,0 @@ -import { ContentMixin, defaultOptions } from '@spryker-oryx/experience'; -import { - MerchantDateSlot, - MerchantMixin, - MerchantWeekdaySlot, -} from '@spryker-oryx/merchant'; -import { HeadingTag } from '@spryker-oryx/ui/heading'; -import { computed } from '@spryker-oryx/utilities'; -import { LitElement, TemplateResult, html } from 'lit'; -import { repeat } from 'lit/directives/repeat.js'; -import { when } from 'lit/directives/when.js'; -import { MerchantScheduleComponentOptions } from './schedule.model'; -import { merchantScheduleStyles } from './schedule.styles'; -import { getWeek } from './util'; - -@defaultOptions({ - tag: HeadingTag.H3, - weeksBefore: 1, - weeksAfter: 12, -}) -export class MerchantScheduleComponent extends MerchantMixin( - ContentMixin(LitElement) -) { - static styles = merchantScheduleStyles; - - protected $dates = computed(() => { - const { weeksBefore, weeksAfter } = this.$options(); - if (weeksBefore === undefined && weeksAfter === undefined) - return this.$merchant()?.schedule?.dates; - const start = getWeek(-(weeksBefore ?? 0)).start; - const end = - weeksAfter && weeksAfter >= 0 ? getWeek(weeksAfter).end : getWeek().end; - - return this.$merchant()?.schedule?.dates?.filter((slot) => { - const matchStart = new Date(slot.date).getTime() >= start.getTime(); - const matchEnd = new Date(slot.date).getTime() <= end.getTime(); - - return matchStart && matchEnd; - }); - }); - - protected override render(): TemplateResult | void { - const merchant = this.$merchant(); - - if (!merchant?.schedule) return; - - return html`${[this.renderWeekdays(), this.renderDates()]}`; - } - - protected renderWeekdays(): TemplateResult | void { - const weekdays = this.$merchant()?.schedule?.weekdays; - - if (!weekdays?.length) return; - - return html` - ${this.i18n(`merchant.schedule.weekdays`)} - - -
    - ${repeat(weekdays, (weekday) => html`${this.renderDay(weekday)}`)} -
`; - } - - protected renderDay( - weekday: MerchantWeekdaySlot | MerchantDateSlot - ): TemplateResult { - return html`
  • - ${when( - 'day' in weekday, - () => - html``, - () => html`'} - >` - )} - ${this.renderTimeSlots(weekday)} -
  • `; - } - - protected renderDates(): TemplateResult | void { - const dates = this.$dates(); - if (!dates?.length) return; - - return html` - ${this.i18n(`merchant.schedule.dates`)} - -
      - ${repeat( - dates, - (date) => html`
    • - - '} - > - ${when( - date.note, - () => - html`${this.i18n('merchant.schedule.', { - note: date.note, - })}` - )} - - ${this.renderTimeSlots(date)} -
    • ` - )} -
    `; - } - - protected renderTimeSlots( - slot: MerchantWeekdaySlot | MerchantDateSlot - ): TemplateResult | void { - if (!slot.times?.length) - return html`
    ${this.i18n('merchant.schedule.closed')}
    `; - - return html` ${repeat( - slot.times, - (time) => html`
    - - - - -
    ` - )}`; - } - - protected getDate(time?: string): Date | undefined { - if (!time) return; - const [hours, minutes, seconds] = time.split(':').map(Number); - const date = new Date(); - date.setHours(hours, minutes, seconds, 0); - return date; - } -} diff --git a/libs/domain/merchant/schedule/schedule.def.ts b/libs/domain/merchant/schedule/schedule.def.ts deleted file mode 100644 index a97240a99..000000000 --- a/libs/domain/merchant/schedule/schedule.def.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { componentDef } from '@spryker-oryx/utilities'; - -export const merchantScheduleComponent = componentDef({ - name: 'oryx-merchant-schedule', - impl: () => - import('./schedule.component').then((m) => m.MerchantScheduleComponent), - schema: () => - import('./schedule.schema').then((m) => m.merchantScheduleComponentSchema), -}); diff --git a/libs/domain/merchant/schedule/schedule.model.ts b/libs/domain/merchant/schedule/schedule.model.ts deleted file mode 100644 index c9b1411d2..000000000 --- a/libs/domain/merchant/schedule/schedule.model.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { HeadingTag } from '@spryker-oryx/ui/heading'; - -export interface MerchantScheduleComponentOptions { - /** - * Allows to render the schedule heading with a specific tag, - * e.g. `

    `, `

    `, `

    `, etc. - * This is useful to align the heading with other headings on the page. - */ - tag?: HeadingTag; - - /** - * Used to filter the dates before the current week. - */ - weeksBefore?: number; - /** - * Used to filter the dates after the current week. - */ - weeksAfter?: number; -} diff --git a/libs/domain/merchant/schedule/schedule.schema.ts b/libs/domain/merchant/schedule/schedule.schema.ts deleted file mode 100644 index 758b13baf..000000000 --- a/libs/domain/merchant/schedule/schedule.schema.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { ContentComponentSchema } from '@spryker-oryx/experience'; -import { FormFieldType } from '@spryker-oryx/form'; -import { HeadingTag } from '@spryker-oryx/ui/heading'; -import { MerchantScheduleComponent } from './schedule.component'; - -export const merchantScheduleComponentSchema: ContentComponentSchema = - { - name: 'Schedule', - group: 'Merchant', - icon: 'schedule', - options: { - tag: { - type: 'select', - options: [ - { value: HeadingTag.H1 }, - { value: HeadingTag.H2 }, - { value: HeadingTag.H3 }, - { value: HeadingTag.H4 }, - { value: HeadingTag.H5 }, - { value: HeadingTag.H6 }, - { value: HeadingTag.Bold }, - { value: HeadingTag.Caption }, - { value: HeadingTag.Small }, - { value: HeadingTag.Subtitle }, - ], - }, - weeksBefore: { type: FormFieldType.Number }, - weeksAfter: { type: FormFieldType.Number }, - }, - }; diff --git a/libs/domain/merchant/schedule/schedule.styles.ts b/libs/domain/merchant/schedule/schedule.styles.ts deleted file mode 100644 index 95f6aa222..000000000 --- a/libs/domain/merchant/schedule/schedule.styles.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { css } from 'lit'; - -export const merchantScheduleStyles = css` - :host { - display: grid; - gap: 8px; - } - - ul { - margin: 0; - padding: 0; - } - - li { - display: grid; - grid-template-columns: 1fr auto; - } - - li div { - grid-column: 2; - } -`; diff --git a/libs/domain/merchant/schedule/stories/demo.stories.ts b/libs/domain/merchant/schedule/stories/demo.stories.ts deleted file mode 100644 index 2bba35979..000000000 --- a/libs/domain/merchant/schedule/stories/demo.stories.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { ContextService } from '@spryker-oryx/core'; -import { resolve } from '@spryker-oryx/di'; -import { MERCHANT } from '@spryker-oryx/merchant'; -import { HeadingTag } from '@spryker-oryx/ui/heading'; -import { Story } from '@storybook/web-components'; -import { TemplateResult, html } from 'lit'; -import { storybookPrefix } from '../../.constants'; -import { MerchantScheduleComponentOptions } from '../schedule.model'; - -export default { - title: `${storybookPrefix}/Schedule`, - args: { - tag: HeadingTag.H3, - }, - argTypes: { - tag: { - control: { - type: 'select', - options: [ - HeadingTag.Bold, - HeadingTag.H1, - HeadingTag.H2, - HeadingTag.H3, - HeadingTag.H4, - HeadingTag.H5, - HeadingTag.H6, - HeadingTag.Small, - HeadingTag.Strong, - HeadingTag.Subtitle, - ], - }, - }, - weeksBefore: { control: { type: 'number' } }, - weeksAfter: { control: { type: 'number' } }, - }, - parameters: { chromatic: { disableSnapshot: true } }, -}; - -const Template: Story = ( - props: MerchantScheduleComponentOptions -): TemplateResult => { - resolve(ContextService).provide(document.body, MERCHANT, { id: '1' }); - return html` `; -}; - -export const Demo = Template.bind({}); diff --git a/libs/domain/merchant/schedule/stories/static.stories.ts b/libs/domain/merchant/schedule/stories/static.stories.ts deleted file mode 100644 index 4c1c6b869..000000000 --- a/libs/domain/merchant/schedule/stories/static.stories.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { ContextService } from '@spryker-oryx/core'; -import { resolve } from '@spryker-oryx/di'; -import { MERCHANT } from '@spryker-oryx/merchant'; -import { Story } from '@storybook/web-components'; -import { TemplateResult, html } from 'lit'; -import { storybookPrefix } from '../../.constants'; - -export default { - title: `${storybookPrefix}/Schedule`, - args: {}, - argTypes: {}, - parameters: { chromatic: { disableSnapshot: true } }, -}; - -const Template: Story = (): TemplateResult => { - resolve(ContextService).provide(document.body, MERCHANT, { id: '1' }); - return html` `; -}; - -export const Static = Template.bind({}); diff --git a/libs/domain/merchant/schedule/util.ts b/libs/domain/merchant/schedule/util.ts deleted file mode 100644 index 934ec10e3..000000000 --- a/libs/domain/merchant/schedule/util.ts +++ /dev/null @@ -1,27 +0,0 @@ -function getStartOfDay(date: Date): Date { - const start = new Date(date); - start.setHours(0, 0, 0, 0); - return start; -} - -function getEndOfDay(date: Date): Date { - const end = new Date(date); - end.setHours(23, 59, 59, 999); - return end; -} - -export function getWeek(offset = 0): { start: Date; end: Date } { - const today = new Date(); - const startOfWeek = getStartOfDay( - new Date( - today.getFullYear(), - today.getMonth(), - today.getDate() - today.getDay() + offset * 7 - ) - ); - const endOfWeek = getEndOfDay( - new Date(startOfWeek.getTime() + 6 * 24 * 60 * 60 * 1000) - ); - - return { start: startOfWeek, end: endOfWeek }; -} diff --git a/libs/domain/merchant/services/index.ts b/libs/domain/merchant/services/index.ts deleted file mode 100644 index 8420b1093..000000000 --- a/libs/domain/merchant/services/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './src'; diff --git a/libs/domain/merchant/services/src/adapter/default-merchant.adapter.spec.ts b/libs/domain/merchant/services/src/adapter/default-merchant.adapter.spec.ts deleted file mode 100644 index 66bea4bb8..000000000 --- a/libs/domain/merchant/services/src/adapter/default-merchant.adapter.spec.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { HttpService, JsonAPITransformerService } from '@spryker-oryx/core'; -import { HttpTestService } from '@spryker-oryx/core/testing'; -import { createInjector, destroyInjector } from '@spryker-oryx/di'; -import { MerchantAdapter, MerchantNormalizer } from '@spryker-oryx/merchant'; -import { of } from 'rxjs'; -import { DefaultMerchantAdapter } from './default-merchant.adapter'; - -const mockApiUrl = 'mockApiUrl'; -const mockMerchant = { - data: { - attributes: { - name: 'mockMerchant', - id: 'merchantId', - }, - }, -}; -const mockTransformer = { - do: vi.fn().mockReturnValue(() => of(null)), -}; - -describe('DefaultMerchantAdapter', () => { - let service: MerchantAdapter; - let http: HttpTestService; - - beforeEach(() => { - const testInjector = createInjector({ - providers: [ - { - provide: HttpService, - useClass: HttpTestService, - }, - { - provide: MerchantAdapter, - useClass: DefaultMerchantAdapter, - }, - { - provide: 'SCOS_BASE_URL', - useValue: mockApiUrl, - }, - { - provide: JsonAPITransformerService, - useValue: mockTransformer, - }, - ], - }); - - service = testInjector.inject(MerchantAdapter); - http = testInjector.inject(HttpService) as HttpTestService; - }); - - afterEach(() => { - destroyInjector(); - }); - - it('should be provided', () => { - expect(service).toBeInstanceOf(DefaultMerchantAdapter); - }); - - describe('get', () => { - const mockQualifier = { id: '123' }; - const mockInclude = ['merchant-opening-hours', 'merchant-addresses']; - - beforeEach(() => { - http.flush(mockMerchant); - }); - - afterEach(() => { - vi.clearAllMocks(); - }); - - it('should build url based on ID', () => { - service.get(mockQualifier); - - expect(http.url).toContain(`${mockApiUrl}/merchants/${mockQualifier.id}`); - }); - - it('should include specific parameters in the url', () => { - service.get(mockQualifier); - - expect(http.url).toContain(`?include=${mockInclude.join(',')}`); - }); - - it('should call transformer with proper normalizer', () => { - service.get(mockQualifier).subscribe(); - - expect(mockTransformer.do).toHaveBeenCalledWith(MerchantNormalizer); - }); - - it('should return transformed data', () => { - const mockTransformerData = 'mockTransformerData'; - const callback = vi.fn(); - mockTransformer.do.mockReturnValue(() => of(mockTransformerData)); - - service.get(mockQualifier).subscribe(callback); - - expect(callback).toHaveBeenCalledWith(mockTransformerData); - }); - }); -}); diff --git a/libs/domain/merchant/services/src/adapter/default-merchant.adapter.ts b/libs/domain/merchant/services/src/adapter/default-merchant.adapter.ts deleted file mode 100644 index f6edb751d..000000000 --- a/libs/domain/merchant/services/src/adapter/default-merchant.adapter.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { HttpService, JsonAPITransformerService } from '@spryker-oryx/core'; -import { inject } from '@spryker-oryx/di'; -import { - ApiMerchantModel, - Merchant, - MerchantAdapter, - MerchantListNormalizer, - MerchantListQualifier, - MerchantNormalizer, - MerchantQualifier, -} from '@spryker-oryx/merchant'; - -import { Observable } from 'rxjs'; - -export class DefaultMerchantAdapter implements MerchantAdapter { - protected merchantEndpoint = 'merchants'; - - constructor( - protected http = inject(HttpService), - protected SCOS_BASE_URL = inject('SCOS_BASE_URL'), - protected transformer = inject(JsonAPITransformerService) - ) {} - - get({ id }: MerchantQualifier): Observable { - const includes = ['merchant-opening-hours', 'merchant-addresses']; - return this.http - .get( - `${this.SCOS_BASE_URL}/${this.merchantEndpoint}/${id}${ - includes?.length ? '?include=' : '' - }${includes?.join(',') || ''}` - ) - .pipe(this.transformer.do(MerchantNormalizer)); - } - - // eslint-disable-next-line @typescript-eslint/no-unused-vars - getList(qualifier?: MerchantListQualifier): Observable { - return this.http - .get( - `${this.SCOS_BASE_URL}/${this.merchantEndpoint}` - ) - .pipe(this.transformer.do(MerchantListNormalizer)); - } -} diff --git a/libs/domain/merchant/services/src/adapter/index.ts b/libs/domain/merchant/services/src/adapter/index.ts deleted file mode 100644 index ab76793c6..000000000 --- a/libs/domain/merchant/services/src/adapter/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './default-merchant.adapter'; -export * from './normalizers'; diff --git a/libs/domain/merchant/services/src/adapter/normalizers/index.ts b/libs/domain/merchant/services/src/adapter/normalizers/index.ts deleted file mode 100644 index ef931d87a..000000000 --- a/libs/domain/merchant/services/src/adapter/normalizers/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './merchant-list.normalizer'; -export * from './merchant.normalizer'; -export * from './models'; -export * from './offer.normalizer'; diff --git a/libs/domain/merchant/services/src/adapter/normalizers/merchant-list.normalizer.ts b/libs/domain/merchant/services/src/adapter/normalizers/merchant-list.normalizer.ts deleted file mode 100644 index 3f57ab2f9..000000000 --- a/libs/domain/merchant/services/src/adapter/normalizers/merchant-list.normalizer.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { TransformerService } from '@spryker-oryx/core'; -import { - ApiMerchantModel, - Merchant, - MerchantNormalizer, -} from '@spryker-oryx/merchant'; -import { Observable, combineLatest, of } from 'rxjs'; - -export function merchantListNormalizer( - data: ApiMerchantModel.Merchant[], - transformer: TransformerService -): Observable { - return data.length - ? combineLatest( - data.map((cart) => transformer.transform(cart, MerchantNormalizer)) - ) - : of([]); -} diff --git a/libs/domain/merchant/services/src/adapter/normalizers/merchant.normalizer.ts b/libs/domain/merchant/services/src/adapter/normalizers/merchant.normalizer.ts deleted file mode 100644 index bc6324246..000000000 --- a/libs/domain/merchant/services/src/adapter/normalizers/merchant.normalizer.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { - ApiMerchantModel, - Merchant, - MerchantDateSlot, - MerchantLegal, - MerchantSchedule, - MerchantWeekdaySlot, -} from '@spryker-oryx/merchant'; - -function normalizeSchedule( - hours: ApiMerchantModel.Schedule -): MerchantSchedule | undefined { - if (!hours) return undefined; - - const weekdays: MerchantWeekdaySlot[] = []; - for (const entry of hours.weekdaySchedule) { - let dayEntry = weekdays.find((day) => day.day === entry.day?.toLowerCase()); - if (!dayEntry) { - dayEntry = { day: entry.day.toLowerCase() }; - weekdays.push(dayEntry); - } - if (entry.timeFrom && entry.timeTo) { - if (!dayEntry.times) dayEntry.times = []; - dayEntry.times.push({ from: entry.timeFrom, to: entry.timeTo }); - } - } - - const dates: MerchantDateSlot[] = []; - for (const entry of hours.dateSchedule) { - let dateEntry = dates.find((date) => date.date === entry.date); - if (!dateEntry) { - dateEntry = { - date: entry.date, - note: entry.noteGlossaryKey, - }; - dates.push(dateEntry); - } - if (entry.timeFrom && entry.timeTo) { - if (!dateEntry.times) dateEntry.times = []; - dateEntry.times.push({ from: entry.timeFrom, to: entry.timeTo }); - } - } - - return { weekdays, dates }; -} - -function normalizeLegal( - data: ApiMerchantModel.MerchantLegal -): MerchantLegal | undefined { - if (!data) return undefined; - - return { - dataPrivacy: data.dataPrivacy, - cancellationPolicy: data.cancellationPolicy, - terms: data.terms?.replace('

    ', '
    '), - imprint: data.imprint, - }; -} - -export function merchantNormalizer( - data: ApiMerchantModel.Merchant -): Merchant | undefined { - if (!data) return; - - return { - id: data.id, - name: data.merchantName, - description: data.description, - url: data.merchantUrl, - deliveryTime: data.deliveryTime, - legal: normalizeLegal(data.legalInformation), - schedule: normalizeSchedule(data.merchantOpeningHours?.[0]), - logo: data.logoUrl, - banner: data.bannerUrl, - contact: { - email: data.publicEmail, - phone: data.publicPhone, - }, - } as Merchant; -} diff --git a/libs/domain/merchant/services/src/adapter/normalizers/models.ts b/libs/domain/merchant/services/src/adapter/normalizers/models.ts deleted file mode 100644 index ab02f6b3c..000000000 --- a/libs/domain/merchant/services/src/adapter/normalizers/models.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { CamelCase } from '@spryker-oryx/core/utilities'; -import { ApiMerchantModel } from '@spryker-oryx/merchant'; -import { DeserializedProduct } from '@spryker-oryx/product'; - -export type DeserializedMerchantProductIncludes = { - [P in ApiMerchantModel.Includes as `${CamelCase

    }`]?: P extends ApiMerchantModel.Includes.ProductOffers - ? ApiMerchantModel.ProductOffer[] - : never; -}; - -export type DeserializedMerchantProduct = DeserializedProduct & - Pick< - DeserializedMerchantProductIncludes, - CamelCase - >; diff --git a/libs/domain/merchant/services/src/adapter/normalizers/offer.normalizer.ts b/libs/domain/merchant/services/src/adapter/normalizers/offer.normalizer.ts deleted file mode 100644 index a85757d26..000000000 --- a/libs/domain/merchant/services/src/adapter/normalizers/offer.normalizer.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { TransformerService } from '@spryker-oryx/core'; -import { - ApiMerchantModel, - MerchantNormalizer, - ProductOffer, -} from '@spryker-oryx/merchant'; -import { AvailabilityNormalizer, PriceNormalizer } from '@spryker-oryx/product'; -import { Observable, map } from 'rxjs'; - -export function offerNormalizer( - data: ApiMerchantModel.ProductOffer -): ProductOffer { - return { - id: data.id, - isDefault: data.isDefault, - } as ProductOffer; -} - -export function offerPriceNormalizer( - data: ApiMerchantModel.ProductOffer, - transformer: TransformerService -): Observable> { - return transformer - .transform(data.productOfferPrices?.[0], PriceNormalizer) - .pipe(map((price) => ({ price }))); -} - -export function offerAvailabilityNormalizer( - data: ApiMerchantModel.ProductOffer, - transformer: TransformerService -): Observable> { - return transformer - .transform(data.productOfferAvailabilities?.[0], AvailabilityNormalizer) - .pipe(map((availability) => ({ availability }))); -} - -export function offerMerchantNormalizer( - data: ApiMerchantModel.ProductOffer, - transformer: TransformerService -): Observable> { - return transformer - .transform(data.merchants?.[0], MerchantNormalizer) - .pipe(map((merchant) => ({ merchant }))); -} diff --git a/libs/domain/merchant/services/src/default-merchant.service.spec.ts b/libs/domain/merchant/services/src/default-merchant.service.spec.ts deleted file mode 100644 index 112ab9278..000000000 --- a/libs/domain/merchant/services/src/default-merchant.service.spec.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { DefaultQueryService, QueryService } from '@spryker-oryx/core'; -import { createInjector, destroyInjector } from '@spryker-oryx/di'; -import { - MerchantAdapter, - MerchantQualifier, - MerchantService, - merchantQueries, -} from '@spryker-oryx/merchant'; -import { Observable, of, switchMap, take } from 'rxjs'; -import { SpyInstance } from 'vitest'; -import { DefaultMerchantService } from './default-merchant.service'; - -class MockMerchantAdapter implements Partial { - get = vi - .fn() - .mockImplementation((qualifier: MerchantQualifier) => - of({ name: `adapter ${qualifier.id}` }) - ); -} - -describe('DefaultMerchantService', () => { - let service: MerchantService; - let adapter: MerchantAdapter; - - beforeEach(() => { - const testInjector = createInjector({ - providers: [ - { - provide: MerchantService, - useClass: DefaultMerchantService, - }, - { - provide: MerchantAdapter, - useClass: MockMerchantAdapter, - }, - { - provide: QueryService, - useClass: DefaultQueryService, - }, - ...merchantQueries, - ], - }); - - service = testInjector.inject(MerchantService); - adapter = testInjector.inject(MerchantAdapter); - }); - - afterEach(() => { - destroyInjector(); - }); - - it('should be provided', () => { - expect(service).toBeInstanceOf(DefaultMerchantService); - }); - - describe('get', () => { - it('should return an observable', () => { - expect(service.get({})).toBeInstanceOf(Observable); - }); - - it('should return an observable with a merchant from adapter', () => { - const callback = vi.fn(); - service.get({ id: '123' }).subscribe(callback); - expect(callback).toHaveBeenCalledWith( - expect.objectContaining({ name: 'adapter 123' }) - ); - }); - - it('should call `get` method of adapter only for getting new merchant', () => { - service.get({ id: '123' }).pipe(take(1)).subscribe(); - expect(adapter.get).toHaveBeenCalledTimes(1); - service.get({ id: '123' }).pipe(take(1)).subscribe(); - expect(adapter.get).toHaveBeenCalledTimes(1); - service.get({ id: '124' }).pipe(take(1)).subscribe(); - expect(adapter.get).toHaveBeenCalledTimes(2); - }); - - it('should return an observable with undefined if error has been caught', () => { - (adapter.get as unknown as SpyInstance).mockReturnValue( - of(null).pipe( - switchMap(() => { - throw new Error('error'); - }) - ) - ); - const callback = vi.fn(); - service.get({}).subscribe(callback); - expect(callback).toHaveBeenCalledWith(undefined); - }); - }); - - describe('getState', () => { - it('should return an observable', () => { - expect(service.getState({})).toBeInstanceOf(Observable); - }); - - it('should return an observable with a merchant state from adapter', () => { - const callback = vi.fn(); - service.getState({ id: '123' }).subscribe(callback); - expect(callback).toHaveBeenCalledWith( - expect.objectContaining({ data: { name: 'adapter 123' } }) - ); - }); - - it('should call `get` method of adapter only for getting new merchant state', () => { - service.getState({ id: '123' }).pipe(take(1)).subscribe(); - expect(adapter.get).toHaveBeenCalledTimes(1); - service.getState({ id: '123' }).pipe(take(1)).subscribe(); - expect(adapter.get).toHaveBeenCalledTimes(1); - service.getState({ id: '124' }).pipe(take(1)).subscribe(); - expect(adapter.get).toHaveBeenCalledTimes(2); - }); - - it('should return an observable with error state if error has been caught', () => { - const testError = new Error('test error'); - (adapter.get as unknown as SpyInstance).mockReturnValue( - of(null).pipe( - switchMap(() => { - throw testError; - }) - ) - ); - const callback = vi.fn(); - service.getState({}).subscribe(callback); - expect(callback).toHaveBeenCalledWith( - expect.objectContaining({ data: undefined, error: testError }) - ); - }); - }); -}); diff --git a/libs/domain/merchant/services/src/default-merchant.service.ts b/libs/domain/merchant/services/src/default-merchant.service.ts deleted file mode 100644 index 3f7cb7f5e..000000000 --- a/libs/domain/merchant/services/src/default-merchant.service.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { injectQuery, QueryState } from '@spryker-oryx/core'; -import { - Merchant, - MerchantListQualifier, - MerchantListQuery, - MerchantQualifier, - MerchantQuery, - MerchantService, -} from '@spryker-oryx/merchant'; -import { Observable } from 'rxjs'; - -export class DefaultMerchantService implements MerchantService { - protected merchantQuery = injectQuery( - MerchantQuery - ); - protected merchantListQuery = injectQuery( - MerchantListQuery - ); - - get(qualifier: MerchantQualifier): Observable { - return this.merchantQuery.get(qualifier); - } - - getList(qualifier?: MerchantQualifier): Observable { - return this.merchantListQuery.get(qualifier); - } - - getState(qualifier: MerchantQualifier): Observable> { - return this.merchantQuery.getState(qualifier); - } -} diff --git a/libs/domain/merchant/services/src/index.ts b/libs/domain/merchant/services/src/index.ts deleted file mode 100644 index 36cb3906c..000000000 --- a/libs/domain/merchant/services/src/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './adapter'; -export * from './default-merchant.service'; -export * from './product'; -export * from './resolvers'; diff --git a/libs/domain/merchant/services/src/product/index.ts b/libs/domain/merchant/services/src/product/index.ts deleted file mode 100644 index a369025a6..000000000 --- a/libs/domain/merchant/services/src/product/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './product.normalizer'; diff --git a/libs/domain/merchant/services/src/product/product.normalizer.ts b/libs/domain/merchant/services/src/product/product.normalizer.ts deleted file mode 100644 index dc18ab6d6..000000000 --- a/libs/domain/merchant/services/src/product/product.normalizer.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { TransformerService } from '@spryker-oryx/core'; -import { ApiMerchantModel, OfferNormalizer } from '@spryker-oryx/merchant'; -import { Product } from '@spryker-oryx/product'; -import { Observable, combineLatest, map, of } from 'rxjs'; -import { DeserializedMerchantProduct } from '../adapter'; - -export function productOfferNormalizer( - data: DeserializedMerchantProduct, // source - transformer: TransformerService -): Observable> { - const offers = data.productOffers as any as ApiMerchantModel.ProductOffer[]; - - if (!offers?.length) return of({}); - - return combineLatest( - offers.map((offer) => transformer.transform(offer, OfferNormalizer)) - ).pipe( - map((offers) => { - const defaultOffer = offers.find((offer) => offer.isDefault); - const price = defaultOffer?.price; - return { offers, ...(price ? { price } : {}) }; - }) - ); -} diff --git a/libs/domain/merchant/services/src/resolvers/index.ts b/libs/domain/merchant/services/src/resolvers/index.ts deleted file mode 100644 index b5ffd2291..000000000 --- a/libs/domain/merchant/services/src/resolvers/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './offer.resolver'; diff --git a/libs/domain/merchant/services/src/resolvers/offer.resolver.ts b/libs/domain/merchant/services/src/resolvers/offer.resolver.ts deleted file mode 100644 index 70198e4d0..000000000 --- a/libs/domain/merchant/services/src/resolvers/offer.resolver.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { - BaseResolver, - ContextService, - ResolvedResult, - Resolver, - TokenResolverOptions, -} from '@spryker-oryx/core'; -import { inject } from '@spryker-oryx/di'; -import { - PRODUCT, - ProductQualifier, - ProductService, -} from '@spryker-oryx/product'; -import { Observable, map, switchMap } from 'rxjs'; - -export type OfferResolvers = { - OFFERS: Resolver; -}; - -export class OfferResolver extends BaseResolver { - protected contextService = inject(ContextService); - protected productService = inject(ProductService); - - protected resolvers = { - OFFERS: (options?: TokenResolverOptions): Observable => { - return this.contextService - .get(options?.contextElement ?? null, PRODUCT) - .pipe( - switchMap((qualifier) => this.productService.get(qualifier!)), - map((product) => (product?.offers ?? []).length > 1) - ); - }, - }; -} diff --git a/libs/domain/merchant/src/components.ts b/libs/domain/merchant/src/components.ts deleted file mode 100644 index f1d8f99a1..000000000 --- a/libs/domain/merchant/src/components.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from '../offer-list/offer-list.def'; -export * from '../offer/offer.def'; -export * from '../schedule/schedule.def'; diff --git a/libs/domain/merchant/src/entity.ts b/libs/domain/merchant/src/entity.ts deleted file mode 100644 index 28d902e4b..000000000 --- a/libs/domain/merchant/src/entity.ts +++ /dev/null @@ -1 +0,0 @@ -export const MERCHANT = 'merchant'; diff --git a/libs/domain/merchant/src/feature.ts b/libs/domain/merchant/src/feature.ts deleted file mode 100644 index 8621f1973..000000000 --- a/libs/domain/merchant/src/feature.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { AppFeature } from '@spryker-oryx/core'; -import * as components from './components'; -import { merchantProductProviders } from './product/providers'; -import { merchantProviders } from './services'; -export * from './components'; - -export const merchantComponents = Object.values(components); - -export const merchantFeature: AppFeature = { - providers: [...merchantProviders, ...merchantProductProviders], - components: merchantComponents, -}; diff --git a/libs/domain/merchant/src/index.ts b/libs/domain/merchant/src/index.ts deleted file mode 100644 index 680b6dd02..000000000 --- a/libs/domain/merchant/src/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './entity'; -export * from './feature'; -export * from './mixins'; -export * from './models'; -export * from './presets'; -export * from './product'; -export * from './services'; diff --git a/libs/domain/merchant/src/mixins/index.ts b/libs/domain/merchant/src/mixins/index.ts deleted file mode 100644 index af8cb076a..000000000 --- a/libs/domain/merchant/src/mixins/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './merchant.mixin'; diff --git a/libs/domain/merchant/src/mixins/merchant.mixin.ts b/libs/domain/merchant/src/mixins/merchant.mixin.ts deleted file mode 100644 index 46436e046..000000000 --- a/libs/domain/merchant/src/mixins/merchant.mixin.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { ContextController, ContextService } from '@spryker-oryx/core'; -import { resolve } from '@spryker-oryx/di'; -import { - Signal, - Type, - computed, - signal, - signalAware, -} from '@spryker-oryx/utilities'; -import { LitElement } from 'lit'; -import { MERCHANT } from '../entity'; -import { Merchant, MerchantQualifier } from '../models'; -import { MerchantService } from '../services'; - -export declare class MerchantMixinInterface { - protected contextController: ContextController; - - protected $merchant: Signal; - protected $merchantMinimal: Signal; -} - -export const MerchantMixinInternals = Symbol('MerchantMixinInternals'); - -export const MerchantMixin = >( - superClass: T -): Type & T => { - @signalAware() - class MerchantMixinClass extends superClass { - protected [MerchantMixinInternals] = { - merchantService: resolve(MerchantService), - contextService: resolve(ContextService), - }; - - protected $merchantContext = signal( - this[MerchantMixinInternals].contextService.get( - this, - MERCHANT - ) - ); - - protected $merchant = computed(() => { - const qualifier = this.$merchantContext(); - return qualifier - ? this[MerchantMixinInternals].merchantService?.get(qualifier) - : undefined; - }); - } - return MerchantMixinClass as unknown as Type & T; -}; diff --git a/libs/domain/merchant/src/mocks/feature.ts b/libs/domain/merchant/src/mocks/feature.ts deleted file mode 100644 index 88617758d..000000000 --- a/libs/domain/merchant/src/mocks/feature.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { AppFeature, provideEntity } from '@spryker-oryx/core'; -import { - MERCHANT, - MerchantService, - merchantComponents, -} from '@spryker-oryx/merchant'; -import { ProductService } from '@spryker-oryx/product'; -import { MockMerchantService } from './merchant.service'; -import { MockMerchantProductService } from './product.service'; - -export const mockMerchantFeature: AppFeature = { - components: merchantComponents, - providers: [ - { - provide: MerchantService, - useClass: MockMerchantService, - }, - { - provide: ProductService, - useClass: MockMerchantProductService, - }, - provideEntity(MERCHANT, { - service: MerchantService, - }), - ], -}; diff --git a/libs/domain/merchant/src/mocks/index.ts b/libs/domain/merchant/src/mocks/index.ts deleted file mode 100644 index 3220b079f..000000000 --- a/libs/domain/merchant/src/mocks/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './feature'; -export * from './merchant.service'; -export * from './product.service'; diff --git a/libs/domain/merchant/src/mocks/merchant.service.ts b/libs/domain/merchant/src/mocks/merchant.service.ts deleted file mode 100644 index da6ea3910..000000000 --- a/libs/domain/merchant/src/mocks/merchant.service.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { Observable, of } from 'rxjs'; -import { Merchant, MerchantQualifier } from '../models'; -import { MerchantService } from '../services'; - -export class MockMerchantService implements Partial { - static mockMerchants: Partial[] = [ - { - id: '1', - name: 'Merchant 1', - banner: - 'https://d2s0ynfc62ej12.cloudfront.net/merchant/sonyexperts-banner.png', - url: 'https://www.foobarbrand.com', - contact: { - phone: '+49 111 222 333', - email: 'info@foobarbrand.com', - }, - schedule: { - weekdays: [ - { - day: 'monday', - times: [ - { from: '07:00:00.000000', to: '13:00:00.000000' }, - { from: '14:00:00.000000', to: '20:00:00.000000' }, - ], - }, - { - day: 'tuesday', - times: [{ from: '07:00:00.000000', to: '20:00:00.000000' }], - }, - { - day: 'wednesday', - times: [{ from: '07:00:00.000000', to: '20:00:00.000000' }], - }, - { - day: 'thursday', - times: [{ from: '07:00:00.000000', to: '20:00:00.000000' }], - }, - { - day: 'friday', - times: [{ from: '07:00:00.000000', to: '20:00:00.000000' }], - }, - { - day: 'saturday', - times: [{ from: '07:00:00.000000', to: '20:00:00.000000' }], - }, - { - day: 'sunday', - }, - ], - dates: [ - { - date: '2023-11-28', - // "note": "Sunday Opening", - times: [{ from: '13:00:00.000000', to: '18:00:00.000000' }], - }, - { - date: '2023-12-31', - times: [ - { from: '10:00:00.000000', to: '12:00:00.000000' }, - { from: '13:00:00.000000', to: '16:00:00.000000' }, - ], - }, - - { - date: '2024-01-01', - // "note": "New Year's Day" - }, - { - date: '2024-04-10', - // "note": "Good Friday" - }, - { - date: '2024-04-12', - // "note": "Easter Sunday" - }, - { - date: '2024-04-13', - // "note": "Easter Monday" - }, - { - date: '2024-05-01', - // "note": "May Day" - }, - { - date: '2024-05-21', - // "note": "Ascension of Christ" - }, - { - date: '2024-05-31', - // "note": "Whit Sunday" - }, - { - date: '2024-06-01', - // "note": "Whit Monday" - }, - { - date: '2024-06-11', - // "note": "Corpus Christi" - }, - { - date: '2024-10-03', - // "note": "Day of German unity" - }, - { - date: '2024-11-01', - // "note": "All Saints' Day" - }, - { - date: '2024-12-25', - // "note": "1st Christmas day" - }, - { - date: '2024-12-26', - // "note": "2nd Christmas day" - }, - ], - }, - }, - ]; - - get(qualifier: MerchantQualifier): Observable { - const merchant = MockMerchantService.mockMerchants.find( - (m) => m.id === qualifier.id - ) as Merchant; - - return of(merchant); - } -} diff --git a/libs/domain/merchant/src/mocks/product.service.ts b/libs/domain/merchant/src/mocks/product.service.ts deleted file mode 100644 index 5ca39ee7f..000000000 --- a/libs/domain/merchant/src/mocks/product.service.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { Product, ProductQualifier } from '@spryker-oryx/product'; - -import { MockProductService } from '@spryker-oryx/product/mocks'; -import { Observable, of } from 'rxjs'; -import { productForOfferTransform } from '../product'; - -export class MockMerchantProductService extends MockProductService { - static mockMerchantProducts: Product[] = [ - { - sku: 'mp-1', - price: { - defaultPrice: { value: 1879, isNet: true, currency: 'EUR' }, - originalPrice: { value: 1779, isNet: true, currency: 'EUR' }, - }, - offers: [ - { - id: 'offer-1', - merchant: { - id: 'MER000005', - name: 'Budget Cameras', - deliveryTime: '1-3 days', - }, - price: { - defaultPrice: { value: 1579, isNet: true, currency: 'EUR' }, - }, - }, - { - id: 'offer-2', - merchant: { - id: 'MER000005', - name: 'Video King', - }, - price: { - defaultPrice: { value: 1879, isNet: true, currency: 'EUR' }, - }, - availability: { - quantity: 5, - }, - }, - { - id: 'offer-3', - merchant: { - id: 'MER000005', - name: 'Sony', - deliveryTime: '2-4 days', - }, - price: { - defaultPrice: { value: 1279, isNet: true, currency: 'EUR' }, - }, - availability: { - isNeverOutOfStock: true, - }, - }, - ], - }, - { - sku: 'mp-2', - price: { - defaultPrice: { value: 1879, isNet: true, currency: 'EUR' }, - }, - availability: { - isNeverOutOfStock: true, - quantity: 0, - availability: false, - }, - offers: [ - { - id: 'offer-2', - merchant: { - id: 'MER000005', - name: 'Video King', - deliveryTime: '2-4 days', - }, - price: { - defaultPrice: { - value: 1879, - isNet: true, - currency: 'EUR', - }, - }, - }, - ], - }, - ]; - - get(qualifier: ProductQualifier): Observable { - const product = MockMerchantProductService.mockMerchantProducts.find( - (p) => p.sku === qualifier.sku - ) as Product; - - if (!product) return super.get(qualifier); - - return of(productForOfferTransform(product, qualifier) as Product); - } -} diff --git a/libs/domain/merchant/src/models/index.ts b/libs/domain/merchant/src/models/index.ts deleted file mode 100644 index 809d569ae..000000000 --- a/libs/domain/merchant/src/models/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './merchant.model'; -export * from './merchant.model.api'; -export * from './offer.model'; diff --git a/libs/domain/merchant/src/models/merchant.model.api.ts b/libs/domain/merchant/src/models/merchant.model.api.ts deleted file mode 100644 index 24adca72a..000000000 --- a/libs/domain/merchant/src/models/merchant.model.api.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { ApiProductModel } from '@spryker-oryx/product'; -import { Price } from '@spryker-oryx/site'; - -export module ApiMerchantModel { - import ProductAvailability = ApiProductModel.ProductAvailability; - - export interface Merchant { - id: string; - merchantName: string; - description: string; - merchantUrl: string; - deliveryTime: string; - legalInformation: MerchantLegal; - merchantOpeningHours: Schedule[]; - logoUrl: string; - bannerUrl: string; - publicEmail: string; - publicPhone: string; - } - - export interface MerchantLegal { - cancellationPolicy?: string; - terms?: string; - dataPrivacy?: string; - imprint?: string; - } - - export interface Schedule { - weekdaySchedule: WeekDaySlot[]; - dateSchedule: DateSlot[]; - } - - interface ScheduleSlot { - timeFrom?: string; - timeTo?: string; - } - - export interface WeekDaySlot extends ScheduleSlot { - day: string; - } - - export interface DateSlot extends ScheduleSlot { - date: string; - noteGlossaryKey?: string; - } - - export interface ProductOffer { - id: string; - isDefault?: boolean; - merchantReference: string; - price?: number; - merchants: Merchant[]; - productOfferPrices: ProductOfferPrice[]; - productOfferAvailabilities: ProductAvailability[]; - } - - export interface ProductOfferPrice { - id: string; - price: number; - prices: Price[]; - } - - export const enum Includes { - ProductOffers = 'product-offers', - ProductOfferPrices = 'product-offer-prices', - ProductOfferAvailabilities = 'product-offer-availabilities', - Merchants = 'merchants', - } -} diff --git a/libs/domain/merchant/src/models/merchant.model.ts b/libs/domain/merchant/src/models/merchant.model.ts deleted file mode 100644 index 762ad89d0..000000000 --- a/libs/domain/merchant/src/models/merchant.model.ts +++ /dev/null @@ -1,70 +0,0 @@ -export interface MerchantQualifier { - id?: string; -} -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface MerchantListQualifier {} - -export interface Merchant { - id: string; - name?: string; - description?: string; - url?: string; - deliveryTime?: string; - schedule?: MerchantSchedule; - /** A url of the logo. */ - logo?: string; - /** A url of the banner. */ - banner?: string; - contact?: { - email?: string; - phone?: string; - fax?: string; - person?: { - name?: string; - salutation?: string; - role?: string; - phone?: string; - }; - }; - legal?: MerchantLegal; -} - -export interface MerchantLegal { - cancellationPolicy?: string; - terms?: string; - dataPrivacy?: string; - imprint?: string; -} - -export interface MerchantSchedule { - weekdays?: MerchantWeekdaySlot[]; - dates?: MerchantDateSlot[]; -} - -export interface MerchantSlot { - times?: TimeRange[]; -} - -export interface MerchantWeekdaySlot extends MerchantSlot { - /** - * The day of the week (e.g. Monday, Tuesday, etc.) - */ - day: string; -} - -export interface MerchantDateSlot extends MerchantSlot { - date: string; - note?: string; -} - -export interface TimeRange { - from: string; - to: string; -} - -export interface MerchantComponentProperties { - /** - * Merchant is a reference to a merchant entity (ID) - */ - merchant?: string; -} diff --git a/libs/domain/merchant/src/models/offer.model.ts b/libs/domain/merchant/src/models/offer.model.ts deleted file mode 100644 index 5c90caaaf..000000000 --- a/libs/domain/merchant/src/models/offer.model.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ProductAvailability, ProductPrices } from '@spryker-oryx/product'; -import { Merchant } from './merchant.model'; - -export interface ProductOffer { - id: string; - isDefault?: boolean; - price: ProductPrices; - merchant: Merchant; - availability?: ProductAvailability; -} diff --git a/libs/domain/merchant/src/presets/index.ts b/libs/domain/merchant/src/presets/index.ts deleted file mode 100644 index cfe287108..000000000 --- a/libs/domain/merchant/src/presets/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './merchant-page'; diff --git a/libs/domain/merchant/src/presets/merchant-page.ts b/libs/domain/merchant/src/presets/merchant-page.ts deleted file mode 100644 index 7ac1847f6..000000000 --- a/libs/domain/merchant/src/presets/merchant-page.ts +++ /dev/null @@ -1,190 +0,0 @@ -import { - ExperienceComponent, - ExperienceDataMergeType, - ObjectFit, -} from '@spryker-oryx/experience'; -import { HeadingTag } from '@spryker-oryx/ui/heading'; -import { IconTypes } from '@spryker-oryx/ui/icon'; - -/** - * Appends the merchant product offers component at the end of the list - */ -export const merchantOffersOnPDP: ExperienceComponent = { - merge: { - selector: 'product-info', - type: ExperienceDataMergeType.Append, - }, - type: 'oryx-composition', - components: { - label: [ - { - type: 'oryx-content-text', - content: { data: { text: 'Product offers' } }, - options: { rules: [{ typography: HeadingTag.H4 }] }, - }, - ], - main: [{ type: 'oryx-merchant-offer-list' }], - }, - options: { - rules: [ - { - hideByRule: 'PRODUCT.!OFFERS', - layout: { - type: 'collapsible', - collapsibleStateKey: 'pdp-merchant-offers', - }, - }, - ], - }, -}; - -export const merchantHeaderNavigation: ExperienceComponent = { - merge: { - selector: 'category-navigation', - type: ExperienceDataMergeType.Append, - }, - type: 'oryx-composition', - options: { rules: [{ layout: { type: 'dropdown' } }] }, - components: { - label: [ - { - type: 'oryx-content-link', - content: { data: { text: 'Merchants' } }, - }, - ], - main: [ - { - type: 'oryx-content-link', - options: { url: '/merchant/MER000001' }, - content: { data: { text: 'Spryker' } }, - }, - { - type: 'oryx-content-link', - options: { url: '/merchant/MER000002' }, - content: { data: { text: 'Video King' } }, - }, - { - type: 'oryx-content-link', - options: { url: '/merchant/MER000005' }, - content: { data: { text: 'Budget Cameras' } }, - }, - { - type: 'oryx-content-link', - options: { url: '/merchant/MER000006' }, - content: { data: { text: 'Sony Experts' } }, - }, - ], - }, -}; - -export const merchantSoldToOnPDP: ExperienceComponent = { - merge: { - selector: 'oryx-product-brand', - type: ExperienceDataMergeType.After, - }, - type: 'oryx-data-text', - options: { - entity: 'merchant', - field: 'name', - link: true, - prefix: 'Sold by: ', - }, -}; - -export const merchantPage: ExperienceComponent = { - id: 'merchant-page-content', - type: 'oryx-composition', - options: { rules: [{ layout: { type: 'list' } }] }, - components: [ - { - type: 'oryx-data-image', - options: { - field: 'banner', - rules: [{ height: '250px', objectFit: ObjectFit.Cover }], - }, - }, - { - type: 'oryx-composition', - options: { - rules: [{ layout: { type: 'split', columnWidthType: 'main' } }], - }, - components: [ - { - type: 'oryx-composition', - options: { rules: [{ layout: { type: 'list' } }] }, - components: [ - { - type: 'oryx-data-text', - options: { - field: 'name', - tag: HeadingTag.H1, - }, - }, - { - type: 'oryx-data-text', - options: { - field: 'description', - }, - }, - { - type: 'oryx-data-text', - options: { field: 'legal.dataPrivacy' }, - }, - { - type: 'oryx-data-text', - options: { - field: 'legal.cancellationPolicy', - }, - }, - { - type: 'oryx-data-text', - options: { field: 'legal.terms' }, - }, - { - type: 'oryx-data-text', - options: { field: 'legal.imprint' }, - }, - ], - }, - { - type: 'oryx-composition', - options: { rules: [{ layout: { type: 'list' } }] }, - components: [ - { - type: 'oryx-data-image', - name: 'logo', - options: { - field: 'logo', - rules: [{ height: '100px' }], - }, - }, - { type: 'oryx-merchant-schedule' }, - { - type: 'oryx-content-text', - content: { - data: { text: 'Contact' }, - }, - options: { - rules: [{ typography: HeadingTag.H3 }], - }, - }, - { - type: 'oryx-data-link', - options: { - field: 'contact.email', - icon: IconTypes.Email, - }, - }, - { - type: 'oryx-data-link', - options: { - field: 'contact.phone', - icon: IconTypes.Phone, - }, - }, - ], - }, - ], - }, - ], -}; diff --git a/libs/domain/merchant/src/product/index.ts b/libs/domain/merchant/src/product/index.ts deleted file mode 100644 index 7e75855be..000000000 --- a/libs/domain/merchant/src/product/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './product.model'; -export * from './query'; diff --git a/libs/domain/merchant/src/product/product.model.ts b/libs/domain/merchant/src/product/product.model.ts deleted file mode 100644 index d79664b9f..000000000 --- a/libs/domain/merchant/src/product/product.model.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ProductOffer } from '../models'; - -declare module '@spryker-oryx/product' { - export interface Product { - offers?: ProductOffer[]; - merchantId?: string; - } -} diff --git a/libs/domain/merchant/src/product/providers.ts b/libs/domain/merchant/src/product/providers.ts deleted file mode 100644 index b60166a0e..000000000 --- a/libs/domain/merchant/src/product/providers.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { FieldsContextSerializer } from '@spryker-oryx/core'; -import { Provider } from '@spryker-oryx/di'; -import { - ProductContextSerializerToken, - ProductNormalizer, - ProductTokenResourceResolverToken, -} from '@spryker-oryx/product'; -import { productOfferQueries } from './query'; - -export const merchantProductProviders: Provider[] = [ - { - provide: ProductNormalizer, - useValue: () => - import('@spryker-oryx/merchant/services').then( - (m) => m.productOfferNormalizer - ), - }, - { - provide: ProductContextSerializerToken, - useFactory: () => new FieldsContextSerializer(['sku', 'offer']), - }, - ...productOfferQueries, - { - provide: ProductTokenResourceResolverToken, - asyncClass: () => - import('@spryker-oryx/merchant/services').then((m) => m.OfferResolver), - }, -]; diff --git a/libs/domain/merchant/src/product/query.ts b/libs/domain/merchant/src/product/query.ts deleted file mode 100644 index 3888a8e86..000000000 --- a/libs/domain/merchant/src/product/query.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { provideQuery, QueryOptions } from '@spryker-oryx/core'; -import { inject } from '@spryker-oryx/di'; -import { - Product, - ProductAdapter, - ProductQualifier, - ProductQuery, - productQueryFactory, -} from '@spryker-oryx/product'; - -/** - * This transform is used to update details (like price) of the product when specific offer is requested. - */ -export function productForOfferTransform( - data: Product, - qualifier: ProductQualifier -): Product | void { - if (data && data.offers?.length) { - const selectedOffer = qualifier.offer - ? data.offers?.find((o) => o.id === qualifier.offer) - : data.offers?.find((o) => o.isDefault); - return { - ...data, - merchantId: selectedOffer?.merchant?.id ?? undefined, - price: selectedOffer?.price ?? data.price, - availability: selectedOffer?.availability ?? data.availability, - }; - } -} - -export function productOfferQueryFactory( - adapter = inject(ProductAdapter) -): QueryOptions { - return { - ...productQueryFactory(adapter), - postTransforms: [productForOfferTransform], - }; -} - -export const productOfferQueries = [ - provideQuery(ProductQuery, productOfferQueryFactory), -]; diff --git a/libs/domain/merchant/src/services/adapter/index.ts b/libs/domain/merchant/src/services/adapter/index.ts deleted file mode 100644 index 3ed75fce6..000000000 --- a/libs/domain/merchant/src/services/adapter/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './merchant-includes'; -export * from './merchant.adapter'; diff --git a/libs/domain/merchant/src/services/adapter/merchant-includes.ts b/libs/domain/merchant/src/services/adapter/merchant-includes.ts deleted file mode 100644 index 412462c55..000000000 --- a/libs/domain/merchant/src/services/adapter/merchant-includes.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { provideIncludes } from '@spryker-oryx/core'; -import { PRODUCT } from '@spryker-oryx/product'; -import { ApiMerchantModel } from '../../models'; - -export const merchantProductIncludes = provideIncludes(PRODUCT, [ - ApiMerchantModel.Includes.ProductOffers, - ApiMerchantModel.Includes.ProductOfferPrices, - ApiMerchantModel.Includes.ProductOfferAvailabilities, - ApiMerchantModel.Includes.Merchants, -]); - -export const merchantIncludes = [...merchantProductIncludes]; diff --git a/libs/domain/merchant/src/services/adapter/merchant.adapter.ts b/libs/domain/merchant/src/services/adapter/merchant.adapter.ts deleted file mode 100644 index ad9a83569..000000000 --- a/libs/domain/merchant/src/services/adapter/merchant.adapter.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Transformer } from '@spryker-oryx/core'; -import { Observable } from 'rxjs'; -import { - Merchant, - MerchantListQualifier, - MerchantQualifier, - ProductOffer, -} from '../../models'; - -export const MerchantAdapter = 'oryx.MerchantAdapter'; -export const MerchantNormalizer = 'oryx.MerchantNormalizer*'; -export const MerchantListNormalizer = 'oryx.MerchantListNormalizer*'; - -export const OfferNormalizer = 'oryx.OfferNormalizer*'; - -export interface MerchantAdapter { - get(qualifier: MerchantQualifier): Observable; - getList(qualifier?: MerchantListQualifier): Observable; -} - -declare global { - interface InjectionTokensContractMap { - [MerchantAdapter]: MerchantAdapter; - [MerchantNormalizer]: Transformer; - [MerchantListNormalizer]: Transformer; - [OfferNormalizer]: Transformer; - } -} diff --git a/libs/domain/merchant/src/services/index.ts b/libs/domain/merchant/src/services/index.ts deleted file mode 100644 index 6f0c4a8e5..000000000 --- a/libs/domain/merchant/src/services/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './adapter'; -export * from './merchant.context'; -export * from './merchant.service'; -export * from './providers'; -export * from './state'; diff --git a/libs/domain/merchant/src/services/jsonld/index.ts b/libs/domain/merchant/src/services/jsonld/index.ts deleted file mode 100644 index 23ea4b1b2..000000000 --- a/libs/domain/merchant/src/services/jsonld/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Provider } from '@spryker-oryx/di'; - -import { ProductOfferJsonLdNormalizers } from '@spryker-oryx/product'; -import { MerchantOffersJsonLdNormalizer } from './offers.jsonld'; - -export * from './model'; -export * from './offers.jsonld'; - -export const merchantJsonLdNormalizers: Provider[] = [ - { - provide: ProductOfferJsonLdNormalizers, - useClass: MerchantOffersJsonLdNormalizer, - }, -]; diff --git a/libs/domain/merchant/src/services/jsonld/model.ts b/libs/domain/merchant/src/services/jsonld/model.ts deleted file mode 100644 index 81277682b..000000000 --- a/libs/domain/merchant/src/services/jsonld/model.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { OfferJSONLD } from '@spryker-oryx/product'; -import { JSONLD } from '@spryker-oryx/site'; - -export interface AggregateOfferJSONLD extends JSONLD { - '@context'?: 'http://schema.org'; - '@type': 'AggregateOffer'; - lowPrice: number | string; // Represents the lowest price among the offers - highPrice: number | string; // Represents the highest price among the offers - priceCurrency: string; // Currency of the prices - availability?: string; // Availability status of the aggregate offer - offerCount: number; // Total count of offers included in the aggregate - offers: OfferJSONLD[]; // Array of individual Offer objects -} diff --git a/libs/domain/merchant/src/services/jsonld/offers.jsonld.ts b/libs/domain/merchant/src/services/jsonld/offers.jsonld.ts deleted file mode 100644 index 4d0859445..000000000 --- a/libs/domain/merchant/src/services/jsonld/offers.jsonld.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { - OfferJSONLD, - OfferJsonLdNormalizer, - Product, -} from '@spryker-oryx/product'; -import { JSONLD } from '@spryker-oryx/site'; -import { Observable, of } from 'rxjs'; -import { ProductOffer } from '../../models'; -import { AggregateOfferJSONLD } from './'; - -export class MerchantOffersJsonLdNormalizer extends OfferJsonLdNormalizer { - transform(product: Product): Observable | undefined> { - if (!product?.offers) return super.transform(product); - - const offerPrices = product.offers.map((offer) => - offer.price.defaultPrice - ? offer.price.defaultPrice.value - : offer.price.originalPrice?.value ?? 0 - ); - - const availability = this.resolveAvailability(product.availability); - return of({ - offers: { - '@type': 'AggregateOffer', - offerCount: product.offers.length, - lowPrice: Math.min(...offerPrices) / 100, - highPrice: Math.max(...offerPrices) / 100, - priceCurrency: product.offers[0].price.defaultPrice?.currency, - availability, - offers: this.resolveOffers(product.offers), - } as AggregateOfferJSONLD, - }); - } - - protected resolveOffers(offers: ProductOffer[]): Partial[] { - return offers.map((offer) => super.mapOffer(offer.price)!); - } -} diff --git a/libs/domain/merchant/src/services/merchant.context.ts b/libs/domain/merchant/src/services/merchant.context.ts deleted file mode 100644 index d32c28bc4..000000000 --- a/libs/domain/merchant/src/services/merchant.context.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { - ContextFallback, - ContextFallbackHandler, - ContextSerializer, - ContextService, - FieldContextSerializer, -} from '@spryker-oryx/core'; -import { Provider, inject } from '@spryker-oryx/di'; -import { - PRODUCT, - ProductQualifier, - ProductService, -} from '@spryker-oryx/product'; -import { RouterService } from '@spryker-oryx/router'; -import { Observable, of, switchMap } from 'rxjs'; -import { MERCHANT } from '../entity'; -import { MerchantQualifier } from '../models'; - -function merchantContextFallbackFactory( - router = inject(RouterService), - context = inject(ContextService), - product = inject(ProductService) -): ContextFallbackHandler { - return ({ element }) => - router.current().pipe( - switchMap((route) => - route.type === MERCHANT - ? of(route.params) - : context.get(element, PRODUCT).pipe( - switchMap((qualifier: ProductQualifier | undefined) => - qualifier ? product.get(qualifier) : of(undefined) - ), - switchMap( - (product) => - context.deserialize( - MERCHANT, - product?.merchantId as string - ) as Observable - ) - ) - ) - ); -} - -export const MerchantContextSerializerToken = `${ContextSerializer}${MERCHANT}`; - -export const merchantContextProviders: Provider[] = [ - { - provide: `${ContextFallback}${MERCHANT}`, - useFactory: merchantContextFallbackFactory, - }, - { - provide: MerchantContextSerializerToken, - useClass: FieldContextSerializer, - }, -]; diff --git a/libs/domain/merchant/src/services/merchant.service.ts b/libs/domain/merchant/src/services/merchant.service.ts deleted file mode 100644 index dbee7b64f..000000000 --- a/libs/domain/merchant/src/services/merchant.service.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { QueryState } from '@spryker-oryx/core'; -import { Observable } from 'rxjs'; -import { Merchant, MerchantListQualifier, MerchantQualifier } from '../models'; - -export interface MerchantService { - get(qualifier: MerchantQualifier): Observable; - getList( - qualifier?: MerchantListQualifier - ): Observable; - getState(qualifier: MerchantQualifier): Observable>; -} - -export const MerchantService = 'oryx.MerchantService'; - -declare global { - interface InjectionTokensContractMap { - [MerchantService]: MerchantService; - } -} diff --git a/libs/domain/merchant/src/services/providers.ts b/libs/domain/merchant/src/services/providers.ts deleted file mode 100644 index 8b3ddb19a..000000000 --- a/libs/domain/merchant/src/services/providers.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { provideEntity } from '@spryker-oryx/core'; -import { Provider } from '@spryker-oryx/di'; -import { provideExperienceData } from '@spryker-oryx/experience'; -import { merchantListNormalizer } from '@spryker-oryx/merchant/services'; -import { MERCHANT } from '../entity'; -import { - merchantHeaderNavigation, - merchantOffersOnPDP, - merchantPage, - merchantSoldToOnPDP, -} from '../presets'; -import { - MerchantAdapter, - MerchantListNormalizer, - MerchantNormalizer, - OfferNormalizer, - merchantIncludes, -} from './adapter'; -import { merchantJsonLdNormalizers } from './jsonld'; -import { merchantContextProviders } from './merchant.context'; -import { MerchantService } from './merchant.service'; -import { merchantQueries, merchantsEffects } from './state'; - -export const merchantProviders: Provider[] = [ - { - provide: OfferNormalizer, - useValue: () => - import('@spryker-oryx/merchant/services').then((m) => m.offerNormalizer), - }, - { - provide: OfferNormalizer, - useValue: () => - import('@spryker-oryx/merchant/services').then( - (m) => m.offerPriceNormalizer - ), - }, - { - provide: OfferNormalizer, - useValue: () => - import('@spryker-oryx/merchant/services').then( - (m) => m.offerAvailabilityNormalizer - ), - }, - { - provide: OfferNormalizer, - useValue: () => - import('@spryker-oryx/merchant/services').then( - (m) => m.offerMerchantNormalizer - ), - }, - { - provide: MerchantAdapter, - asyncClass: () => - import('@spryker-oryx/merchant/services').then( - (m) => m.DefaultMerchantAdapter - ), - }, - { - provide: MerchantService, - asyncClass: () => - import('@spryker-oryx/merchant/services').then( - (m) => m.DefaultMerchantService - ), - }, - { - provide: MerchantNormalizer, - useValue: () => - import('@spryker-oryx/merchant/services').then( - (m) => m.merchantNormalizer - ), - }, - - { - provide: MerchantListNormalizer, - useValue: merchantListNormalizer, - }, - ...merchantQueries, - ...merchantsEffects, - ...merchantIncludes, - ...merchantContextProviders, - provideEntity(MERCHANT, { - service: MerchantService, - }), - provideExperienceData([ - merchantPage, - merchantHeaderNavigation, - merchantOffersOnPDP, - merchantSoldToOnPDP, - ]), - ...merchantJsonLdNormalizers, -]; diff --git a/libs/domain/merchant/src/services/state/effects.ts b/libs/domain/merchant/src/services/state/effects.ts deleted file mode 100644 index b09d524a1..000000000 --- a/libs/domain/merchant/src/services/state/effects.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { provideEffect, QueryService } from '@spryker-oryx/core'; -import { ProductLoaded, ProductsLoaded } from '@spryker-oryx/product'; -import { ProductOffer } from '../../models'; -import { MerchantQuery } from './queries'; - -function setMerchant(query: QueryService, offer: ProductOffer) { - query.getQuery(MerchantQuery)?.set({ - data: offer.merchant, - qualifier: { id: offer.merchant.id }, - }); -} - -export const merchantsEffects = [ - provideEffect([ - ProductsLoaded, - ({ event, query }) => { - event.data?.products?.forEach((product) => - product.offers?.forEach((offer) => setMerchant(query, offer)) - ); - }, - ]), - - provideEffect([ - ProductLoaded, - ({ event, query }) => { - event.data?.offers?.forEach((offer) => setMerchant(query, offer)); - }, - ]), -]; diff --git a/libs/domain/merchant/src/services/state/index.ts b/libs/domain/merchant/src/services/state/index.ts deleted file mode 100644 index 2245aefc9..000000000 --- a/libs/domain/merchant/src/services/state/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './effects'; -export * from './queries'; diff --git a/libs/domain/merchant/src/services/state/queries.ts b/libs/domain/merchant/src/services/state/queries.ts deleted file mode 100644 index 58f3d78d2..000000000 --- a/libs/domain/merchant/src/services/state/queries.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { provideQuery, Query } from '@spryker-oryx/core'; -import { inject } from '@spryker-oryx/di'; -import { LocaleChanged } from '@spryker-oryx/i18n'; -import { - Merchant, - MerchantListQualifier, - MerchantQualifier, -} from '../../models'; -import { MerchantAdapter } from '../adapter'; - -export const MerchantQuery = 'oryx.merchantQuery'; -export const MerchantListQuery = 'oryx.merchantListQuery'; - -export type MerchantQuery = Query; -export type MerchantListQuery = Query; - -export const merchantQueries = [ - provideQuery(MerchantQuery, (adapter = inject(MerchantAdapter)) => ({ - loader: (q: MerchantQualifier) => adapter.get(q), - refreshOn: [LocaleChanged], - })), - - provideQuery(MerchantListQuery, (adapter = inject(MerchantAdapter)) => ({ - loader: (q: MerchantListQualifier) => adapter.getList(q), - refreshOn: [LocaleChanged], - })), -]; diff --git a/libs/domain/merchant/tsconfig.lib.json b/libs/domain/merchant/tsconfig.lib.json deleted file mode 100644 index 17f6f12f1..000000000 --- a/libs/domain/merchant/tsconfig.lib.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../tsconfig.lib.json", - "include": ["**/*.ts"] -} diff --git a/libs/domain/merchant/tsconfig.spec.json b/libs/domain/merchant/tsconfig.spec.json deleted file mode 100644 index 3a00f26c7..000000000 --- a/libs/domain/merchant/tsconfig.spec.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../tsconfig.spec.json", - "include": ["**/*.spec.ts"] -} diff --git a/libs/domain/merchant/vitest.config.ts b/libs/domain/merchant/vitest.config.ts deleted file mode 100644 index 9eee1bada..000000000 --- a/libs/domain/merchant/vitest.config.ts +++ /dev/null @@ -1,3 +0,0 @@ -import config from '../../vitest.config'; - -export default config; diff --git a/libs/lerna.json b/libs/lerna.json index 6e1d7546f..67140d8bd 100644 --- a/libs/lerna.json +++ b/libs/lerna.json @@ -23,8 +23,7 @@ "template/themes", "base/ui", "domain/user", - "base/utilities", - "domain/merchant" + "base/utilities" ], "version": "1.4.0", "npmClient": "npm", diff --git a/libs/template/labs/src/feature.ts b/libs/template/labs/src/feature.ts index bc0d43803..90b3d468c 100644 --- a/libs/template/labs/src/feature.ts +++ b/libs/template/labs/src/feature.ts @@ -4,7 +4,6 @@ import { bazaarVoiceComponentMapping } from './bazaarvoice'; import { cloudinaryImageConverter } from './cloudinary'; import * as components from './components'; import { i18nLabsProviders, labsI18nFeature } from './i18n'; -import { merchantBanners } from './merchants'; import { myAccountFeature } from './my-account'; export * from './components'; @@ -27,7 +26,6 @@ export const labsFeatures: AppFeature[] = [ bazaarVoiceComponentMapping, ...articleProviders, ...i18nLabsProviders, - merchantBanners, ], }, ]; diff --git a/libs/template/labs/src/i18n/translations/en.ts b/libs/template/labs/src/i18n/translations/en.ts index 38f01557f..73d2d70e8 100644 --- a/libs/template/labs/src/i18n/translations/en.ts +++ b/libs/template/labs/src/i18n/translations/en.ts @@ -76,13 +76,6 @@ const search = { 'search.facet.rating.up': '& up', }; -const merchant = { - 'merchant.schedule.weekdays': 'Opening hours', - 'merchant.schedule.dates': 'Upcoming dates', - 'merchant.schedule.': '({note})', - 'merchant.schedule.-': '{date} ({note})', -}; - export default { ...product, ...cart, @@ -93,5 +86,4 @@ export default { ...user, ...ui, ...search, - ...merchant, }; diff --git a/libs/template/labs/src/index.ts b/libs/template/labs/src/index.ts index 4a87afe78..78d78a254 100644 --- a/libs/template/labs/src/index.ts +++ b/libs/template/labs/src/index.ts @@ -1,3 +1,2 @@ export * from './articles'; export * from './feature'; -export * from './merchants'; diff --git a/libs/template/labs/src/merchants/index.ts b/libs/template/labs/src/merchants/index.ts deleted file mode 100644 index 133db0ed7..000000000 --- a/libs/template/labs/src/merchants/index.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { Provider } from '@spryker-oryx/di'; -import { - ExperienceComponent, - ExperienceDataMergeType, - provideExperienceData, -} from '@spryker-oryx/experience'; - -const env = import.meta.env; - -const merchantBannersData: ExperienceComponent = { - merge: { - selector: 'brands', - type: ExperienceDataMergeType.After, - }, - type: 'oryx-composition', - components: [ - { - type: 'oryx-data-list', - options: { - entity: 'merchant', - link: true, - rules: [ - { - layout: { type: 'grid' }, - padding: '10px', - background: 'var(--oryx-color-neutral-5)', - }, - ], - }, - components: [ - { type: 'oryx-data-image', options: { field: 'banner' } }, - { type: 'oryx-data-text', options: { field: 'name' } }, - ], - }, - ], - - options: { - rules: [{ layout: { type: 'split' } }], - }, -}; - -export const merchantBanners: Provider = provideExperienceData([ - ...(env.ORYX_MERCHANT ? [merchantBannersData] : []), -]); diff --git a/libs/template/presets/storefront/experience/experience-data.ts b/libs/template/presets/storefront/experience/experience-data.ts index 9a86bcf8e..53d36b978 100644 --- a/libs/template/presets/storefront/experience/experience-data.ts +++ b/libs/template/presets/storefront/experience/experience-data.ts @@ -15,7 +15,6 @@ import { editAddressPage, homePage, loginPage, - merchantPage, orderConfirmationPage, productPage, registrationPage, @@ -39,7 +38,6 @@ export const StaticExperienceFeature: AppFeature = { addressBookPage, createAddressPage, editAddressPage, - merchantPage, ...(featureVersion >= '1.1' ? [registrationPage] : []), ...(featureVersion >= '1.4' ? [cartsPage, cartCreatePage] : []), ]), diff --git a/libs/template/presets/storefront/experience/pages/index.ts b/libs/template/presets/storefront/experience/pages/index.ts index f17dee043..6ca95dcf3 100644 --- a/libs/template/presets/storefront/experience/pages/index.ts +++ b/libs/template/presets/storefront/experience/pages/index.ts @@ -4,7 +4,6 @@ export * from './checkout-page'; export * from './contact-page'; export * from './home-page'; export * from './login-page'; -export * from './merchant-page'; export * from './my-account'; export * from './order-confirmation-page'; export * from './product-page'; diff --git a/libs/template/presets/storefront/experience/pages/merchant-page.ts b/libs/template/presets/storefront/experience/pages/merchant-page.ts deleted file mode 100644 index 1a116a0ae..000000000 --- a/libs/template/presets/storefront/experience/pages/merchant-page.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { ExperienceComponent } from '@spryker-oryx/experience'; -import { Size } from '@spryker-oryx/utilities'; - -export const merchantPage: ExperienceComponent = { - id: 'merchant-page', - type: 'Page', - meta: { - title: 'Merchant', - route: '/merchant/:id', - routeType: 'merchant', - description: 'Default Merchant Page Description', - }, - components: [ - { ref: 'header' }, - - { - type: 'oryx-composition', - - options: { - rules: [ - { - layout: { type: 'list' }, - padding: '30px 0', - }, - ], - }, - - components: [ - { - type: 'oryx-site-breadcrumb', - options: { rules: [{ query: { breakpoint: Size.Sm }, hide: true }] }, - }, - { ref: 'merchant-page-content' }, - ], - }, - { ref: 'footer' }, - ], -}; diff --git a/tsconfig.base.json b/tsconfig.base.json index 77a2b6d7f..76e98a71f 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -133,20 +133,6 @@ "@spryker-oryx/i18n": ["libs/platform/i18n/src/index.ts"], "@spryker-oryx/indexed-db": ["libs/platform/indexed-db/src/index.ts"], "@spryker-oryx/labs": ["libs/template/labs/src/index.ts"], - "@spryker-oryx/merchant": ["libs/domain/merchant/src/index.ts"], - "@spryker-oryx/merchant/mocks": [ - "libs/domain/merchant/src/mocks/index.ts" - ], - "@spryker-oryx/merchant/offer": ["libs/domain/merchant/offer/index.ts"], - "@spryker-oryx/merchant/offer-list": [ - "libs/domain/merchant/offer-list/index.ts" - ], - "@spryker-oryx/merchant/schedule": [ - "libs/domain/merchant/schedule/index.ts" - ], - "@spryker-oryx/merchant/services": [ - "libs/domain/merchant/services/index.ts" - ], "@spryker-oryx/offline": ["libs/platform/offline/src/index.ts"], "@spryker-oryx/offline/mocks": [ "libs/platform/offline/src/mocks/index.ts" diff --git a/workspace.json b/workspace.json index d43e840ae..cd404993c 100644 --- a/workspace.json +++ b/workspace.json @@ -15,7 +15,6 @@ "i18n": "libs/platform/i18n", "indexed-db": "libs/platform/indexed-db", "labs": "libs/template/labs", - "merchant": "libs/domain/merchant", "offline": "libs/platform/offline", "order": "libs/domain/order", "presets": "libs/template/presets",