|
|
|
const mongoose = require("mongoose");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Schema = mongoose.Schema;
|
|
|
|
const ObjectId = Schema.Types.ObjectId;
|
|
|
|
|
|
|
|
// Store a random password reset code
|
|
|
|
const code = Math.floor(100000 + Math.random() * 900000);
|
|
|
|
const RoleSchema = new Schema({ name: String });
|
|
|
|
|
|
|
|
|
|
|
|
const tankersSchema = new mongoose.Schema({
|
|
|
|
supplierId: { type: String, default: null },
|
|
|
|
tankerName: { type: String, default: null },
|
|
|
|
phoneNumber: { type: String, default: null },
|
|
|
|
alternative_phoneNumber: { type: String, default: null },
|
|
|
|
typeofwater: [{ typeofwater: String}],
|
|
|
|
price:[{ price: String}],
|
|
|
|
capacity: { type: String},
|
|
|
|
supplier_address: { type: String, default: null },
|
|
|
|
supplier_name : { type: String, default: null },
|
|
|
|
|
|
|
|
// price: {
|
|
|
|
// type: [String],
|
|
|
|
// default: []
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
const tankersbookingSchema = new mongoose.Schema({
|
|
|
|
|
|
|
|
customerId: { type: String, default: null },
|
|
|
|
tankname:{ type: String, default: null },
|
|
|
|
tankLocation:{ type: String, default: null },
|
|
|
|
tankerName: { type: String, default: null },
|
|
|
|
bookingid: { type: String, default: null,unique: true },
|
|
|
|
supplierId:{type: String, default: null},
|
|
|
|
dateOfOrder: { type: String, default: null },
|
|
|
|
date: { type: String, default: null },
|
|
|
|
time: { type: String, default: null },
|
|
|
|
typeofwater: { type: String, default: null },
|
|
|
|
capacity: { type: String, default: null },
|
|
|
|
address: { type: String, default: null },
|
|
|
|
price: { type: String, default: "750" },
|
|
|
|
payment_status : { type: String, default: "due" },
|
|
|
|
orderStatus: { type: String, default: "pending" },
|
|
|
|
delivery_agent : { type: String, default: "null" },
|
|
|
|
delivery_agent_mobile : { type: String, default: "null" },
|
|
|
|
delivery_agent_alternative_mobile : { type: String, default: "null" },
|
|
|
|
|
|
|
|
quantityDelivered: { type: String, default: null},
|
|
|
|
amount_paid: { type: String, default: null },
|
|
|
|
amount_due: { type: String, default: null },
|
|
|
|
payment_mode: { type: String, default: null },
|
|
|
|
remarks : { type: String, default: null }
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
const boreSchema = new mongoose.Schema({
|
|
|
|
customerId: { type: String, default: null },
|
|
|
|
|
|
|
|
boreName: { type: String, default: null },
|
|
|
|
capacity: { type: String, default: null },
|
|
|
|
typeofwater: { type: String, default: null },
|
|
|
|
description: { type: String, default: null },
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
const GovtPipeLineSchema = new mongoose.Schema({
|
|
|
|
customerId: { type: String, default: null },
|
|
|
|
Name: { type: String, default: null },
|
|
|
|
capacity: { type: String, default: null },
|
|
|
|
typeofwater: { type: String, default: null },
|
|
|
|
description: { type: String, default: null },
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Tanker = mongoose.model("Tanker", tankersSchema);
|
|
|
|
const Tankerbooking = mongoose.model("Tankerbooking", tankersbookingSchema);
|
|
|
|
const Bore = mongoose.model("Bore", boreSchema);
|
|
|
|
const GovtPipeLine = mongoose.model("GovtPipeLine", GovtPipeLineSchema);
|
|
|
|
|
|
|
|
|
|
|
|
// Exporting our model objects
|
|
|
|
module.exports = {
|
|
|
|
Tanker, Tankerbooking,Bore,GovtPipeLine
|
|
|
|
}
|