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
@@ -48,20 +48,20 @@ export class PartnerLicensesService {
created_at: true,
}
async findAll(page = 1, pageSize = 10) {
const [licenses, count] = await this.prisma.$transaction([
async findAll(page = 1, perPage = 10) {
const [licenses, total] = await this.prisma.$transaction([
this.prisma.licenseActivation.findMany({
select: this.licenseDefaultSelect,
skip: (page - 1) * pageSize,
take: pageSize,
skip: (page - 1) * perPage,
take: perPage,
}),
this.prisma.licenseActivation.count(),
])
return ResponseMapper.paginate(licenses, {
count,
total,
page,
pageSize,
perPage,
})
}