import {
  ItemType,
  PriceDTO,
  PriceValueDTO,
  VATValueDTO,
} from '@generated/swagger/checkout-api';
import { PurchaseOption } from './store';
import { OrderTypeFeature } from '@isa/checkout/data-access';

export const PURCHASE_OPTIONS: PurchaseOption[] = [
  'in-store',
  'pickup',
  'delivery',
  'dig-delivery',
  'b2b-delivery',
  'download',
];

export const DELIVERY_PURCHASE_OPTIONS: PurchaseOption[] = [
  'delivery',
  'dig-delivery',
  'b2b-delivery',
];

export const PURCHASE_OPTION_TO_ORDER_TYPE: {
  [purchaseOption: string]: OrderTypeFeature;
} = {
  'in-store': 'Rücklage',
  'pickup': 'Abholung',
  'delivery': 'Versand',
  'dig-delivery': 'Versand',
  'b2b-delivery': 'Versand',
};

export const GIFT_CARD_TYPE = 66560 as ItemType;

export const DEFAULT_PRICE_DTO: PriceDTO = {
  value: { value: undefined },
  vat: { vatType: 0 },
};

export const DEFAULT_PRICE_VALUE: PriceValueDTO = { value: 0, currency: 'EUR' };

export const DEFAULT_VAT_VALUE: VATValueDTO = { value: 0 };

export const GIFT_CARD_MAX_PRICE = 200;

export const PRICE_PATTERN = /^\d+(,\d{1,2})?$/;
