import { RepositoryBase } from '@tomei/general'; import { ServiceOrderModel } from '../../models/service-order.entity'; export class ServiceOrderRepository extends RepositoryBase { constructor() { super(ServiceOrderModel); } async findAndCountAll(options?: any) { try { let serviceOrders: any; if (options) { serviceOrders = await ServiceOrderModel.findAndCountAll(options); } else { serviceOrders = await ServiceOrderModel.findAndCountAll(); } return serviceOrders; } catch (error) { throw new Error( `An Error occured when retriving service orders: ${error.message}`, ); } } }