correcao na organiz

This commit is contained in:
2026-04-02 11:53:45 +00:00
parent 3132bb73a2
commit 44aac9ac2d
4 changed files with 49 additions and 33 deletions

View File

@@ -1,9 +1,8 @@
import { StockItem, Instrument, Notification, TechnicalDataSheet } from '../lib/compat.js';
import { INotification } from '../models/Notification.js';
import { addMonths, isBefore } from 'date-fns';
export const notificationService = {
async create(data: Partial<INotification> & { organizationId: string }) {
async create(data: any & { organizationId: string }) {
return await Notification.create(data);
},
@@ -11,14 +10,6 @@ export const notificationService = {
return await Notification.find({ organizationId });
},
async markAsRead(id: string) {
return await Notification.findOneAndUpdate({ id }, { isRead: true });
},
async delete(id: string) {
return await Notification.findByIdAndDelete(id);
},
async checkLowStock(stockItemId: string) {
try {
const item = await StockItem.findById(stockItemId);