From 35830898052bbdd889e90a17323d1962fdced814 Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Fri, 15 May 2020 14:12:44 +0200 Subject: [PATCH] refactor(core): Rename order-merge-strategy config dir to order --- packages/core/src/config/default-config.ts | 4 ++-- packages/core/src/config/index.ts | 2 +- .../merge-orders-strategy.spec.ts | 0 .../{order-merge-strategy => order}/merge-orders-strategy.ts | 2 +- .../{order-merge-strategy => order}/order-merge-strategy.ts | 0 .../use-existing-strategy.spec.ts | 0 .../{order-merge-strategy => order}/use-existing-strategy.ts | 0 .../use-guest-if-existing-empty-strategy.spec.ts | 0 .../use-guest-if-existing-empty-strategy.ts | 0 .../use-guest-strategy.spec.ts | 0 .../{order-merge-strategy => order}/use-guest-strategy.ts | 0 packages/core/src/config/vendure-config.ts | 2 +- .../src/service/helpers/order-merger/order-merger.spec.ts | 2 +- 13 files changed, 6 insertions(+), 6 deletions(-) rename packages/core/src/config/{order-merge-strategy => order}/merge-orders-strategy.spec.ts (100%) rename packages/core/src/config/{order-merge-strategy => order}/merge-orders-strategy.ts (90%) rename packages/core/src/config/{order-merge-strategy => order}/order-merge-strategy.ts (100%) rename packages/core/src/config/{order-merge-strategy => order}/use-existing-strategy.spec.ts (100%) rename packages/core/src/config/{order-merge-strategy => order}/use-existing-strategy.ts (100%) rename packages/core/src/config/{order-merge-strategy => order}/use-guest-if-existing-empty-strategy.spec.ts (100%) rename packages/core/src/config/{order-merge-strategy => order}/use-guest-if-existing-empty-strategy.ts (100%) rename packages/core/src/config/{order-merge-strategy => order}/use-guest-strategy.spec.ts (100%) rename packages/core/src/config/{order-merge-strategy => order}/use-guest-strategy.ts (100%) diff --git a/packages/core/src/config/default-config.ts b/packages/core/src/config/default-config.ts index 9575785dea..6b7a20a613 100644 --- a/packages/core/src/config/default-config.ts +++ b/packages/core/src/config/default-config.ts @@ -12,8 +12,8 @@ import { defaultCollectionFilters } from './collection/default-collection-filter import { AutoIncrementIdStrategy } from './entity-id-strategy/auto-increment-id-strategy'; import { DefaultLogger } from './logger/default-logger'; import { TypeOrmLogger } from './logger/typeorm-logger'; -import { MergeOrdersStrategy } from './order-merge-strategy/merge-orders-strategy'; -import { UseGuestStrategy } from './order-merge-strategy/use-guest-strategy'; +import { MergeOrdersStrategy } from './order/merge-orders-strategy'; +import { UseGuestStrategy } from './order/use-guest-strategy'; import { defaultPromotionActions } from './promotion/default-promotion-actions'; import { defaultPromotionConditions } from './promotion/default-promotion-conditions'; import { defaultShippingCalculator } from './shipping-method/default-shipping-calculator'; diff --git a/packages/core/src/config/index.ts b/packages/core/src/config/index.ts index bd60a1a977..e7c4829b10 100644 --- a/packages/core/src/config/index.ts +++ b/packages/core/src/config/index.ts @@ -15,7 +15,7 @@ export * from './logger/default-logger'; export * from './logger/noop-logger'; export * from './logger/vendure-logger'; export * from './merge-config'; -export * from './order-merge-strategy/order-merge-strategy'; +export * from './order/order-merge-strategy'; export * from './payment-method/example-payment-method-handler'; export * from './payment-method/payment-method-handler'; export * from './promotion/default-promotion-actions'; diff --git a/packages/core/src/config/order-merge-strategy/merge-orders-strategy.spec.ts b/packages/core/src/config/order/merge-orders-strategy.spec.ts similarity index 100% rename from packages/core/src/config/order-merge-strategy/merge-orders-strategy.spec.ts rename to packages/core/src/config/order/merge-orders-strategy.spec.ts diff --git a/packages/core/src/config/order-merge-strategy/merge-orders-strategy.ts b/packages/core/src/config/order/merge-orders-strategy.ts similarity index 90% rename from packages/core/src/config/order-merge-strategy/merge-orders-strategy.ts rename to packages/core/src/config/order/merge-orders-strategy.ts index 074f3f12dc..a93a416b15 100644 --- a/packages/core/src/config/order-merge-strategy/merge-orders-strategy.ts +++ b/packages/core/src/config/order/merge-orders-strategy.ts @@ -25,6 +25,6 @@ export class MergeOrdersStrategy implements OrderMergeStrategy { } private findCorrespondingLine(existingOrder: Order, guestLine: OrderLine): OrderLine | undefined { - return existingOrder.lines.find(line => line.productVariant.id === guestLine.productVariant.id); + return existingOrder.lines.find((line) => line.productVariant.id === guestLine.productVariant.id); } } diff --git a/packages/core/src/config/order-merge-strategy/order-merge-strategy.ts b/packages/core/src/config/order/order-merge-strategy.ts similarity index 100% rename from packages/core/src/config/order-merge-strategy/order-merge-strategy.ts rename to packages/core/src/config/order/order-merge-strategy.ts diff --git a/packages/core/src/config/order-merge-strategy/use-existing-strategy.spec.ts b/packages/core/src/config/order/use-existing-strategy.spec.ts similarity index 100% rename from packages/core/src/config/order-merge-strategy/use-existing-strategy.spec.ts rename to packages/core/src/config/order/use-existing-strategy.spec.ts diff --git a/packages/core/src/config/order-merge-strategy/use-existing-strategy.ts b/packages/core/src/config/order/use-existing-strategy.ts similarity index 100% rename from packages/core/src/config/order-merge-strategy/use-existing-strategy.ts rename to packages/core/src/config/order/use-existing-strategy.ts diff --git a/packages/core/src/config/order-merge-strategy/use-guest-if-existing-empty-strategy.spec.ts b/packages/core/src/config/order/use-guest-if-existing-empty-strategy.spec.ts similarity index 100% rename from packages/core/src/config/order-merge-strategy/use-guest-if-existing-empty-strategy.spec.ts rename to packages/core/src/config/order/use-guest-if-existing-empty-strategy.spec.ts diff --git a/packages/core/src/config/order-merge-strategy/use-guest-if-existing-empty-strategy.ts b/packages/core/src/config/order/use-guest-if-existing-empty-strategy.ts similarity index 100% rename from packages/core/src/config/order-merge-strategy/use-guest-if-existing-empty-strategy.ts rename to packages/core/src/config/order/use-guest-if-existing-empty-strategy.ts diff --git a/packages/core/src/config/order-merge-strategy/use-guest-strategy.spec.ts b/packages/core/src/config/order/use-guest-strategy.spec.ts similarity index 100% rename from packages/core/src/config/order-merge-strategy/use-guest-strategy.spec.ts rename to packages/core/src/config/order/use-guest-strategy.spec.ts diff --git a/packages/core/src/config/order-merge-strategy/use-guest-strategy.ts b/packages/core/src/config/order/use-guest-strategy.ts similarity index 100% rename from packages/core/src/config/order-merge-strategy/use-guest-strategy.ts rename to packages/core/src/config/order/use-guest-strategy.ts diff --git a/packages/core/src/config/vendure-config.ts b/packages/core/src/config/vendure-config.ts index 19660c8d1b..2c23c9d4ee 100644 --- a/packages/core/src/config/vendure-config.ts +++ b/packages/core/src/config/vendure-config.ts @@ -20,7 +20,7 @@ import { CustomFields } from './custom-field/custom-field-types'; import { EntityIdStrategy } from './entity-id-strategy/entity-id-strategy'; import { JobQueueStrategy } from './job-queue/job-queue-strategy'; import { VendureLogger } from './logger/vendure-logger'; -import { OrderMergeStrategy } from './order-merge-strategy/order-merge-strategy'; +import { OrderMergeStrategy } from './order/order-merge-strategy'; import { PaymentMethodHandler } from './payment-method/payment-method-handler'; import { PromotionAction } from './promotion/promotion-action'; import { PromotionCondition } from './promotion/promotion-condition'; diff --git a/packages/core/src/service/helpers/order-merger/order-merger.spec.ts b/packages/core/src/service/helpers/order-merger/order-merger.spec.ts index bcf4dd6a2f..1831e50931 100644 --- a/packages/core/src/service/helpers/order-merger/order-merger.spec.ts +++ b/packages/core/src/service/helpers/order-merger/order-merger.spec.ts @@ -2,7 +2,7 @@ import { Test } from '@nestjs/testing'; import { ConfigService } from '../../../config/config.service'; import { MockConfigService } from '../../../config/config.service.mock'; -import { MergeOrdersStrategy } from '../../../config/order-merge-strategy/merge-orders-strategy'; +import { MergeOrdersStrategy } from '../../../config/order/merge-orders-strategy'; import { Order } from '../../../entity/order/order.entity'; import { createOrderFromLines } from '../../../testing/order-test-utils';