correcao na organiz
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user