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:
@@ -1,4 +1,16 @@
|
||||
import { Body, Controller, Get, Param, Patch, Post } from '@nestjs/common'
|
||||
import { multerImageOptions } from '@/multer.config'
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Get,
|
||||
Param,
|
||||
Patch,
|
||||
Post,
|
||||
UploadedFile,
|
||||
UseInterceptors,
|
||||
} from '@nestjs/common'
|
||||
import { FileInterceptor } from '@nestjs/platform-express'
|
||||
import { ApiBody, ApiConsumes } from '@nestjs/swagger'
|
||||
import { CreatePartnerDto, UpdatePartnerDto } from './dto/partner.dto'
|
||||
import { PartnersService } from './partners.service'
|
||||
|
||||
@@ -7,23 +19,47 @@ export class PartnersController {
|
||||
constructor(private readonly partnersService: PartnersService) {}
|
||||
|
||||
@Get()
|
||||
async findAll() {
|
||||
async findAll(): Promise<PartnersServiceFindAllResponseDto> {
|
||||
return this.partnersService.findAll()
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
async findOne(@Param('id') id: string) {
|
||||
async findOne(@Param('id') id: string): Promise<PartnersServiceFindOneResponseDto> {
|
||||
return this.partnersService.findOne(id)
|
||||
}
|
||||
|
||||
@Post()
|
||||
async create(@Body() data: CreatePartnerDto) {
|
||||
return this.partnersService.create(data)
|
||||
@UseInterceptors(FileInterceptor('logo', multerImageOptions))
|
||||
@ApiConsumes('multipart/form-data')
|
||||
@ApiBody({
|
||||
schema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
logo: { type: 'string', format: 'binary' },
|
||||
},
|
||||
},
|
||||
})
|
||||
async create(@Body() data: CreatePartnerDto, @UploadedFile() logo: any): Promise<PartnersServiceCreateResponseDto> {
|
||||
return this.partnersService.create(data, logo)
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
async update(@Param('id') id: string, @Body() data: UpdatePartnerDto) {
|
||||
return this.partnersService.update(id, data)
|
||||
@UseInterceptors(FileInterceptor('logo', multerImageOptions))
|
||||
@ApiConsumes('multipart/form-data')
|
||||
@ApiBody({
|
||||
schema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
logo: { type: 'string', format: 'binary' },
|
||||
},
|
||||
},
|
||||
})
|
||||
async update(
|
||||
@Param('id') id: string,
|
||||
@Body() data: UpdatePartnerDto,
|
||||
@UploadedFile() logo: Express.Multer.File,
|
||||
): Promise<PartnersServiceUpdateResponseDto> {
|
||||
return this.partnersService.update(id, data, logo)
|
||||
}
|
||||
|
||||
// @Delete(':id')
|
||||
@@ -31,3 +67,5 @@ export class PartnersController {
|
||||
// return this.partnersService.delete(id)
|
||||
// }
|
||||
}
|
||||
|
||||
import type { PartnersServiceCreateResponseDto, PartnersServiceFindAllResponseDto, PartnersServiceFindOneResponseDto, PartnersServiceUpdateResponseDto } from './dto/partners-response.dto'
|
||||
Reference in New Issue
Block a user