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
@@ -51,16 +51,16 @@ export class PartnerLicenseChargeTransactionService {
},
}
async findAll(partner_id: string, page = 1, pageSize = 10) {
async findAll(partner_id: string, page = 1, perPage = 10) {
const defaultWhere: LicenseChargeTransactionWhereInput = {
partner_id,
}
const [transactions, count] = await this.prisma.$transaction(async tx => [
const [transactions, total] = await this.prisma.$transaction(async tx => [
await tx.licenseChargeTransaction.findMany({
where: defaultWhere,
skip: (page - 1) * pageSize,
take: pageSize,
skip: (page - 1) * perPage,
take: perPage,
select: this.defaultSelect,
}),
await tx.licenseChargeTransaction.count({
@@ -72,8 +72,8 @@ export class PartnerLicenseChargeTransactionService {
return ResponseMapper.paginate(mappedTransactions, {
page,
pageSize,
count,
perPage,
total,
})
}