35 lines
989 B
TypeScript
35 lines
989 B
TypeScript
|
|
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
|
||
|
|
import { BankAccountsService } from './bank-accounts.service'
|
||
|
|
import { CreateBankAccountDto } from './dto/create-bank-account.dto'
|
||
|
|
import { UpdateBankAccountDto } from './dto/update-bank-account.dto'
|
||
|
|
|
||
|
|
@Controller('bank-accounts')
|
||
|
|
export class BankAccountsController {
|
||
|
|
constructor(private readonly bankAccountsService: BankAccountsService) {}
|
||
|
|
|
||
|
|
@Post()
|
||
|
|
create(@Body() dto: CreateBankAccountDto) {
|
||
|
|
return this.bankAccountsService.create(dto)
|
||
|
|
}
|
||
|
|
|
||
|
|
@Get()
|
||
|
|
findAll() {
|
||
|
|
return this.bankAccountsService.findAll()
|
||
|
|
}
|
||
|
|
|
||
|
|
@Get(':id')
|
||
|
|
findOne(@Param('id') id: string) {
|
||
|
|
return this.bankAccountsService.findOne(Number(id))
|
||
|
|
}
|
||
|
|
|
||
|
|
@Patch(':id')
|
||
|
|
update(@Param('id') id: string, @Body() dto: UpdateBankAccountDto) {
|
||
|
|
return this.bankAccountsService.update(Number(id), dto)
|
||
|
|
}
|
||
|
|
|
||
|
|
@Delete(':id')
|
||
|
|
remove(@Param('id') id: string) {
|
||
|
|
return this.bankAccountsService.remove(Number(id))
|
||
|
|
}
|
||
|
|
}
|