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:
+5
-4
@@ -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 { CreateComplexDto, UpdateComplexDto } from './dto/complex.dto'
|
||||
import type { BusinessActivityComplexesServiceCreateResponseDto, BusinessActivityComplexesServiceFindAllResponseDto, BusinessActivityComplexesServiceFindOneResponseDto, BusinessActivityComplexesServiceUpdateResponseDto } from './dto/complexes-response.dto'
|
||||
|
||||
@ApiTags('PartnerBusinessActivityComplexes')
|
||||
@Controller(
|
||||
@@ -16,7 +17,7 @@ export class BusinessActivityComplexesController {
|
||||
@PartnerInfo('id') partnerId: string,
|
||||
@Param('consumerId') consumerId: string,
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
) {
|
||||
): Promise<BusinessActivityComplexesServiceFindAllResponseDto> {
|
||||
return this.service.findAll(partnerId, consumerId, businessActivityId)
|
||||
}
|
||||
|
||||
@@ -26,7 +27,7 @@ export class BusinessActivityComplexesController {
|
||||
@Param('consumerId') consumerId: string,
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
@Param('id') id: string,
|
||||
) {
|
||||
): Promise<BusinessActivityComplexesServiceFindOneResponseDto> {
|
||||
return this.service.findOne(partnerId, consumerId, businessActivityId, id)
|
||||
}
|
||||
|
||||
@@ -35,7 +36,7 @@ export class BusinessActivityComplexesController {
|
||||
@PartnerInfo('id') partnerId: string,
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
@Body() data: CreateComplexDto,
|
||||
) {
|
||||
): Promise<BusinessActivityComplexesServiceCreateResponseDto> {
|
||||
return this.service.create(partnerId, businessActivityId, data)
|
||||
}
|
||||
|
||||
@@ -46,7 +47,7 @@ export class BusinessActivityComplexesController {
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
@Param('id') id: string,
|
||||
@Body() data: UpdateComplexDto,
|
||||
) {
|
||||
): Promise<BusinessActivityComplexesServiceUpdateResponseDto> {
|
||||
return this.service.update(partnerId, consumerId, businessActivityId, id, data)
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,18 @@ export class BusinessActivityComplexesService {
|
||||
id: business_activity_id,
|
||||
consumer: {
|
||||
id: consumer_id,
|
||||
partner_id,
|
||||
OR: [
|
||||
{
|
||||
legal: {
|
||||
partner_id,
|
||||
},
|
||||
},
|
||||
{
|
||||
individual: {
|
||||
partner_id,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
+6
@@ -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']>>
|
||||
+6
@@ -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']>>
|
||||
+5
-4
@@ -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('AdminComplexPoses')
|
||||
@Controller('partner/business_activities/:businessActivityId/complexes/:complexId/poses')
|
||||
@@ -14,7 +15,7 @@ export class ComplexPosesController {
|
||||
@PartnerInfo('id') partnerId: string,
|
||||
@Param('businessActivityId') businessActivityId: string,
|
||||
@Param('complexId') complexId: string,
|
||||
) {
|
||||
): Promise<ComplexPosesServiceFindAllResponseDto> {
|
||||
return this.service.findAll(partnerId, 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(partnerId, 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(partnerId, 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(partnerId, businessActivityId, complexId, id, data)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user