Package rename and very minor modifications
This commit is contained in:
+2
@@ -185,6 +185,8 @@ public class SynchronousCommandProcessingService implements CommandProcessingSer
|
||||
handler = applicationContext.getBean("createGuarantorCommandHandler", NewCommandSourceHandler.class);
|
||||
} else if (wrapper.isUpdate()) {
|
||||
handler = applicationContext.getBean("updateGuarantorCommandHandler", NewCommandSourceHandler.class);
|
||||
} else if (wrapper.isDelete()) {
|
||||
handler = applicationContext.getBean("deleteGuarantorCommandHandler", NewCommandSourceHandler.class);
|
||||
} else {
|
||||
throw new UnsupportedCommandException(wrapper.commandName());
|
||||
}
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@ import org.mifosplatform.portfolio.loanaccount.data.LoanBasicDetailsData;
|
||||
import org.mifosplatform.portfolio.loanaccount.data.LoanChargeData;
|
||||
import org.mifosplatform.portfolio.loanaccount.data.LoanPermissionData;
|
||||
import org.mifosplatform.portfolio.loanaccount.data.LoanTransactionData;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.data.GuarantorData;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.service.GuarantorReadPlatformService;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.data.GuarantorData;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.service.GuarantorReadPlatformService;
|
||||
import org.mifosplatform.portfolio.loanaccount.loanschedule.data.LoanScheduleData;
|
||||
import org.mifosplatform.portfolio.loanaccount.loanschedule.service.LoanScheduleCalculationPlatformService;
|
||||
import org.mifosplatform.portfolio.loanaccount.service.LoanChargeReadPlatformService;
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
||||
import org.mifosplatform.organisation.staff.data.StaffData;
|
||||
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
||||
import org.mifosplatform.portfolio.fund.data.FundData;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.data.GuarantorData;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.data.GuarantorData;
|
||||
import org.mifosplatform.portfolio.loanaccount.loanschedule.data.LoanScheduleData;
|
||||
import org.mifosplatform.portfolio.loanproduct.data.LoanProductData;
|
||||
import org.mifosplatform.portfolio.loanproduct.data.TransactionProcessingStrategyData;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor.api;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor.api;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
@@ -26,10 +26,10 @@ import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
||||
import org.mifosplatform.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.mifosplatform.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.data.GuarantorData;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.domain.GuarantorType;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.service.GuarantorEnumerations;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.service.GuarantorReadPlatformService;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.data.GuarantorData;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.domain.GuarantorType;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.service.GuarantorEnumerations;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.service.GuarantorReadPlatformService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor.command;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@@ -8,8 +8,8 @@ import org.joda.time.LocalDate;
|
||||
import org.mifosplatform.infrastructure.core.data.ApiParameterError;
|
||||
import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder;
|
||||
import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.GuarantorConstants.GUARANTOR_JSON_INPUT_PARAMS;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.domain.GuarantorType;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.GuarantorConstants.GUARANTOR_JSON_INPUT_PARAMS;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.domain.GuarantorType;
|
||||
|
||||
/**
|
||||
* Immutable command for creating or updating details of a Guarantor.
|
||||
+6
-6
@@ -1,4 +1,4 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor.data;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor.data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -6,8 +6,8 @@ import org.joda.time.LocalDate;
|
||||
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
||||
import org.mifosplatform.organisation.staff.data.StaffData;
|
||||
import org.mifosplatform.portfolio.client.data.ClientData;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.domain.GuarantorType;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.service.GuarantorEnumerations;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.domain.GuarantorType;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.service.GuarantorEnumerations;
|
||||
|
||||
public class GuarantorData {
|
||||
|
||||
@@ -93,15 +93,15 @@ public class GuarantorData {
|
||||
}
|
||||
|
||||
public boolean isExternalGuarantor() {
|
||||
return GuarantorType.EXTERNAL.getValue().equals(guarantorType.getId());
|
||||
return GuarantorType.EXTERNAL.getValue().equals(guarantorType.getId().intValue());
|
||||
}
|
||||
|
||||
public boolean isExistingClient() {
|
||||
return GuarantorType.CUSTOMER.getValue().equals(guarantorType.getId());
|
||||
return GuarantorType.CUSTOMER.getValue().equals(guarantorType.getId().intValue());
|
||||
}
|
||||
|
||||
public boolean isStaffMember() {
|
||||
return GuarantorType.STAFF.getValue().equals(guarantorType.getId());
|
||||
return GuarantorType.STAFF.getValue().equals(guarantorType.getId().intValue());
|
||||
}
|
||||
|
||||
public Long getEntityId() {
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor.domain;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -15,7 +15,7 @@ import javax.persistence.TemporalType;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||
import org.mifosplatform.portfolio.loanaccount.domain.Loan;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.GuarantorConstants.GUARANTOR_JSON_INPUT_PARAMS;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.GuarantorConstants.GUARANTOR_JSON_INPUT_PARAMS;
|
||||
import org.springframework.data.jpa.domain.AbstractPersistable;
|
||||
|
||||
@Entity
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor.domain;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor.domain;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor.domain;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor.domain;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor.exception;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor.exception;
|
||||
|
||||
import org.mifosplatform.infrastructure.core.exception.AbstractPlatformResourceNotFoundException;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor.exception;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor.exception;
|
||||
|
||||
import org.mifosplatform.infrastructure.core.exception.AbstractPlatformDomainRuleException;
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor.handler;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor.handler;
|
||||
|
||||
import org.mifosplatform.commands.handler.NewCommandSourceHandler;
|
||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.service.GuarantorWritePlatformService;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.service.GuarantorWritePlatformService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor.handler;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor.handler;
|
||||
|
||||
import org.mifosplatform.commands.handler.NewCommandSourceHandler;
|
||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.service.GuarantorWritePlatformService;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.service.GuarantorWritePlatformService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor.handler;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor.handler;
|
||||
|
||||
import org.mifosplatform.commands.handler.NewCommandSourceHandler;
|
||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.service.GuarantorWritePlatformService;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.service.GuarantorWritePlatformService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
+10
-6
@@ -1,7 +1,8 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor.serialization;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor.serialization;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.joda.time.LocalDate;
|
||||
@@ -9,8 +10,8 @@ import org.mifosplatform.infrastructure.core.exception.InvalidJsonException;
|
||||
import org.mifosplatform.infrastructure.core.serialization.AbstractFromApiJsonDeserializer;
|
||||
import org.mifosplatform.infrastructure.core.serialization.FromApiJsonDeserializer;
|
||||
import org.mifosplatform.infrastructure.core.serialization.FromJsonHelper;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.GuarantorConstants.GUARANTOR_JSON_INPUT_PARAMS;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.command.GuarantorCommand;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.GuarantorConstants.GUARANTOR_JSON_INPUT_PARAMS;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.command.GuarantorCommand;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -36,13 +37,16 @@ public final class GuarantorCommandFromApiJsonDeserializer extends AbstractFromA
|
||||
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
|
||||
|
||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||
fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, GUARANTOR_JSON_INPUT_PARAMS.getAllValues());
|
||||
Set<String> supportedParameters = GUARANTOR_JSON_INPUT_PARAMS.getAllValues();
|
||||
supportedParameters.add("locale");
|
||||
supportedParameters.add("dateFormat");
|
||||
fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, supportedParameters);
|
||||
|
||||
final JsonElement element = fromApiJsonHelper.parse(json);
|
||||
|
||||
Long loanId = fromApiJsonHelper.extractLongNamed(GUARANTOR_JSON_INPUT_PARAMS.LOAN_ID.getValue(), element);
|
||||
Integer guarantorTypeId = fromApiJsonHelper.extractIntegerSansLocaleNamed(
|
||||
GUARANTOR_JSON_INPUT_PARAMS.GUARANTOR_TYPE_ID.getValue(), element);
|
||||
Integer guarantorTypeId = fromApiJsonHelper.extractIntegerSansLocaleNamed(GUARANTOR_JSON_INPUT_PARAMS.GUARANTOR_TYPE_ID.getValue(),
|
||||
element);
|
||||
Long entityId = fromApiJsonHelper.extractLongNamed(GUARANTOR_JSON_INPUT_PARAMS.ENTITY_ID.getValue(), element);
|
||||
String firstname = fromApiJsonHelper.extractStringNamed(GUARANTOR_JSON_INPUT_PARAMS.FIRSTNAME.getValue(), element);
|
||||
String lastname = fromApiJsonHelper.extractStringNamed(GUARANTOR_JSON_INPUT_PARAMS.LASTNAME.getValue(), element);
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor.service;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.domain.GuarantorType;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.domain.GuarantorType;
|
||||
|
||||
public class GuarantorEnumerations {
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor.service;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.data.GuarantorData;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.data.GuarantorData;
|
||||
|
||||
public interface GuarantorReadPlatformService {
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor.service;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor.service;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
@@ -13,8 +13,8 @@ import org.mifosplatform.organisation.staff.data.StaffData;
|
||||
import org.mifosplatform.organisation.staff.service.StaffReadPlatformService;
|
||||
import org.mifosplatform.portfolio.client.data.ClientData;
|
||||
import org.mifosplatform.portfolio.client.service.ClientReadPlatformService;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.data.GuarantorData;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.domain.GuarantorType;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.data.GuarantorData;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.domain.GuarantorType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.core.RowMapper;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor.service;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor.service;
|
||||
|
||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||
+8
-8
@@ -1,4 +1,4 @@
|
||||
package org.mifosplatform.portfolio.loanaccount.gaurantor.service;
|
||||
package org.mifosplatform.portfolio.loanaccount.guarantor.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -15,13 +15,13 @@ import org.mifosplatform.portfolio.client.exception.ClientNotFoundException;
|
||||
import org.mifosplatform.portfolio.loanaccount.domain.Loan;
|
||||
import org.mifosplatform.portfolio.loanaccount.domain.LoanRepository;
|
||||
import org.mifosplatform.portfolio.loanaccount.exception.LoanNotFoundException;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.GuarantorConstants.GUARANTOR_JSON_INPUT_PARAMS;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.command.GuarantorCommand;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.domain.Guarantor;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.domain.GuarantorRepository;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.exception.GuarantorNotFoundException;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.exception.InvalidGuarantorException;
|
||||
import org.mifosplatform.portfolio.loanaccount.gaurantor.serialization.GuarantorCommandFromApiJsonDeserializer;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.GuarantorConstants.GUARANTOR_JSON_INPUT_PARAMS;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.command.GuarantorCommand;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.domain.Guarantor;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.domain.GuarantorRepository;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.exception.GuarantorNotFoundException;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.exception.InvalidGuarantorException;
|
||||
import org.mifosplatform.portfolio.loanaccount.guarantor.serialization.GuarantorCommandFromApiJsonDeserializer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
Reference in New Issue
Block a user