feat: implement partner licenses module with pagination and filtering capabilities

This commit is contained in:
2026-04-26 09:54:48 +03:30
parent b72e6c7194
commit 34793295c9
24 changed files with 459 additions and 76 deletions
@@ -20,10 +20,10 @@ export class SalesInvoicesService {
},
}
const pageSize = 10
const perPage = 10
const page = 1
const [items, count] = await this.prisma.$transaction([
const [items, total] = await this.prisma.$transaction([
this.prisma.salesInvoice.findMany({
where: defaultWhere,
select: {
@@ -91,14 +91,14 @@ export class SalesInvoicesService {
},
unknown_customer: true,
},
skip: (page - 1) * pageSize,
take: pageSize,
skip: (page - 1) * perPage,
take: perPage,
}),
this.prisma.salesInvoice.count({
where: defaultWhere,
}),
])
return ResponseMapper.paginate(items, { count, page, pageSize })
return ResponseMapper.paginate(items, { total, page, perPage })
}
findOne(complex_id: string, pos_id: string, id: string) {