35 lines
928 B
TypeScript
35 lines
928 B
TypeScript
|
|
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
|
||
|
|
import { CreateSalesInvoiceDto } from './dto/create-sales-invoice.dto'
|
||
|
|
import { UpdateSalesInvoiceDto } from './dto/update-sales-invoice.dto'
|
||
|
|
import { SalesInvoicesService } from './sales-invoices.service'
|
||
|
|
|
||
|
|
@Controller('sales-invoices')
|
||
|
|
export class SalesInvoicesController {
|
||
|
|
constructor(private readonly service: SalesInvoicesService) {}
|
||
|
|
|
||
|
|
@Post()
|
||
|
|
create(@Body() dto: CreateSalesInvoiceDto) {
|
||
|
|
return this.service.create(dto)
|
||
|
|
}
|
||
|
|
|
||
|
|
@Get()
|
||
|
|
findAll() {
|
||
|
|
return this.service.findAll()
|
||
|
|
}
|
||
|
|
|
||
|
|
@Get(':id')
|
||
|
|
findOne(@Param('id') id: string) {
|
||
|
|
return this.service.findOne(Number(id))
|
||
|
|
}
|
||
|
|
|
||
|
|
@Patch(':id')
|
||
|
|
update(@Param('id') id: string, @Body() dto: UpdateSalesInvoiceDto) {
|
||
|
|
return this.service.update(Number(id), dto)
|
||
|
|
}
|
||
|
|
|
||
|
|
@Delete(':id')
|
||
|
|
remove(@Param('id') id: string) {
|
||
|
|
return this.service.remove(Number(id))
|
||
|
|
}
|
||
|
|
}
|