Spaces:
Running
Running
| 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; | |