Skip to content

Commit

Permalink
GAP-2537: address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
a-lor-cab committed Apr 17, 2024
1 parent e6c1ca8 commit 2999f05
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ public ResponseEntity<SchemeMandatoryQuestionApplicationFormInfosDto> schemeHasI
final GrantScheme grantScheme = grantSchemeService.getSchemeById(grantSchemeId);
log.debug("Scheme with id {} found. Getting associated advert", grantSchemeId);

final boolean hasSchemeAnApplication = grantApplicationService.doesSchemeHaveAnApplication(grantScheme);
final boolean schemeHasAnApplication = grantApplicationService.doesSchemeHaveAnApplication(grantScheme);
final boolean hasPublishedApplication = grantApplicationService.doesSchemeHaveAPublishedApplication(grantScheme);
log.debug("Application form associated to scheme with Id {} has PUBLISHED status: {}", grantScheme.getId(), hasPublishedApplication);

final SchemeMandatoryQuestionApplicationFormInfosDto dto = SchemeMandatoryQuestionApplicationFormInfosDto.builder()
.hasAdvertPublished(false)
.hasInternalApplication(hasSchemeAnApplication)
.hasInternalApplication(schemeHasAnApplication)
.hasPublishedInternalApplication(hasPublishedApplication)
.build();

checkIfAdvertExistAndHasApplyingUrlPointingToInternalApplication(grantSchemeId, dto);
checkIfAdvertExistAndIsInternal(grantSchemeId, dto);

log.debug("Scheme with ID {} is for internal application: {} and has a published application form : {}",
grantSchemeId, dto.isHasInternalApplication(), dto.isHasPublishedInternalApplication());
Expand All @@ -94,7 +94,7 @@ public ResponseEntity<SchemeMandatoryQuestionApplicationFormInfosDto> schemeHasI
}


private void checkIfAdvertExistAndHasApplyingUrlPointingToInternalApplication(Integer grantSchemeId, SchemeMandatoryQuestionApplicationFormInfosDto dto) {
private void checkIfAdvertExistAndIsInternal(Integer grantSchemeId, SchemeMandatoryQuestionApplicationFormInfosDto dto) {
try {
log.debug("Getting Advert associated to scheme with id {}", grantSchemeId);
final GrantAdvert advert = grantAdvertService.getAdvertBySchemeId(grantSchemeId.toString());
Expand Down

0 comments on commit 2999f05

Please sign in to comment.