import Model from "./model.js"; // Create export const createDesignation = async (data) => { return await Model.create(data); }; // Read (Get by ID) export const getDesignationById = async (id) => { return await Model.findById(id); }; // Read (Get by Query) export const getDesignationByQuery = async (query) => { return await Model.findOne(query); } // Read (Get all) export const getAllDesignations = async () => { return await Model.find(); }; // Update export const updateDesignation = async (id, data) => { return await Model.findByIdAndUpdate(id, data, { new: true }); }; // Aggregate export const aggregateDesignation = async (pipeline) => { return await Model.aggregate(pipeline); };