This platform allows users to register themselves in the system, view information about their contracts, and submit requests for sick leave and vacation. It enables accountants and managers to create employment contracts and track/manage absences. It can be used in organizational contexts where absence tracking and contract management are essential, such as human resources systems or employee management platforms.
- User Registration: Sign up users with unique credentials, validate user input, and store securely.
- Contract Creation: Create and manage contracts between users and the system.
- Absence Management: Allow users to report, track, and manage absences.
- Backend: Python, Flask
- Database: PostgresSQL, AWS S3
- Authentication: JWT (JSON Web Tokens)
- Other: Postman for API testing, Pytest, SES-AWS
- Clone the repository:
git clone https://github.com/VelmiraPetkova/Employee-Management-System/.git
- Navigate to the project directory:
cd Employee-Management-System
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
- Create a
.env
file in the root directory with the following keys:
DB_USER=postgres-user DB_PASSWORD=password DB_HOST=127.0.0.1 DB_PORT=5432 DB_NAME=payrollsystem JWT_SECRET=your_secret_key
- Create a
- Start the server:
flask run
- Endpoint:
POST /register
- URL:
http://127.0.0.1:5000/register
- Description: Register a new user.
- Postman Setup:
- Method: POST
- Body: JSON (raw)
{ "name": "Testname Example", "civil_number": "1111111111", "phone": "08811111", "iban": "BG70BNBG47622021445672", "email": "[email protected]", "password": "Password-example1" }
- Headers:
Content-Type
:application/json
- Endpoint:
POST /login
- URL:
http://127.0.0.1:5000/login
- Description: Log in an existing user.
- Postman Setup:
- Method: POST
- Body: JSON (raw)
{ "username": "example_user", "password": "example_password" }
- Headers:
Content-Type
:application/json
- Endpoint:
POST /contract
- URL:
http://127.0.0.1:5000/contract
- Description: Create or manage a contract.This method requires that your role in the system is Accountant
- Postman Setup:
- Method: POST
- Body: JSON (raw)
{ "employee": 1, "effective": "2024-10-14", "salary": 1000, "hours": 8, "department": "example_department", "position": "example_position" }
- Headers:
Content-Type
:application/json
Authorization
:Bearer
- Endpoint:
GET /contract
- URL:
http://127.0.0.1:5000/contract
- Description: Review your contract, or the contract of your employees.
- Postman Setup:
- Method: POST
- Headers:
Content-Type
:application/json
Authorization
:Bearer
- Endpoint:
POST /absenceregister
- URL:
http://127.0.0.1:5000/absenceregister
- Description: Register a new absence.
- Postman Setup:
- Method: POST
- Body: JSON (raw)
{ "from_": "2024-10-20", "to_": "2024-10-20", "days": "2", "employee": "2", "type": "sick", "photo":"/9j/4AAQSkZJRgABAQAAAQABAAD/…", "photo_extension":"jpeg" }
- Headers:
Content-Type
:application/json
Authorization
:Bearer
- Endpoint:
PUT /addmanager/user/<int:user_id>
- URL:
http://127.0.0.1:5000/addmanager/user/1
- Description: Assign a manager to a specified user.
- Postman Setup:
- Method: PUT
- Body: JSON (raw)
{ "manager_id": 2 }
- Headers:
Content-Type
:application/json
Authorization
:Bearer
- Endpoint:
GET /absences/<int:absence_id>/approve
- URL:
http://127.0.0.1:5000/absences/1/approve
- Description: Approve a pending absence request.
- Postman Setup:
- Method: PUT
- Headers:
Content-Type
:application/json
Authorization
:Bearer
- Endpoint:
GET /absences/<int:absence_id>/reject
- URL:
http://127.0.0.1:5000/absences/1/reject
- Description: Reject a pending absence request.
- Postman Setup:
- Method: PUT
- Headers:
Content-Type
:application/json
Authorization
:Bearer
- Endpoint:
PUT /change/<int:contract_id>/contract
- URL:
http://127.0.0.1:5000/change/1/contract
- Description: Update details of an existing contract.
- Postman Setup:
- Method: PUT
- Body: JSON (raw)
{ "position": "Lead Developer" }
- Headers:
Content-Type
:application/json
Authorization
:Bearer
- Endpoint:
DELETE /absences/<int:absence_id>/delete
- URL:
http://127.0.0.1:5000/absences/1/delete
- Description: Delete an absence record.
- Postman Setup:
- Method: DELETE
- Headers:
Content-Type
:application/json
Authorization
:Bearer