update license structures and setup file storage services
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user