update license structures and setup file storage services

This commit is contained in:
2026-04-16 22:19:20 +03:30
parent d098ef10e1
commit ca494ee82a
75 changed files with 4550 additions and 1255 deletions
@@ -12,11 +12,10 @@ export class PartnerCustomersService {
first_name: true,
last_name: true,
status: true,
license: {
activated_licenses: {
select: {
id: true,
starts_at: true,
status: true,
expires_at: true,
created_at: true,
},
@@ -25,8 +24,14 @@ export class PartnerCustomersService {
}
private defaultWhere = (partner_id: string): ConsumerWhereInput => ({
license: {
partner_id,
activated_licenses: {
some: {
license: {
charged_license_transaction: {
partner_id,
},
},
},
},
})
@@ -48,9 +53,7 @@ export class PartnerCustomersService {
async findOne(partner_id: string, consumer_id: string) {
const partner = await this.prisma.consumer.findUniqueOrThrow({
where: {
license: {
partner_id,
},
...(this.defaultWhere(partner_id) as any),
id: consumer_id,
},
select: this.defaultSelect,