2026-04-24 23:02:05 +03:30
|
|
|
import { PartnerInfo } from '@/common/decorators/partnerInfo.decorator'
|
|
|
|
|
import { Body, Controller, Get, Param, Patch } from '@nestjs/common'
|
2026-04-23 20:59:39 +03:30
|
|
|
import { ApiTags } from '@nestjs/swagger'
|
|
|
|
|
import { AccountsService } from './accounts.service'
|
2026-04-24 23:02:05 +03:30
|
|
|
import { UpdateAccountDto } from './dto/account.dto'
|
2026-04-23 20:59:39 +03:30
|
|
|
|
|
|
|
|
@ApiTags('PartnerConsumerAccounts')
|
|
|
|
|
@Controller('partner/consumers/:consumerId/accounts')
|
|
|
|
|
export class AccountsController {
|
|
|
|
|
constructor(private readonly accountsService: AccountsService) {}
|
|
|
|
|
|
|
|
|
|
@Get()
|
2026-04-24 23:02:05 +03:30
|
|
|
async findAll(
|
|
|
|
|
@PartnerInfo('id') partnerId: string,
|
|
|
|
|
@Param('consumerId') consumerId: string,
|
|
|
|
|
) {
|
|
|
|
|
return this.accountsService.findAll(partnerId, consumerId)
|
2026-04-23 20:59:39 +03:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Get(':id')
|
2026-04-24 23:02:05 +03:30
|
|
|
async findOne(
|
|
|
|
|
@PartnerInfo('id') partnerId: string,
|
2026-04-23 20:59:39 +03:30
|
|
|
@Param('consumerId') consumerId: string,
|
2026-04-24 23:02:05 +03:30
|
|
|
@Param('id') id: string,
|
2026-04-23 20:59:39 +03:30
|
|
|
) {
|
2026-04-24 23:02:05 +03:30
|
|
|
return this.accountsService.findOne(partnerId, consumerId, id)
|
2026-04-23 20:59:39 +03:30
|
|
|
}
|
|
|
|
|
|
2026-04-24 23:02:05 +03:30
|
|
|
// @Post()
|
|
|
|
|
// async create(
|
|
|
|
|
// @PartnerInfo('id') partnerId: string,
|
|
|
|
|
// @Param('consumerId') consumerId: string,
|
|
|
|
|
// @Body() data: CreateConsumerAccountDto,
|
|
|
|
|
// ) {
|
|
|
|
|
// return this.accountsService.create(partnerId, consumerId, data)
|
|
|
|
|
// }
|
|
|
|
|
|
2026-04-23 20:59:39 +03:30
|
|
|
@Patch(':id')
|
2026-04-24 23:02:05 +03:30
|
|
|
async update(
|
|
|
|
|
@PartnerInfo('id') partnerId: string,
|
|
|
|
|
@Param('consumerId') consumerId: string,
|
|
|
|
|
@Param('id') id: string,
|
|
|
|
|
@Body() data: UpdateAccountDto,
|
|
|
|
|
) {
|
|
|
|
|
return this.accountsService.update(partnerId, consumerId, id, data)
|
2026-04-23 20:59:39 +03:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Delete(':id')
|
|
|
|
|
// async delete(@Param('id') id: string) {
|
|
|
|
|
// return this.accountsService.delete(id)
|
|
|
|
|
// }
|
|
|
|
|
}
|