20 lines
803 B
TypeScript
20 lines
803 B
TypeScript
import { Controller, Get, Query } from "@nestjs/common";
|
|
import { Access } from "src/common/decorators/module-access.decorators";
|
|
import { ModuleAccessAllowed } from "src/common/decorators/modules-guard.decorators";
|
|
import { PaidTimeOffBankHoursService } from "src/time-and-attendance/paid-time-off/paid-time-off.service";
|
|
|
|
@Controller('paid-time-off')
|
|
export class PaidTimeOffController {
|
|
constructor(
|
|
private readonly paidTimeOffService: PaidTimeOffBankHoursService,
|
|
) { }
|
|
|
|
@Get('totals')
|
|
@ModuleAccessAllowed('timesheets')
|
|
async getPaidTimeOffTotalsForOneEmployee(
|
|
@Access('email') email: string,
|
|
@Query('email') employee_email?: string,
|
|
) {
|
|
return this.paidTimeOffService.getPaidTimeOffTotalsWithEmployeeEmail(employee_email ?? email);
|
|
}
|
|
} |