import { createRandomId } from '../util';
import { Product } from '../../models/product';

export const product: Product = {
  id: createRandomId(),
  imageId: '9783836270236',
  contributors: 'Sascha Kersken',
  name: 'Remission für Fortgeschrittene',
  format: 'HC',
  formatDetail: 'Buch (Kartoniert, Paperback)',
  ean: '2638489561882',
  productGroup: '111',
  productGroupName: 'Krimi/Spannung',
  features: [
    {
      key: 'SOB',
      name: 'Basissortiment',
    },
    {
      key: 'SOE',
      name: 'Extrasortiment',
    },
  ],
  sourcePrice: {
    value: {
      value: 100,
      currency: 'EUR',
      currencySymbol: '€',
    },
    vat: {
      inPercent: 7,
      vatType: 4, // MediumRate = 4,
    },
  },
  sourceProduct: {
    name: 'Remission für Fortgeschrittene',
    ean: '2638489561882',
    contributors: 'Sascha Kersken',
    supplierProductNumber: '123ABC',
    catalogProductNumber: '123XYZ',
    manufacturer: 'Hugendubel',
    format: 'HC',
    formatDetail: 'Buch (Kartoniert, Paperback)',
  },
};

export function removeSourcePriceAndProductFromProduct(prod: Product): Partial<Product> {
  delete prod.sourcePrice;
  delete prod.sourceProduct;

  return prod;
}
