24 lines
593 B
TypeScript
24 lines
593 B
TypeScript
import { prisma } from '../utils/prisma.js'
|
|
|
|
export const supplierDao = {
|
|
findActiveByIdentification(supplierIdentification: string) {
|
|
return prisma.supplierInfo.findFirst({
|
|
where: { supplierIdentification, deleted: 0 }
|
|
})
|
|
},
|
|
|
|
findActiveBySupplierId(supplierId: string) {
|
|
return prisma.supplierInfo.findFirst({
|
|
where: { supplierId, deleted: 0 }
|
|
})
|
|
},
|
|
|
|
findActiveSuppliers() {
|
|
return prisma.supplierInfo.findMany({
|
|
where: { deleted: 0 },
|
|
select: { supplierId: true, supplierName: true },
|
|
orderBy: { supplierName: 'asc' }
|
|
})
|
|
}
|
|
}
|