import { translatableModel, strictAddressModel } from 'store/appModels';

const orderListModel = {
  _id: true,
  title: translatableModel,
};

const buyerInfoModel = {
  firstName: true,
  lastName: true,
  email: true,
  company: true,
  vatNumber: true,
  address: strictAddressModel,
};

const orderModel = {
  _id: true,
  lines: {
    productRessource: true,
    productId: true,
    title: true,
    price: true,
    salesPrice: true,
    quantity: true,
    finalPrice: true,
  },
  // localeInfo: {
  //   countryCode: true,
  //   locale: true,
  // },
  currency: true,
  vatExempt: true,
  accountId: true,
  contactInfo: buyerInfoModel,
  billingInfo: buyerInfoModel,
  orderStatus: true,
  paymentIntent: {
    provider: true,
    stripePaymentIntentData: {
      id: true,
      // eslint-disable-next-line
      client_secret: true,
      currency: true,
      customer: true,
      status: true,
    },
  },
  paymentStatus: true,
  paymentInfo: {
    provider: true,
    transactionId: true,
  },
  // deprecated
  finalPrice: true,
  subTotalPrice: true,
  vatPrice: true,
  getBookingInput: {
    durationType: true,
    slot: {
      startDate: true,
      endDate: true,
      startTime: true,
      endTime: true,
    },
    capacity: true,
    comments: true,
    ressourceId: true,
  },
};

export { orderListModel, orderModel };
