diff --git a/apps/delivery-options/src/composables/useFeatures.ts b/apps/delivery-options/src/composables/useFeatures.ts index 87fea2e5..c5c23703 100644 --- a/apps/delivery-options/src/composables/useFeatures.ts +++ b/apps/delivery-options/src/composables/useFeatures.ts @@ -1,19 +1,25 @@ import {computed} from 'vue'; import {useMemoize} from '@vueuse/core'; -import {ConfigSetting, PACKAGE_TYPE_DEFAULT} from '@myparcel-do/shared'; +import {ConfigSetting, LimitedPackageTypeName} from '@myparcel-do/shared'; import {useConfigStore} from '../stores'; import {SHOWN_SHIPMENT_OPTIONS} from '../data'; +const PACKAGE_TYPE_DEFAULT = [LimitedPackageTypeName.Package, LimitedPackageTypeName.PackageSmall]; + export const useFeatures = useMemoize(() => { const config = useConfigStore(); - return { availableShipmentOptions: computed(() => { - return PACKAGE_TYPE_DEFAULT === config.packageType ? SHOWN_SHIPMENT_OPTIONS : []; + return PACKAGE_TYPE_DEFAULT.includes(config.packageType as unknown as LimitedPackageTypeName) + ? SHOWN_SHIPMENT_OPTIONS + : []; }), showDeliveryDate: computed(() => { - return PACKAGE_TYPE_DEFAULT === config.packageType && config[ConfigSetting.ShowDeliveryDate]; + return ( + PACKAGE_TYPE_DEFAULT.includes(config.packageType as unknown as LimitedPackageTypeName) && + config[ConfigSetting.ShowDeliveryDate] + ); }), }; }); diff --git a/libs/shared/src/data/enums.ts b/libs/shared/src/data/enums.ts index f6c2db7c..a48c5d85 100644 --- a/libs/shared/src/data/enums.ts +++ b/libs/shared/src/data/enums.ts @@ -115,3 +115,8 @@ export enum CustomDeliveryType { Monday = 'monday', Saturday = 'saturday', } + +export enum LimitedPackageTypeName { + Package = 'package', + PackageSmall = 'package_small', +}