2025-09-19 18:30:44 -06:00
|
|
|
import { Body, Controller, Post, Req, UseGuards } from '@nestjs/common';
|
|
|
|
|
import { OperationsService } from './operations.services';
|
|
|
|
|
import { chargePrintDto } from './dto/operations.dto';
|
|
|
|
|
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
2025-09-16 22:37:25 -06:00
|
|
|
|
|
|
|
|
@Controller('operations')
|
2025-09-19 18:30:44 -06:00
|
|
|
export class OperationsController {
|
|
|
|
|
constructor(private readonly operationsService: OperationsService) {}
|
2025-09-16 22:37:25 -06:00
|
|
|
|
2025-09-19 18:30:44 -06:00
|
|
|
@UseGuards(JwtAuthGuard)
|
|
|
|
|
@Post('impressions')
|
|
|
|
|
async chargePrint(@Body() data: chargePrintDto, @Req() req: any) {
|
|
|
|
|
const id_usuario = req.user.id;
|
|
|
|
|
return this.operationsService.chargePrint(data, id_usuario);
|
|
|
|
|
}
|
2025-09-19 17:15:05 -06:00
|
|
|
|
2025-09-19 18:30:44 -06:00
|
|
|
@UseGuards(JwtAuthGuard)
|
|
|
|
|
@Post('receipt')
|
|
|
|
|
async addCredit(@Body() data, @Req() req: any) {
|
|
|
|
|
const id_usuario = req.user.id;
|
|
|
|
|
return this.operationsService.addCredit(data, id_usuario);
|
|
|
|
|
}
|
2026-01-23 12:36:14 -06:00
|
|
|
|
2026-01-23 13:36:45 -06:00
|
|
|
@UseGuards(JwtAuthGuard)
|
|
|
|
|
@Post('registration')
|
|
|
|
|
async addReceiptInscription(@Body() data, @Req() req: any) {
|
|
|
|
|
const id_usuario = req.user.id;
|
|
|
|
|
return this.operationsService.addReceiptInscription(data, id_usuario);
|
|
|
|
|
}
|
2026-01-23 12:36:14 -06:00
|
|
|
|
|
|
|
|
@UseGuards(JwtAuthGuard)
|
|
|
|
|
@Post('time')
|
|
|
|
|
async addTime(@Body() data, @Req() req: any) {
|
|
|
|
|
const id_usuario = req.user.id;
|
|
|
|
|
return this.operationsService.addTime(data, id_usuario);
|
|
|
|
|
}
|
2025-09-19 18:30:44 -06:00
|
|
|
}
|
2026-01-23 12:36:14 -06:00
|
|
|
//IO
|