Operational Endpoints for Admin, Products, Assignments, Location, Vendor, Venue completed. Geofence Testing PEnding

This commit is contained in:
Shibi Chakkaravarthy
2026-06-14 08:04:31 +05:30
parent 5326235183
commit 36e1bf664f
26 changed files with 1392 additions and 25 deletions
BIN
View File
Binary file not shown.
+8
View File
@@ -36,6 +36,14 @@ const schema = new Schema({
type: Date,
required: true,
},
city: {
type: String,
required: true,
},
state: {
type: String,
required: true,
},
});
export default model("access", schema);
+4
View File
@@ -25,6 +25,10 @@ const schema = new Schema({
type: Number,
required: true,
},
hsn: {
type: String,
required: true,
},
stock: {
type: Number,
required: true,
+10 -1
View File
@@ -17,7 +17,16 @@ export const getProductByQuery = async (query) => {
// Read (Get all)
export const getAllProducts = async () => {
return await Model.find();
return await Model.aggregate([
{
$lookup: {
from: "vendors",
localField: "vendors",
foreignField: "_id",
as: "vendors"
}
}
]);
};
// Update
+8
View File
@@ -18,6 +18,8 @@ const moduleSchema = new Schema({
"salary",
"vendor",
"expense",
"venue",
"metadata",
"product",
"invoice",
"partner",
@@ -28,6 +30,12 @@ const moduleSchema = new Schema({
"inventoryLog",
],
},
region: {
type: String,
required: true,
default: "CITY",
enum: ["CITY", "STATE", "COUNTRY"],
},
permission: {
type: String,
required: true,
+4
View File
@@ -30,6 +30,10 @@ const schema = new Schema({
required: true,
ref: "user",
},
isActive: {
type: Boolean,
required: true,
},
});
export default model("user", schema);
+7 -2
View File
@@ -10,10 +10,15 @@ export const getVendorById = async (id) => {
return await Model.findById(id);
};
// Read (Get by Query)
// Read (Get One by Query)
export const getVendorByQuery = async (query) => {
return await Model.findOne(query);
}
};
// Read (Get All by Query)
export const getVendorsByQuery = async (query) => {
return await Model.find(query);
};
// Read (Get all)
export const getAllVendors = async () => {