2022-01-15 18:32:46 +00:00
|
|
|
//relatorio
|
|
|
|
|
|
|
|
import { Request, Response } from "express";
|
|
|
|
import AppError from "../errors/AppError";
|
|
|
|
import ShowTicketReport from "../services/TicketServices/ShowTicketReport";
|
|
|
|
|
|
|
|
|
2022-01-25 14:24:05 +00:00
|
|
|
type IndexQuery = {
|
|
|
|
userId: string;
|
|
|
|
startDate: string;
|
|
|
|
endDate: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*export const reportUser = async (req: Request, res: Response): Promise<Response> => {
|
2022-01-15 18:32:46 +00:00
|
|
|
|
|
|
|
const { userId } = req.params;
|
|
|
|
|
|
|
|
console.log('******* Estrou no report: ', userId)
|
|
|
|
|
|
|
|
const test = await ShowTicketReport(userId);
|
|
|
|
|
|
|
|
return res.status(200).json(test);
|
|
|
|
|
2022-01-25 14:24:05 +00:00
|
|
|
};*/
|
|
|
|
|
|
|
|
|
|
|
|
export const reportUserByDateStartDateEnd = async (req: Request, res: Response): Promise<Response> => {
|
|
|
|
|
|
|
|
const { userId, startDate, endDate } = req.query as IndexQuery
|
|
|
|
|
|
|
|
console.log('******* Estrou no report')
|
|
|
|
console.log('******* userId: ', userId)
|
|
|
|
console.log('******* startDate: ', startDate)
|
|
|
|
console.log('******* endDate: ', endDate)
|
|
|
|
|
|
|
|
const data_query = await ShowTicketReport(userId, startDate, endDate);
|
|
|
|
|
|
|
|
return res.status(200).json(data_query);
|
|
|
|
|
2022-01-15 18:32:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*export const reportAll = async (req: Request, res: Response): Promise<Response> => {
|
|
|
|
|
|
|
|
const test = await ShowTicketReport();
|
|
|
|
|
|
|
|
return res.status(200).json(test);
|
|
|
|
|
|
|
|
};*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|