const mongoose = require('mongoose')
const Schema = mongoose.Schema

const customerSchema = new mongoose.Schema({
    merchantId: {
        type: String,
    },
    storeDomain: {
        type: String,
    },
    customerId: {
        type: String,
    },
	password: {
		type: String,
		require: true
	},
	category: {
		type: String,
		default: "b2c"
	},
    email: {
        type: String,
    },
    firstName: {
        type: String
    },
    lastName: {
        type: String
    },
    note: {
        type: String
    },
    phoneNo: {
        type: String
    },
    companyName: {
        type: String
    },
    gstNumber: {
        type: String
    },
    mobileNumber: {
        type: String
    },
    gstData: {},
    isGstVerified: {
        type: Boolean,
        default: false
    },
    isDelete: {
        type: Boolean,
        default: false
    },
    rawData: {
        type: Object,
    },
    loginID: {
        type: String,
    },
    address: {
        type: String
    },
    city: {
        type: String
    },
    state: {
        type: String
    },
    pincode: {
        type: String
    },

    createdAt: { type: Date, default: new Date().toISOString() },
    updatedAt: { type: Date, default: new Date().toISOString() },
},  {
    timestamps: true,
  })

const Customer = mongoose.model('Customer', customerSchema)

module.exports = Customer
