diff --git a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java index f67a2ee2..2effa6d2 100644 --- a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java +++ b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java @@ -24,7 +24,7 @@ public class GepafinConstant { public static final String GET_REGION_SUCCESS_MSG = "get.region.success"; public static final String DELETE_REGION_SUCCESS_MSG = "delete.region.success"; public static final String REGION_NOT_FOUND_MSG = "user.region.not.found"; - public static final String PASSWORD_DOESNT_MATCH ="password.doesnt.match"; + public static final String PASSWORD_DOESNT_MATCH = "password.doesnt.match"; public static final String USER_NOT_EXIST_MSG = "user.not.exist"; public static final String REGION_NOT_FOUND = "region.not.found"; public static final String USER_ID_NOT_NULL_MSG = "user.id.not.null"; @@ -36,13 +36,13 @@ public class GepafinConstant { public static final String LOOK_UP_DATA_NOT_VALID_MSG = "look.up.data.not.valid"; public static final String FILES_UPLOADED_MSG = "files.uploaded"; public static final String CALL_CREATED_SUCCESSFULLY_MSG = "call.created.successfully"; - public static final String FILE_DELETED_SUCCESSFULLY_MSG="file.deleted.successfully"; - public static final String DOCUMENT_NOT_FOUND="document.not.found"; - public static final String LOGIN_SUCCESS_MSG="login.successfully"; - public static final String PASSWORD_MIN_LEN ="pass.min.len.msg"; + public static final String FILE_DELETED_SUCCESSFULLY_MSG = "file.deleted.successfully"; + public static final String DOCUMENT_NOT_FOUND = "document.not.found"; + public static final String LOGIN_SUCCESS_MSG = "login.successfully"; + public static final String PASSWORD_MIN_LEN = "pass.min.len.msg"; public static final String EMAIL_ALREADY_EXISTS = "email.already.exists"; - public static final String DOCUMENT_ID_NOT_FOUND="document.id.not.found"; - public static final String INVALID_DATE_MSG = "call.invalid.date"; + public static final String DOCUMENT_ID_NOT_FOUND = "document.id.not.found"; + public static final String INVALID_DATE_MSG = "call.invalid.date"; public static final String FORM_NOT_FOUND = "form.not.found"; public static final String FORM_CREATED_SUCCESSFULLY = "form.created.successfully"; public static final String FORM_UPDATED_SUCCESSFULLY = "form.updated.suucessfully"; @@ -61,12 +61,12 @@ public class GepafinConstant { public static final String FORM_TEMPLATE_DELETED_SUCCESSFULLY = "form.template.deleted.successfully"; public static final String FORM_TEMPLATE_FETCHED_SUCCESSFULLY = "form.template.fetched.successfully"; public static final String REQUIRED_PARAMETER_NOT_FOUND_FOR_FORM_TEMPLATE = "required.parameter.not.found.for.form.template"; - public static final String FORM_NOT_FOUND_FOR_CALL_ID="form.not.found.for.call.id"; - public static final String STEP_1 = "STEP_1"; - public static final String STEP_2 = "STEP_2"; - public static final String VALIDATE_REQUEST = "VALIDATE_REQUEST"; - public static final String CALL_UPDATE_SUCCESSFULLY_MSG = "call.update.successfully"; - public static final String CALL_NOT_FOUND = "call.not.found"; + public static final String FORM_NOT_FOUND_FOR_CALL_ID = "form.not.found.for.call.id"; + public static final String STEP_1 = "STEP_1"; + public static final String STEP_2 = "STEP_2"; + public static final String VALIDATE_REQUEST = "VALIDATE_REQUEST"; + public static final String CALL_UPDATE_SUCCESSFULLY_MSG = "call.update.successfully"; + public static final String CALL_NOT_FOUND = "call.not.found"; public static final String CALL_FETCH_SUCCESS_MSG = "call.fetch.success"; public static final String EVALUATION_CRITERIA_NOT_FOUND = "evaluation.criteria.not.found"; @@ -74,7 +74,7 @@ public class GepafinConstant { public static final String EVALUATION_CRITERIA_FETCH_SUCCESSFULLY = "evaluation.criteria.fetch.successfully"; public static final String EVALUATION_CRITERIA_UPDATED_SUCCESSFULLY = "evaluation.criteria.updated.successfully"; public static final String EVALUATION_CRITERIA_DELETED_SUCCESSFULLY = "evaluation.criteria.deleted.successfully"; - public static final String SCORE_NOT_NULL_MSG="score.not.null"; + public static final String SCORE_NOT_NULL_MSG = "score.not.null"; public static final String FAQ_NOT_FOUND = "faq.not.found"; public static final String FAQ_CREATED_SUCCESSFULLY = "faq.created.successfully"; public static final String FAQ_FETCHED_SUCCESSFULLY = "faq.fetched.successfully"; @@ -102,41 +102,41 @@ public class GepafinConstant { public static final String INVALID_STATUS_CHANGE_FROM_DRAFT = "invalid.status.change.from.draft"; public static final String INVALID_STATUS_CHANGE_FROM_PUBLISH = "invalid.status.change.from.publish"; public static final String STATUS_CANNOT_BE_CHANGED = "status.cannot.be.changed"; - public static final String PUBLISHED_CALL_NOT_UPDATE = "published.call.not.update"; + public static final String PUBLISHED_CALL_NOT_UPDATE = "published.call.not.update"; public static final String INVALID_USER = "invalid_user"; - public static final String FLOW_CREATED_SUCCESSFULLY="flow.created.successfully"; - public static final String FLOW_FETCHED_SUCCESSFULLY="flow.fetched.successfully"; - public static final String FLOW_ALREADY_EXISTS="flow.already.exists"; - public static final String FLOW_REQUEST_NOT_PROPER="flow.request.not.complete"; + public static final String FLOW_CREATED_SUCCESSFULLY = "flow.created.successfully"; + public static final String FLOW_FETCHED_SUCCESSFULLY = "flow.fetched.successfully"; + public static final String FLOW_ALREADY_EXISTS = "flow.already.exists"; + public static final String FLOW_REQUEST_NOT_PROPER = "flow.request.not.complete"; public static final String APPLICATION_CREATED_SUCCESS_MSG = "application.created.success"; public static final String APPLICATION_UPDATED_SUCCESS_MSG = "application.updated.success"; public static final String DELETE_APPLICATION_SUCCESS_MSG = "application.deleted.success"; public static final String GET_APPLICATION_SUCCESS_MSG = "application.get.success"; public static final String APPLICATION_NOT_FOUND_MSG = "application.not.found"; - public static final String APPLICATION_FORM_FIELD_NOT_FOUND="application.form.field.not.found"; - public static final String FORM_ID_DOES_NOT_MACTHES="Form.not.matches.to.call.initial.form"; + public static final String APPLICATION_FORM_FIELD_NOT_FOUND = "application.form.field.not.found"; + public static final String FORM_ID_DOES_NOT_MACTHES = "Form.not.matches.to.call.initial.form"; public static final String VALIDATION_FIELD_REQUIRED = "validation.field.required"; public static final String VALIDATION_FIELD_MIN_LENGTH = "validation.field.min_length"; public static final String VALIDATION_FIELD_MAX_LENGTH = "validation.field.max_length"; public static final String VALIDATION_FIELD_PATTERN = "validation.field.pattern"; public static final String VALIDATION_FIELD_NOT_NULL = "validation.field.not_null"; public static final String VALIDATION_FIELD_NOT_EMPTY = "validation.field.not_empty"; - public static final String APPLICATION_ALREADY_EXISTS="application.already.exists"; - // public static final String NEXT_FORM_NOT_FOUND = "next.form.not.found"; - // public static final String PREVIOUS_FORM_NOT_FOUND = "previous.form.not.found"; - public static final String CURRENT_FORM_INCOMPLETE = "current.form.incomplete"; + public static final String APPLICATION_ALREADY_EXISTS = "application.already.exists"; + // public static final String NEXT_FORM_NOT_FOUND = "next.form.not.found"; + // public static final String PREVIOUS_FORM_NOT_FOUND = "previous.form.not.found"; + public static final String CURRENT_FORM_INCOMPLETE = "current.form.incomplete"; public static final String FLOW_NOT_FOUND = "flow.not.found"; - public static final String VALIDATION_MESSAGE = "validation.message"; - public static final String ACTION_REQUIRED = "action.required"; - public static final String CALL_NOT_PUBLISHED="call.not.published"; - public static final String APPLICATION_ALREADY_SUBMITTED="application.already.submitted"; - public static final String INITAL_AND_FINAL_FORM_CANNOT_NULL="initial.and.final.form.cannot.null"; - public static final String APPLICATION_FORM_NOT_FOUND="application.form.not.found"; - public static final String UPDATING_FORM_VALUE_IMPACT_ON_FLOW="updating.form.value.impact.on.flow"; + public static final String VALIDATION_MESSAGE = "validation.message"; + public static final String ACTION_REQUIRED = "action.required"; + public static final String CALL_NOT_PUBLISHED = "call.not.published"; + public static final String APPLICATION_ALREADY_SUBMITTED = "application.already.submitted"; + public static final String INITAL_AND_FINAL_FORM_CANNOT_NULL = "initial.and.final.form.cannot.null"; + public static final String APPLICATION_FORM_NOT_FOUND = "application.form.not.found"; + public static final String UPDATING_FORM_VALUE_IMPACT_ON_FLOW = "updating.form.value.impact.on.flow"; public static final String APPLICATION_IS_INCOMPLETE_MSG = "application.is.incomplete"; public static final String AUTHORIZATION = "Authorization"; public static final String CHECK_VATNUMBER_V2_NEW_URL = "https://imprese.openapi.it/advance"; - public static final String VALIDATION_FIELD_CUSTOM="validation.field.custom"; + public static final String VALIDATION_FIELD_CUSTOM = "validation.field.custom"; public static final String VALIDATION_CODICE_FISCALE = "validation.codice.fiscale"; public static final String VALIDATION_CAP = "validation.cap"; public static final String VALIDATION_IBAN = "validation.iban"; @@ -145,39 +145,39 @@ public class GepafinConstant { public static final String VALIDATION_URL = "validation.url"; public static final String VALIDATION_MARCA_DA_BOLLO = "validation.marca.da.bollo"; public static final String VALIDATION_PIVA = "validation.piva"; - public static final String VALIDATION_VALID_PIVA="valid.vat.number"; - public static final String IS_MARCA_DA_BOLLO="isMarcaDaBollo"; - public static final String IS_URL="isUrl"; - public static final String IS_EMAIL_PEC="isEmailPEC"; - public static final String IS_EMAIL="isEmail"; - public static final String IS_IBAN="isIBAN"; - public static final String IS_CAP="isCAP"; - public static final String IS_CODICE_FISCALE="isCodiceFiscale"; - public static final String IS_PIVA="isPIVA"; - public static final String FAILED_RETAIN_FIELD="failed.retain.field"; - public static final String USER_ALREADY_EXIST_MSG = "user.already.exist.msg"; - public static final String TOKEN_VALIDATE_SUCCESS_MSE = "token.validate.success"; - public static final String INVALID_REQUEST = "invalid.request"; - public static final String CODICE_FISCALE_EXISTS = "codice.fiscale.exists"; - public static final String TOTAL_STEPS_NOT_BE_ZERO="total.steps.not.zero"; - public static final String COMPLETED_STEPS_NOT_VALID="completed.steps.not.valid"; - public static final String FIELD_ID_NOT_FOUND="field.id.not.found"; - public static final String VALIDATE_EMAIL = "validate.email"; - public static final String ROLE_ID_MANDATORY = "role.id.mandatory"; - public static final String VALIDATE_PASSWORD = "validate.password"; - - public static final String COMPANY_CREATED_SUCCESS_MSG = "company.created.success"; - public static final String COMPANY_UPDATED_SUCCESS_MSG = "company.updated.success"; - public static final String COMPANY_DELETE_SUCCESS_MSG = "company.delete.success"; - public static final String COMPANY_GET_SUCCESS_MSG = "company.get.success"; - public static final String COMPANY_NOT_FOUND_MSG = "company.not.found"; - public static final String CHECK_VATNUMBER_SUCCESS_MSG = "check.vatnumber.success"; - public static final String INVALID_VATNUMBER = "invalid.vatnumber"; - public static final String VATNUMBER_MANDATORY = "vatnumber.mandatory"; - public static final String VATNUMBER_ALREADY_EXISTS = "vatnumber.already.exists"; - public static final String INVALID_EMAIL = "invalid.email"; - public static final String UNAUTHORIZED = "UNAUTHORIZED"; - public static final String COMPANY_ID_MANDATORY = "company.id.mandatory"; + public static final String VALIDATION_VALID_PIVA = "valid.vat.number"; + public static final String IS_MARCA_DA_BOLLO = "isMarcaDaBollo"; + public static final String IS_URL = "isUrl"; + public static final String IS_EMAIL_PEC = "isEmailPEC"; + public static final String IS_EMAIL = "isEmail"; + public static final String IS_IBAN = "isIBAN"; + public static final String IS_CAP = "isCAP"; + public static final String IS_CODICE_FISCALE = "isCodiceFiscale"; + public static final String IS_PIVA = "isPIVA"; + public static final String FAILED_RETAIN_FIELD = "failed.retain.field"; + public static final String USER_ALREADY_EXIST_MSG = "user.already.exist.msg"; + public static final String TOKEN_VALIDATE_SUCCESS_MSE = "token.validate.success"; + public static final String INVALID_REQUEST = "invalid.request"; + public static final String CODICE_FISCALE_EXISTS = "codice.fiscale.exists"; + public static final String TOTAL_STEPS_NOT_BE_ZERO = "total.steps.not.zero"; + public static final String COMPLETED_STEPS_NOT_VALID = "completed.steps.not.valid"; + public static final String FIELD_ID_NOT_FOUND = "field.id.not.found"; + public static final String VALIDATE_EMAIL = "validate.email"; + public static final String ROLE_ID_MANDATORY = "role.id.mandatory"; + public static final String VALIDATE_PASSWORD = "validate.password"; + + public static final String COMPANY_CREATED_SUCCESS_MSG = "company.created.success"; + public static final String COMPANY_UPDATED_SUCCESS_MSG = "company.updated.success"; + public static final String COMPANY_DELETE_SUCCESS_MSG = "company.delete.success"; + public static final String COMPANY_GET_SUCCESS_MSG = "company.get.success"; + public static final String COMPANY_NOT_FOUND_MSG = "company.not.found"; + public static final String CHECK_VATNUMBER_SUCCESS_MSG = "check.vatnumber.success"; + public static final String INVALID_VATNUMBER = "invalid.vatnumber"; + public static final String VATNUMBER_MANDATORY = "vatnumber.mandatory"; + public static final String VATNUMBER_ALREADY_EXISTS = "vatnumber.already.exists"; + public static final String INVALID_EMAIL = "invalid.email"; + public static final String UNAUTHORIZED = "UNAUTHORIZED"; + public static final String COMPANY_ID_MANDATORY = "company.id.mandatory"; public static final String USER_ALREADY_CONNECTED_TO_COMPANY = "user.already.connected.to.company"; public static final String YYYY_MM_DD_DASH = "yyyy-MM-dd"; public static final String YYYY_MM_DD_SLASH = "yyyy/MM/dd"; @@ -195,8 +195,10 @@ public class GepafinConstant { public static final String CALL_NOT_STARTED_YET = "call.not.started.yet"; public static final String CALL_ALREADY_ENDED = "call.already.ended"; public static final String APPLICATION_STATUS_UPDATED_SUCCESSFULLY = "application.status.updated.successfully"; + public static final String APPLICATION_ALREADY_IN_PREVIOUS_STATUS = "application.already.in.provided.status"; public static final String DELEGATION_NOT_FOUND = "delegation.not.found"; public static final String USER_COMPANY_RELATION_NOT_FOUND = "user.company.relation.not.found"; public static final String DELEGATION_DELETE_SUCCESS = "delegation.delete.success"; } + diff --git a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java index ae8db433..ba6339a7 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java @@ -31,6 +31,7 @@ import jakarta.persistence.criteria.Predicate; import java.text.MessageFormat; import java.time.LocalDateTime; +import java.time.LocalTime; import java.util.*; import java.util.stream.Collectors; @@ -72,6 +73,9 @@ public class ApplicationDao { @Autowired private Validator validator; + @Autowired + private ProtocolRepository protocolRepository; + public ApplicationResponseBean createApplication(ApplicationRequestBean applicationRequestBean, UserEntity userEntity, Long formId, Long applicationId) { FormEntity formEntity = formService.validateForm(formId); @@ -260,6 +264,9 @@ public class ApplicationDao { responseBean.setComments(applicationEntity.getComments()); responseBean.setCompanyId(applicationEntity.getCompany().getId()); responseBean.setCompanyName(applicationEntity.getCompany().getCompanyName()); + if(applicationEntity.getProtocol() != null) { + responseBean.setProtocolNumber(applicationEntity.getProtocol().getProtocolNumber()); + } return responseBean; } @@ -279,6 +286,9 @@ public class ApplicationDao { response.setCallId(entity.getCall().getId()); response.setCreatedDate(entity.getCreatedDate()); response.setUpdatedDate(entity.getUpdatedDate()); + if(entity.getProtocol() != null) { + response.setProtocolNumber(entity.getProtocol().getProtocolNumber()); + } return response; } @@ -472,6 +482,9 @@ public class ApplicationDao { applicationGetResponseBean.setCallId(applicationEntity.getCall().getId()); applicationGetResponseBean.setCallTitle(applicationEntity.getCall().getName()); applicationGetResponseBean.setCompanyId(applicationEntity.getCompany().getId()); + if(applicationEntity.getProtocol() != null) { + applicationGetResponseBean.setProtocolNumber(applicationEntity.getProtocol().getProtocolNumber()); + } applicationGetResponseBean.setCompanyName(applicationEntity.getCompany().getCompanyName()); return applicationGetResponseBean; } @@ -506,6 +519,9 @@ public class ApplicationDao { public ApplicationResponse updateApplicationStatus(Long applicationId, ApplicationStatusTypeEnum status) { ApplicationEntity applicationEntity = validateApplication(applicationId); + if(Boolean.TRUE.equals(applicationEntity.getStatus().equals(status.getValue()))){ + throw new CustomValidationException(Status.BAD_REQUEST,Translator.toLocale(GepafinConstant.APPLICATION_ALREADY_IN_PREVIOUS_STATUS)); + } if (status.equals(ApplicationStatusTypeEnum.SUBMIT)) { callService.validatePublishedCall(applicationEntity.getCall().getId()); // CallEntity callEntity = applicationEntity.getCall(); @@ -525,6 +541,10 @@ public class ApplicationDao { if (totalSteps.intValue() != completedSteps) { throw new CustomValidationException(Status.BAD_REQUEST, Translator.toLocale(GepafinConstant.APPLICATION_IS_INCOMPLETE_MSG)); } + Integer maxProtocolNumber=protocolRepository.findMaxProtocolNumber(); + Integer protocolNumber = (maxProtocolNumber != null) ? maxProtocolNumber + 1 : 10000; + ProtocolEntity protocolEntity=createProtocolEntity(applicationEntity,protocolNumber); + applicationEntity.setProtocol(protocolEntity); applicationEntity.setStatus(ApplicationStatusTypeEnum.SUBMIT.getValue()); applicationEntity.setSubmissionDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now())); } else { @@ -608,4 +628,15 @@ public class ApplicationDao { } } + public ProtocolEntity createProtocolEntity(ApplicationEntity applicationEntity,Integer protocolNumber){ + ProtocolEntity protocolEntity=new ProtocolEntity(); + protocolEntity.setCall(applicationEntity.getCall().getId()); + LocalDateTime utcDateTime = DateTimeUtil.DateServerToUTC(LocalDateTime.now()); + protocolEntity.setYear(utcDateTime.getYear()); + protocolEntity.setProtocolNumber(Long.valueOf(protocolNumber)); + protocolEntity.setTime(LocalTime.now()); + protocolEntity.setApplicationId(applicationEntity.getId()); + protocolRepository.save(protocolEntity); + return protocolEntity; + } } diff --git a/src/main/java/net/gepafin/tendermanagement/dao/FlowFormDao.java b/src/main/java/net/gepafin/tendermanagement/dao/FlowFormDao.java index 1ffb9059..4ad912f4 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/FlowFormDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/FlowFormDao.java @@ -307,6 +307,9 @@ public class FlowFormDao { completedSteps = getCompletedSteps(applicationEntity); nextOrPreviousFormResponse.setCompletedSteps(Long.valueOf(completedSteps)); nextOrPreviousFormResponse.setCurrentStep(currentStep); + if(applicationEntity.getProtocol() != null) { + nextOrPreviousFormResponse.setProtocolNumber(applicationEntity.getProtocol().getProtocolNumber()); + } return nextOrPreviousFormResponse; } diff --git a/src/main/java/net/gepafin/tendermanagement/entities/ApplicationEntity.java b/src/main/java/net/gepafin/tendermanagement/entities/ApplicationEntity.java index 01648c67..cc0f929e 100644 --- a/src/main/java/net/gepafin/tendermanagement/entities/ApplicationEntity.java +++ b/src/main/java/net/gepafin/tendermanagement/entities/ApplicationEntity.java @@ -36,4 +36,7 @@ public class ApplicationEntity extends BaseEntity { @Column(name="IS_DELETED") private Boolean isDeleted; + @OneToOne + @JoinColumn(name = "PROTOCOL_NUMBER") + private ProtocolEntity protocol; } \ No newline at end of file diff --git a/src/main/java/net/gepafin/tendermanagement/entities/ProtocolEntity.java b/src/main/java/net/gepafin/tendermanagement/entities/ProtocolEntity.java new file mode 100644 index 00000000..0924c922 --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/entities/ProtocolEntity.java @@ -0,0 +1,28 @@ +package net.gepafin.tendermanagement.entities; + +import jakarta.persistence.*; +import lombok.Data; + +import java.time.LocalTime; + +@Entity +@Table(name = "PROTOCOL") +@Data +public class ProtocolEntity extends BaseEntity { + + @Column(name = "PROTOCOL_NUMBER", nullable = false) + private Long protocolNumber; + + @Column(name = "YEAR", nullable = false) + private Integer year; + + @Column(name="CALL_ID") + private Long call; + + @Column(name = "TIME", nullable = false) + private LocalTime time; + + @Column(name="APPLICATION_ID") + private Long applicationId; + +} diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationGetResponseBean.java b/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationGetResponseBean.java index 9078f3a2..aa686023 100644 --- a/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationGetResponseBean.java +++ b/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationGetResponseBean.java @@ -24,6 +24,8 @@ public class ApplicationGetResponseBean { private String companyName; + private Long protocolNumber; + private List form; } diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationResponse.java b/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationResponse.java index 4283637f..d5df459e 100644 --- a/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationResponse.java +++ b/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationResponse.java @@ -31,4 +31,6 @@ public class ApplicationResponse{ private String companyName; + private Long protocolNumber; + } \ No newline at end of file diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationResponseBean.java b/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationResponseBean.java index e621197c..6b99961f 100644 --- a/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationResponseBean.java +++ b/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationResponseBean.java @@ -17,6 +17,8 @@ public class ApplicationResponseBean extends BaseBean { private String comments; + private Long protocolNumber; + private List formFields; } diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/NextOrPreviousFormResponse.java b/src/main/java/net/gepafin/tendermanagement/model/response/NextOrPreviousFormResponse.java index 7864e831..8925e7f6 100644 --- a/src/main/java/net/gepafin/tendermanagement/model/response/NextOrPreviousFormResponse.java +++ b/src/main/java/net/gepafin/tendermanagement/model/response/NextOrPreviousFormResponse.java @@ -22,6 +22,8 @@ public class NextOrPreviousFormResponse { private String companyName; + private Long protocolNumber; + private ApplicationStatusTypeEnum applicationStatus; private FormApplicationResponse applicationFormResponse; diff --git a/src/main/java/net/gepafin/tendermanagement/repositories/ProtocolRepository.java b/src/main/java/net/gepafin/tendermanagement/repositories/ProtocolRepository.java new file mode 100644 index 00000000..8bdfb553 --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/repositories/ProtocolRepository.java @@ -0,0 +1,13 @@ +package net.gepafin.tendermanagement.repositories; + +import net.gepafin.tendermanagement.entities.ProtocolEntity; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +@Repository +public interface ProtocolRepository extends JpaRepository { + + @Query("SELECT MAX(p.protocolNumber) FROM ProtocolEntity p") + Integer findMaxProtocolNumber(); +} diff --git a/src/main/resources/db/changelog/db.changelog-1.0.0.xml b/src/main/resources/db/changelog/db.changelog-1.0.0.xml index 13e2bedf..98016d3c 100644 --- a/src/main/resources/db/changelog/db.changelog-1.0.0.xml +++ b/src/main/resources/db/changelog/db.changelog-1.0.0.xml @@ -942,4 +942,35 @@ columnName="field_value" newDataType="TEXT"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/message_en.properties b/src/main/resources/message_en.properties index 84279127..278cae9a 100644 --- a/src/main/resources/message_en.properties +++ b/src/main/resources/message_en.properties @@ -220,6 +220,7 @@ call.not.started.yet = The call has not started yet. Please wait until the speci call.already.ended = The call has already ended. You cannot submit the application after the deadline. status.updated.successfully=Status updated successfully. application.status.updated.successfully = Application status updated successfully. +application.already.in.provided.status=Application is already in provided status. delegation.not.found=Delegation not found. user.company.relation.not.found=User with the specified company relation not found. delegation.delete.success=Delegation deleted successfully. diff --git a/src/main/resources/message_it.properties b/src/main/resources/message_it.properties index 4dfec2b0..e28900bd 100644 --- a/src/main/resources/message_it.properties +++ b/src/main/resources/message_it.properties @@ -215,6 +215,7 @@ call.not.started.yet = La chiamata non � ancora iniziata. Attendere fino alla call.already.ended = La chiamata � gi� terminata. Non � possibile inviare l'applicazione dopo la scadenza. status.updated.successfully=Stato aggiornato con successo. application.status.updated.successfully = Stato dell'applicazione aggiornato con successo. +application.already.in.provided.status=L'applicazione � gi� nello stato fornito. delegation.not.found=Delega non trovata. user.company.relation.not.found=Relazione utente con l'azienda specificata non trovata. delegation.delete.success=Delega eliminata con successo.