const mongoose = require("mongoose");
const {mongooseConstantValues} = require('../apps/common/systemConstents')
const Schema = mongoose.Schema

const AddressesSchema = mongoose.Schema({
  merchantId: {
    type: Object
  },
  firstName: {
    type: String,
    required: true
  },
  lastName: {
    type: String,
  },
  company: {
    type: String,
  },
  [mongooseConstantValues.CONTACT_NUMBER]:{
    type: Number,
    required: true
  },
  [mongooseConstantValues.BUSINESS_TYPE]:{
    type: String,
    required: true
  },
  [mongooseConstantValues.IS_DEFAULT]:{
    type: Boolean,
    required: true,
  },
  [mongooseConstantValues.ADDRESS_TITLE]:{
    type: String,
    required: true
  },
  address1:{
    type: String,
    required: true
  },
  address2:{
    type: String,
  },
  city:{
    type: String,
    required: true
  },
  province:{
    type: String,
    required: true
  },
  country:{
    type: String,
    required: true
  },
  country_code:{
    type: String,
  },
  province_code:{
    type: String,
  },
  zip:{
    type: String,
    required: true
  },
  sa:{
    type: Object,
  },
});

module.exports = mongoose.model("Addresses", AddressesSchema);
