Resolved conflicts
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
package net.gepafin.tendermanagement.service.impl;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
import net.gepafin.tendermanagement.config.Translator;
|
||||
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
||||
import net.gepafin.tendermanagement.model.response.CallResponse;
|
||||
import net.gepafin.tendermanagement.util.FieldValidator;
|
||||
import net.gepafin.tendermanagement.web.rest.api.errors.CustomValidationException;
|
||||
import net.gepafin.tendermanagement.web.rest.api.errors.Status;
|
||||
|
||||
public class CallValidatorServiceImpl {
|
||||
|
||||
@@ -11,14 +17,14 @@ public class CallValidatorServiceImpl {
|
||||
.notNull(response.getName(), "name")
|
||||
.notNull(response.getDescriptionShort(), "descriptionShort")
|
||||
.notNull(response.getDescriptionLong(), "descriptionLong")
|
||||
.notNull(response.getStartDate(), "startDate")
|
||||
.notNull(response.getEndDate(), "endDate")
|
||||
.notNull(response.getDates().get(0), "startDate")
|
||||
.notNull(response.getDates().get(1), "endDate")
|
||||
.notNull(response.getStatus(), "status")
|
||||
.notNull(response.getRegionId(), "regionId")
|
||||
.notNull(response.getAmount(), "amount")
|
||||
.notNull(response.getAmountMax(), "amountMax")
|
||||
.notNull(response.getThreshold(), "threshold")
|
||||
.notNull(response.getDocumentationReqested(), "documentationReqested")
|
||||
.notNull(response.getDocumentationRequested(), "documentationRequested")
|
||||
.notEmpty(response.getAimedTo(), "aimedTo")
|
||||
.notEmpty(response.getCriteria(), "criteria")
|
||||
.notEmpty(response.getDocs(), "docs")
|
||||
@@ -26,6 +32,13 @@ public class CallValidatorServiceImpl {
|
||||
.notEmpty(response.getImages(), "images")
|
||||
.notEmpty(response.getCheckList(), "checkList")
|
||||
.validate();
|
||||
|
||||
if (response.getDates().get(0).toLocalDate().isBefore(LocalDate.now())
|
||||
|| response.getDates().get(1).toLocalDate().isBefore(LocalDate.now()) ||
|
||||
response.getDates().get(0).toLocalDate().isAfter(response.getDates().get(1).toLocalDate())) {
|
||||
throw new CustomValidationException(Status.VALIDATION_ERROR,
|
||||
Translator.toLocale(GepafinConstant.INVALID_DATE_MSG));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user