import { addressModel, imageModel, placeModel, seoModel, translatableModel } from 'store/appModels';
import { convertArrayToObject, convertObjectToArray, deepOmit } from 'store/utils/helper';

const workspaceBase = {
  _id: true,
  title: true,
  mainImages: {
    main: imageModel,
    one: imageModel,
    two: imageModel,
    three: imageModel,
    four: imageModel,
  },
  extraImages: imageModel,
  organisationId: true,
  workspaceType: true,
  pricingPerHour: true,
  currency: true,
  maxCapacity: true,
  minStay: true,
  equipmentIds: true,
  featureIds: true,
  finalPrice: true,
  place: placeModel,
  address: addressModel,
  createdBy: true,
  urls: true,
  getOwner: {
    firstName: true,
    lastName: true,
  },
};

const workspaceListModel = {
  ...workspaceBase,
  dist: {
    calculated: true,
    location: {
      type: true,
      coordinates: true,
    },
  },
};

const workspaceModel = {
  ...workspaceBase,
  content: true,
  availability: {
    dates: {
      startDate: true,
      endDate: true,
    },
    noWeekend: true,
    hours: {
      from: true,
      to: true,
    },
    exceptions: {
      dates: {
        startDate: true,
        endDate: true,
      },
      hours: {
        from: true,
        to: true,
      },
      allDay: true,
    },
  },
};

export { workspaceListModel, workspaceModel };
