Skip to content

Commit

Permalink
MOSIP-36852 - fix scenario3 (Prereg_BookAppointmentByPRID_blank_preRe…
Browse files Browse the repository at this point in the history
…gistrationId) (#800)

* MOSIP-36852 - fix scenario3 (Prereg_BookAppointmentByPRID_blank_preRegistrationId) (#754)

Signed-off-by: ymahtat-dev <youssef.mahtat.as.developer@gmail.com>
Signed-off-by: Youssef MAHTAT <youssef.mahtat.as.developer@gmail.com>

* MOSIP-36852 - github actions fix - update actions/upload-artifact to version 4

Signed-off-by: Youssef MAHTAT <youssef.mahtat.as.developer@gmail.com>

---------

Signed-off-by: ymahtat-dev <youssef.mahtat.as.developer@gmail.com>
Signed-off-by: Youssef MAHTAT <youssef.mahtat.as.developer@gmail.com>
  • Loading branch information
ymahtat-dev authored Jan 22, 2025
1 parent d8dc84a commit d749656
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ jobs:
find ${{ env.SERVICE_LOCATION }} -path '*/target/*' -exec zip ${{ env.BUILD_ARTIFACT }}.zip {} +
- name: Upload the springboot jars
if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_ARTIFACT }}
path: ${{ env.BUILD_ARTIFACT }}.zip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public MainResponseDTO<BookingRegistrationDTO> getAppointmentDetails(String preR
}

private void userValidation(String applicationId) {
this.applicationIdValidation(applicationId);
String authUserId = authUserDetails().getUserId();
List<String> list = listAuth(authUserDetails().getAuthorities());
if (list.contains("ROLE_INDIVIDUAL")) {
Expand All @@ -155,7 +156,7 @@ private void userValidation(String applicationId) {
+ " and userID " + authUserId);
ApplicationEntity applicationEntity = null;
try {
applicationEntity = applicationRepostiory.findByApplicationId(applicationId);
applicationEntity = applicationRepostiory.findById(applicationId).orElseThrow();
} catch (Exception ex) {
log.error(LOGGER_SESSIONID, LOGGER_IDTYPE, LOGGER_ID,
"Invaid applicationId/Not Record Found for the ID : " + applicationId);
Expand All @@ -169,6 +170,15 @@ private void userValidation(String applicationId) {
}
}

private void applicationIdValidation(String applicationId) {
if (applicationId == null || applicationId.trim().isEmpty()) {
throw new AppointmentExecption(
ApplicationErrorCodes.PRG_APP_013.getCode(),
"preRegistrationId cannot be empty."
);
}
}

/**
* This method is used to get the list of authorization role
*
Expand Down

0 comments on commit d749656

Please sign in to comment.