dee96b6e91
- 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.
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
import { Body, Controller, Get, Param, Patch, Post } from '@nestjs/common'
|
|
import { ApiTags } from '@nestjs/swagger'
|
|
import { AccountsService } from './accounts.service'
|
|
import { CreateConsumerAccountDto, UpdateAccountDto } from './dto/account.dto'
|
|
import type { AccountsServiceCreateResponseDto, AccountsServiceFindAllResponseDto, AccountsServiceFindOneResponseDto, AccountsServiceUpdateResponseDto } from './dto/accounts-response.dto'
|
|
|
|
@ApiTags('AdminConsumerAccounts')
|
|
@Controller('admin/consumers/:consumerId/accounts')
|
|
export class AccountsController {
|
|
constructor(private readonly accountsService: AccountsService) {}
|
|
|
|
@Get()
|
|
async findAll(@Param('consumerId') consumerId: string): Promise<AccountsServiceFindAllResponseDto> {
|
|
return this.accountsService.findAll(consumerId)
|
|
}
|
|
|
|
@Get(':id')
|
|
async findOne(@Param('id') id: string): Promise<AccountsServiceFindOneResponseDto> {
|
|
return this.accountsService.findOne(id)
|
|
}
|
|
|
|
@Post()
|
|
async create(
|
|
@Param('consumerId') consumerId: string,
|
|
@Body() data: CreateConsumerAccountDto,
|
|
): Promise<AccountsServiceCreateResponseDto> {
|
|
return this.accountsService.create(consumerId, data)
|
|
}
|
|
|
|
@Patch(':id')
|
|
async update(@Param('id') id: string, @Body() data: UpdateAccountDto): Promise<AccountsServiceUpdateResponseDto> {
|
|
return this.accountsService.update(id, data)
|
|
}
|
|
|
|
// @Delete(':id')
|
|
// async delete(@Param('id') id: string) {
|
|
// return this.accountsService.delete(id)
|
|
// }
|
|
}
|