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('PartnerConsumerAccounts')
|
||||
@Controller('partner/consumers/:consumerId/accounts')
|
||||
@@ -13,7 +14,7 @@ export class AccountsController {
|
||||
async findAll(
|
||||
@PartnerInfo('id') partnerId: string,
|
||||
@Param('consumerId') consumerId: string,
|
||||
) {
|
||||
): Promise<AccountsServiceFindAllResponseDto> {
|
||||
return this.accountsService.findAll(partnerId, consumerId)
|
||||
}
|
||||
|
||||
@@ -22,7 +23,7 @@ export class AccountsController {
|
||||
@PartnerInfo('id') partnerId: string,
|
||||
@Param('consumerId') consumerId: string,
|
||||
@Param('id') id: string,
|
||||
) {
|
||||
): Promise<AccountsServiceFindOneResponseDto> {
|
||||
return this.accountsService.findOne(partnerId, consumerId, id)
|
||||
}
|
||||
|
||||
@@ -41,7 +42,7 @@ export class AccountsController {
|
||||
@Param('consumerId') consumerId: string,
|
||||
@Param('id') id: string,
|
||||
@Body() data: UpdateAccountDto,
|
||||
) {
|
||||
): Promise<AccountsServiceUpdateResponseDto> {
|
||||
return this.accountsService.update(partnerId, consumerId, id, data)
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,18 @@ export class AccountsService {
|
||||
private readonly defaultWhere = (partner_id, consumer_id) => ({
|
||||
consumer_id,
|
||||
consumer: {
|
||||
partner_id,
|
||||
OR: [
|
||||
{
|
||||
legal: {
|
||||
partner_id,
|
||||
},
|
||||
},
|
||||
{
|
||||
individual: {
|
||||
partner_id,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -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']>>
|
||||
Reference in New Issue
Block a user