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,
|
2026-04-23 20:59:39 +03:30
|
|
|
account_quota_charge_transactions: {
|
|
|
|
|
select: {
|
|
|
|
|
_count: {
|
|
|
|
|
select: {
|
|
|
|
|
allocations: {
|
|
|
|
|
where: {
|
|
|
|
|
license_id: undefined,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-04-13 15:47:59 +03:30
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
return ResponseMapper.single(partner)
|
|
|
|
|
}
|
|
|
|
|
}
|