Merge pull request #169 from Kitzanos/evaluation-expiration-config

Evaluation Expiration Configuration, in case of sviluppUmbria 999 days.
This commit is contained in:
Rinaldo
2025-01-20 16:07:33 +01:00
committed by GitHub
3 changed files with 32 additions and 1 deletions

View File

@@ -113,12 +113,21 @@ public class ApplicationEvaluationDao {
@Autowired @Autowired
private ApplicationAmendmentRequestDao applicationAmendmentRequestDao; private ApplicationAmendmentRequestDao applicationAmendmentRequestDao;
@Autowired
private HubService hubService;
private ApplicationEvaluationEntity convertToEntity(UserEntity user, ApplicationEvaluationRequest req, Long assignedApplciationId) { private ApplicationEvaluationEntity convertToEntity(UserEntity user, ApplicationEvaluationRequest req, Long assignedApplciationId) {
ApplicationEvaluationEntity entity = new ApplicationEvaluationEntity(); ApplicationEvaluationEntity entity = new ApplicationEvaluationEntity();
AssignedApplicationsEntity assignedApplications = assignedApplicationsService.validateAssignedApplication(assignedApplciationId); AssignedApplicationsEntity assignedApplications = assignedApplicationsService.validateAssignedApplication(assignedApplciationId);
ApplicationEntity application = applicationService.validateApplication(assignedApplications.getApplication().getId()); ApplicationEntity application = applicationService.validateApplication(assignedApplications.getApplication().getId());
Long hubId = application.getHubId();
HubEntity hub = hubService.valdateHub(hubId);
Long initialDays = (hub != null) ? hub.getEvaluationExpirationDays() : 0L;
entity.setApplicationId(application.getId()); entity.setApplicationId(application.getId());
entity.setAssignedApplicationsEntity(assignedApplications); entity.setAssignedApplicationsEntity(assignedApplications);
entity.setUserId(user.getId()); entity.setUserId(user.getId());
@@ -128,7 +137,7 @@ public class ApplicationEvaluationDao {
entity.setNote(req.getNote()); entity.setNote(req.getNote());
entity.setMotivation(req.getMotivation()); entity.setMotivation(req.getMotivation());
entity.setIsDeleted(false); entity.setIsDeleted(false);
entity.setInitialDays(30L); entity.setInitialDays(initialDays);
entity.setRemainingDays(30L); entity.setRemainingDays(30L);
entity.setSuspendedDays(0L); entity.setSuspendedDays(0L);
entity.setStartDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now())); entity.setStartDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now()));

View File

@@ -63,4 +63,7 @@ public class HubEntity extends BaseEntity{
@Column(name = "AREA_CODE") @Column(name = "AREA_CODE")
private String areaCode; private String areaCode;
@Column(name = "EVALUATION_EXPIRATION_DAYS")
private Long evaluationExpirationDays;
} }

View File

@@ -2229,4 +2229,23 @@
<column name="date_rejected" type="TIMESTAMP WITHOUT TIME ZONE"></column> <column name="date_rejected" type="TIMESTAMP WITHOUT TIME ZONE"></column>
</addColumn> </addColumn>
</changeSet> </changeSet>
<changeSet id="16-01-2025_RK_173515" author="Rajesh Khore">
<addColumn tableName="hub">
<column name="evaluation_expiration_days" type="INTEGER"/>
</addColumn>
</changeSet>
<changeSet id="16-01-2025_RK_173616" author="Rajesh Khore">
<update tableName="hub">
<column name="evaluation_expiration_days" valueNumeric="999"/>
<where>unique_uuid = 't7jh5wfg9QXylNaTZkPoE'</where>
</update>
<update tableName="hub">
<column name="evaluation_expiration_days" valueNumeric="30"/>
<where>unique_uuid = 'p4lk3bcx1RStqTaIVVbXs'</where>
</update>
</changeSet>
</databaseChangeLog> </databaseChangeLog>