-
Task Management
- Creating tasks
- Editing tasks
- Deleting tasks
- Viewing tasks
- Each task must include the following information:
- Title
- Description
- Status (e.g., "pending", "in progress", "completed")
- Priority (e.g., "high", "medium", "low")
- Comments
- Task author (Reporter) and task executor (Assignee)
-
Authentication and Authorization
- User authentication and authorization should be done with email and password.
- API access should be authenticated using JWT tokens.
-
Role System
- Admin and user roles should be created.
- Admin permissions:
- Manage all tasks (create, edit, view, delete)
- Change task status and priority
- Assign tasks to executors
- Leave comments
- User permissions:
- Manage only tasks assigned to them (change status, leave comments)
-
Filtering and Pagination of Tasks
- Tasks should be filtered by author (Reporter) or executor (Assignee).
- Tasks should be paginated.
-
Error Handling and Data Validation
- System should handle errors properly and return understandable messages to users.
- Incoming data should be validated.
-
Documentation
- API should be documented using OpenAPI and Swagger.
- Swagger UI should be configured.
- A README file should be created with local setup instructions.
-
Development Environment
- Development environment should be created using docker-compose.
- Basic unit tests should be written for core functionalities.
+--------------------+
| Admin |
+--------------------+
|
|
+----------------+----------------+----------------+
| | | |
| | | |
+------------+ +-------------+ +-----------+ +-------------+
| View Tasks | | Create Task | | Edit Task | | Delete Task |
+------------+ +-------------+ +-----------+ +-------------+
|
|
+--------------------+------------------+---------------+
| | | |
| | | |
+---------------+ +---------------+ +---------------+ +---------------+
| Change Status | |Change Priority| | Assign Task | | Leave Comment |
+---------------+ +---------------+ +---------------+ +---------------+
+---------------------+
| User |
+---------------------+
|
|
+---------------------+
| View Assigned Tasks |
+---------------------+
|
|
+-----------------------------------+
| |
| |
+---------------+ +----------------+
| Change Status | | Leave Comments |
+---------------+ +----------------+
┌──────────────────┐ ┌──────────────────────┐ ┌──────────────────┐
│ Roles │ │ Users │ │ Tasks │
├──────────────────┤ 1:N ├──────────────────────┤ ├──────────────────┤
│ role_id (PK) ├─────────────────┤ user_id (PK) │ 1:N │ task_id (PK) │
│ role_name │ │ username ├─────────────────┤ title │
└──────────────────┘ │ email │ 1:N │ description │
│ password ├─────────────────┤ status │
│ role_id (FK) │ │ priority │
│ created_at │ │ author_id (FK) │
│ updated_at │ │ assignee_id (FK) │
└───────┬──────────────┘ │ created_at │
│ │ updated_at │
│ └────────┬─────────┘
│ │
│ │
│ │
│ │
│ │
┌──────────────────┐ │ │
│ Comments │ │ │
├──────────────────┤ 1:N │ │
│ comment_id (PK) │ │ │
│ content ├─────────────────────────┘ │
│ task_id (FK) │←──────────────────────────────────────────────────────────────────┘
│ user_id (FK) │ 1:N
│ created_at │
│ updated_at │
└──────────────────┘
-
Users and Roles:
- Each user can have one role (role_id).
- Each role can be assigned to many users.
-
Users and Tasks:
- author_id: Only admin users can create tasks. (1:N)
- assignee_id: Each user can be assigned to many tasks. (1:N)
-
Tasks and Comments:
- task_id: Each task can have many comments. (1:N)
-
Users and Comments:
- user_id: Each user can leave many comments. (1:N)
Class : %84
Methods : %74
To access Swagger doc, click live link below.
Swagger / OpenAPI : http://localhost:8080/swagger-ui/swagger-ui/index.html
Postman Collection To run the collection in your postman:
1. Sign Up as Admin or User
2. Using the email as username and password to sign in to receive token.
3. Copy the generated token and save it as variable. Variables are defined in parent level so all API's will inherit them.
4. API Authorization must be Bearer Token and the token value reference the token variable
5. User API getAllUsers method retrieves all the registered users. Note that user id 51 has no task for now.
6. As an admin we can create task and assign it to user with any role type. Notice that the new task is assigned to user with id 51 - which previously didnt have a task.
But if you try to create a task as a user, you will receive a warning
7. You can customize task search by using following dynamic search criterias: taskId
, taskStatus
, taskPriority
,authorId
,assigneeId
,page
,size
. You can use any of the filter. By default per page it shows 10 elements. If there are more than 10 elements, it will load second page
8. Admin can delete tasks but users are not allowed.
9. Admins can add comments to any task. Users can leave comment if only the task is assigned to them. For example, admin will add a new comment to task 1
of userId 50
If you try to add comment as a user with id different than 50, you will receive a warning.
- Java 17+
- Spring Boot
- PostgreSQL
- Spring Security JWT
- Docker