55 lines
1.3 KiB
TypeScript
55 lines
1.3 KiB
TypeScript
import {
|
|
Controller,
|
|
Get,
|
|
Post,
|
|
Body,
|
|
Patch,
|
|
Param,
|
|
Delete,
|
|
} from '@nestjs/common';
|
|
import { BitacoraMesaService } from './bitacora_mesa.service';
|
|
import { CreateBitacoraMesaDto, FindByDate } from './dto/create-bitacora_mesa.dto';
|
|
|
|
@Controller('bitacora-mesa')
|
|
export class BitacoraMesaController {
|
|
constructor(private readonly bitacoraMesaService: BitacoraMesaService) { }
|
|
|
|
@Post()
|
|
assignment(@Body() createBitacoraMesaDto: CreateBitacoraMesaDto) {
|
|
return this.bitacoraMesaService.assignment(createBitacoraMesaDto);
|
|
}
|
|
|
|
@Get()
|
|
findAll() {
|
|
return this.bitacoraMesaService.findAll();
|
|
}
|
|
|
|
@Get(':id')
|
|
findOne(@Param('id') id: string) {
|
|
return this.bitacoraMesaService.findOne(+id);
|
|
}
|
|
|
|
@Get('/cuenta/:id_cuenta')
|
|
findByCuenta(@Param('id_cuenta') id_cuenta: string) {
|
|
return this.bitacoraMesaService.findByCuenta(+id_cuenta);
|
|
}
|
|
|
|
@Get('/table/:id_mesa')
|
|
findByTable(@Param('id_mesa') id_mesa: number) {
|
|
return this.bitacoraMesaService.findByTable(id_mesa);
|
|
}
|
|
|
|
@Post('/date')
|
|
findByDate(@Body() data: FindByDate) {
|
|
return this.bitacoraMesaService.findByDate(data.date);
|
|
}
|
|
|
|
@Patch('cancelar/:id')
|
|
cancelationByMachine(
|
|
@Param('id') id: number,
|
|
@Body('tiempo_asignado') tiempo_asignado: number,
|
|
) {
|
|
return this.bitacoraMesaService.cancelation(id, tiempo_asignado);
|
|
}
|
|
}
|