-
Notifications
You must be signed in to change notification settings - Fork 0
[Feature] implement getting pending enrollment requests #570
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
serggalel
merged 14 commits into
dev
from
feature/implement-getting-pending-enrollment-requests
Aug 27, 2026
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
858daad
feat(applications): create and update necessary dtos
serggalel b44aec5
feat(applications): create an assembler and update the repository
serggalel 1a6746e
feat(applications): create a mapper and update the service
serggalel 10d979d
feat(applications): update the service and controller
serggalel a516429
feat(invitations): create dto and specifications
serggalel bccd480
feat(invitations): update the repository
serggalel 1721bde
feat(invitations): update the repository and services
serggalel 9ff6550
feat: update the controllers
serggalel 83aecb8
feat(applications): add specification and update service&controller
serggalel 26bbc15
feat: update the repository and service
serggalel 85c6cdc
feat: add tests
serggalel 83ad458
feat: add missing swagger docs
serggalel 87deee4
fix: coderabbit issues
serggalel 6b66453
fix: coderabbit issues#2
serggalel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...om/itasocialacademy/oitassist/participation/dao/dto/request/AbstractEnrollmentFilter.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package com.itasocialacademy.oitassist.participation.dao.dto.request; | ||
|
|
||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
| import lombok.Setter; | ||
| import lombok.experimental.SuperBuilder; | ||
|
|
||
| @SuperBuilder | ||
| @Getter | ||
| @Setter | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public abstract class AbstractEnrollmentFilter { | ||
| @Schema( | ||
| description = "Unique identifier of the competition", | ||
| example = "1", | ||
| requiredMode = Schema.RequiredMode.REQUIRED) | ||
| @NotNull | ||
| private Long competitionId; | ||
| @Schema( | ||
| description = "Unique identifier of the stage", | ||
| example = "2", | ||
| requiredMode = Schema.RequiredMode.REQUIRED) | ||
| @NotNull | ||
| private Long stageId; | ||
| } |
17 changes: 17 additions & 0 deletions
17
...om/itasocialacademy/oitassist/participation/dao/dto/request/EnrollmentRequestsFilter.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| package com.itasocialacademy.oitassist.participation.dao.dto.request; | ||
|
|
||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.EqualsAndHashCode; | ||
| import lombok.Getter; | ||
| import lombok.Setter; | ||
| import lombok.experimental.SuperBuilder; | ||
|
|
||
| @Getter | ||
| @Setter | ||
| @AllArgsConstructor | ||
| @EqualsAndHashCode(callSuper = true) | ||
| @SuperBuilder | ||
| @Schema(description = "DTO for getting the enrollment requests list.") | ||
| public class EnrollmentRequestsFilter extends AbstractEnrollmentFilter { | ||
| } |
13 changes: 13 additions & 0 deletions
13
...tasocialacademy/oitassist/participation/dao/dto/response/ApplicationListItemResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package com.itasocialacademy.oitassist.participation.dao.dto.response; | ||
|
|
||
| import com.itasocialacademy.oitassist.participation.dao.enums.RequestStatus; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import java.time.Instant; | ||
|
|
||
| @Schema(description = "DTO representing the each application request's details in the list.") | ||
| public record ApplicationListItemResponse( | ||
| @Schema(description = "Unique identifier of the request", example = "1") Long applicationId, | ||
| @Schema(description = "Request creation date", example = "2026-06-07T09:50:30Z") Instant issuedAt, | ||
| @Schema(description = "Current request status", example = "PENDING") RequestStatus status, | ||
| UserSummary user) { | ||
| } |
13 changes: 13 additions & 0 deletions
13
...itasocialacademy/oitassist/participation/dao/dto/response/InvitationListItemResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package com.itasocialacademy.oitassist.participation.dao.dto.response; | ||
|
|
||
| import com.itasocialacademy.oitassist.participation.dao.enums.RequestStatus; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import java.time.Instant; | ||
|
|
||
| @Schema(description = "DTO representing the each invitation's details in the list.") | ||
| public record InvitationListItemResponse( | ||
| @Schema(description = "Unique identifier of the request", example = "1") Long invitationId, | ||
| @Schema(description = "Request creation date", example = "2026-06-07T09:50:30Z") Instant issuedAt, | ||
| @Schema(description = "Current request status", example = "PENDING") RequestStatus status, | ||
| UserSummary user) { | ||
| } |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/itasocialacademy/oitassist/participation/dao/dto/response/UserSummary.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package com.itasocialacademy.oitassist.participation.dao.dto.response; | ||
|
|
||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
|
|
||
| @Schema(description = "DTO representing the each user's details of each enrollment request in the list.") | ||
| public record UserSummary( | ||
| @Schema(description = "User's first name", example = "Ivan") String firstName, | ||
| @Schema(description = "User's surname", example = "Petrenko") String surname, | ||
| @Schema(description = "User's email address", example = "ivapetr@gmail.com") String email) { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
.../itasocialacademy/oitassist/participation/dao/specification/ApplicationSpecification.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package com.itasocialacademy.oitassist.participation.dao.specification; | ||
|
|
||
| import com.itasocialacademy.oitassist.participation.dao.enums.RequestStatus; | ||
| import com.itasocialacademy.oitassist.participation.dao.model.Application; | ||
| import lombok.AccessLevel; | ||
| import lombok.NoArgsConstructor; | ||
| import org.springframework.data.jpa.domain.Specification; | ||
| import java.util.List; | ||
|
|
||
| @NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
| public class ApplicationSpecification { | ||
| public static Specification<Application> hasCompetitionAndStage(Long competitionId, Long stageId) { | ||
| return (root, query, cb) -> cb.and( | ||
| cb.equal(root.get("competitionId"), competitionId), | ||
| cb.equal(root.get("stageId"), stageId)); | ||
| } | ||
|
|
||
| public static Specification<Application> userIdIn(List<Long> userIds) { | ||
| return (root, query, cb) -> userIds == null | ||
| ? cb.conjunction() | ||
| : root.get("issuedBy").in(userIds); | ||
| } | ||
|
|
||
| public static Specification<Application> hasStatus(RequestStatus status) { | ||
| return (root, query, cb) -> cb.and( | ||
| cb.equal(root.get("status"), status)); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.