Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat session: service, controller, entity #15

Merged
merged 38 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0a4de94
Fix missing dependencies and imports (#9)
AlbertoBaroso Nov 23, 2023
27f282f
docs: updated project description, useful links, and contributors in …
AlbertoBaroso Dec 7, 2023
9f52fdf
feat session: service, controller, entity
whiitex Dec 11, 2023
7014267
Merge branch 'dev' of https://github.com/MuNuChapterHKN/HKrecruitment…
whiitex Dec 11, 2023
97aa948
feat upd recruitment-session: service, controller, entity
whiitex Dec 28, 2023
7f1e3d8
feat upd recruitment-session: service, controller, entity
whiitex Dec 28, 2023
f3aedbf
upd dependencies in shared/abilities
whiitex Jan 7, 2024
70964e7
mock
whiitex Jan 7, 2024
0f046a7
mock formatted
whiitex Jan 7, 2024
37c060e
upd date array
whiitex Jan 12, 2024
0e21b0e
upd date array, format
whiitex Jan 12, 2024
e7bf426
upd date array2
whiitex Jan 12, 2024
0fddaee
upd date array3
whiitex Jan 12, 2024
d8daacc
upd date array4
whiitex Jan 12, 2024
39b010c
upd date array5
whiitex Jan 12, 2024
3600b0b
mock shared -> required/optional fields
whiitex Jan 13, 2024
4470ea8
mock shared -> required/optional fields 2
whiitex Jan 13, 2024
dffa94f
upd date string
whiitex Jan 13, 2024
c314bd9
upd date string2
whiitex Jan 13, 2024
dfe1433
upd date string3
whiitex Jan 13, 2024
d4bf3b9
upd date string check
whiitex Jan 13, 2024
c2d69bd
mock recruitment session service, insert data mock
whiitex Jan 14, 2024
2c77714
mock service
whiitex Jan 14, 2024
09e737b
mock update
whiitex Jan 14, 2024
5b51f0c
upd shared mock
whiitex Jan 14, 2024
8971cf1
fix: relative import of recruitment-session from shared folder
AlbertoBaroso Jan 19, 2024
f95f5db
fix: recruitment-session service Delete test
AlbertoBaroso Jan 19, 2024
70e4e5a
fix: removed lastModified from UpdateRecruitmentSessionDto
AlbertoBaroso Jan 19, 2024
5fc8fed
fix: ability check on recruitment session creation
AlbertoBaroso Jan 19, 2024
9190905
feat: check if recruitment session has pending interviews before dele…
AlbertoBaroso Jan 21, 2024
d0e4524
feat: check for conflicts and consistency when updating a recruitment…
AlbertoBaroso Jan 21, 2024
2d8bfea
fix: check ability for update recruitment session
AlbertoBaroso Jan 21, 2024
f40d727
refactor: removed unused imports in recruitment-session.controller.ts
AlbertoBaroso Jan 21, 2024
3bcac19
fix: use const for unchanged variable in createRecruitmentSession ser…
AlbertoBaroso Jan 21, 2024
dc45a8e
refactor: removed unused code in creatre-recruitment-session.dto.ts
AlbertoBaroso Jan 21, 2024
ce62385
fix: updated Date[] in create and update Recruitment session DTOs
AlbertoBaroso Jan 21, 2024
74d1a9c
test: Recruitment Session Controller tests
AlbertoBaroso Jan 21, 2024
598f2dc
refactor: removed unused imports
AlbertoBaroso Jan 21, 2024
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
40 changes: 29 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
<img src="https://hknpolito.org/wp-content/uploads/2018/05/hkn_logo_blu.png" width="100">
<img src="https://www.hknpolito.org/Signature/hkn_logo_blu.png" width="100">

# HKrecruitment
HKrecruitment is the platform used by HKN Polito to handle
the recruitment process. This repository contains three branches:
* **apiserver** - tracks the development of the API server
* **reactapp** - tracks the development of the front-end React application
* **documentation** - track the documentation for both the API server and the React application

Trello for project state https://trello.com/invite/b/T6YYVYW3/ATTI0e7257a02d61a8b4fe54ac88affe746346110847/hkrecruitment
HKrecruitment is the platform used by HKN Polito to handle the recruitment process.

## Authors
This repository follows the strcuture:

* **Riccardo Zaccone** - *API server* - [HKN Polito](https://hknpolito.org/)
* **Arianna Ravera** - *API server* - [HKN Polito](https://hknpolito.org/)
* **Marco Pappalardo** - *React application* - [HKN Polito](https://hknpolito.org/)
- **api** - API endpoints, back-end logic, and data storage
- **frontend** - React Application UI
- **shared** - Models, interfaces, and validation logic common to front-end and back-end

## Useful Links

[Reports](https://drive.google.com/drive/folders/1RqGVtzU4TV6RJPmtjZQPpHVybDpU6DZk?usp=sharing)

[Trello](https://trello.com/b/vnLyKH85/hkrecruitment)

[UI Mockups](https://miro.com/app/board/uXjVOdvzKAk=/)

[Database Schema](https://app.diagrams.net/#G19QUWxP5BBB3tWXnATnHP8wFE4wW7NsXw)

## Contributors

- **Riccardo Zaccone** - _API server_ - [HKN Polito](https://hknpolito.org/)
- **Arianna Ravera** - _API server_ - [HKN Polito](https://hknpolito.org/)
- **Vincenzo Pellegrini** - _API server_ - [HKN Polito](https://hknpolito.org/)
- **Alberto Baroso** - _API server_ - [HKN Polito](https://hknpolito.org/)
- **Marco De Luca** - _API server_ - [HKN Polito](https://hknpolito.org/)
- **Matteo Mugnai** - _API server_ - [HKN Polito](https://hknpolito.org/)
- **Pasquale Bianco** - _API server_ - [HKN Polito](https://hknpolito.org/)

- **Marco Pappalardo** - _React application_ - [HKN Polito](https://hknpolito.org/)
- **Damiano Bonaccorsi** - _React application_ - [HKN Polito](https://hknpolito.org/)

## License

HKRecruitment is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. See the [COPYING](COPYING) file for details.
7 changes: 4 additions & 3 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@casl/ability": "^6.3.3",
"@fastify/static": "^6.6.0",
"@hkrecruitment/shared": "workspace:*",
"@joi/date": "^2.1.0",
"@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.2.0",
"@nestjs/core": "^9.0.0",
Expand All @@ -34,9 +35,9 @@
"@types/js-yaml": "^4.0.5",
"@types/passport-jwt": "^3.0.7",
"class-transformer": "^0.5.1",
"dotenv": "^16.0.3",
"google-auth-library": "^8.7.0",
"googleapis": "^118.0.0",
"dotenv": "^16.0.3",
"joi": "^17.7.0",
"js-yaml": "^4.1.0",
"jwks-rsa": "^3.0.0",
Expand All @@ -49,7 +50,6 @@
"webpack": "^5.75.0"
},
"devDependencies": {
"@types/multer": "^1.4.7",
"@automock/jest": "^1.0.1",
"@golevelup/ts-jest": "^0.3.6",
"@nestjs/cli": "^9.0.0",
Expand All @@ -59,6 +59,7 @@
"@swc/jest": "^0.2.26",
"@types/express": "^4.17.14",
"@types/jest": "28.1.8",
"@types/multer": "^1.4.7",
"@types/node": "^16.11.10",
"@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "^5.0.0",
Expand Down Expand Up @@ -99,7 +100,7 @@
],
"moduleNameMapper": {
"^@mocks/(.*)$": "<rootDir>/src/mocks/$1"
},
},
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
Expand Down
36 changes: 36 additions & 0 deletions api/src/mocks/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import {
PhdApplication,
} from 'src/application/application.entity';
import { UpdateApplicationDto } from 'src/application/update-application.dto';
import { RecruitmentSessionState } from '@hkrecruitment/shared/recruitment-session';
import { CreateRecruitmentSessionDto } from 'src/recruitment-session/create-recruitment-session.dto';
import { UpdateRecruitmentSessionDto } from 'src/recruitment-session/update-recruitment-session.dto';

export const testDate = new Date(2023, 0, 1);
export const testDateTimeStart = new Date(2023, 0, 1, 10, 30, 0);
Expand All @@ -24,6 +27,39 @@ export const mockTimeSlot = {
id: 1,
};

export const testInterviewStart = '11:55' as unknown as Date;
export const testInterviewEnd = '20:35' as unknown as Date;
export const testDay1 = '2024-10-20' as unknown as Date;
export const testDay2 = '2024-10-21' as unknown as Date;
export const testDay3 = '2024-10-22' as unknown as Date;
export const testDateCreatedAt = '2024-9-10' as unknown as Date;
export const testDateLastModified = '2024-9-12' as unknown as Date;

export const mockRecruitmentSession = {
id: 1,
state: RecruitmentSessionState.Active,
slotDuration: 50,
interviewStart: testInterviewStart,
interviewEnd: testInterviewEnd,
days: [testDay1, testDay2, testDay3],
createdAt: testDateCreatedAt,
lastModified: testDateLastModified,
};

export const mockCreateRecruitmentSessionDto = {
slotDuration: 50,
interviewStart: testInterviewStart,
interviewEnd: testInterviewEnd,
days: [testDay1, testDay2, testDay3],
} as CreateRecruitmentSessionDto;

export const mockUpdateRecruitmentSessionDto = {
slotDuration: 50,
interviewStart: testInterviewStart,
interviewEnd: testInterviewEnd,
days: [testDay1, testDay2, testDay3],
} as UpdateRecruitmentSessionDto;

export const baseFile = {
encoding: '7bit',
mimetype: 'application/pdf',
Expand Down
18 changes: 18 additions & 0 deletions api/src/recruitment-session/create-recruitment-session.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { RecruitmentSession } from '@hkrecruitment/shared/recruitment-session';
import { ApiProperty } from '@nestjs/swagger';

export class CreateRecruitmentSessionDto
implements Partial<RecruitmentSession>
{
@ApiProperty()
slotDuration: number;

@ApiProperty()
interviewStart: Date;

@ApiProperty()
interviewEnd: Date;

@ApiProperty({ isArray: true })
days: Date[];
}
14 changes: 14 additions & 0 deletions api/src/recruitment-session/recruitment-session-response.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {
RecruitmentSession,
RecruitmentSessionState,
} from '@hkrecruitment/shared/recruitment-session';
import { Exclude, Expose } from 'class-transformer';

@Exclude()
export class RecruitmentSessionResponseDto
implements Partial<RecruitmentSession>
{
@Expose() id: number;
@Expose() createdAt: Date;
@Expose() state: RecruitmentSessionState;
}
Loading