location controller updated with heading and created new models and controllers for remaining modules
This commit is contained in:
@@ -1,6 +1,25 @@
|
||||
import { model, Schema, Types } from "mongoose";
|
||||
import { locationSchema } from "../../helpers";
|
||||
|
||||
const contactPersonSchema = new Schema({
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
email: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
mobile: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
designation: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const schema = new Schema({
|
||||
name: {
|
||||
type: String,
|
||||
@@ -47,6 +66,10 @@ const schema = new Schema({
|
||||
type: Types.ObjectId,
|
||||
required: false,
|
||||
},
|
||||
contactPerson: {
|
||||
type: contactPersonSchema,
|
||||
required: false,
|
||||
},
|
||||
});
|
||||
|
||||
schema.index({ location: "2dsphere" });
|
||||
|
||||
Reference in New Issue
Block a user