Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions apps/api/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["employees"]
},
"post": {
Expand All @@ -147,6 +152,9 @@
}
},
"security": [
{
"bearer": []
},
{
"bearer": []
}
Expand All @@ -172,6 +180,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["employees"]
},
"put": {
Expand Down Expand Up @@ -202,6 +215,9 @@
}
},
"security": [
{
"bearer": []
},
{
"bearer": []
}
Expand All @@ -226,6 +242,9 @@
}
},
"security": [
{
"bearer": []
},
{
"bearer": []
}
Expand Down Expand Up @@ -262,6 +281,9 @@
}
},
"security": [
{
"bearer": []
},
{
"bearer": []
}
Expand All @@ -288,6 +310,9 @@
}
},
"security": [
{
"bearer": []
},
{
"bearer": []
}
Expand Down Expand Up @@ -1794,6 +1819,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["requests"]
},
"post": {
Expand All @@ -1814,6 +1844,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["requests"]
}
},
Expand All @@ -1835,6 +1870,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["requests"]
}
},
Expand All @@ -1856,6 +1896,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["requests"]
}
},
Expand All @@ -1878,6 +1923,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["requests"]
}
},
Expand Down Expand Up @@ -1909,6 +1959,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["requests"]
}
},
Expand Down Expand Up @@ -1940,6 +1995,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["requests"]
}
},
Expand Down Expand Up @@ -1971,6 +2031,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["requests"]
}
},
Expand Down Expand Up @@ -2002,6 +2067,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["requests"]
}
},
Expand Down Expand Up @@ -2033,6 +2103,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["requests"]
}
},
Expand Down Expand Up @@ -2064,6 +2139,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["requests"]
}
},
Expand Down Expand Up @@ -2095,6 +2175,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["requests"]
}
},
Expand Down Expand Up @@ -2126,6 +2211,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["requests"]
}
},
Expand Down Expand Up @@ -2157,6 +2247,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["requests"]
}
},
Expand Down Expand Up @@ -2188,6 +2283,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["requests"]
}
},
Expand All @@ -2210,6 +2310,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["requests"]
}
},
Expand All @@ -2232,6 +2337,11 @@
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"tags": ["requests"]
}
},
Expand Down
14 changes: 11 additions & 3 deletions apps/api/src/app/employees/employees.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ import {
} from './employees.dto';

@ApiTags('employees')
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@Controller('employees')
export class EmployeesController {
constructor(private readonly employees: EmployeesService) {}

@Get()
list(@Query('includeInactive') includeInactive?: string): Promise<EmployeeDto[]> {
list(
@Query('includeInactive') includeInactive?: string,
): Promise<EmployeeDto[]> {
return this.employees.list({ includeInactive: includeInactive === 'true' });
}

Expand Down Expand Up @@ -74,15 +78,19 @@ export class EmployeesController {
@ApiBearerAuth()
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles('HRAdmin')
deactivate(@Param('id', new ParseUUIDPipe()) id: string): Promise<EmployeeDto> {
deactivate(
@Param('id', new ParseUUIDPipe()) id: string,
): Promise<EmployeeDto> {
return this.employees.deactivate(id);
}

@Post(':id/reactivate')
@ApiBearerAuth()
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles('HRAdmin')
reactivate(@Param('id', new ParseUUIDPipe()) id: string): Promise<EmployeeDto> {
reactivate(
@Param('id', new ParseUUIDPipe()) id: string,
): Promise<EmployeeDto> {
return this.employees.reactivate(id);
}
}
Loading
Loading