samoulla-backend / models /shippingPriceModel.js
Samoulla Sync Bot
Auto-deploy Samoulla Backend: 8574a71f0fc617aeb1ce9b5e35dac24c5319a12a
59c49c1
raw
history blame contribute delete
971 Bytes
const mongoose = require('mongoose');
const shippingPriceSchema = new mongoose.Schema(
{
bostaCityId: {
type: String,
required: [true, 'Please provide the Bosta City ID'],
},
bostaZoneId: {
type: String,
default: null, // If null, it means it's a general price for the whole governorate
},
type: {
type: String,
enum: ['city', 'zone'],
default: 'city',
},
areaNameAr: {
type: String,
required: [true, 'Area name in Arabic is required'],
},
areaNameEn: {
type: String,
required: [true, 'Area name in English is required'],
},
fees: {
type: Number,
default: 50,
},
deliveryDays: {
type: Number,
default: 3,
},
isActive: {
type: Boolean,
default: true,
},
},
{
timestamps: true,
},
);
const ShippingPrice = mongoose.model('ShippingPrice', shippingPriceSchema);
module.exports = ShippingPrice;