Your IP : 216.73.216.43


Current Path : /home/deltalab/PMS/buy-button-generator/models/mongoose/
Upload File :
Current File : //home/deltalab/PMS/buy-button-generator/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
}