reinitializing codebase and resuming development

This commit is contained in:
Shibi Chakkaravarthy
2026-09-27 00:48:18 +05:30
parent 5e894627f5
commit be7211ac28
23 changed files with 744 additions and 45 deletions
+31
View File
@@ -0,0 +1,31 @@
import Model from "./model.js";
// Create
export const createApproval = async (data) => {
return await Model.create(data);
};
// Read (Get by ID)
export const getApprovalById = async (id) => {
return await Model.findById(id);
};
// Read (Get by Query)
export const getApprovalByQuery = async (query) => {
return await Model.findOne(query);
}
// Read (Get all)
export const getAllApprovals = async () => {
return await Model.find();
};
// Update
export const updateApproval = async (id, data) => {
return await Model.findByIdAndUpdate(id, data, { new: true });
};
// Aggregate
export const aggregateApproval = async (pipeline) => {
return await Model.aggregate(pipeline);
};