location controller updated with heading and created new models and controllers for remaining modules
This commit is contained in:
+16
-2
@@ -20,10 +20,17 @@ const contactPersonSchema = new Schema({
|
||||
});
|
||||
|
||||
const schema = new Schema({
|
||||
id: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
tags: {
|
||||
type: [String],
|
||||
},
|
||||
createdBy: {
|
||||
type: Types.ObjectId,
|
||||
required: true,
|
||||
@@ -37,7 +44,7 @@ const schema = new Schema({
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
mobile: {
|
||||
phone: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
@@ -57,11 +64,18 @@ const schema = new Schema({
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
gst: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
isActive: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
contactPersons: [contactPersonSchema],
|
||||
contactPersons: {
|
||||
type: [contactPersonSchema],
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
export default model("partner", schema);
|
||||
|
||||
@@ -13,7 +13,12 @@ export const getPartnerById = async (id) => {
|
||||
// Read (Get by Query)
|
||||
export const getPartnerByQuery = async (query) => {
|
||||
return await Model.findOne(query);
|
||||
}
|
||||
};
|
||||
|
||||
// Read (Get all)
|
||||
export const getPartnersByQuery = async (query) => {
|
||||
return await Model.find(query);
|
||||
};
|
||||
|
||||
// Read (Get all)
|
||||
export const getAllPartners = async () => {
|
||||
|
||||
Reference in New Issue
Block a user