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
+5 -5
View File
@@ -7,16 +7,16 @@ import { CreateDeviceDto, UpdateDeviceDto } from './dto/device.dto'
export class DevicesService {
constructor(private readonly prisma: PrismaService) {}
async findAll(page = 1, pageSize = 10) {
const [items, count] = await this.prisma.$transaction([
async findAll(page = 1, perPage = 10) {
const [items, total] = await this.prisma.$transaction([
this.prisma.device.findMany({
skip: (page - 1) * pageSize,
take: pageSize,
skip: (page - 1) * perPage,
take: perPage,
include: { brand: true },
}),
this.prisma.device.count(),
])
return ResponseMapper.paginate(items, { count, page, pageSize })
return ResponseMapper.paginate(items, { total, page, perPage })
}
async findOne(id: string) {