location updates saved to db and base endpoints for other modules started

This commit is contained in:
Shibi Chakkaravarthy
2026-04-18 04:15:23 +05:30
parent 92769cfd38
commit eb84767d44
12 changed files with 167 additions and 44 deletions
+18 -10
View File
@@ -15,6 +15,22 @@ const schema = new Schema({
type: Date,
required: true,
},
address: {
type: String,
required: true,
},
city: {
type: String,
required: true,
},
state: {
type: String,
required: true,
},
pincode: {
type: String,
required: true,
},
location: locationSchema,
category: {
type: String,
@@ -25,19 +41,11 @@ const schema = new Schema({
type: {
type: String,
required: true,
enum: [
"HQ",
"BRANCH",
"WAREHOUSE",
"VENDOR",
"PARTNER",
"DISTRIBUTOR",
"CLIENT",
],
enum: ["HQ", "BRANCH", "WAREHOUSE"],
},
entity: {
type: Types.ObjectId,
required: true,
required: false,
},
});
+3 -3
View File
@@ -13,11 +13,11 @@ export const getVenueById = async (id) => {
// Read (Get by Query)
export const getVenueByQuery = async (query) => {
return await Model.findOne(query);
}
};
// Read (Get all)
export const getAllVenues = async () => {
return await Model.find();
export const getAllVenues = async (query = {}) => {
return await Model.find(query);
};
// Update