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
@@ -60,19 +60,19 @@ export class consumerCustomersService {
}
}
async findAll(consumer_id: string, page = 1, pageSize = 10) {
const [customers, count] = await this.prisma.$transaction(async tx => [
async findAll(consumer_id: string, page = 1, perPage = 10) {
const [customers, total] = await this.prisma.$transaction(async tx => [
await tx.customer.findMany({
where: this.defaultWhere(consumer_id),
select: this.defaultSelect,
skip: (page - 1) * pageSize,
skip: (page - 1) * perPage,
take: 10,
}),
await tx.customer.count({
where: this.defaultWhere(consumer_id),
}),
])
return ResponseMapper.paginate(customers, { count, page, pageSize })
return ResponseMapper.paginate(customers, { total, page, perPage })
}
async findOne(consumer_id: string, customer_id: string) {