Download OpenAPI specification:
API для управления информацией о сотрудниках
Register a new employee or admin account. Only explicitly allowed fields are accepted. Admin-only fields (salary, position, mentorName, englishLevel, etc.) cannot be set during registration for security reasons. To create an admin, provide role='admin' and the correct secretWord from environment variable. Passwords are automatically hashed before storage.
| email required | string <email> Email address (must be unique) |
| password required | string <password> [ 6 .. 20 ] characters Password (6-20 characters, will be hashed) |
| firstName required | string [ 2 .. 40 ] characters First name (2-40 characters) |
| lastName required | string [ 2 .. 40 ] characters Last name (2-40 characters) |
| middleName required | string [ 2 .. 40 ] characters Middle name (2-40 characters) |
| birthDate required | string <date> Birth date (YYYY-MM-DD) |
| phone required | string <= 50 characters Phone number |
| programmingLanguage required | string <= 100 characters Primary programming language |
| role | string Enum: "employee" "admin" User role (defaults to employee if not provided) |
| secretWord | string Required ONLY for admin registration - must match SECRET_WORD environment variable |
{- "email": "user@example.com",
- "password": "pa$$word",
- "firstName": "string",
- "lastName": "string",
- "middleName": "string",
- "birthDate": "2019-08-24",
- "phone": "string",
- "programmingLanguage": "string",
- "role": "employee",
- "secretWord": "string"
}{- "message": "Пользователь успешно зарегистрирован",
- "userId": 1
}| type | string Notification type for filtering |
| sortBy | string Enum: "createdAt" "type" Field to sort notifications by |
| order | string Enum: "ASC" "DESC" Sort order (ASC for ascending, DESC for descending) |
| page | integer Default: 1 Page number for pagination |
| limit | integer Default: 10 Number of notifications per page |
{- "notifications": [
- {
- "id": 0,
- "message": "string",
- "userId": 0,
- "relatedUserId": 0,
- "type": "birthday_reminder",
- "eventDate": "2019-08-24",
- "isRead": false,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "total": 0,
- "page": 0,
- "totalPages": 0
}| id required | integer Notification ID |
{- "id": 0,
- "message": "string",
- "userId": 0,
- "relatedUserId": 0,
- "type": "birthday_reminder",
- "eventDate": "2019-08-24",
- "isRead": false,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Returns the profile data of the currently authenticated user
{- "id": 0,
- "firstName": "string",
- "lastName": "string",
- "middleName": "string",
- "birthDate": "2019-08-24",
- "phone": "string",
- "email": "user@example.com",
- "programmingLanguage": "string",
- "country": "string",
- "bankCard": "string",
- "registrationDate": "2019-08-24T14:15:22Z",
- "lastLoginDate": "2019-08-24T14:15:22Z",
- "salary": 0,
- "lastSalaryIncreaseDate": "2019-08-24T14:15:22Z",
- "position": "string",
- "mentorName": "string",
- "vacationDates": [
- "2019-08-24"
], - "adminNote": "string",
- "currentProject": "string",
- "englishLevel": "string",
- "workingHoursPerWeek": 0,
- "role": "employee",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Admin-only endpoint to create new employee accounts with all fields. Role defaults to 'employee' if not specified. Passwords are automatically hashed before storage. A notification is created for audit trail.
| email required | string <email> Email address (must be unique) |
| password required | string <password> [ 6 .. 20 ] characters Password (6-20 characters, will be hashed) |
| firstName required | string [ 2 .. 40 ] characters First name (2-40 characters) |
| lastName required | string [ 2 .. 40 ] characters Last name (2-40 characters) |
| middleName | string or null [ 2 .. 40 ] characters Middle name (2-40 characters, optional) |
| birthDate | string or null <date> Birth date (YYYY-MM-DD, optional) |
| phone | string or null <= 50 characters Phone number (optional) |
| programmingLanguage | string or null <= 100 characters Primary programming language (optional) |
| country | string or null Country (optional) |
| bankCard | string or null Bank card info (optional) |
| linkedinLink | string or null <uri> LinkedIn profile URL (optional) |
| githubLink | string or null <uri> GitHub profile URL (optional) |
| hireDate | string or null <date> Hire date (optional) |
| adminNote | string or null Admin notes (optional) |
| currentProject | string or null Current project assignment (optional) |
| englishLevel | string or null English proficiency level (optional) |
| vacationDates | Array of strings or null <date> [ items <date > ] Vacation dates (optional) |
| mentorName | string or null Assigned mentor (optional) |
| position | string or null Job position (optional) |
| salary | number or null Salary amount (optional) |
| role | string Enum: "employee" "admin" User role (defaults to employee if not provided) |
| workingHoursPerWeek | integer or null [ 0 .. 100 ] Working hours per week (0-100, optional) |
{- "email": "user@example.com",
- "password": "pa$$word",
- "firstName": "string",
- "lastName": "string",
- "middleName": "string",
- "birthDate": "2019-08-24",
- "phone": "string",
- "programmingLanguage": "string",
- "country": "string",
- "bankCard": "string",
- "hireDate": "2019-08-24",
- "adminNote": "string",
- "currentProject": "string",
- "englishLevel": "string",
- "vacationDates": [
- "2019-08-24"
], - "mentorName": "string",
- "position": "string",
- "salary": 0,
- "role": "employee",
- "workingHoursPerWeek": 100
}{- "message": "Сотрудник успешно создан",
- "user": {
- "id": 0,
- "firstName": "string",
- "lastName": "string",
- "middleName": "string",
- "birthDate": "2019-08-24",
- "phone": "string",
- "email": "user@example.com",
- "programmingLanguage": "string",
- "country": "string",
- "bankCard": "string",
- "registrationDate": "2019-08-24T14:15:22Z",
- "lastLoginDate": "2019-08-24T14:15:22Z",
- "salary": 0,
- "lastSalaryIncreaseDate": "2019-08-24T14:15:22Z",
- "position": "string",
- "mentorName": "string",
- "vacationDates": [
- "2019-08-24"
], - "adminNote": "string",
- "currentProject": "string",
- "englishLevel": "string",
- "workingHoursPerWeek": 0,
- "role": "employee",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
}| page | integer Default: 1 Page number |
| limit | integer Default: 10 Number of users per page |
| firstName | string Search by first name |
| lastName | string Search by last name |
| sortBy | string Default: "registrationDate" Enum: "registrationDate" "programmingLanguage" "country" "mentorName" "englishLevel" "position" Field to sort by |
| order | string Default: "ASC" Enum: "ASC" "DESC" Sort order |
{- "users": [
- {
- "id": 0,
- "firstName": "string",
- "lastName": "string",
- "middleName": "string",
- "birthDate": "2019-08-24",
- "phone": "string",
- "email": "user@example.com",
- "programmingLanguage": "string",
- "country": "string",
- "bankCard": "string",
- "registrationDate": "2019-08-24T14:15:22Z",
- "lastLoginDate": "2019-08-24T14:15:22Z",
- "salary": 0,
- "lastSalaryIncreaseDate": "2019-08-24T14:15:22Z",
- "position": "string",
- "mentorName": "string",
- "vacationDates": [
- "2019-08-24"
], - "adminNote": "string",
- "currentProject": "string",
- "englishLevel": "string",
- "workingHoursPerWeek": 0,
- "role": "employee",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "total": 0,
- "page": 0,
- "totalPages": 0
}Update user profile. Employees can update their own basic profile fields (firstName, lastName, middleName, birthDate, phone, email, programmingLanguage, country, bankCard, linkedinLink, githubLink). Admins can update all fields including admin-only fields (hireDate, adminNote, currentProject, englishLevel, vacationDates, mentorName, position, salary, role, password, workingHoursPerWeek). Passwords are automatically hashed when updated.
| id required | integer User ID |
| firstName | string [ 2 .. 40 ] characters First name - employees can update their own |
| lastName | string [ 2 .. 40 ] characters Last name - employees can update their own |
| middleName | string [ 2 .. 40 ] characters Middle name - employees can update their own |
| birthDate | string <date> Birth date - employees can update their own |
| phone | string <= 50 characters Phone number - employees can update their own |
string <email> Email address (must be unique) - employees can update their own | |
| programmingLanguage | string <= 100 characters Programming language - employees can update their own |
| country | string or null Country - employees can update their own |
| bankCard | string or null Bank card info - employees can update their own |
| linkedinLink | string or null <uri> LinkedIn profile URL - employees can update their own |
| githubLink | string or null <uri> GitHub profile URL - employees can update their own |
| hireDate | string or null <date> Hire date - ADMIN ONLY |
| adminNote | string or null Admin notes - ADMIN ONLY |
| currentProject | string or null Current project assignment - ADMIN ONLY |
| englishLevel | string or null English proficiency level - ADMIN ONLY |
| vacationDates | Array of strings or null <date> [ items <date > ] Vacation dates - ADMIN ONLY |
| mentorName | string or null Assigned mentor - ADMIN ONLY |
| position | string or null Job position - ADMIN ONLY |
| salary | number or null Salary amount - ADMIN ONLY |
| role | string Enum: "employee" "admin" User role - ADMIN ONLY |
| password | string <password> [ 6 .. 20 ] characters New password (will be automatically hashed) - ADMIN ONLY |
| workingHoursPerWeek | integer or null [ 0 .. 100 ] Working hours per week - ADMIN ONLY |
{- "firstName": "string",
- "lastName": "string",
- "middleName": "string",
- "birthDate": "2019-08-24",
- "phone": "string",
- "email": "user@example.com",
- "programmingLanguage": "string",
- "country": "string",
- "bankCard": "string",
- "hireDate": "2019-08-24",
- "adminNote": "string",
- "currentProject": "string",
- "englishLevel": "string",
- "vacationDates": [
- "2019-08-24"
], - "mentorName": "string",
- "position": "string",
- "salary": 0,
- "role": "employee",
- "password": "pa$$word",
- "workingHoursPerWeek": 100
}{- "id": 0,
- "firstName": "string",
- "lastName": "string",
- "middleName": "string",
- "birthDate": "2019-08-24",
- "phone": "string",
- "email": "user@example.com",
- "programmingLanguage": "string",
- "country": "string",
- "bankCard": "string",
- "registrationDate": "2019-08-24T14:15:22Z",
- "lastLoginDate": "2019-08-24T14:15:22Z",
- "salary": 0,
- "lastSalaryIncreaseDate": "2019-08-24T14:15:22Z",
- "position": "string",
- "mentorName": "string",
- "vacationDates": [
- "2019-08-24"
], - "adminNote": "string",
- "currentProject": "string",
- "englishLevel": "string",
- "workingHoursPerWeek": 0,
- "role": "employee",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}| id required | integer Employee ID |
{- "id": 0,
- "firstName": "string",
- "lastName": "string",
- "middleName": "string",
- "birthDate": "2019-08-24",
- "phone": "string",
- "email": "user@example.com",
- "programmingLanguage": "string",
- "country": "string",
- "bankCard": "string",
- "registrationDate": "2019-08-24T14:15:22Z",
- "lastLoginDate": "2019-08-24T14:15:22Z",
- "salary": 0,
- "lastSalaryIncreaseDate": "2019-08-24T14:15:22Z",
- "position": "string",
- "mentorName": "string",
- "vacationDates": [
- "2019-08-24"
], - "adminNote": "string",
- "currentProject": "string",
- "englishLevel": "string",
- "workingHoursPerWeek": 0,
- "role": "employee",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}