FINERACT-2081: Support for string type primary keys - refactor existing enums
This commit is contained in:
committed by
Adam Saghy
parent
009e9ded01
commit
b482fbd447
+16
-10
@@ -20,16 +20,21 @@ package org.apache.fineract.accounting.common;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||||
|
import org.apache.fineract.infrastructure.core.data.StringEnumOptionData;
|
||||||
|
|
||||||
|
@Getter
|
||||||
public enum AccountingRuleType {
|
public enum AccountingRuleType {
|
||||||
|
|
||||||
NONE(1, "accountingRuleType.none"), //
|
NONE(1, "accountingRuleType.none", "No accounting"), //
|
||||||
CASH_BASED(2, "accountingRuleType.cash"), //
|
CASH_BASED(2, "accountingRuleType.cash", "Cash based accounting"), //
|
||||||
ACCRUAL_PERIODIC(3, "accountingRuleType.accrual.periodic"), //
|
ACCRUAL_PERIODIC(3, "accountingRuleType.accrual.periodic", "Periodic accrual accounting"), //
|
||||||
ACCRUAL_UPFRONT(4, "accountingRuleType.accrual.upfront"); //
|
ACCRUAL_UPFRONT(4, "accountingRuleType.accrual.upfront", "Upfront accrual accounting"); //
|
||||||
|
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
private final String code;
|
private final String code;
|
||||||
|
private final String description;
|
||||||
|
|
||||||
private static final Map<Integer, AccountingRuleType> intToEnumMap = new HashMap<>();
|
private static final Map<Integer, AccountingRuleType> intToEnumMap = new HashMap<>();
|
||||||
|
|
||||||
@@ -44,21 +49,22 @@ public enum AccountingRuleType {
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
AccountingRuleType(final Integer value, final String code) {
|
AccountingRuleType(final Integer value, final String code, final String description) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.code = code;
|
this.code = code;
|
||||||
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name().toString().replaceAll("_", " ");
|
return name().replaceAll("_", " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getValue() {
|
public EnumOptionData toEnumOptionData() {
|
||||||
return this.value;
|
return new EnumOptionData((long) getValue(), getCode(), getDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCode() {
|
public StringEnumOptionData toStringEnumOptionData() {
|
||||||
return this.code;
|
return new StringEnumOptionData(name(), getCode(), getDescription());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -130,7 +130,7 @@ public enum EntityTables {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static List<Integer> getCheckStatusCodes(String name) {
|
public static List<Integer> getCheckStatusCodes(String name) {
|
||||||
return getCheckStatuses(name).stream().map(StatusEnum::getCode).toList();
|
return getCheckStatuses(name).stream().map(StatusEnum::getValue).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
+32
-65
@@ -18,88 +18,55 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.dataqueries.data;
|
package org.apache.fineract.infrastructure.dataqueries.data;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||||
|
|
||||||
public enum StatusEnum {
|
public enum StatusEnum {
|
||||||
|
|
||||||
CREATE("create", 100), APPROVE("approve", 200), ACTIVATE("activate", 300), WITHDRAWN("withdraw", 400), REJECTED("reject", 500), CLOSE(
|
CREATE("statusEnum.create", 100), //
|
||||||
"close", 600), WRITE_OFF("write off", 601), RESCHEDULE("reschedule", 602), OVERPAY("overpay", 700), DISBURSE("disburse", 800);
|
APPROVE("statusEnum.approve", 200), //
|
||||||
|
ACTIVATE("statusEnum.activate", 300), //
|
||||||
|
WITHDRAWN("statusEnum.withdraw", 400), //
|
||||||
|
REJECTED("statusEnum.reject", 500), //
|
||||||
|
CLOSE("statusEnum.close", 600), //
|
||||||
|
WRITE_OFF("statusEnum.write off", 601), //
|
||||||
|
RESCHEDULE("statusEnum.reschedule", 602), //
|
||||||
|
OVERPAY("statusEnum.overpay", 700), //
|
||||||
|
DISBURSE("statusEnum.disburse", 800), //
|
||||||
|
;
|
||||||
|
|
||||||
private final String name;
|
private static final StatusEnum[] VALUES = values();
|
||||||
|
|
||||||
private final Integer code;
|
private static final Map<Integer, StatusEnum> BY_ID = Arrays.stream(VALUES).collect(Collectors.toMap(StatusEnum::getValue, v -> v));
|
||||||
|
|
||||||
public Integer getCode() {
|
private final String code;
|
||||||
return code;
|
|
||||||
|
private final Integer value;
|
||||||
|
|
||||||
|
public Integer getValue() {
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
StatusEnum(String name, Integer code) {
|
StatusEnum(String code, Integer value) {
|
||||||
|
|
||||||
this.name = name;
|
|
||||||
this.code = code;
|
this.code = code;
|
||||||
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<DatatableCheckStatusData> getStatusList() {
|
public static StatusEnum fromInt(final Integer value) {
|
||||||
|
return BY_ID.get(value);
|
||||||
List<DatatableCheckStatusData> data = new ArrayList<DatatableCheckStatusData>();
|
|
||||||
|
|
||||||
for (StatusEnum status : StatusEnum.values()) {
|
|
||||||
data.add(new DatatableCheckStatusData(status.name, status.code));
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static StatusEnum fromInt(final Integer code) {
|
public static EnumOptionData toEnumOptionData(final Integer id) {
|
||||||
StatusEnum ret = null;
|
return toEnumOptionData(StatusEnum.fromInt(id));
|
||||||
switch (code) {
|
|
||||||
case 100:
|
|
||||||
ret = StatusEnum.CREATE;
|
|
||||||
break;
|
|
||||||
case 200:
|
|
||||||
ret = StatusEnum.APPROVE;
|
|
||||||
break;
|
|
||||||
case 300:
|
|
||||||
ret = StatusEnum.ACTIVATE;
|
|
||||||
break;
|
|
||||||
case 400:
|
|
||||||
ret = StatusEnum.WITHDRAWN;
|
|
||||||
break;
|
|
||||||
case 500:
|
|
||||||
ret = StatusEnum.REJECTED;
|
|
||||||
break;
|
|
||||||
case 600:
|
|
||||||
ret = StatusEnum.CLOSE;
|
|
||||||
break;
|
|
||||||
case 601:
|
|
||||||
ret = StatusEnum.WRITE_OFF;
|
|
||||||
break;
|
|
||||||
case 602:
|
|
||||||
ret = StatusEnum.RESCHEDULE;
|
|
||||||
break;
|
|
||||||
case 700:
|
|
||||||
ret = StatusEnum.OVERPAY;
|
|
||||||
break;
|
|
||||||
case 800:
|
|
||||||
ret = StatusEnum.DISBURSE;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EnumOptionData statusTypeEnum(final Integer id) {
|
public static EnumOptionData toEnumOptionData(final StatusEnum statusType) {
|
||||||
return statusType(StatusEnum.fromInt(id));
|
return statusType == null ? null : statusType.toEnumOptionData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EnumOptionData statusType(final StatusEnum statusType) {
|
public EnumOptionData toEnumOptionData() {
|
||||||
final EnumOptionData optionData = new EnumOptionData(statusType.getCode().longValue(), statusType.name(), statusType.name());
|
return new EnumOptionData(getValue().longValue(), code, name());
|
||||||
return optionData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -56,7 +56,8 @@ public enum JobName {
|
|||||||
LOAN_DELINQUENCY_CLASSIFICATION("Loan Delinquency Classification"), //
|
LOAN_DELINQUENCY_CLASSIFICATION("Loan Delinquency Classification"), //
|
||||||
SEND_ASYNCHRONOUS_EVENTS("Send Asynchronous Events"), //
|
SEND_ASYNCHRONOUS_EVENTS("Send Asynchronous Events"), //
|
||||||
PURGE_EXTERNAL_EVENTS("Purge External Events"), //
|
PURGE_EXTERNAL_EVENTS("Purge External Events"), //
|
||||||
PURGE_PROCESSED_COMMANDS("Purge Processed Commands");
|
PURGE_PROCESSED_COMMANDS("Purge Processed Commands"), //
|
||||||
|
;
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
|
|||||||
+18
-11
@@ -18,26 +18,25 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.portfolio;
|
package org.apache.fineract.portfolio;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||||
|
import org.apache.fineract.infrastructure.core.data.StringEnumOptionData;
|
||||||
|
|
||||||
|
@Getter
|
||||||
public enum TransactionEntryType {
|
public enum TransactionEntryType {
|
||||||
|
|
||||||
CREDIT(1, "transactionEntryType.credit"), //
|
CREDIT(1, "transactionEntryType.credit", "Credit transaction"), //
|
||||||
DEBIT(2, "transactionEntryType.debit"), //
|
DEBIT(2, "transactionEntryType.debit", "Debit transaction"), //
|
||||||
;
|
;
|
||||||
|
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
private final String code;
|
private final String code;
|
||||||
|
private final String description;
|
||||||
|
|
||||||
TransactionEntryType(final Integer value, final String code) {
|
TransactionEntryType(final Integer value, final String code, final String description) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.code = code;
|
this.code = code;
|
||||||
}
|
this.description = description;
|
||||||
|
|
||||||
public Integer getValue() {
|
|
||||||
return this.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCode() {
|
|
||||||
return this.code;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCredit() {
|
public boolean isCredit() {
|
||||||
@@ -51,4 +50,12 @@ public enum TransactionEntryType {
|
|||||||
public TransactionEntryType getReversal() {
|
public TransactionEntryType getReversal() {
|
||||||
return this == CREDIT ? DEBIT : CREDIT;
|
return this == CREDIT ? DEBIT : CREDIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EnumOptionData toEnumOptionData() {
|
||||||
|
return new EnumOptionData((long) getValue(), getCode(), getDescription());
|
||||||
|
}
|
||||||
|
|
||||||
|
public StringEnumOptionData toStringEnumOptionData() {
|
||||||
|
return new StringEnumOptionData(name(), getCode(), getDescription());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -22,7 +22,8 @@ public enum PortfolioAccountType {
|
|||||||
|
|
||||||
INVALID(0, "accountType.invalid"), //
|
INVALID(0, "accountType.invalid"), //
|
||||||
LOAN(1, "accountType.loan"), //
|
LOAN(1, "accountType.loan"), //
|
||||||
SAVINGS(2, "accountType.savings");
|
SAVINGS(2, "accountType.savings"), //
|
||||||
|
;
|
||||||
|
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
+11
-1
@@ -18,6 +18,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.portfolio.accountdetails.domain;
|
package org.apache.fineract.portfolio.accountdetails.domain;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||||
|
import org.apache.fineract.portfolio.accountdetails.service.AccountEnumerations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enum representation of account types .
|
* Enum representation of account types .
|
||||||
*/
|
*/
|
||||||
@@ -27,7 +32,8 @@ public enum AccountType {
|
|||||||
INDIVIDUAL(1, "accountType.individual"), //
|
INDIVIDUAL(1, "accountType.individual"), //
|
||||||
GROUP(2, "accountType.group"), //
|
GROUP(2, "accountType.group"), //
|
||||||
JLG(3, "accountType.jlg"), // JLG account given in group context
|
JLG(3, "accountType.jlg"), // JLG account given in group context
|
||||||
GLIM(4, "accountType.glim"), GSIM(5, "accountType.gsim");
|
GLIM(4, "accountType.glim"), //
|
||||||
|
GSIM(5, "accountType.gsim");
|
||||||
|
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
private final String code;
|
private final String code;
|
||||||
@@ -71,6 +77,10 @@ public enum AccountType {
|
|||||||
return accountType;
|
return accountType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<EnumOptionData> toEnumOptionData() {
|
||||||
|
return Arrays.stream(values()).sequential().map(AccountEnumerations::loanType).toList();
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getValue() {
|
public Integer getValue() {
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,6 +75,14 @@ public enum NoteType {
|
|||||||
return BY_API.get(url);
|
return BY_API.get(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static EnumOptionData toEnumOptionData(final Integer id) {
|
||||||
|
return toEnumOptionData(NoteType.fromInt(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumOptionData toEnumOptionData(final NoteType noteType) {
|
||||||
|
return noteType == null ? null : noteType.toEnumOptionData();
|
||||||
|
}
|
||||||
|
|
||||||
public EnumOptionData toEnumOptionData() {
|
public EnumOptionData toEnumOptionData() {
|
||||||
return new EnumOptionData(getValue().longValue(), getCode(), getDescription());
|
return new EnumOptionData(getValue().longValue(), getCode(), getDescription());
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -72,7 +72,7 @@ public class EntityDatatableChecksApiResource {
|
|||||||
+ "Example Request:\n" + "\n" + "entityDatatableChecks?offset=0&limit=15")
|
+ "Example Request:\n" + "\n" + "entityDatatableChecks?offset=0&limit=15")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = EntityDatatableChecksApiResourceSwagger.GetEntityDatatableChecksResponse.class)))) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = EntityDatatableChecksApiResourceSwagger.GetEntityDatatableChecksResponse.class)))) })
|
||||||
public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("status") @Parameter(description = "status") final Long status,
|
public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("status") @Parameter(description = "status") final Integer status,
|
||||||
@QueryParam("entity") @Parameter(description = "entity") final String entity,
|
@QueryParam("entity") @Parameter(description = "entity") final String entity,
|
||||||
@QueryParam("productId") @Parameter(description = "productId") final Long productId,
|
@QueryParam("productId") @Parameter(description = "productId") final Long productId,
|
||||||
@QueryParam("offset") @Parameter(description = "offset") final Integer offset,
|
@QueryParam("offset") @Parameter(description = "offset") final Integer offset,
|
||||||
|
|||||||
+3
-13
@@ -41,7 +41,7 @@ public class EntityDatatableChecks extends AbstractPersistableCustom<Long> {
|
|||||||
private String datatableName;
|
private String datatableName;
|
||||||
|
|
||||||
@Column(name = "status_enum", nullable = false)
|
@Column(name = "status_enum", nullable = false)
|
||||||
private Long status;
|
private Integer status;
|
||||||
|
|
||||||
@Column(name = "system_defined")
|
@Column(name = "system_defined")
|
||||||
private boolean systemDefined = false;
|
private boolean systemDefined = false;
|
||||||
@@ -50,29 +50,19 @@ public class EntityDatatableChecks extends AbstractPersistableCustom<Long> {
|
|||||||
private Long productId;
|
private Long productId;
|
||||||
|
|
||||||
public static EntityDatatableChecks fromJson(final JsonCommand command) {
|
public static EntityDatatableChecks fromJson(final JsonCommand command) {
|
||||||
|
|
||||||
final String entity = command.stringValueOfParameterNamed("entity");
|
final String entity = command.stringValueOfParameterNamed("entity");
|
||||||
final Long status = command.longValueOfParameterNamed("status");
|
final Integer status = command.integerValueSansLocaleOfParameterNamed("status");
|
||||||
final String datatableName = command.stringValueOfParameterNamed("datatableName");
|
final String datatableName = command.stringValueOfParameterNamed("datatableName");
|
||||||
|
|
||||||
boolean systemDefined = false;
|
boolean systemDefined = command.booleanPrimitiveValueOfParameterNamed("systemDefined");
|
||||||
if (command.parameterExists("systemDefined")) {
|
|
||||||
systemDefined = command.booleanObjectValueOfParameterNamed("systemDefined");
|
|
||||||
} else {
|
|
||||||
systemDefined = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Long productId = null;
|
Long productId = null;
|
||||||
if (command.parameterExists("productId")) {
|
if (command.parameterExists("productId")) {
|
||||||
productId = command.longValueOfParameterNamed("productId");
|
productId = command.longValueOfParameterNamed("productId");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new EntityDatatableChecks(entity, datatableName, status, systemDefined, productId);
|
return new EntityDatatableChecks(entity, datatableName, status, systemDefined, productId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSystemDefined() {
|
public boolean isSystemDefined() {
|
||||||
return this.systemDefined;
|
return this.systemDefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -41,20 +41,20 @@ public interface EntityDatatableChecksRepository
|
|||||||
@Param("subtype") String subtype);
|
@Param("subtype") String subtype);
|
||||||
|
|
||||||
@Query("select t from EntityDatatableChecks t WHERE t.status =:status and t.entity=:entity and t.productId = :productId ")
|
@Query("select t from EntityDatatableChecks t WHERE t.status =:status and t.entity=:entity and t.productId = :productId ")
|
||||||
List<EntityDatatableChecks> findByEntityStatusAndProduct(@Param("entity") String entity, @Param("status") Long status,
|
List<EntityDatatableChecks> findByEntityStatusAndProduct(@Param("entity") String entity, @Param("status") Integer status,
|
||||||
@Param("productId") Long productId);
|
@Param("productId") Long productId);
|
||||||
|
|
||||||
@Query("select t from EntityDatatableChecks t WHERE t.status =:status and t.entity=:entity and t.productId IS NULL ")
|
@Query("select t from EntityDatatableChecks t WHERE t.status =:status and t.entity=:entity and t.productId IS NULL ")
|
||||||
List<EntityDatatableChecks> findByEntityStatusAndNoProduct(@Param("entity") String entity, @Param("status") Long status);
|
List<EntityDatatableChecks> findByEntityStatusAndNoProduct(@Param("entity") String entity, @Param("status") Integer status);
|
||||||
|
|
||||||
@Query("select t from EntityDatatableChecks t WHERE t.status =:status "
|
@Query("select t from EntityDatatableChecks t WHERE t.status =:status "
|
||||||
+ "and t.entity=:entity and t.datatableName = :datatableName AND t.productId = :productId")
|
+ "and t.entity=:entity and t.datatableName = :datatableName AND t.productId = :productId")
|
||||||
List<EntityDatatableChecks> findByEntityStatusAndDatatableIdAndProductId(@Param("entity") String entityName,
|
List<EntityDatatableChecks> findByEntityStatusAndDatatableIdAndProductId(@Param("entity") String entityName,
|
||||||
@Param("status") Long status, @Param("datatableName") String datatableName, @Param("productId") Long productId);
|
@Param("status") Integer status, @Param("datatableName") String datatableName, @Param("productId") Long productId);
|
||||||
|
|
||||||
@Query("select t from EntityDatatableChecks t WHERE t.status =:status and t.entity=:entity "
|
@Query("select t from EntityDatatableChecks t WHERE t.status =:status and t.entity=:entity "
|
||||||
+ " and t.datatableName = :datatableName AND t.productId IS NULL")
|
+ " and t.datatableName = :datatableName AND t.productId IS NULL")
|
||||||
List<EntityDatatableChecks> findByEntityStatusAndDatatableIdAndNoProduct(@Param("entity") String entityName,
|
List<EntityDatatableChecks> findByEntityStatusAndDatatableIdAndNoProduct(@Param("entity") String entityName,
|
||||||
@Param("status") Long status, @Param("datatableName") String datatableName);
|
@Param("status") Integer status, @Param("datatableName") String datatableName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -25,16 +25,16 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR
|
|||||||
*/
|
*/
|
||||||
public class EntityDatatableCheckAlreadyExistsException extends AbstractPlatformDomainRuleException {
|
public class EntityDatatableCheckAlreadyExistsException extends AbstractPlatformDomainRuleException {
|
||||||
|
|
||||||
public EntityDatatableCheckAlreadyExistsException(final String entityName, final Long status, final String datatableName) {
|
public EntityDatatableCheckAlreadyExistsException(final String entityName, final Integer status, final String datatable) {
|
||||||
super("error.msg.entityDatatableCheck.duplicate.entry", "the entity datatable check for status: '" + status
|
super("error.msg.entityDatatableCheck.duplicate.entry", "the entity datatable check for status: '" + status
|
||||||
+ "' and datatable name '" + datatableName + "' on entity '" + entityName + "' already exist", "status", "datatableName",
|
+ "' and datatable name '" + datatable + "' on entity '" + entityName + "' already exist", "status", "datatable", "entity",
|
||||||
"entity", status, datatableName, entityName);
|
status, datatable, entityName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityDatatableCheckAlreadyExistsException(final String entityName, long status, String datatableName, long productId) {
|
public EntityDatatableCheckAlreadyExistsException(final String entityName, Integer status, String datatable, Long productId) {
|
||||||
super("error.msg.entityDatatableCheck.duplicate.entry",
|
super("error.msg.entityDatatableCheck.duplicate.entry",
|
||||||
"the entity datatable check for status: '" + status + "' and datatable name '" + datatableName + "' on entity '"
|
"the entity datatable check for status: '" + status + "' and datatable name '" + datatable + "' on entity '" + entityName
|
||||||
+ entityName + "' and product id '" + productId + "' already exist",
|
+ "' and product id '" + productId + "' already exist",
|
||||||
"status", "datatableName", "entity", "productId", status, datatableName, entityName, productId);
|
"status", "datatable", "entity", "productId", status, datatable, entityName, productId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-14
@@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.dataqueries.service;
|
package org.apache.fineract.infrastructure.dataqueries.service;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -84,11 +85,10 @@ public class EntityDatatableChecksReadPlatformServiceImpl implements EntityDatat
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<EntityDataTableChecksData> retrieveAll(SearchParameters searchParameters, final Long status, final String entity,
|
public Page<EntityDataTableChecksData> retrieveAll(@NotNull SearchParameters searchParameters, final Integer status,
|
||||||
final Long productId) {
|
final String entity, final Long productId) {
|
||||||
final StringBuilder sqlBuilder = new StringBuilder(200);
|
final StringBuilder sqlBuilder = new StringBuilder(200);
|
||||||
sqlBuilder.append("select " + sqlGenerator.calcFoundRows() + " ");
|
sqlBuilder.append("select ").append(sqlGenerator.calcFoundRows()).append(" ").append(this.entityDataTableChecksMapper.schema());
|
||||||
sqlBuilder.append(this.entityDataTableChecksMapper.schema());
|
|
||||||
|
|
||||||
if (status != null || entity != null || productId != null) {
|
if (status != null || entity != null || productId != null) {
|
||||||
sqlBuilder.append(" where ");
|
sqlBuilder.append(" where ");
|
||||||
@@ -122,8 +122,7 @@ public class EntityDatatableChecksReadPlatformServiceImpl implements EntityDatat
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DatatableData> retrieveTemplates(final Long status, final String entity, final Long productId) {
|
public List<DatatableData> retrieveTemplates(final Integer status, final String entity, final Long productId) {
|
||||||
|
|
||||||
List<EntityDatatableChecks> tableRequiredBeforeAction = null;
|
List<EntityDatatableChecks> tableRequiredBeforeAction = null;
|
||||||
if (productId != null) {
|
if (productId != null) {
|
||||||
tableRequiredBeforeAction = this.entityDatatableChecksRepository.findByEntityStatusAndProduct(entity, status, productId);
|
tableRequiredBeforeAction = this.entityDatatableChecksRepository.findByEntityStatusAndProduct(entity, status, productId);
|
||||||
@@ -162,7 +161,7 @@ public class EntityDatatableChecksReadPlatformServiceImpl implements EntityDatat
|
|||||||
List<DatatableCheckStatusData> ret = new ArrayList<>();
|
List<DatatableCheckStatusData> ret = new ArrayList<>();
|
||||||
if (statuses != null) {
|
if (statuses != null) {
|
||||||
for (StatusEnum status : statuses) {
|
for (StatusEnum status : statuses) {
|
||||||
ret.add(new DatatableCheckStatusData(status.name(), status.getCode()));
|
ret.add(new DatatableCheckStatusData(status.name(), status.getValue()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@@ -196,14 +195,10 @@ public class EntityDatatableChecksReadPlatformServiceImpl implements EntityDatat
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EntityDataTableChecksData mapRow(final ResultSet rs, @SuppressWarnings("unused") final int rowNum) throws SQLException {
|
public EntityDataTableChecksData mapRow(final ResultSet rs, @SuppressWarnings("unused") final int rowNum) throws SQLException {
|
||||||
|
|
||||||
final Long id = JdbcSupport.getLong(rs, "id");
|
final Long id = JdbcSupport.getLong(rs, "id");
|
||||||
final String entity = rs.getString("entity");
|
final String entity = rs.getString("entity");
|
||||||
final Long status = rs.getLong("status");
|
final int status = rs.getInt("status");
|
||||||
EnumOptionData statusEnum = null;
|
EnumOptionData statusEnum = StatusEnum.toEnumOptionData(status);
|
||||||
if (status != null) {
|
|
||||||
statusEnum = StatusEnum.statusTypeEnum(status.intValue());
|
|
||||||
}
|
|
||||||
final String datatableName = rs.getString("datatableName");
|
final String datatableName = rs.getString("datatableName");
|
||||||
final boolean systemDefined = rs.getBoolean("systemDefined");
|
final boolean systemDefined = rs.getBoolean("systemDefined");
|
||||||
final Long productId = JdbcSupport.getLong(rs, "productId");
|
final Long productId = JdbcSupport.getLong(rs, "productId");
|
||||||
@@ -222,5 +217,4 @@ public class EntityDatatableChecksReadPlatformServiceImpl implements EntityDatat
|
|||||||
+ "left join m_savings_product sp on sp.id = t.product_id and t.application_table_name = 'm_savings_account' ";
|
+ "left join m_savings_product sp on sp.id = t.product_id and t.application_table_name = 'm_savings_account' ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -29,8 +29,7 @@ public interface EntityDatatableChecksReadService {
|
|||||||
|
|
||||||
EntityDataTableChecksTemplateData retrieveTemplate();
|
EntityDataTableChecksTemplateData retrieveTemplate();
|
||||||
|
|
||||||
List<DatatableData> retrieveTemplates(Long status, String entity, Long productId);
|
List<DatatableData> retrieveTemplates(Integer status, String entity, Long productId);
|
||||||
|
|
||||||
Page<EntityDataTableChecksData> retrieveAll(SearchParameters searchParameters, Long status, String entity, Long productLoanId);
|
|
||||||
|
|
||||||
|
Page<EntityDataTableChecksData> retrieveAll(SearchParameters searchParameters, Integer status, String entity, Long productId);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -28,10 +28,10 @@ public interface EntityDatatableChecksWritePlatformService {
|
|||||||
|
|
||||||
CommandProcessingResult deleteCheck(Long entityDatatableCheckId);
|
CommandProcessingResult deleteCheck(Long entityDatatableCheckId);
|
||||||
|
|
||||||
void runTheCheck(Long entityId, String entityName, Integer statusCode, String foreignKeyColumn, String entitySubtype);
|
void runTheCheck(Long entityId, String entityName, Integer status, String foreignKeyColumn, String entitySubtype);
|
||||||
|
|
||||||
void runTheCheckForProduct(Long entityId, String entityName, Long statusCode, String foreignKeyColumn, long productLoanId);
|
void runTheCheckForProduct(Long entityId, String entityName, Integer status, String foreignKeyColumn, long productLoanId);
|
||||||
|
|
||||||
boolean saveDatatables(Long status, String entity, Long entityId, Long productId, JsonArray data);
|
boolean saveDatatables(Integer status, String entity, Long entityId, Long productId, JsonArray data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-15
@@ -94,9 +94,9 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Long productId = command.longValueOfParameterNamed("productId");
|
final Long productId = command.longValueOfParameterNamed("productId");
|
||||||
final Long status = command.longValueOfParameterNamed("status");
|
final Integer status = command.integerValueSansLocaleOfParameterNamed("status");
|
||||||
|
|
||||||
List<EntityDatatableChecks> entityDatatableCheck = null;
|
List<EntityDatatableChecks> entityDatatableCheck;
|
||||||
if (productId == null) {
|
if (productId == null) {
|
||||||
entityDatatableCheck = this.entityDatatableChecksRepository.findByEntityStatusAndDatatableIdAndNoProduct(entity, status,
|
entityDatatableCheck = this.entityDatatableChecksRepository.findByEntityStatusAndDatatableIdAndNoProduct(entity, status,
|
||||||
datatableName);
|
datatableName);
|
||||||
@@ -139,13 +139,13 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void runTheCheck(final Long entityId, final String entityName, final Integer statusCode, String foreignKeyColumn,
|
public void runTheCheck(final Long entityId, final String entityName, final Integer status, String foreignKeyColumn,
|
||||||
final String entitySubtype) {
|
final String entitySubtype) {
|
||||||
List<EntityDatatableChecks> tableRequiredBeforeClientActivation;
|
List<EntityDatatableChecks> tableRequiredBeforeClientActivation;
|
||||||
if (entitySubtype == null) {
|
if (entitySubtype == null) {
|
||||||
tableRequiredBeforeClientActivation = entityDatatableChecksRepository.findByEntityAndStatus(entityName, statusCode);
|
tableRequiredBeforeClientActivation = entityDatatableChecksRepository.findByEntityAndStatus(entityName, status);
|
||||||
} else {
|
} else {
|
||||||
tableRequiredBeforeClientActivation = entityDatatableChecksRepository.findByEntityAndStatusAndSubtype(entityName, statusCode,
|
tableRequiredBeforeClientActivation = entityDatatableChecksRepository.findByEntityAndStatusAndSubtype(entityName, status,
|
||||||
entitySubtype.toUpperCase());
|
entitySubtype.toUpperCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,22 +161,21 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData
|
|||||||
reqDatatables.add(datatableName);
|
reqDatatables.add(datatableName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (reqDatatables.size() > 0) {
|
if (!reqDatatables.isEmpty()) {
|
||||||
throw new DatatableEntryRequiredException(reqDatatables.toString());
|
throw new DatatableEntryRequiredException(reqDatatables.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
@Override
|
@Override
|
||||||
public void runTheCheckForProduct(final Long entityId, final String entityName, final Long statusCode, String foreignKeyColumn,
|
public void runTheCheckForProduct(final Long entityId, final String entityName, final Integer status, String foreignKeyColumn,
|
||||||
long productId) {
|
long productId) {
|
||||||
List<EntityDatatableChecks> tableRequiredBeforAction = entityDatatableChecksRepository.findByEntityStatusAndProduct(entityName,
|
List<EntityDatatableChecks> tableRequiredBeforAction = entityDatatableChecksRepository.findByEntityStatusAndProduct(entityName,
|
||||||
statusCode, productId);
|
status, productId);
|
||||||
|
|
||||||
if (tableRequiredBeforAction == null || tableRequiredBeforAction.isEmpty()) {
|
if (tableRequiredBeforAction == null || tableRequiredBeforAction.isEmpty()) {
|
||||||
tableRequiredBeforAction = entityDatatableChecksRepository.findByEntityStatusAndNoProduct(entityName, statusCode);
|
tableRequiredBeforAction = entityDatatableChecksRepository.findByEntityStatusAndNoProduct(entityName, status);
|
||||||
}
|
}
|
||||||
if (tableRequiredBeforAction != null) {
|
if (tableRequiredBeforAction != null) {
|
||||||
List<String> reqDatatables = new ArrayList<>();
|
List<String> reqDatatables = new ArrayList<>();
|
||||||
@@ -194,12 +193,11 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData
|
|||||||
throw new DatatableEntryRequiredException(reqDatatables.toString());
|
throw new DatatableEntryRequiredException(reqDatatables.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public boolean saveDatatables(final Long status, final String entity, final Long entityId, final Long productId,
|
public boolean saveDatatables(final Integer status, final String entity, final Long entityId, final Long productId,
|
||||||
final JsonArray datatableDatas) {
|
final JsonArray datatableDatas) {
|
||||||
final AppUser user = this.context.authenticatedUser();
|
final AppUser user = this.context.authenticatedUser();
|
||||||
boolean isMakerCheckerEnabled = false;
|
boolean isMakerCheckerEnabled = false;
|
||||||
@@ -237,7 +235,6 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData
|
|||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult deleteCheck(final Long entityDatatableCheckId) {
|
public CommandProcessingResult deleteCheck(final Long entityDatatableCheckId) {
|
||||||
|
|
||||||
final EntityDatatableChecks check = this.entityDatatableChecksRepository.findById(entityDatatableCheckId)
|
final EntityDatatableChecks check = this.entityDatatableChecksRepository.findById(entityDatatableCheckId)
|
||||||
.orElseThrow(() -> new EntityDatatableChecksNotFoundException(entityDatatableCheckId));
|
.orElseThrow(() -> new EntityDatatableChecksNotFoundException(entityDatatableCheckId));
|
||||||
|
|
||||||
@@ -265,9 +262,9 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData
|
|||||||
msgArgs = new Object[] { datatableName, dae };
|
msgArgs = new Object[] { datatableName, dae };
|
||||||
} else if (checkEx.getMessage().contains("unique_entity_check")) {
|
} else if (checkEx.getMessage().contains("unique_entity_check")) {
|
||||||
final String datatableName = command.stringValueOfParameterNamed("datatableName");
|
final String datatableName = command.stringValueOfParameterNamed("datatableName");
|
||||||
final long status = command.longValueOfParameterNamed("status");
|
final Integer status = command.integerValueSansLocaleOfParameterNamed("status");
|
||||||
final String entity = command.stringValueOfParameterNamed("entity");
|
final String entity = command.stringValueOfParameterNamed("entity");
|
||||||
final long productId = command.longValueOfParameterNamed("productId");
|
final Long productId = command.longValueOfParameterNamed("productId");
|
||||||
throw new EntityDatatableCheckAlreadyExistsException(entity, status, datatableName, productId);
|
throw new EntityDatatableCheckAlreadyExistsException(entity, status, datatableName, productId);
|
||||||
} else {
|
} else {
|
||||||
msgCode += ".unknown.data.integrity.issue";
|
msgCode += ".unknown.data.integrity.issue";
|
||||||
|
|||||||
+2
-2
@@ -155,8 +155,8 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService
|
|||||||
|
|
||||||
final List<EnumOptionData> clientLegalFormOptions = ClientEnumerations.legalForm(LegalForm.values());
|
final List<EnumOptionData> clientLegalFormOptions = ClientEnumerations.legalForm(LegalForm.values());
|
||||||
|
|
||||||
final List<DatatableData> datatableTemplates = this.entityDatatableChecksReadService
|
final List<DatatableData> datatableTemplates = this.entityDatatableChecksReadService.retrieveTemplates(StatusEnum.CREATE.getValue(),
|
||||||
.retrieveTemplates(StatusEnum.CREATE.getCode().longValue(), EntityTables.CLIENT.getName(), null);
|
EntityTables.CLIENT.getName(), null);
|
||||||
|
|
||||||
return ClientData.template(defaultOfficeId, LocalDate.now(DateUtils.getDateTimeZoneOfTenant()), offices, staffOptions, null,
|
return ClientData.template(defaultOfficeId, LocalDate.now(DateUtils.getDateTimeZoneOfTenant()), offices, staffOptions, null,
|
||||||
genderOptions, savingsProductDatas, clientTypeOptions, clientClassificationOptions, clientNonPersonConstitutionOptions,
|
genderOptions, savingsProductDatas, clientTypeOptions, clientClassificationOptions, clientNonPersonConstitutionOptions,
|
||||||
|
|||||||
+5
-6
@@ -324,14 +324,13 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (command.parameterExists(ClientApiConstants.datatables)) {
|
if (command.parameterExists(ClientApiConstants.datatables)) {
|
||||||
this.entityDatatableChecksWritePlatformService.saveDatatables(StatusEnum.CREATE.getCode().longValue(),
|
this.entityDatatableChecksWritePlatformService.saveDatatables(StatusEnum.CREATE.getValue(), EntityTables.CLIENT.getName(),
|
||||||
EntityTables.CLIENT.getName(), newClient.getId(), null,
|
newClient.getId(), null, command.arrayOfParameterNamed(ClientApiConstants.datatables));
|
||||||
command.arrayOfParameterNamed(ClientApiConstants.datatables));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
legalForm = LegalForm.fromInt(newClient.getLegalForm());
|
legalForm = LegalForm.fromInt(newClient.getLegalForm());
|
||||||
entityDatatableChecksWritePlatformService.runTheCheck(newClient.getId(), EntityTables.CLIENT.getName(),
|
entityDatatableChecksWritePlatformService.runTheCheck(newClient.getId(), EntityTables.CLIENT.getName(),
|
||||||
StatusEnum.CREATE.getCode(), EntityTables.CLIENT.getForeignKeyColumnNameOnDatatable(), legalForm.getLabel());
|
StatusEnum.CREATE.getValue(), EntityTables.CLIENT.getForeignKeyColumnNameOnDatatable(), legalForm.getLabel());
|
||||||
businessEventNotifierService.notifyPostBusinessEvent(new ClientCreateBusinessEvent(newClient));
|
businessEventNotifierService.notifyPostBusinessEvent(new ClientCreateBusinessEvent(newClient));
|
||||||
if (newClient.isActive()) {
|
if (newClient.isActive()) {
|
||||||
businessEventNotifierService.notifyPostBusinessEvent(new ClientActivateBusinessEvent(newClient));
|
businessEventNotifierService.notifyPostBusinessEvent(new ClientActivateBusinessEvent(newClient));
|
||||||
@@ -856,7 +855,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
|
|||||||
closureDate, client.getActivationDate());
|
closureDate, client.getActivationDate());
|
||||||
}
|
}
|
||||||
final LegalForm legalForm = LegalForm.fromInt(client.getLegalForm());
|
final LegalForm legalForm = LegalForm.fromInt(client.getLegalForm());
|
||||||
entityDatatableChecksWritePlatformService.runTheCheck(clientId, EntityTables.CLIENT.getName(), StatusEnum.CLOSE.getCode(),
|
entityDatatableChecksWritePlatformService.runTheCheck(clientId, EntityTables.CLIENT.getName(), StatusEnum.CLOSE.getValue(),
|
||||||
EntityTables.CLIENT.getForeignKeyColumnNameOnDatatable(), legalForm.getLabel());
|
EntityTables.CLIENT.getForeignKeyColumnNameOnDatatable(), legalForm.getLabel());
|
||||||
|
|
||||||
final List<Loan> clientLoans = this.loanRepositoryWrapper.findLoanByClientId(clientId);
|
final List<Loan> clientLoans = this.loanRepositoryWrapper.findLoanByClientId(clientId);
|
||||||
@@ -955,7 +954,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
|
|||||||
|
|
||||||
private void runEntityDatatableCheck(final Long clientId, final Integer legalFormId) {
|
private void runEntityDatatableCheck(final Long clientId, final Integer legalFormId) {
|
||||||
final LegalForm legalForm = LegalForm.fromInt(legalFormId);
|
final LegalForm legalForm = LegalForm.fromInt(legalFormId);
|
||||||
entityDatatableChecksWritePlatformService.runTheCheck(clientId, EntityTables.CLIENT.getName(), StatusEnum.ACTIVATE.getCode(),
|
entityDatatableChecksWritePlatformService.runTheCheck(clientId, EntityTables.CLIENT.getName(), StatusEnum.ACTIVATE.getValue(),
|
||||||
EntityTables.CLIENT.getForeignKeyColumnNameOnDatatable(), legalForm.getLabel());
|
EntityTables.CLIENT.getForeignKeyColumnNameOnDatatable(), legalForm.getLabel());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -139,8 +139,8 @@ public class CentersApiResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final CenterData template = this.centerReadPlatformService.retrieveTemplate(officeId, staffInSelectedOfficeOnly);
|
final CenterData template = this.centerReadPlatformService.retrieveTemplate(officeId, staffInSelectedOfficeOnly);
|
||||||
final List<DatatableData> datatableTemplates = this.entityDatatableChecksReadService
|
final List<DatatableData> datatableTemplates = this.entityDatatableChecksReadService.retrieveTemplates(StatusEnum.CREATE.getValue(),
|
||||||
.retrieveTemplates(StatusEnum.CREATE.getCode().longValue(), EntityTables.GROUP.getName(), null);
|
EntityTables.GROUP.getName(), null);
|
||||||
template.setDatatables(datatableTemplates);
|
template.setDatatables(datatableTemplates);
|
||||||
|
|
||||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
|
|||||||
+2
-2
@@ -159,8 +159,8 @@ public class GroupsApiResource {
|
|||||||
GroupingTypesApiConstants.GROUP_RESPONSE_DATA_PARAMETERS);
|
GroupingTypesApiConstants.GROUP_RESPONSE_DATA_PARAMETERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<DatatableData> datatableTemplates = entityDatatableChecksReadService
|
final List<DatatableData> datatableTemplates = entityDatatableChecksReadService.retrieveTemplates(StatusEnum.CREATE.getValue(),
|
||||||
.retrieveTemplates(StatusEnum.CREATE.getCode().longValue(), EntityTables.GROUP.getName(), null);
|
EntityTables.GROUP.getName(), null);
|
||||||
if (centerId != null) {
|
if (centerId != null) {
|
||||||
final GroupGeneralData centerGroupTemplate = centerReadPlatformService.retrieveCenterGroupTemplate(centerId);
|
final GroupGeneralData centerGroupTemplate = centerReadPlatformService.retrieveCenterGroupTemplate(centerId);
|
||||||
centerGroupTemplate.setDatatables(datatableTemplates);
|
centerGroupTemplate.setDatatables(datatableTemplates);
|
||||||
|
|||||||
+5
-5
@@ -200,13 +200,13 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
|
|||||||
|
|
||||||
if (newGroup.isGroup()) {
|
if (newGroup.isGroup()) {
|
||||||
if (command.parameterExists(GroupingTypesApiConstants.datatables)) {
|
if (command.parameterExists(GroupingTypesApiConstants.datatables)) {
|
||||||
this.entityDatatableChecksWritePlatformService.saveDatatables(StatusEnum.CREATE.getCode().longValue(),
|
this.entityDatatableChecksWritePlatformService.saveDatatables(StatusEnum.CREATE.getValue(),
|
||||||
EntityTables.GROUP.getName(), newGroup.getId(), null,
|
EntityTables.GROUP.getName(), newGroup.getId(), null,
|
||||||
command.arrayOfParameterNamed(GroupingTypesApiConstants.datatables));
|
command.arrayOfParameterNamed(GroupingTypesApiConstants.datatables));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.entityDatatableChecksWritePlatformService.runTheCheck(newGroup.getId(), EntityTables.GROUP.getName(),
|
this.entityDatatableChecksWritePlatformService.runTheCheck(newGroup.getId(), EntityTables.GROUP.getName(),
|
||||||
StatusEnum.CREATE.getCode(), EntityTables.GROUP.getForeignKeyColumnNameOnDatatable(), null);
|
StatusEnum.CREATE.getValue(), EntityTables.GROUP.getForeignKeyColumnNameOnDatatable(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new CommandProcessingResultBuilder() //
|
return new CommandProcessingResultBuilder() //
|
||||||
@@ -322,7 +322,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
|
|||||||
if (!isGroupClientCountValid) {
|
if (!isGroupClientCountValid) {
|
||||||
throw new GroupMemberCountNotInPermissibleRangeException(group.getId(), minClients, maxClients);
|
throw new GroupMemberCountNotInPermissibleRangeException(group.getId(), minClients, maxClients);
|
||||||
}
|
}
|
||||||
entityDatatableChecksWritePlatformService.runTheCheck(group.getId(), EntityTables.GROUP.getName(), StatusEnum.ACTIVATE.getCode(),
|
entityDatatableChecksWritePlatformService.runTheCheck(group.getId(), EntityTables.GROUP.getName(), StatusEnum.ACTIVATE.getValue(),
|
||||||
EntityTables.GROUP.getForeignKeyColumnNameOnDatatable(), null);
|
EntityTables.GROUP.getForeignKeyColumnNameOnDatatable(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -594,7 +594,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
|
|||||||
|
|
||||||
validateLoansAndSavingsForGroupOrCenterClose(group, closureDate);
|
validateLoansAndSavingsForGroupOrCenterClose(group, closureDate);
|
||||||
|
|
||||||
entityDatatableChecksWritePlatformService.runTheCheck(groupId, EntityTables.GROUP.getName(), StatusEnum.CLOSE.getCode(),
|
entityDatatableChecksWritePlatformService.runTheCheck(groupId, EntityTables.GROUP.getName(), StatusEnum.CLOSE.getValue(),
|
||||||
EntityTables.GROUP.getForeignKeyColumnNameOnDatatable(), null);
|
EntityTables.GROUP.getForeignKeyColumnNameOnDatatable(), null);
|
||||||
|
|
||||||
group.close(currentUser, closureReason, closureDate);
|
group.close(currentUser, closureReason, closureDate);
|
||||||
@@ -669,7 +669,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
|
|||||||
|
|
||||||
validateLoansAndSavingsForGroupOrCenterClose(center, closureDate);
|
validateLoansAndSavingsForGroupOrCenterClose(center, closureDate);
|
||||||
|
|
||||||
entityDatatableChecksWritePlatformService.runTheCheck(centerId, EntityTables.GROUP.getName(), StatusEnum.ACTIVATE.getCode(),
|
entityDatatableChecksWritePlatformService.runTheCheck(centerId, EntityTables.GROUP.getName(), StatusEnum.ACTIVATE.getValue(),
|
||||||
EntityTables.GROUP.getForeignKeyColumnNameOnDatatable(), null);
|
EntityTables.GROUP.getForeignKeyColumnNameOnDatatable(), null);
|
||||||
|
|
||||||
center.close(currentUser, closureReason, closureDate);
|
center.close(currentUser, closureReason, closureDate);
|
||||||
|
|||||||
+2
-2
@@ -414,8 +414,8 @@ public class LoansApiResource {
|
|||||||
newLoanAccount = LoanAccountData.associationsAndTemplate(newLoanAccount, productOptions, allowedLoanOfficers, calendarOptions,
|
newLoanAccount = LoanAccountData.associationsAndTemplate(newLoanAccount, productOptions, allowedLoanOfficers, calendarOptions,
|
||||||
accountLinkingOptions, isRatesEnabled);
|
accountLinkingOptions, isRatesEnabled);
|
||||||
}
|
}
|
||||||
final List<DatatableData> datatableTemplates = this.entityDatatableChecksReadService
|
final List<DatatableData> datatableTemplates = this.entityDatatableChecksReadService.retrieveTemplates(StatusEnum.CREATE.getValue(),
|
||||||
.retrieveTemplates(StatusEnum.CREATE.getCode().longValue(), EntityTables.LOAN.getName(), productId);
|
EntityTables.LOAN.getName(), productId);
|
||||||
newLoanAccount.setDatatables(datatableTemplates);
|
newLoanAccount.setDatatables(datatableTemplates);
|
||||||
|
|
||||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
|
|||||||
+1
-1
@@ -2004,7 +2004,7 @@ public final class LoanApplicationValidator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
entityDatatableChecksWritePlatformService.runTheCheckForProduct(loanId, EntityTables.LOAN.getName(),
|
entityDatatableChecksWritePlatformService.runTheCheckForProduct(loanId, EntityTables.LOAN.getName(),
|
||||||
StatusEnum.APPROVE.getCode().longValue(), EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(), loan.productId());
|
StatusEnum.APPROVE.getValue(), EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(), loan.productId());
|
||||||
|
|
||||||
if (loan.isTopup() && loan.getClientId() != null) {
|
if (loan.isTopup() && loan.getClientId() != null) {
|
||||||
validateTopupLoan(loan, expectedDisbursementDate);
|
validateTopupLoan(loan, expectedDisbursementDate);
|
||||||
|
|||||||
+6
-7
@@ -153,15 +153,14 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
createSavingsAccountAssociation(savingsAccountId, loan);
|
createSavingsAccountAssociation(savingsAccountId, loan);
|
||||||
// Save related datatable entries
|
// Save related datatable entries
|
||||||
if (command.parameterExists(LoanApiConstants.datatables)) {
|
if (command.parameterExists(LoanApiConstants.datatables)) {
|
||||||
this.entityDatatableChecksWritePlatformService.saveDatatables(StatusEnum.CREATE.getCode().longValue(),
|
this.entityDatatableChecksWritePlatformService.saveDatatables(StatusEnum.CREATE.getValue(), EntityTables.LOAN.getName(),
|
||||||
EntityTables.LOAN.getName(), loan.getId(), loan.productId(),
|
loan.getId(), loan.productId(), command.arrayOfParameterNamed(LoanApiConstants.datatables));
|
||||||
command.arrayOfParameterNamed(LoanApiConstants.datatables));
|
|
||||||
}
|
}
|
||||||
// TODO: review whether we really need this
|
// TODO: review whether we really need this
|
||||||
loanRepositoryWrapper.flush();
|
loanRepositoryWrapper.flush();
|
||||||
// Check mandatory datatable entries were created
|
// Check mandatory datatable entries were created
|
||||||
this.entityDatatableChecksWritePlatformService.runTheCheckForProduct(loan.getId(), EntityTables.LOAN.getName(),
|
this.entityDatatableChecksWritePlatformService.runTheCheckForProduct(loan.getId(), EntityTables.LOAN.getName(),
|
||||||
StatusEnum.CREATE.getCode().longValue(), EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(), loan.productId());
|
StatusEnum.CREATE.getValue(), EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(), loan.productId());
|
||||||
// Trigger business event
|
// Trigger business event
|
||||||
businessEventNotifierService.notifyPostBusinessEvent(new LoanCreatedBusinessEvent(loan));
|
businessEventNotifierService.notifyPostBusinessEvent(new LoanCreatedBusinessEvent(loan));
|
||||||
// Building response
|
// Building response
|
||||||
@@ -691,8 +690,8 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
loanApplicationTransitionValidator.validateRejection(command, loan);
|
loanApplicationTransitionValidator.validateRejection(command, loan);
|
||||||
|
|
||||||
// check for mandatory entities
|
// check for mandatory entities
|
||||||
entityDatatableChecksWritePlatformService.runTheCheckForProduct(loanId, EntityTables.LOAN.getName(),
|
entityDatatableChecksWritePlatformService.runTheCheckForProduct(loanId, EntityTables.LOAN.getName(), StatusEnum.REJECTED.getValue(),
|
||||||
StatusEnum.REJECTED.getCode().longValue(), EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(), loan.productId());
|
EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(), loan.productId());
|
||||||
|
|
||||||
// loan application rejection
|
// loan application rejection
|
||||||
final AppUser currentUser = getAppUserIfPresent();
|
final AppUser currentUser = getAppUserIfPresent();
|
||||||
@@ -730,7 +729,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
|
|
||||||
// check for mandatory entities
|
// check for mandatory entities
|
||||||
entityDatatableChecksWritePlatformService.runTheCheckForProduct(loanId, EntityTables.LOAN.getName(),
|
entityDatatableChecksWritePlatformService.runTheCheckForProduct(loanId, EntityTables.LOAN.getName(),
|
||||||
StatusEnum.WITHDRAWN.getCode().longValue(), EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(), loan.productId());
|
StatusEnum.WITHDRAWN.getValue(), EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(), loan.productId());
|
||||||
|
|
||||||
// loan application withdrawal
|
// loan application withdrawal
|
||||||
final AppUser currentUser = getAppUserIfPresent();
|
final AppUser currentUser = getAppUserIfPresent();
|
||||||
|
|||||||
+3
-3
@@ -362,8 +362,8 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
final LocalDate nextPossibleRepaymentDate = loan.getNextPossibleRepaymentDateForRescheduling();
|
final LocalDate nextPossibleRepaymentDate = loan.getNextPossibleRepaymentDateForRescheduling();
|
||||||
final LocalDate rescheduledRepaymentDate = command.localDateValueOfParameterNamed("adjustRepaymentDate");
|
final LocalDate rescheduledRepaymentDate = command.localDateValueOfParameterNamed("adjustRepaymentDate");
|
||||||
|
|
||||||
entityDatatableChecksWritePlatformService.runTheCheckForProduct(loanId, EntityTables.LOAN.getName(),
|
entityDatatableChecksWritePlatformService.runTheCheckForProduct(loanId, EntityTables.LOAN.getName(), StatusEnum.DISBURSE.getValue(),
|
||||||
StatusEnum.DISBURSE.getCode().longValue(), EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(), loan.productId());
|
EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(), loan.productId());
|
||||||
|
|
||||||
LocalDate recalculateFrom = null;
|
LocalDate recalculateFrom = null;
|
||||||
if (!loan.isMultiDisburmentLoan()) {
|
if (!loan.isMultiDisburmentLoan()) {
|
||||||
@@ -1786,7 +1786,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
}
|
}
|
||||||
businessEventNotifierService.notifyPreBusinessEvent(new LoanWrittenOffPreBusinessEvent(loan));
|
businessEventNotifierService.notifyPreBusinessEvent(new LoanWrittenOffPreBusinessEvent(loan));
|
||||||
entityDatatableChecksWritePlatformService.runTheCheckForProduct(loanId, EntityTables.LOAN.getName(),
|
entityDatatableChecksWritePlatformService.runTheCheckForProduct(loanId, EntityTables.LOAN.getName(),
|
||||||
StatusEnum.WRITE_OFF.getCode().longValue(), EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(), loan.productId());
|
StatusEnum.WRITE_OFF.getValue(), EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(), loan.productId());
|
||||||
|
|
||||||
removeLoanCycle(loan);
|
removeLoanCycle(loan);
|
||||||
|
|
||||||
|
|||||||
-2
@@ -247,8 +247,6 @@ public class NotesApiResource {
|
|||||||
}
|
}
|
||||||
default -> resourceNameForPermissions = INVALIDNOTE;
|
default -> resourceNameForPermissions = INVALIDNOTE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return resourceDetails.withEntityName(resourceNameForPermissions).build();
|
return resourceDetails.withEntityName(resourceNameForPermissions).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
-59
@@ -1,59 +0,0 @@
|
|||||||
/**
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
package org.apache.fineract.portfolio.note.service;
|
|
||||||
|
|
||||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
|
||||||
import org.apache.fineract.portfolio.note.domain.NoteType;
|
|
||||||
|
|
||||||
public final class NoteEnumerations {
|
|
||||||
|
|
||||||
private NoteEnumerations() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static EnumOptionData noteType(final Integer id) {
|
|
||||||
return noteType(NoteType.fromInt(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static EnumOptionData noteType(final NoteType type) {
|
|
||||||
EnumOptionData optionData = null;
|
|
||||||
switch (type) {
|
|
||||||
case CLIENT:
|
|
||||||
optionData = new EnumOptionData(type.getValue().longValue(), type.getCode(), "Client note");
|
|
||||||
break;
|
|
||||||
case LOAN:
|
|
||||||
optionData = new EnumOptionData(type.getValue().longValue(), type.getCode(), "Loan note");
|
|
||||||
break;
|
|
||||||
case LOAN_TRANSACTION:
|
|
||||||
optionData = new EnumOptionData(type.getValue().longValue(), type.getCode(), "Loan transaction note");
|
|
||||||
break;
|
|
||||||
case SAVING_ACCOUNT:
|
|
||||||
optionData = new EnumOptionData(type.getValue().longValue(), type.getCode(), "Saving account note");
|
|
||||||
break;
|
|
||||||
case GROUP:
|
|
||||||
optionData = new EnumOptionData(type.getValue().longValue(), type.getCode(), "Group note");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
return optionData;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
+1
-5
@@ -61,12 +61,8 @@ public class NoteReadPlatformServiceImpl implements NoteReadPlatformService {
|
|||||||
final Long groupId = JdbcSupport.getLong(rs, "groupId");
|
final Long groupId = JdbcSupport.getLong(rs, "groupId");
|
||||||
final Long loanId = JdbcSupport.getLong(rs, "loanId");
|
final Long loanId = JdbcSupport.getLong(rs, "loanId");
|
||||||
final Long transactionId = JdbcSupport.getLong(rs, "transactionId");
|
final Long transactionId = JdbcSupport.getLong(rs, "transactionId");
|
||||||
// final Long depositAccountId = JdbcSupport.getLong(rs,
|
|
||||||
// "depositAccountId");
|
|
||||||
// final Long savingAccountId = JdbcSupport.getLong(rs,
|
|
||||||
// "savingAccountId");
|
|
||||||
final Integer noteTypeId = JdbcSupport.getInteger(rs, "noteTypeEnum");
|
final Integer noteTypeId = JdbcSupport.getInteger(rs, "noteTypeEnum");
|
||||||
final EnumOptionData noteType = NoteEnumerations.noteType(noteTypeId);
|
final EnumOptionData noteType = NoteType.toEnumOptionData(noteTypeId);
|
||||||
final String note = rs.getString("note");
|
final String note = rs.getString("note");
|
||||||
final OffsetDateTime createdDateLocal = JdbcSupport.getOffsetDateTime(rs, "createdDate");
|
final OffsetDateTime createdDateLocal = JdbcSupport.getOffsetDateTime(rs, "createdDate");
|
||||||
final OffsetDateTime createdDateUtc = JdbcSupport.getOffsetDateTime(rs, "createdDateUtc");
|
final OffsetDateTime createdDateUtc = JdbcSupport.getOffsetDateTime(rs, "createdDateUtc");
|
||||||
|
|||||||
+2
-2
@@ -1154,8 +1154,8 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead
|
|||||||
charges, chargeOptions);
|
charges, chargeOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<DatatableData> datatableTemplates = this.entityDatatableChecksReadService
|
final List<DatatableData> datatableTemplates = this.entityDatatableChecksReadService.retrieveTemplates(StatusEnum.CREATE.getValue(),
|
||||||
.retrieveTemplates(StatusEnum.CREATE.getCode().longValue(), EntityTables.SAVINGS.getName(), productId);
|
EntityTables.SAVINGS.getName(), productId);
|
||||||
template.setDatatables(datatableTemplates);
|
template.setDatatables(datatableTemplates);
|
||||||
|
|
||||||
return template;
|
return template;
|
||||||
|
|||||||
+2
-2
@@ -208,7 +208,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
final Map<String, Object> changes = account.activate(user, command);
|
final Map<String, Object> changes = account.activate(user, command);
|
||||||
|
|
||||||
entityDatatableChecksWritePlatformService.runTheCheckForProduct(savingsId, EntityTables.SAVINGS.getName(),
|
entityDatatableChecksWritePlatformService.runTheCheckForProduct(savingsId, EntityTables.SAVINGS.getName(),
|
||||||
StatusEnum.ACTIVATE.getCode().longValue(), EntityTables.SAVINGS.getForeignKeyColumnNameOnDatatable(), account.productId());
|
StatusEnum.ACTIVATE.getValue(), EntityTables.SAVINGS.getForeignKeyColumnNameOnDatatable(), account.productId());
|
||||||
|
|
||||||
if (!changes.isEmpty()) {
|
if (!changes.isEmpty()) {
|
||||||
final Locale locale = command.extractLocale();
|
final Locale locale = command.extractLocale();
|
||||||
@@ -904,7 +904,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
}
|
}
|
||||||
|
|
||||||
entityDatatableChecksWritePlatformService.runTheCheckForProduct(savingsId, EntityTables.SAVINGS.getName(),
|
entityDatatableChecksWritePlatformService.runTheCheckForProduct(savingsId, EntityTables.SAVINGS.getName(),
|
||||||
StatusEnum.CLOSE.getCode().longValue(), EntityTables.SAVINGS.getForeignKeyColumnNameOnDatatable(), account.productId());
|
StatusEnum.CLOSE.getValue(), EntityTables.SAVINGS.getForeignKeyColumnNameOnDatatable(), account.productId());
|
||||||
|
|
||||||
final boolean isWithdrawBalance = command.booleanPrimitiveValueOfParameterNamed(withdrawBalanceParamName);
|
final boolean isWithdrawBalance = command.booleanPrimitiveValueOfParameterNamed(withdrawBalanceParamName);
|
||||||
|
|
||||||
|
|||||||
+6
-11
@@ -226,13 +226,11 @@ public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
|||||||
// end of gsim
|
// end of gsim
|
||||||
final Long savingsId = account.getId();
|
final Long savingsId = account.getId();
|
||||||
if (command.parameterExists(SavingsApiConstants.datatables)) {
|
if (command.parameterExists(SavingsApiConstants.datatables)) {
|
||||||
this.entityDatatableChecksWritePlatformService.saveDatatables(StatusEnum.CREATE.getCode().longValue(),
|
this.entityDatatableChecksWritePlatformService.saveDatatables(StatusEnum.CREATE.getValue(), EntityTables.SAVINGS.getName(),
|
||||||
EntityTables.SAVINGS.getName(), savingsId, account.productId(),
|
savingsId, account.productId(), command.arrayOfParameterNamed(SavingsApiConstants.datatables));
|
||||||
command.arrayOfParameterNamed(SavingsApiConstants.datatables));
|
|
||||||
}
|
}
|
||||||
this.entityDatatableChecksWritePlatformService.runTheCheckForProduct(savingsId, EntityTables.SAVINGS.getName(),
|
this.entityDatatableChecksWritePlatformService.runTheCheckForProduct(savingsId, EntityTables.SAVINGS.getName(),
|
||||||
StatusEnum.CREATE.getCode().longValue(), EntityTables.SAVINGS.getForeignKeyColumnNameOnDatatable(),
|
StatusEnum.CREATE.getValue(), EntityTables.SAVINGS.getForeignKeyColumnNameOnDatatable(), account.productId());
|
||||||
account.productId());
|
|
||||||
|
|
||||||
businessEventNotifierService.notifyPostBusinessEvent(new SavingsCreateBusinessEvent(account));
|
businessEventNotifierService.notifyPostBusinessEvent(new SavingsCreateBusinessEvent(account));
|
||||||
|
|
||||||
@@ -447,8 +445,7 @@ public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
|||||||
checkClientOrGroupActive(savingsAccount);
|
checkClientOrGroupActive(savingsAccount);
|
||||||
|
|
||||||
entityDatatableChecksWritePlatformService.runTheCheckForProduct(savingsId, EntityTables.SAVINGS.getName(),
|
entityDatatableChecksWritePlatformService.runTheCheckForProduct(savingsId, EntityTables.SAVINGS.getName(),
|
||||||
StatusEnum.APPROVE.getCode().longValue(), EntityTables.SAVINGS.getForeignKeyColumnNameOnDatatable(),
|
StatusEnum.APPROVE.getValue(), EntityTables.SAVINGS.getForeignKeyColumnNameOnDatatable(), savingsAccount.productId());
|
||||||
savingsAccount.productId());
|
|
||||||
|
|
||||||
final Map<String, Object> changes = savingsAccount.approveApplication(currentUser, command);
|
final Map<String, Object> changes = savingsAccount.approveApplication(currentUser, command);
|
||||||
if (!changes.isEmpty()) {
|
if (!changes.isEmpty()) {
|
||||||
@@ -570,8 +567,7 @@ public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
|||||||
checkClientOrGroupActive(savingsAccount);
|
checkClientOrGroupActive(savingsAccount);
|
||||||
|
|
||||||
entityDatatableChecksWritePlatformService.runTheCheckForProduct(savingsId, EntityTables.SAVINGS.getName(),
|
entityDatatableChecksWritePlatformService.runTheCheckForProduct(savingsId, EntityTables.SAVINGS.getName(),
|
||||||
StatusEnum.REJECTED.getCode().longValue(), EntityTables.SAVINGS.getForeignKeyColumnNameOnDatatable(),
|
StatusEnum.REJECTED.getValue(), EntityTables.SAVINGS.getForeignKeyColumnNameOnDatatable(), savingsAccount.productId());
|
||||||
savingsAccount.productId());
|
|
||||||
|
|
||||||
final Map<String, Object> changes = savingsAccount.rejectApplication(currentUser, command);
|
final Map<String, Object> changes = savingsAccount.rejectApplication(currentUser, command);
|
||||||
if (!changes.isEmpty()) {
|
if (!changes.isEmpty()) {
|
||||||
@@ -607,8 +603,7 @@ public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
|||||||
checkClientOrGroupActive(savingsAccount);
|
checkClientOrGroupActive(savingsAccount);
|
||||||
|
|
||||||
entityDatatableChecksWritePlatformService.runTheCheckForProduct(savingsId, EntityTables.SAVINGS.getName(),
|
entityDatatableChecksWritePlatformService.runTheCheckForProduct(savingsId, EntityTables.SAVINGS.getName(),
|
||||||
StatusEnum.WITHDRAWN.getCode().longValue(), EntityTables.SAVINGS.getForeignKeyColumnNameOnDatatable(),
|
StatusEnum.WITHDRAWN.getValue(), EntityTables.SAVINGS.getForeignKeyColumnNameOnDatatable(), savingsAccount.productId());
|
||||||
savingsAccount.productId());
|
|
||||||
|
|
||||||
final Map<String, Object> changes = savingsAccount.applicantWithdrawsFromApplication(currentUser, command);
|
final Map<String, Object> changes = savingsAccount.applicantWithdrawsFromApplication(currentUser, command);
|
||||||
if (!changes.isEmpty()) {
|
if (!changes.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user