Initialized Project with default middlewares and helpers, connected to Atlas Instance and created Swagger Setup. Created necessary DB models and authentication-authorization logic

This commit is contained in:
Shibi Chakkaravarthy
2026-04-15 02:28:35 +05:30
commit 864e5fae65
71 changed files with 8184 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
import { model, Schema, Types } from "mongoose";
const schema = new Schema({});
export default model("partner", schema);
+31
View File
@@ -0,0 +1,31 @@
import Model from "./model.js";
// Create
export const createPartner = async (data) => {
return await Model.create(data);
};
// Read (Get by ID)
export const getPartnerById = async (id) => {
return await Model.findById(id);
};
// Read (Get by Query)
export const getPartnerByQuery = async (query) => {
return await Model.findOne(query);
}
// Read (Get all)
export const getAllPartners = async () => {
return await Model.find();
};
// Update
export const updatePartner = async (id, data) => {
return await Model.findByIdAndUpdate(id, data, { new: true });
};
// Aggregate
export const aggregatePartner = async (pipeline) => {
return await Model.aggregate(pipeline);
};