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,7 +1,15 @@
|
||||
import { PartnerInfo } from '@/common/decorators/partnerInfo.decorator'
|
||||
import type { IPartnerPayload } from '@/common/models/partnerPayload.model'
|
||||
import { Controller, Get, Patch } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { multerImageOptions } from '@/multer.config'
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Get,
|
||||
Patch,
|
||||
UploadedFile,
|
||||
UseInterceptors,
|
||||
} from '@nestjs/common'
|
||||
import { FileInterceptor } from '@nestjs/platform-express'
|
||||
import { ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger'
|
||||
import { UpdatePartnerProfileDto } from './dto/partner.dto'
|
||||
import { PartnerService } from './partners.service'
|
||||
|
||||
@@ -11,17 +19,34 @@ export class PartnerController {
|
||||
constructor(private service: PartnerService) {}
|
||||
|
||||
@Get('')
|
||||
async me(@PartnerInfo() { id, account_id }: IPartnerPayload) {
|
||||
async me(@PartnerInfo() { id, account_id }: IPartnerPayload): Promise<PartnerServiceMeResponseDto> {
|
||||
return this.service.me(id, account_id)
|
||||
}
|
||||
|
||||
@Get('info')
|
||||
async getInfo(@PartnerInfo('id') partnerId: string) {
|
||||
async getInfo(@PartnerInfo('id') partnerId: string): Promise<PartnerServiceGetInfoResponseDto> {
|
||||
return this.service.getInfo(partnerId)
|
||||
}
|
||||
|
||||
@Patch('profile')
|
||||
async update(@PartnerInfo('id') partnerId: string, data: UpdatePartnerProfileDto) {
|
||||
return this.service.updateInfo(partnerId, data)
|
||||
@UseInterceptors(FileInterceptor('logo', multerImageOptions))
|
||||
@ApiConsumes('multipart/form-data')
|
||||
@ApiBody({
|
||||
schema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
logo: { type: 'string', format: 'binary' },
|
||||
},
|
||||
},
|
||||
})
|
||||
async update(
|
||||
@PartnerInfo('id') partnerId: string,
|
||||
@Body() data: UpdatePartnerProfileDto,
|
||||
@UploadedFile() logo: Express.Multer.File,
|
||||
): Promise<PartnerServiceUpdateInfoResponseDto> {
|
||||
return this.service.updateInfo(partnerId, data, logo)
|
||||
}
|
||||
}
|
||||
|
||||
import type { IPartnerPayload } from '@/common/models/partnerPayload.model'
|
||||
import type { PartnerServiceGetInfoResponseDto, PartnerServiceMeResponseDto, PartnerServiceUpdateInfoResponseDto } from './dto/partners-response.dto'
|
||||
Reference in New Issue
Block a user