fix(imports): added pay-periods-overview-service to module
This commit is contained in:
parent
dcf340325a
commit
32201f0dba
|
|
@ -668,7 +668,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Leave request not found"
|
"description": "List of leave request not found"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"security": [
|
"security": [
|
||||||
|
|
@ -1802,6 +1802,136 @@
|
||||||
"Auth"
|
"Auth"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"/pay-periods": {
|
||||||
|
"get": {
|
||||||
|
"operationId": "PayPeriodsController_findAll",
|
||||||
|
"parameters": [],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "List of pay period found",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/PayPeriodEntity"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "List of pay period not found"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"summary": "Find all pay period",
|
||||||
|
"tags": [
|
||||||
|
"pay-periods"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/pay-periods/{periodNumber}": {
|
||||||
|
"get": {
|
||||||
|
"operationId": "PayPeriodsController_findOne",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "periodNumber",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Pay period found",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/PayPeriodEntity"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "Pay period not found"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"summary": "Find pay period",
|
||||||
|
"tags": [
|
||||||
|
"pay-periods"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/pay-periods/{periodNumber}/overview": {
|
||||||
|
"get": {
|
||||||
|
"operationId": "PayPeriodsController_getOverview",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "periodNumber",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Pay period overview found",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/PayPeriodOverviewDto"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "Pay period not found"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"summary": "detailed view of a pay period",
|
||||||
|
"tags": [
|
||||||
|
"pay-periods"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/pay-periods/date/{date}": {
|
||||||
|
"get": {
|
||||||
|
"operationId": "PayPeriodsController_findByDate",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "date",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Pay period found for the selected date",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/PayPeriodEntity"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "Pay period not found for the selected date date"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"summary": "cherry picking a date to find a period",
|
||||||
|
"tags": [
|
||||||
|
"pay-periods"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"info": {
|
"info": {
|
||||||
|
|
@ -2906,6 +3036,113 @@
|
||||||
"description": "Timesheet`s approval status"
|
"description": "Timesheet`s approval status"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"PayPeriodEntity": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"period_number": {
|
||||||
|
"type": "number",
|
||||||
|
"example": 1,
|
||||||
|
"description": "numéro cyclique de la période entre 1 et 26"
|
||||||
|
},
|
||||||
|
"start_date": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "2023-12-17",
|
||||||
|
"format": "date"
|
||||||
|
},
|
||||||
|
"end_date": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "2023-12-30",
|
||||||
|
"format": "date"
|
||||||
|
},
|
||||||
|
"year": {
|
||||||
|
"type": "number",
|
||||||
|
"example": 2023
|
||||||
|
},
|
||||||
|
"label": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "2023-12-17 → 2023-12-30"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"period_number",
|
||||||
|
"start_date",
|
||||||
|
"end_date",
|
||||||
|
"year",
|
||||||
|
"label"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"EmployeePeriodOverviewDto": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"employee_id": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "a1b2c3d4",
|
||||||
|
"description": "Employee`s ID"
|
||||||
|
},
|
||||||
|
"employee_name": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "Alex Dupont",
|
||||||
|
"description": "Employee`s full name"
|
||||||
|
},
|
||||||
|
"total_hours": {
|
||||||
|
"type": "number",
|
||||||
|
"example": 34,
|
||||||
|
"description": "period`s total worked hours"
|
||||||
|
},
|
||||||
|
"is_approved": {
|
||||||
|
"type": "boolean",
|
||||||
|
"example": true,
|
||||||
|
"description": "All timesheets are approved for this employee"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"employee_id",
|
||||||
|
"employee_name",
|
||||||
|
"total_hours",
|
||||||
|
"is_approved"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"PayPeriodOverviewDto": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"period_number": {
|
||||||
|
"type": "number",
|
||||||
|
"example": 1,
|
||||||
|
"description": "period`s number ( 1-26 )"
|
||||||
|
},
|
||||||
|
"start_date": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "2023-12-17",
|
||||||
|
"format": "date",
|
||||||
|
"description": "Period`s starting date"
|
||||||
|
},
|
||||||
|
"end_date": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "2023-12-30",
|
||||||
|
"format": "date",
|
||||||
|
"description": "Period`s ending date"
|
||||||
|
},
|
||||||
|
"label": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "2023-12-17 → 2023-12-30",
|
||||||
|
"description": "period`s label for showing"
|
||||||
|
},
|
||||||
|
"employees_overview": {
|
||||||
|
"description": "Detailed view by employee for a chosen period",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/EmployeePeriodOverviewDto"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"period_number",
|
||||||
|
"start_date",
|
||||||
|
"end_date",
|
||||||
|
"label",
|
||||||
|
"employees_overview"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import { TimesheetsModule } from './modules/timesheets/timesheets.module';
|
||||||
import { AuthenticationModule } from './modules/authentication/auth.module';
|
import { AuthenticationModule } from './modules/authentication/auth.module';
|
||||||
import { ExpensesModule } from './modules/expenses/expenses.module';
|
import { ExpensesModule } from './modules/expenses/expenses.module';
|
||||||
import { ExpenseCodesModule } from './modules/expense-codes/expense-codes.module';
|
import { ExpenseCodesModule } from './modules/expense-codes/expense-codes.module';
|
||||||
import { PayperiodModule } from './modules/pay-periods/pay-periods.module';
|
import { PayperiodsModule } from './modules/pay-periods/pay-periods.module';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
|
|
@ -32,7 +32,7 @@ import { PayperiodModule } from './modules/pay-periods/pay-periods.module';
|
||||||
ShiftsModule,
|
ShiftsModule,
|
||||||
TimesheetsModule,
|
TimesheetsModule,
|
||||||
AuthenticationModule,
|
AuthenticationModule,
|
||||||
PayperiodModule,
|
PayperiodsModule,
|
||||||
],
|
],
|
||||||
controllers: [AppController, HealthController],
|
controllers: [AppController, HealthController],
|
||||||
providers: [AppService],
|
providers: [AppService],
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@ import { Controller, Get, Param, ParseIntPipe } from "@nestjs/common";
|
||||||
import { PayPeriods } from "@prisma/client";
|
import { PayPeriods } from "@prisma/client";
|
||||||
import { ApiOperation, ApiResponse, ApiTags } from "@nestjs/swagger";
|
import { ApiOperation, ApiResponse, ApiTags } from "@nestjs/swagger";
|
||||||
import { PayPeriodsService } from "../services/pay-periods.service";
|
import { PayPeriodsService } from "../services/pay-periods.service";
|
||||||
import { PayPeriodsOverviewService } from "../services/pay-periods-overview.service";
|
|
||||||
import { PayPeriodEntity } from "../dtos/swagger-entities/pay-period.entity";
|
import { PayPeriodEntity } from "../dtos/swagger-entities/pay-period.entity";
|
||||||
import { PayPeriodOverviewDto } from "../dtos/overview-pay-period.dto";
|
import { PayPeriodOverviewDto } from "../dtos/overview-pay-period.dto";
|
||||||
|
import { PayPeriodsOverviewService } from "../services/pay-periods-overview.service";
|
||||||
|
|
||||||
|
|
||||||
@ApiTags('pay-periods')
|
@ApiTags('pay-periods')
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,15 @@ import { PrismaModule } from "src/prisma/prisma.module";
|
||||||
import { PayPeriodsService } from "./services/pay-periods.service";
|
import { PayPeriodsService } from "./services/pay-periods.service";
|
||||||
import { PayPeriodsController } from "./controllers/pay-periods.controller";
|
import { PayPeriodsController } from "./controllers/pay-periods.controller";
|
||||||
import { Module } from "@nestjs/common";
|
import { Module } from "@nestjs/common";
|
||||||
|
import { PayPeriodsOverviewService } from "./services/pay-periods-overview.service";
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [PrismaModule],
|
imports: [PrismaModule],
|
||||||
providers: [PayPeriodsService],
|
providers: [
|
||||||
|
PayPeriodsService,
|
||||||
|
PayPeriodsOverviewService,
|
||||||
|
],
|
||||||
controllers: [PayPeriodsController],
|
controllers: [PayPeriodsController],
|
||||||
})
|
})
|
||||||
|
|
||||||
export class PayperiodModule {}
|
export class PayperiodsModule {}
|
||||||
Loading…
Reference in New Issue
Block a user