feat: add response DTOs for various services across modules
- Created response DTOs for ConfigService, AppService, AuthService, CatalogsService, AccountsService, BusinessActivityComplexesService, ComplexPosesService, SalesInvoicesService, BusinessActivitiesService, ConsumerBusinessActivityGoodsService, and others. - Implemented Create, FindAll, FindOne, and Update response types for services in consumer, partners, and POS modules. - Added request DTOs for creating and updating goods in the consumer business activities module. - Introduced filtering DTO for partner licenses. - Enhanced response mapping for partner license activations.
This commit is contained in:
@@ -3,6 +3,7 @@ import { Body, Controller, Get, Param, Patch } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { AccountsService } from './accounts.service'
|
||||
import { UpdateAccountDto } from './dto/account.dto'
|
||||
import type { AccountsServiceFindAllResponseDto, AccountsServiceFindOneResponseDto, AccountsServiceUpdateResponseDto } from './dto/accounts-response.dto'
|
||||
|
||||
@ApiTags('ConsumerAccounts')
|
||||
@Controller('consumer/accounts')
|
||||
@@ -10,12 +11,12 @@ export class AccountsController {
|
||||
constructor(private readonly accountsService: AccountsService) {}
|
||||
|
||||
@Get()
|
||||
async findAll(@TokenAccount('userId') consumerId: string) {
|
||||
async findAll(@TokenAccount('userId') consumerId: string): Promise<AccountsServiceFindAllResponseDto> {
|
||||
return this.accountsService.findAll(consumerId)
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
async findOne(@Param('id') id: string) {
|
||||
async findOne(@Param('id') id: string): Promise<AccountsServiceFindOneResponseDto> {
|
||||
return this.accountsService.findOne(id)
|
||||
}
|
||||
|
||||
@@ -28,7 +29,7 @@ export class AccountsController {
|
||||
// }
|
||||
|
||||
@Patch(':id')
|
||||
async update(@Param('id') id: string, @Body() data: UpdateAccountDto) {
|
||||
async update(@Param('id') id: string, @Body() data: UpdateAccountDto): Promise<AccountsServiceUpdateResponseDto> {
|
||||
return this.accountsService.update(id, data)
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { AccountsService } from '../accounts.service'
|
||||
|
||||
export type AccountsServiceFindAllResponseDto = Awaited<ReturnType<AccountsService['findAll']>>
|
||||
export type AccountsServiceFindOneResponseDto = Awaited<ReturnType<AccountsService['findOne']>>
|
||||
export type AccountsServiceUpdateResponseDto = Awaited<ReturnType<AccountsService['update']>>
|
||||
@@ -0,0 +1,4 @@
|
||||
import type { AccountsService } from '../permissions.service'
|
||||
|
||||
export type AccountsServiceCreateResponseDto = Awaited<ReturnType<AccountsService['create']>>
|
||||
export type AccountsServiceFindAllResponseDto = Awaited<ReturnType<AccountsService['findAll']>>
|
||||
@@ -3,6 +3,7 @@ import { Body, Controller, Get, Param, Put } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { UpdatePermissionDto } from './dto/permission.dto'
|
||||
import { AccountsService } from './permissions.service'
|
||||
import type { AccountsServiceCreateResponseDto, AccountsServiceFindAllResponseDto } from './dto/permissions-response.dto'
|
||||
|
||||
@ApiTags('ConsumerAccountPermissions')
|
||||
@Controller('consumer/accounts/:accountId/permissions')
|
||||
@@ -13,7 +14,7 @@ export class AccountPermissionsController {
|
||||
async findAll(
|
||||
@TokenAccount('userId') userId: string,
|
||||
@Param('accountId') accountId: string,
|
||||
) {
|
||||
): Promise<AccountsServiceFindAllResponseDto> {
|
||||
return this.service.findAll(userId, accountId)
|
||||
}
|
||||
|
||||
@@ -22,7 +23,7 @@ export class AccountPermissionsController {
|
||||
@Param('userId') userId: string,
|
||||
@Param('accountId') accountId: string,
|
||||
@Body() data: UpdatePermissionDto,
|
||||
) {
|
||||
): Promise<AccountsServiceCreateResponseDto> {
|
||||
return this.service.create(userId, accountId, data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ export class AccountsService {
|
||||
complex: {
|
||||
business_activity: {
|
||||
consumer: {
|
||||
consumer_accounts: {
|
||||
accounts: {
|
||||
some: {
|
||||
id: account_id,
|
||||
},
|
||||
@@ -112,9 +112,9 @@ export class AccountsService {
|
||||
const businessActivities = await this.prisma.businessActivity.findMany({
|
||||
where: {
|
||||
consumer: {
|
||||
consumer_accounts: {
|
||||
accounts: {
|
||||
some: {
|
||||
account_id,
|
||||
id: account_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -2,18 +2,19 @@ import { TokenAccount } from '@/common/decorators/tokenInfo.decorator'
|
||||
import { Body, Controller, Get, Param, Patch } from '@nestjs/common'
|
||||
import { BusinessActivitiesService } from './business-activities.service'
|
||||
import { UpdateBusinessActivityDto } from './dto/create-business-activities.dto'
|
||||
import type { BusinessActivitiesServiceFindAllResponseDto, BusinessActivitiesServiceFindOneResponseDto, BusinessActivitiesServiceUpdateResponseDto } from './dto/business-activities-response.dto'
|
||||
|
||||
@Controller('consumer/business_activities')
|
||||
export class BusinessActivitiesController {
|
||||
constructor(private readonly service: BusinessActivitiesService) {}
|
||||
|
||||
@Get()
|
||||
async findAll(@TokenAccount('userId') userId: string) {
|
||||
async findAll(@TokenAccount('userId') userId: string): Promise<BusinessActivitiesServiceFindAllResponseDto> {
|
||||
return this.service.findAll(userId)
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
async findOne(@TokenAccount('userId') userId: string, @Param('id') id: string) {
|
||||
async findOne(@TokenAccount('userId') userId: string, @Param('id') id: string): Promise<BusinessActivitiesServiceFindOneResponseDto> {
|
||||
return this.service.findOne(userId, id)
|
||||
}
|
||||
|
||||
@@ -22,7 +23,7 @@ export class BusinessActivitiesController {
|
||||
@TokenAccount('userId') userId: string,
|
||||
@Param('id') id: string,
|
||||
@Body() data: UpdateBusinessActivityDto,
|
||||
) {
|
||||
): Promise<BusinessActivitiesServiceUpdateResponseDto> {
|
||||
return this.service.update(userId, id, data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,14 @@ import { Module } from '@nestjs/common'
|
||||
import { BusinessActivitiesController } from './business-activities.controller'
|
||||
import { BusinessActivitiesService } from './business-activities.service'
|
||||
import { ConsumerBusinessActivityComplexesModule } from './complexes/complexes.module'
|
||||
import { ConsumerBusinessActivityGoodsModule } from './goods/goods.module'
|
||||
|
||||
@Module({
|
||||
imports: [PrismaModule, ConsumerBusinessActivityComplexesModule],
|
||||
imports: [
|
||||
PrismaModule,
|
||||
ConsumerBusinessActivityComplexesModule,
|
||||
ConsumerBusinessActivityGoodsModule,
|
||||
],
|
||||
controllers: [BusinessActivitiesController],
|
||||
providers: [BusinessActivitiesService],
|
||||
})
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Body, Controller, Get, Param, Patch, Post } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { BusinessActivityComplexesService } from './complexes.service'
|
||||
import { CreateConsumerComplexDto, UpdateConsumerComplexDto } from './dto/complex.dto'
|
||||
import type { BusinessActivityComplexesServiceCreateResponseDto, BusinessActivityComplexesServiceFindAllResponseDto, BusinessActivityComplexesServiceFindOneResponseDto, BusinessActivityComplexesServiceUpdateResponseDto } from './dto/complexes-response.dto'
|
||||
|
||||
@ApiTags('AdminBusinessActivityComplexes')
|
||||
@Controller('consumer/business_activities/:businessActivityId/complexes')
|
||||
@@ -13,7 +14,7 @@ export class BusinessActivityComplexesController {
|
||||
async findAll(
|
||||
@ConsumerInfo('id') consumerId: string,
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
) {
|
||||
): Promise<BusinessActivityComplexesServiceFindAllResponseDto> {
|
||||
return this.service.findAll(consumerId, businessActivityId)
|
||||
}
|
||||
|
||||
@@ -22,7 +23,7 @@ export class BusinessActivityComplexesController {
|
||||
@ConsumerInfo('id') consumerId: string,
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
@Param('id') id: string,
|
||||
) {
|
||||
): Promise<BusinessActivityComplexesServiceFindOneResponseDto> {
|
||||
return this.service.findOne(consumerId, businessActivityId, id)
|
||||
}
|
||||
|
||||
@@ -31,7 +32,7 @@ export class BusinessActivityComplexesController {
|
||||
@ConsumerInfo('id') consumerId: string,
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
@Body() data: CreateConsumerComplexDto,
|
||||
) {
|
||||
): Promise<BusinessActivityComplexesServiceCreateResponseDto> {
|
||||
return this.service.create(consumerId, businessActivityId, data)
|
||||
}
|
||||
|
||||
@@ -41,7 +42,7 @@ export class BusinessActivityComplexesController {
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
@Param('id') id: string,
|
||||
@Body() data: UpdateConsumerComplexDto,
|
||||
) {
|
||||
): Promise<BusinessActivityComplexesServiceUpdateResponseDto> {
|
||||
return this.service.update(consumerId, businessActivityId, id, data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,10 @@ import { PrismaModule } from '@/prisma/prisma.module'
|
||||
import { Module } from '@nestjs/common'
|
||||
import { BusinessActivityComplexesController } from './complexes.controller'
|
||||
import { BusinessActivityComplexesService } from './complexes.service'
|
||||
import { ConsumerComplexGoodsModule } from './goods/goods.module'
|
||||
import { ConsumerComplexPosesModule } from './poses/poses.module'
|
||||
|
||||
@Module({
|
||||
imports: [PrismaModule, ConsumerComplexPosesModule, ConsumerComplexGoodsModule],
|
||||
imports: [PrismaModule, ConsumerComplexPosesModule],
|
||||
controllers: [BusinessActivityComplexesController],
|
||||
providers: [BusinessActivityComplexesService],
|
||||
})
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { BusinessActivityComplexesService } from '../complexes.service'
|
||||
|
||||
export type BusinessActivityComplexesServiceCreateResponseDto = Awaited<ReturnType<BusinessActivityComplexesService['create']>>
|
||||
export type BusinessActivityComplexesServiceFindAllResponseDto = Awaited<ReturnType<BusinessActivityComplexesService['findAll']>>
|
||||
export type BusinessActivityComplexesServiceFindOneResponseDto = Awaited<ReturnType<BusinessActivityComplexesService['findOne']>>
|
||||
export type BusinessActivityComplexesServiceUpdateResponseDto = Awaited<ReturnType<BusinessActivityComplexesService['update']>>
|
||||
@@ -1,51 +0,0 @@
|
||||
import { TokenAccount } from '@/common/decorators/tokenInfo.decorator'
|
||||
import { Body, Controller, Get, Param, Patch, Post } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { CreateGoodDto, UpdateGoodDto } from './dto/good.dto'
|
||||
import { ConsumerComplexGoodsService } from './goods.service'
|
||||
|
||||
@ApiTags('ConsumerComplexGoods')
|
||||
@Controller('consumer/business_activities/:businessActivityId/complexes/:complexId/goods')
|
||||
export class ConsumerComplexGoodsController {
|
||||
constructor(private readonly service: ConsumerComplexGoodsService) {}
|
||||
|
||||
@Get()
|
||||
async findAll(
|
||||
@TokenAccount('userId') userId: string,
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
@Param('complexId') complexId: string,
|
||||
) {
|
||||
return this.service.findAll(userId, businessActivityId, complexId)
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
async findOne(
|
||||
@TokenAccount('userId') userId: string,
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
@Param('complexId') complexId: string,
|
||||
@Param('id') id: string,
|
||||
) {
|
||||
return this.service.findOne(userId, businessActivityId, complexId, id)
|
||||
}
|
||||
|
||||
@Post()
|
||||
async create(@Param('complexId') complexId: string, @Body() data: CreateGoodDto) {
|
||||
return this.service.create(complexId, data)
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
async update(
|
||||
@TokenAccount('userId') userId: string,
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
@Param('complexId') complexId: string,
|
||||
@Param('id') id: string,
|
||||
@Body() data: UpdateGoodDto,
|
||||
) {
|
||||
return this.service.update(userId, businessActivityId, complexId, id, data)
|
||||
}
|
||||
|
||||
// @Delete(':id')
|
||||
// async delete(@Param('id') id: string) {
|
||||
// return this.businessActivityAccountsService.delete(id)
|
||||
// }
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import { PrismaModule } from '@/prisma/prisma.module'
|
||||
import { Module } from '@nestjs/common'
|
||||
import { ConsumerComplexGoodsController } from './goods.controller'
|
||||
import { ConsumerComplexGoodsService } from './goods.service'
|
||||
|
||||
@Module({
|
||||
imports: [PrismaModule],
|
||||
controllers: [ConsumerComplexGoodsController],
|
||||
providers: [ConsumerComplexGoodsService],
|
||||
exports: [ConsumerComplexGoodsService],
|
||||
})
|
||||
export class ConsumerComplexGoodsModule {}
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { ComplexPosesService } from '../poses.service'
|
||||
|
||||
export type ComplexPosesServiceCreateResponseDto = Awaited<ReturnType<ComplexPosesService['create']>>
|
||||
export type ComplexPosesServiceFindAllResponseDto = Awaited<ReturnType<ComplexPosesService['findAll']>>
|
||||
export type ComplexPosesServiceFindOneResponseDto = Awaited<ReturnType<ComplexPosesService['findOne']>>
|
||||
export type ComplexPosesServiceUpdateResponseDto = Awaited<ReturnType<ComplexPosesService['update']>>
|
||||
@@ -3,6 +3,7 @@ import { Body, Controller, Get, Param, Patch, Post } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { CreatePosDto, UpdatePosDto } from './dto/pos.dto'
|
||||
import { ComplexPosesService } from './poses.service'
|
||||
import type { ComplexPosesServiceCreateResponseDto, ComplexPosesServiceFindAllResponseDto, ComplexPosesServiceFindOneResponseDto, ComplexPosesServiceUpdateResponseDto } from './dto/poses-response.dto'
|
||||
|
||||
@ApiTags('ConsumerComplexPoses')
|
||||
@Controller('consumer/business_activities/:businessActivityId/complexes/:complexId/poses')
|
||||
@@ -14,7 +15,7 @@ export class ComplexPosesController {
|
||||
@ConsumerInfo('id') consumerId: string,
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
@Param('complexId') complexId: string,
|
||||
) {
|
||||
): Promise<ComplexPosesServiceFindAllResponseDto> {
|
||||
return this.service.findAll(consumerId, businessActivityId, complexId)
|
||||
}
|
||||
|
||||
@@ -24,7 +25,7 @@ export class ComplexPosesController {
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
@Param('complexId') complexId: string,
|
||||
@Param('id') id: string,
|
||||
) {
|
||||
): Promise<ComplexPosesServiceFindOneResponseDto> {
|
||||
return this.service.findOne(consumerId, businessActivityId, complexId, id)
|
||||
}
|
||||
|
||||
@@ -34,7 +35,7 @@ export class ComplexPosesController {
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
@Param('complexId') complexId: string,
|
||||
@Body() data: CreatePosDto,
|
||||
) {
|
||||
): Promise<ComplexPosesServiceCreateResponseDto> {
|
||||
return this.service.create(consumerId, businessActivityId, complexId, data)
|
||||
}
|
||||
|
||||
@@ -45,7 +46,7 @@ export class ComplexPosesController {
|
||||
@Param('complexId') complexId: string,
|
||||
@Param('id') id: string,
|
||||
@Body() data: UpdatePosDto,
|
||||
) {
|
||||
): Promise<ComplexPosesServiceUpdateResponseDto> {
|
||||
return this.service.update(consumerId, businessActivityId, complexId, id, data)
|
||||
}
|
||||
|
||||
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
import type { SalesInvoicesService } from '../sales-invoices.service'
|
||||
|
||||
export type SalesInvoicesServiceFindAllResponseDto = Awaited<ReturnType<SalesInvoicesService['findAll']>>
|
||||
export type SalesInvoicesServiceFindOneResponseDto = Awaited<ReturnType<SalesInvoicesService['findOne']>>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import type { SalesInvoiceItemsService } from '../sales-invoice-items.service'
|
||||
|
||||
export type SalesInvoiceItemsServiceCreateResponseDto = Awaited<ReturnType<SalesInvoiceItemsService['create']>>
|
||||
export type SalesInvoiceItemsServiceFindAllResponseDto = Awaited<ReturnType<SalesInvoiceItemsService['findAll']>>
|
||||
export type SalesInvoiceItemsServiceFindOneResponseDto = Awaited<ReturnType<SalesInvoiceItemsService['findOne']>>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import type { SalesInvoicePaymentsService } from '../sales-invoice-payments.service'
|
||||
|
||||
export type SalesInvoicePaymentsServiceCreateResponseDto = Awaited<ReturnType<SalesInvoicePaymentsService['create']>>
|
||||
export type SalesInvoicePaymentsServiceFindAllResponseDto = Awaited<ReturnType<SalesInvoicePaymentsService['findAll']>>
|
||||
export type SalesInvoicePaymentsServiceFindOneResponseDto = Awaited<ReturnType<SalesInvoicePaymentsService['findOne']>>
|
||||
+2
-2
@@ -71,7 +71,7 @@ export class SalesInvoicesService {
|
||||
customer: {
|
||||
select: {
|
||||
type: true,
|
||||
customer_individual: {
|
||||
individual: {
|
||||
select: {
|
||||
economic_code: true,
|
||||
first_name: true,
|
||||
@@ -80,7 +80,7 @@ export class SalesInvoicesService {
|
||||
national_id: true,
|
||||
},
|
||||
},
|
||||
customer_legal: {
|
||||
legal: {
|
||||
select: {
|
||||
economic_code: true,
|
||||
postal_code: true,
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { BusinessActivitiesService } from '../business-activities.service'
|
||||
|
||||
export type BusinessActivitiesServiceFindAllResponseDto = Awaited<ReturnType<BusinessActivitiesService['findAll']>>
|
||||
export type BusinessActivitiesServiceFindOneResponseDto = Awaited<ReturnType<BusinessActivitiesService['findOne']>>
|
||||
export type BusinessActivitiesServiceUpdateResponseDto = Awaited<ReturnType<BusinessActivitiesService['update']>>
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { ConsumerBusinessActivityGoodsService } from '../goods.service'
|
||||
|
||||
export type ConsumerBusinessActivityGoodsServiceCreateResponseDto = Awaited<ReturnType<ConsumerBusinessActivityGoodsService['create']>>
|
||||
export type ConsumerBusinessActivityGoodsServiceFindAllResponseDto = Awaited<ReturnType<ConsumerBusinessActivityGoodsService['findAll']>>
|
||||
export type ConsumerBusinessActivityGoodsServiceFindOneResponseDto = Awaited<ReturnType<ConsumerBusinessActivityGoodsService['findOne']>>
|
||||
export type ConsumerBusinessActivityGoodsServiceUpdateResponseDto = Awaited<ReturnType<ConsumerBusinessActivityGoodsService['update']>>
|
||||
@@ -0,0 +1,54 @@
|
||||
import { TokenAccount } from '@/common/decorators/tokenInfo.decorator'
|
||||
import { Body, Controller, Get, Param, Patch, Post } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { CreateGoodDto, UpdateGoodDto } from './dto/good.dto'
|
||||
import { ConsumerBusinessActivityGoodsService } from './goods.service'
|
||||
import type { ConsumerBusinessActivityGoodsServiceCreateResponseDto, ConsumerBusinessActivityGoodsServiceFindAllResponseDto, ConsumerBusinessActivityGoodsServiceFindOneResponseDto, ConsumerBusinessActivityGoodsServiceUpdateResponseDto } from './dto/goods-response.dto'
|
||||
|
||||
@ApiTags('ConsumerBusinessActivityGoods')
|
||||
@Controller('consumer/business_activities/:businessActivityId/goods')
|
||||
export class ConsumerBusinessActivityGoodsController {
|
||||
constructor(private readonly service: ConsumerBusinessActivityGoodsService) {}
|
||||
|
||||
@Get()
|
||||
async findAll(
|
||||
@TokenAccount('userId') consumer_id: string,
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
): Promise<ConsumerBusinessActivityGoodsServiceFindAllResponseDto> {
|
||||
return this.service.findAll(consumer_id, businessActivityId)
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
async findOne(
|
||||
@TokenAccount('userId') consumer_id: string,
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
|
||||
@Param('id') id: string,
|
||||
): Promise<ConsumerBusinessActivityGoodsServiceFindOneResponseDto> {
|
||||
return this.service.findOne(consumer_id, businessActivityId, id)
|
||||
}
|
||||
|
||||
@Post()
|
||||
async create(
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
@Body() data: CreateGoodDto,
|
||||
): Promise<ConsumerBusinessActivityGoodsServiceCreateResponseDto> {
|
||||
return this.service.create(businessActivityId, data)
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
async update(
|
||||
@TokenAccount('userId') consumer_id: string,
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
|
||||
@Param('id') id: string,
|
||||
@Body() data: UpdateGoodDto,
|
||||
): Promise<ConsumerBusinessActivityGoodsServiceUpdateResponseDto> {
|
||||
return this.service.update(consumer_id, businessActivityId, id, data)
|
||||
}
|
||||
|
||||
// @Delete(':id')
|
||||
// async delete(@Param('id') id: string) {
|
||||
// return this.businessActivityAccountsService.delete(id)
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { PrismaModule } from '@/prisma/prisma.module'
|
||||
import { Module } from '@nestjs/common'
|
||||
import { ConsumerBusinessActivityGoodsController } from './goods.controller'
|
||||
import { ConsumerBusinessActivityGoodsService } from './goods.service'
|
||||
|
||||
@Module({
|
||||
imports: [PrismaModule],
|
||||
controllers: [ConsumerBusinessActivityGoodsController],
|
||||
providers: [ConsumerBusinessActivityGoodsService],
|
||||
exports: [ConsumerBusinessActivityGoodsService],
|
||||
})
|
||||
export class ConsumerBusinessActivityGoodsModule {}
|
||||
+17
-33
@@ -5,7 +5,7 @@ import { ResponseMapper } from 'common/response/response-mapper'
|
||||
import { CreateGoodDto, UpdateGoodDto } from './dto/good.dto'
|
||||
|
||||
@Injectable()
|
||||
export class ConsumerComplexGoodsService {
|
||||
export class ConsumerBusinessActivityGoodsService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
defaultSelect: GoodSelect = {
|
||||
@@ -26,16 +26,12 @@ export class ConsumerComplexGoodsService {
|
||||
created_at: true,
|
||||
}
|
||||
|
||||
async findAll(consumer_id: string, business_activity_id: string, complex_id: string) {
|
||||
async findAll(consumer_id: string, business_activity_id: string) {
|
||||
const goods = await this.prisma.good.findMany({
|
||||
where: {
|
||||
complex_id,
|
||||
complex: {
|
||||
id: complex_id,
|
||||
business_activity: {
|
||||
id: business_activity_id,
|
||||
consumer_id,
|
||||
},
|
||||
business_activity: {
|
||||
id: business_activity_id,
|
||||
consumer_id,
|
||||
},
|
||||
},
|
||||
select: this.defaultSelect,
|
||||
@@ -44,20 +40,12 @@ export class ConsumerComplexGoodsService {
|
||||
return ResponseMapper.list(goods)
|
||||
}
|
||||
|
||||
async findOne(
|
||||
consumer_id: string,
|
||||
business_activity_id: string,
|
||||
complex_id: string,
|
||||
id: string,
|
||||
) {
|
||||
async findOne(consumer_id: string, business_activity_id: string, id: string) {
|
||||
const good = await this.prisma.good.findUnique({
|
||||
where: {
|
||||
complex: {
|
||||
id: complex_id,
|
||||
business_activity: {
|
||||
id: business_activity_id,
|
||||
consumer_id,
|
||||
},
|
||||
business_activity: {
|
||||
id: business_activity_id,
|
||||
consumer_id,
|
||||
},
|
||||
id,
|
||||
},
|
||||
@@ -66,15 +54,15 @@ export class ConsumerComplexGoodsService {
|
||||
return ResponseMapper.single(good)
|
||||
}
|
||||
|
||||
async create(complex_id: string, data: CreateGoodDto) {
|
||||
async create(business_activity_id: string, data: CreateGoodDto) {
|
||||
const { category_id, ...rest } = data
|
||||
|
||||
const good = await this.prisma.good.create({
|
||||
data: {
|
||||
...rest,
|
||||
complex: {
|
||||
business_activity: {
|
||||
connect: {
|
||||
id: complex_id,
|
||||
id: business_activity_id,
|
||||
},
|
||||
},
|
||||
category: {
|
||||
@@ -90,26 +78,22 @@ export class ConsumerComplexGoodsService {
|
||||
async update(
|
||||
consumer_id: string,
|
||||
business_activity_id: string,
|
||||
complex_id: string,
|
||||
id: string,
|
||||
data: UpdateGoodDto,
|
||||
) {
|
||||
const { category_id, ...rest } = data
|
||||
const good = await this.prisma.good.update({
|
||||
where: {
|
||||
complex: {
|
||||
id: complex_id,
|
||||
business_activity: {
|
||||
id: business_activity_id,
|
||||
consumer_id,
|
||||
},
|
||||
business_activity: {
|
||||
id: business_activity_id,
|
||||
consumer_id,
|
||||
},
|
||||
id,
|
||||
},
|
||||
data: {
|
||||
complex: {
|
||||
business_activity: {
|
||||
connect: {
|
||||
id: complex_id,
|
||||
id: business_activity_id,
|
||||
},
|
||||
},
|
||||
category: {
|
||||
@@ -2,6 +2,7 @@ import { ConsumerInfo } from '@/common/decorators/consumerInfo.decorator'
|
||||
import { Controller, Get } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { ConsumerService } from './consumer.service'
|
||||
import type { ConsumerServiceGetInfoResponseDto } from './dto/consumer-response.dto'
|
||||
|
||||
@ApiTags('Consumer')
|
||||
@Controller('consumer')
|
||||
@@ -9,7 +10,7 @@ export class ConsumerController {
|
||||
constructor(private service: ConsumerService) {}
|
||||
|
||||
@Get('')
|
||||
async findOne(@ConsumerInfo('id') consumerId: string) {
|
||||
async findOne(@ConsumerInfo('id') consumerId: string): Promise<ConsumerServiceGetInfoResponseDto> {
|
||||
return this.service.getInfo(consumerId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { QUERY_CONSTANTS } from '@/common/queryConstants'
|
||||
import { ResponseMapper } from '@/common/response/response-mapper'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import mapConsumerWithLicenseUtil from './utils/mapConsumerWithLicense.util'
|
||||
import consumer_mappersUtil from '../../common/utils/mappers/consumer_mappers.util'
|
||||
|
||||
@Injectable()
|
||||
export class ConsumerService {
|
||||
@@ -14,13 +15,11 @@ export class ConsumerService {
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
first_name: true,
|
||||
last_name: true,
|
||||
mobile_number: true,
|
||||
status: true,
|
||||
...QUERY_CONSTANTS.CONSUMER.infoSelect,
|
||||
},
|
||||
})
|
||||
|
||||
return ResponseMapper.single(mapConsumerWithLicenseUtil(consumer))
|
||||
return ResponseMapper.single(consumer_mappersUtil(consumer))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ export class consumerCustomersController {
|
||||
constructor(private readonly service: consumerCustomersService) {}
|
||||
|
||||
@Get()
|
||||
async findAll(@ConsumerInfo('id') consumerId: string) {
|
||||
async findAll(@ConsumerInfo('id') consumerId: string): Promise<consumerCustomersServiceFindAllResponseDto> {
|
||||
return this.service.findAll(consumerId)
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
async findOne(@ConsumerInfo('id') consumerId: string, @Param('id') id: string) {
|
||||
async findOne(@ConsumerInfo('id') consumerId: string, @Param('id') id: string): Promise<consumerCustomersServiceFindOneResponseDto> {
|
||||
return this.service.findOne(consumerId, id)
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ export class consumerCustomersController {
|
||||
@ConsumerInfo('id') consumerId: string,
|
||||
@Param('id') id: string,
|
||||
@Body() data: UpdateCustomerLegalDto,
|
||||
) {
|
||||
): Promise<consumerCustomersServiceUpdateLegalResponseDto> {
|
||||
return this.service.updateLegal(consumerId, id, data)
|
||||
}
|
||||
|
||||
@@ -34,7 +34,9 @@ export class consumerCustomersController {
|
||||
@ConsumerInfo('id') consumerId: string,
|
||||
@Param('id') id: string,
|
||||
@Body() data: UpdateCustomerIndividualDto,
|
||||
) {
|
||||
): Promise<consumerCustomersServiceUpdateIndividualResponseDto> {
|
||||
return this.service.updateIndividual(consumerId, id, data)
|
||||
}
|
||||
}
|
||||
|
||||
import type { consumerCustomersServiceFindAllResponseDto, consumerCustomersServiceFindOneResponseDto, consumerCustomersServiceUpdateIndividualResponseDto, consumerCustomersServiceUpdateLegalResponseDto } from './dto/customers-response.dto'
|
||||
@@ -16,7 +16,7 @@ export class consumerCustomersService {
|
||||
type: true,
|
||||
is_favorite: true,
|
||||
created_at: true,
|
||||
customer_individual: {
|
||||
individual: {
|
||||
select: {
|
||||
first_name: true,
|
||||
last_name: true,
|
||||
@@ -25,7 +25,7 @@ export class consumerCustomersService {
|
||||
economic_code: true,
|
||||
},
|
||||
},
|
||||
customer_legal: {
|
||||
legal: {
|
||||
select: {
|
||||
company_name: true,
|
||||
registration_number: true,
|
||||
@@ -39,20 +39,16 @@ export class consumerCustomersService {
|
||||
return {
|
||||
OR: [
|
||||
{
|
||||
customer_individual: {
|
||||
complex: {
|
||||
business_activity: {
|
||||
consumer_id,
|
||||
},
|
||||
individual: {
|
||||
business_activity: {
|
||||
consumer_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
customer_legal: {
|
||||
complex: {
|
||||
business_activity: {
|
||||
consumer_id,
|
||||
},
|
||||
legal: {
|
||||
business_activity: {
|
||||
consumer_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -95,17 +91,15 @@ export class consumerCustomersService {
|
||||
const customer = await this.prisma.customer.update({
|
||||
where: {
|
||||
id: customer_id,
|
||||
customer_legal: {
|
||||
complex: {
|
||||
business_activity: {
|
||||
consumer_id,
|
||||
},
|
||||
legal: {
|
||||
business_activity: {
|
||||
consumer_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
data: {
|
||||
is_favorite: data.is_favorite,
|
||||
customer_legal: {
|
||||
legal: {
|
||||
update: {
|
||||
...data,
|
||||
},
|
||||
@@ -124,18 +118,16 @@ export class consumerCustomersService {
|
||||
const customer = await this.prisma.customer.update({
|
||||
where: {
|
||||
id: customer_id,
|
||||
customer_individual: {
|
||||
complex: {
|
||||
business_activity: {
|
||||
consumer_id,
|
||||
},
|
||||
individual: {
|
||||
business_activity: {
|
||||
consumer_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
data: {
|
||||
is_favorite: data.is_favorite,
|
||||
|
||||
customer_individual: {
|
||||
individual: {
|
||||
update: {
|
||||
...data,
|
||||
},
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { consumerCustomersService } from '../customers.service'
|
||||
|
||||
export type consumerCustomersServiceFindAllResponseDto = Awaited<ReturnType<consumerCustomersService['findAll']>>
|
||||
export type consumerCustomersServiceFindOneResponseDto = Awaited<ReturnType<consumerCustomersService['findOne']>>
|
||||
export type consumerCustomersServiceUpdateIndividualResponseDto = Awaited<ReturnType<consumerCustomersService['updateIndividual']>>
|
||||
export type consumerCustomersServiceUpdateLegalResponseDto = Awaited<ReturnType<consumerCustomersService['updateLegal']>>
|
||||
@@ -0,0 +1,4 @@
|
||||
import type { CustomerSaleInvoicesService } from '../sale-invoices.service'
|
||||
|
||||
export type CustomerSaleInvoicesServiceFindAllResponseDto = Awaited<ReturnType<CustomerSaleInvoicesService['findAll']>>
|
||||
export type CustomerSaleInvoicesServiceFindOneResponseDto = Awaited<ReturnType<CustomerSaleInvoicesService['findOne']>>
|
||||
@@ -2,6 +2,7 @@ import { TokenAccount } from '@/common/decorators/tokenInfo.decorator'
|
||||
import { Controller, Get, Param } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { CustomerSaleInvoicesService } from './sale-invoices.service'
|
||||
import type { CustomerSaleInvoicesServiceFindAllResponseDto, CustomerSaleInvoicesServiceFindOneResponseDto } from './dto/sale-invoices-response.dto'
|
||||
|
||||
@ApiTags('customerSaleInvoices')
|
||||
@Controller('consumer/customers/:customerId/sale-invoices')
|
||||
@@ -12,7 +13,7 @@ export class CustomerSaleInvoicesController {
|
||||
async findAll(
|
||||
@TokenAccount('userId') userId: string,
|
||||
@Param('customerId') customerId: string,
|
||||
) {
|
||||
): Promise<CustomerSaleInvoicesServiceFindAllResponseDto> {
|
||||
return this.service.findAll(userId, customerId)
|
||||
}
|
||||
|
||||
@@ -21,7 +22,7 @@ export class CustomerSaleInvoicesController {
|
||||
@TokenAccount('userId') userId: string,
|
||||
@Param('customerId') customerId: string,
|
||||
@Param('id') id: string,
|
||||
) {
|
||||
): Promise<CustomerSaleInvoicesServiceFindOneResponseDto> {
|
||||
return this.service.findOne(userId, customerId, id)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { QUERY_CONSTANTS } from '@/common/queryConstants'
|
||||
import consumer_mappersUtil from '@/common/utils/mappers/consumer_mappers.util'
|
||||
import { SalesInvoiceSelect, SalesInvoiceWhereInput } from '@/generated/prisma/models'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
@@ -7,7 +9,7 @@ import { ResponseMapper } from 'common/response/response-mapper'
|
||||
export class CustomerSaleInvoicesService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
defaultSelect: SalesInvoiceSelect = {
|
||||
private readonly defaultSelect: SalesInvoiceSelect = {
|
||||
id: true,
|
||||
code: true,
|
||||
invoice_date: true,
|
||||
@@ -36,8 +38,7 @@ export class CustomerSaleInvoicesService {
|
||||
role: true,
|
||||
consumer: {
|
||||
select: {
|
||||
first_name: true,
|
||||
last_name: true,
|
||||
...QUERY_CONSTANTS.CONSUMER.infoSelect,
|
||||
},
|
||||
},
|
||||
account: {
|
||||
@@ -62,7 +63,7 @@ export class CustomerSaleInvoicesService {
|
||||
},
|
||||
}
|
||||
|
||||
const [accounts, total] = await this.prisma.$transaction(async tx => [
|
||||
const [saleInvoices, total] = await this.prisma.$transaction(async tx => [
|
||||
await tx.salesInvoice.findMany({
|
||||
where: salesWhere,
|
||||
select: {
|
||||
@@ -81,11 +82,17 @@ export class CustomerSaleInvoicesService {
|
||||
}),
|
||||
])
|
||||
|
||||
const mappedAccounts = accounts.map(account => {
|
||||
const { _count, ...rest } = account
|
||||
const mappedAccounts = saleInvoices.map(saleInvoice => {
|
||||
const { _count, consumer_account, ...rest } = saleInvoice
|
||||
const { consumer, ...restConsumerAccount } = consumer_account as any
|
||||
const mappedConsumer = consumer_mappersUtil(consumer)
|
||||
return {
|
||||
...rest,
|
||||
items_count: _count.items,
|
||||
consumer_account: {
|
||||
...restConsumerAccount,
|
||||
consumer: mappedConsumer,
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
@@ -97,7 +104,7 @@ export class CustomerSaleInvoicesService {
|
||||
}
|
||||
|
||||
async findOne(consumer_id: string, customer_id: string, id: string) {
|
||||
const account = await this.prisma.salesInvoice.findUniqueOrThrow({
|
||||
const saleInvoice = await this.prisma.salesInvoice.findUniqueOrThrow({
|
||||
where: {
|
||||
id,
|
||||
customer_id,
|
||||
@@ -111,7 +118,6 @@ export class CustomerSaleInvoicesService {
|
||||
},
|
||||
select: {
|
||||
...this.defaultSelect,
|
||||
|
||||
items: {
|
||||
select: {
|
||||
id: true,
|
||||
@@ -147,6 +153,17 @@ export class CustomerSaleInvoicesService {
|
||||
},
|
||||
},
|
||||
})
|
||||
return ResponseMapper.single(account)
|
||||
const { _count, consumer_account, ...rest } = saleInvoice
|
||||
const { consumer, ...restConsumerAccount } = consumer_account as any
|
||||
const mappedConsumer = consumer_mappersUtil(consumer)
|
||||
|
||||
return ResponseMapper.single({
|
||||
...rest,
|
||||
items_count: _count.items,
|
||||
consumer_account: {
|
||||
...restConsumerAccount,
|
||||
consumer: mappedConsumer,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
import type { ConsumerService } from '../consumer.service'
|
||||
|
||||
export type ConsumerServiceGetInfoResponseDto = Awaited<ReturnType<ConsumerService['getInfo']>>
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { PosesService } from '../poses.service'
|
||||
|
||||
export type PosesServiceFindAllResponseDto = Awaited<ReturnType<PosesService['findAll']>>
|
||||
export type PosesServiceFindOneResponseDto = Awaited<ReturnType<PosesService['findOne']>>
|
||||
export type PosesServiceUpdateResponseDto = Awaited<ReturnType<PosesService['update']>>
|
||||
@@ -2,18 +2,19 @@ import { TokenAccount } from '@/common/decorators/tokenInfo.decorator'
|
||||
import { Body, Controller, Get, Param, Patch } from '@nestjs/common'
|
||||
import { UpdateBusinessActivityDto } from './dto/poses.dto'
|
||||
import { PosesService } from './poses.service'
|
||||
import type { PosesServiceFindAllResponseDto, PosesServiceFindOneResponseDto, PosesServiceUpdateResponseDto } from './dto/poses-response.dto'
|
||||
|
||||
@Controller('consumer/poses')
|
||||
export class PosesController {
|
||||
constructor(private readonly service: PosesService) {}
|
||||
|
||||
@Get()
|
||||
async findAll(@TokenAccount('userId') userId: string) {
|
||||
async findAll(@TokenAccount('userId') userId: string): Promise<PosesServiceFindAllResponseDto> {
|
||||
return this.service.findAll(userId)
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
async findOne(@TokenAccount('userId') userId: string, @Param('id') id: string) {
|
||||
async findOne(@TokenAccount('userId') userId: string, @Param('id') id: string): Promise<PosesServiceFindOneResponseDto> {
|
||||
return this.service.findOne(userId, id)
|
||||
}
|
||||
|
||||
@@ -22,7 +23,7 @@ export class PosesController {
|
||||
@TokenAccount('userId') userId: string,
|
||||
@Param('id') id: string,
|
||||
@Body() data: UpdateBusinessActivityDto,
|
||||
) {
|
||||
): Promise<PosesServiceUpdateResponseDto> {
|
||||
return this.service.update(userId, id, data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { ResponseMapper } from 'common/response/response-mapper'
|
||||
export class PosesService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
private readonly defaultSelect = QUERY_CONSTANTS.pos.select
|
||||
private readonly defaultSelect = QUERY_CONSTANTS.POS.select
|
||||
private readonly defaultWhere = (consumer_id: string) => ({
|
||||
complex: {
|
||||
business_activity: {
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
import type { SaleInvoicesService } from '../saleInvoices.service'
|
||||
|
||||
export type SaleInvoicesServiceFindAllResponseDto = Awaited<ReturnType<SaleInvoicesService['findAll']>>
|
||||
export type SaleInvoicesServiceFindOneResponseDto = Awaited<ReturnType<SaleInvoicesService['findOne']>>
|
||||
@@ -2,6 +2,7 @@ import { TokenAccount } from '@/common/decorators/tokenInfo.decorator'
|
||||
import { Controller, Get, Param } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { SaleInvoicesService } from './saleInvoices.service'
|
||||
import type { SaleInvoicesServiceFindAllResponseDto, SaleInvoicesServiceFindOneResponseDto } from './dto/saleInvoices-response.dto'
|
||||
|
||||
@ApiTags('ConsumerSaleInvoices')
|
||||
@Controller('consumer/sale-invoices')
|
||||
@@ -9,12 +10,12 @@ export class StatisticsController {
|
||||
constructor(private readonly service: SaleInvoicesService) {}
|
||||
|
||||
@Get('')
|
||||
async findAll(@TokenAccount('userId') consumerId: string) {
|
||||
async findAll(@TokenAccount('userId') consumerId: string): Promise<SaleInvoicesServiceFindAllResponseDto> {
|
||||
return this.service.findAll(consumerId)
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
async findOne(@TokenAccount('userId') consumerId: string, @Param('id') id: string) {
|
||||
async findOne(@TokenAccount('userId') consumerId: string, @Param('id') id: string): Promise<SaleInvoicesServiceFindOneResponseDto> {
|
||||
return this.service.findOne(consumerId, id)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ export class SaleInvoicesService {
|
||||
select: {
|
||||
id: true,
|
||||
type: true,
|
||||
customer_legal: {
|
||||
legal: {
|
||||
select: {
|
||||
company_name: true,
|
||||
economic_code: true,
|
||||
@@ -123,7 +123,7 @@ export class SaleInvoicesService {
|
||||
postal_code: true,
|
||||
},
|
||||
},
|
||||
customer_individual: {
|
||||
individual: {
|
||||
select: {
|
||||
first_name: true,
|
||||
last_name: true,
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
import type { StatisticsService } from '../statistics.service'
|
||||
|
||||
export type StatisticsServiceGetInvoicesResponseDto = Awaited<ReturnType<StatisticsService['getInvoices']>>
|
||||
@@ -2,6 +2,7 @@ import { TokenAccount } from '@/common/decorators/tokenInfo.decorator'
|
||||
import { Controller, Get } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { StatisticsService } from './statistics.service'
|
||||
import type { StatisticsServiceGetInvoicesResponseDto } from './dto/statistics-response.dto'
|
||||
|
||||
@ApiTags('ConsumerStatistics')
|
||||
@Controller('consumer/statistics')
|
||||
@@ -9,7 +10,7 @@ export class StatisticsController {
|
||||
constructor(private readonly service: StatisticsService) {}
|
||||
|
||||
@Get('invoices')
|
||||
async getInvoices(@TokenAccount('userId') consumerId: string) {
|
||||
async getInvoices(@TokenAccount('userId') consumerId: string): Promise<StatisticsServiceGetInvoicesResponseDto> {
|
||||
return this.service.getInvoices(consumerId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
export * from './mapConsumerWithLicense.util'
|
||||
export * from '../../../common/utils/mappers/consumer_mappers.util'
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
export default (consumer: any) => {
|
||||
const { activation, ...rest } = consumer
|
||||
|
||||
return {
|
||||
...rest,
|
||||
fullname: `${rest?.first_name} ${rest?.last_name}`,
|
||||
license_info: prepareLicenseInfo(activation),
|
||||
}
|
||||
}
|
||||
|
||||
function prepareLicenseInfo(latestLicense: any) {
|
||||
if (!latestLicense) return null
|
||||
const { license, ...rest } = latestLicense
|
||||
|
||||
return {
|
||||
...rest,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user