Files
psp_api/src/modules/partners/partners.service.ts
T

37 lines
871 B
TypeScript
Raw Normal View History

2026-04-13 15:47:59 +03:30
import { ResponseMapper } from '@/common/response/response-mapper'
import { PrismaService } from '@/prisma/prisma.service'
import { Injectable } from '@nestjs/common'
@Injectable()
export class PartnerService {
constructor(private readonly prisma: PrismaService) {}
async getInfo(partner_id: string) {
const partner = await this.prisma.partner.findUniqueOrThrow({
where: {
id: partner_id,
},
select: {
id: true,
name: true,
status: true,
account_quota_charge_transactions: {
select: {
_count: {
select: {
allocations: {
where: {
license_id: undefined,
},
},
},
},
},
},
2026-04-13 15:47:59 +03:30
},
})
return ResponseMapper.single(partner)
}
}