| Current Path : /home/deltalab/PMS/partner-manager-backend/models/mongoose/ |
| Current File : //home/deltalab/PMS/partner-manager-backend/models/mongoose/storefront.js |
const mongoose = require('mongoose');
// SCHEMA ============================================
const StorefrontDataSchema = new mongoose.Schema({
username: String,
surname: String,
description: String,
company: String,
whatsapp: String,
facebook: String,
instagram: String,
phone: String,
email: String,
address: String,
website: String,
colour: String,
bgcolour: String,
buybutton: String
});
const StorefrontSchema = new mongoose.Schema(
{
name: String, // this is the unique storefront name provided to SMS
url: String,
location: String,
storefrontData: {
type: StorefrontDataSchema,
},
partnerId: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Partner'
},
},
{
timestamps: true,
versionKey: false,
}
);
// MODELS ============================================
const storefrontModel = mongoose.model('Storefront', StorefrontSchema);
module.exports = {
StorefrontSchema,
storefrontModel
}