tidy up by moving mifosng-data files back into platform project.
This commit is contained in:
@@ -4,7 +4,7 @@ import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
public class DataValidatorBuilder {
|
||||
|
||||
+2
-2
@@ -23,11 +23,11 @@ import org.codehaus.jettison.json.JSONArray;
|
||||
import org.codehaus.jettison.json.JSONException;
|
||||
import org.codehaus.jettison.json.JSONObject;
|
||||
import org.mifosng.data.AdditionalFieldsSet;
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.data.reports.GenericResultset;
|
||||
import org.mifosng.platform.InvalidSqlException;
|
||||
import org.mifosng.platform.ReadExtraDataAndReportingService;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
import org.mifosng.platform.api.data.EntityIdentifier;
|
||||
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
||||
import org.mifosng.platform.exceptions.PlatformApiDataValidationException;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -18,11 +18,11 @@ import javax.ws.rs.core.UriInfo;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
import org.mifosng.data.ClientLoanAccountSummaryCollectionData;
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.data.NoteData;
|
||||
import org.mifosng.platform.api.commands.ClientCommand;
|
||||
import org.mifosng.platform.api.commands.NoteCommand;
|
||||
import org.mifosng.platform.api.data.ClientData;
|
||||
import org.mifosng.platform.api.data.EntityIdentifier;
|
||||
import org.mifosng.platform.api.data.NoteData;
|
||||
import org.mifosng.platform.api.data.OfficeLookup;
|
||||
import org.mifosng.platform.api.infrastructure.ApiDataConversionService;
|
||||
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
||||
|
||||
+1
-1
@@ -10,8 +10,8 @@ import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.UriInfo;
|
||||
|
||||
import org.mifosng.data.ConfigurationData;
|
||||
import org.mifosng.platform.api.commands.OrganisationCurrencyCommand;
|
||||
import org.mifosng.platform.api.data.ConfigurationData;
|
||||
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
||||
import org.mifosng.platform.configuration.service.ConfigurationReadPlatformService;
|
||||
import org.mifosng.platform.configuration.service.ConfigurationWritePlatformService;
|
||||
|
||||
@@ -16,8 +16,8 @@ import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.UriInfo;
|
||||
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.platform.api.commands.LoanProductCommand;
|
||||
import org.mifosng.platform.api.data.EntityIdentifier;
|
||||
import org.mifosng.platform.api.data.LoanProductData;
|
||||
import org.mifosng.platform.api.infrastructure.ApiDataConversionService;
|
||||
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
||||
|
||||
@@ -18,7 +18,6 @@ import javax.ws.rs.core.UriInfo;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.data.LoanAccountData;
|
||||
import org.mifosng.data.LoanRepaymentData;
|
||||
import org.mifosng.data.LoanSchedule;
|
||||
@@ -28,7 +27,8 @@ import org.mifosng.platform.api.commands.LoanStateTransitionCommand;
|
||||
import org.mifosng.platform.api.commands.LoanTransactionCommand;
|
||||
import org.mifosng.platform.api.commands.SubmitLoanApplicationCommand;
|
||||
import org.mifosng.platform.api.commands.UndoStateTransitionCommand;
|
||||
import org.mifosng.platform.api.data.NewLoanWorkflowStepOneData;
|
||||
import org.mifosng.platform.api.data.EntityIdentifier;
|
||||
import org.mifosng.platform.api.data.NewLoanData;
|
||||
import org.mifosng.platform.api.infrastructure.ApiDataConversionService;
|
||||
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
||||
import org.mifosng.platform.exceptions.UnrecognizedQueryParamException;
|
||||
@@ -76,7 +76,7 @@ public class LoansApiResource {
|
||||
@QueryParam("productId") final Long productId,
|
||||
@Context UriInfo uriInfo) {
|
||||
|
||||
NewLoanWorkflowStepOneData workflowData = this.loanReadPlatformService
|
||||
NewLoanData workflowData = this.loanReadPlatformService
|
||||
.retrieveClientAndProductDetails(clientId, productId);
|
||||
|
||||
String selectedFields = "";
|
||||
|
||||
@@ -16,8 +16,8 @@ import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.UriInfo;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.platform.api.commands.OfficeCommand;
|
||||
import org.mifosng.platform.api.data.EntityIdentifier;
|
||||
import org.mifosng.platform.api.data.OfficeData;
|
||||
import org.mifosng.platform.api.infrastructure.ApiDataConversionService;
|
||||
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
||||
|
||||
@@ -15,8 +15,8 @@ import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.UriInfo;
|
||||
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.platform.api.commands.RoleCommand;
|
||||
import org.mifosng.platform.api.data.EntityIdentifier;
|
||||
import org.mifosng.platform.api.data.PermissionData;
|
||||
import org.mifosng.platform.api.data.RoleData;
|
||||
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
||||
|
||||
@@ -15,9 +15,9 @@ import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.UriInfo;
|
||||
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.platform.api.commands.UserCommand;
|
||||
import org.mifosng.platform.api.data.AppUserData;
|
||||
import org.mifosng.platform.api.data.EntityIdentifier;
|
||||
import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService;
|
||||
import org.mifosng.platform.user.service.AppUserReadPlatformService;
|
||||
import org.mifosng.platform.user.service.AppUserWritePlatformService;
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.mifosng.platform.api.data;
|
||||
|
||||
|
||||
public class ApiErrorMessageArg {
|
||||
|
||||
/**
|
||||
* The actual value of the parameter (if any) as passed to API.
|
||||
*/
|
||||
private Object value;
|
||||
|
||||
public static ApiErrorMessageArg from(Object object) {
|
||||
return new ApiErrorMessageArg(object);
|
||||
}
|
||||
|
||||
protected ApiErrorMessageArg() {
|
||||
//
|
||||
}
|
||||
|
||||
public ApiErrorMessageArg(Object object) {
|
||||
this.value = object;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Object value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
+203
@@ -0,0 +1,203 @@
|
||||
package org.mifosng.platform.api.data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class ApiGlobalErrorResponse {
|
||||
|
||||
/**
|
||||
* A developer friendly plain English description of why the HTTP error response was returned from the API.
|
||||
*/
|
||||
private String developerMessage;
|
||||
|
||||
/**
|
||||
* A link to a URL which provides more information on the details of this type of error.
|
||||
*/
|
||||
private String developerDocLink;
|
||||
|
||||
/**
|
||||
* The HTTP status code of the response.
|
||||
*/
|
||||
private String httpStatusCode;
|
||||
|
||||
/**
|
||||
* A user friendly plain English description of why the HTTP error response was returned from the API that can be presented to end users.
|
||||
*/
|
||||
private String defaultUserMessage;
|
||||
|
||||
/**
|
||||
* A code that can be used for globalisation support by client applications of the API.
|
||||
*/
|
||||
private String userMessageGlobalisationCode;
|
||||
|
||||
/**
|
||||
* A list of zero or more of the actual reasons for the HTTP error should they be needed. Typically used to express data validation errors with parameters passed to API.
|
||||
*/
|
||||
private List<ApiParameterError> errors = new ArrayList<ApiParameterError>();
|
||||
|
||||
public static ApiGlobalErrorResponse unAuthenticated() {
|
||||
|
||||
ApiGlobalErrorResponse globalErrorResponse = new ApiGlobalErrorResponse();
|
||||
globalErrorResponse.setHttpStatusCode("401");
|
||||
globalErrorResponse.setDeveloperMessage("Invalid authentication details were passed in api request.");
|
||||
globalErrorResponse.setDeveloperDocLink("https://github.com/keithwoodlock/mifosx/wiki/HTTP-API-Error-codes");
|
||||
globalErrorResponse.setUserMessageGlobalisationCode("error.msg.not.authenticated");
|
||||
globalErrorResponse.setDefaultUserMessage("Unauthenticated. Please login.");
|
||||
|
||||
return globalErrorResponse;
|
||||
}
|
||||
|
||||
public static ApiGlobalErrorResponse unAuthorized() {
|
||||
ApiGlobalErrorResponse globalErrorResponse = new ApiGlobalErrorResponse();
|
||||
globalErrorResponse.setHttpStatusCode("403");
|
||||
globalErrorResponse.setDeveloperMessage("The user associated with credentials passed on this request does not have sufficient privileges to perform this action.");
|
||||
globalErrorResponse.setDeveloperDocLink("https://github.com/keithwoodlock/mifosx/wiki/HTTP-API-Error-codes");
|
||||
globalErrorResponse.setUserMessageGlobalisationCode("error.msg.not.authorized");
|
||||
globalErrorResponse.setDefaultUserMessage("Insufficient priviledges to perform this action.");
|
||||
|
||||
return globalErrorResponse;
|
||||
}
|
||||
|
||||
public static ApiGlobalErrorResponse domainRuleViolation(String globalisationMessageCode, String defaultUserMessage, Object... defaultUserMessageArgs) {
|
||||
ApiGlobalErrorResponse globalErrorResponse = new ApiGlobalErrorResponse();
|
||||
globalErrorResponse.setHttpStatusCode("403");
|
||||
globalErrorResponse.setDeveloperMessage("Request was understoon but caused a domain rule violation.");
|
||||
globalErrorResponse.setDeveloperDocLink("https://github.com/keithwoodlock/mifosx/wiki/HTTP-API-Error-codes");
|
||||
globalErrorResponse.setUserMessageGlobalisationCode("validation.msg.domain.rule.violation");
|
||||
globalErrorResponse.setDefaultUserMessage("Errors contain reason for domain rule violation.");
|
||||
|
||||
List<ApiParameterError> errors = new ArrayList<ApiParameterError>();
|
||||
errors.add(ApiParameterError.generalError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs));
|
||||
globalErrorResponse.setErrors(errors);
|
||||
|
||||
return globalErrorResponse;
|
||||
}
|
||||
|
||||
|
||||
public static ApiGlobalErrorResponse notFound(String globalisationMessageCode, String defaultUserMessage, Object... defaultUserMessageArgs) {
|
||||
|
||||
ApiGlobalErrorResponse globalErrorResponse = new ApiGlobalErrorResponse();
|
||||
globalErrorResponse.setHttpStatusCode("404");
|
||||
globalErrorResponse.setDeveloperMessage("The requested resource is not available.");
|
||||
globalErrorResponse.setDeveloperDocLink("https://github.com/keithwoodlock/mifosx/wiki/HTTP-API-Error-codes");
|
||||
globalErrorResponse.setUserMessageGlobalisationCode("error.msg.resource.not.found");
|
||||
globalErrorResponse.setDefaultUserMessage("The requested resource is not available.");
|
||||
|
||||
List<ApiParameterError> errors = new ArrayList<ApiParameterError>();
|
||||
errors.add(ApiParameterError.resourceIdentifierNotFound(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs));
|
||||
globalErrorResponse.setErrors(errors);
|
||||
|
||||
return globalErrorResponse;
|
||||
}
|
||||
|
||||
public static ApiGlobalErrorResponse dataIntegrityError(final String globalisationMessageCode, final String defaultUserMessage, final String parameterName, final Object... defaultUserMessageArgs) {
|
||||
|
||||
ApiGlobalErrorResponse globalErrorResponse = new ApiGlobalErrorResponse();
|
||||
globalErrorResponse.setHttpStatusCode("400");
|
||||
globalErrorResponse.setDeveloperMessage("The request caused a data integrity issue to be fired by the database.");
|
||||
globalErrorResponse.setDeveloperDocLink("https://github.com/keithwoodlock/mifosx/wiki/HTTP-API-Error-codes");
|
||||
globalErrorResponse.setUserMessageGlobalisationCode(globalisationMessageCode);
|
||||
globalErrorResponse.setDefaultUserMessage(defaultUserMessage);
|
||||
|
||||
List<ApiParameterError> errors = new ArrayList<ApiParameterError>();
|
||||
errors.add(ApiParameterError.parameterError(globalisationMessageCode, defaultUserMessage, parameterName, defaultUserMessageArgs));
|
||||
globalErrorResponse.setErrors(errors);
|
||||
|
||||
return globalErrorResponse;
|
||||
}
|
||||
|
||||
public static ApiGlobalErrorResponse badClientRequest(final String globalisationMessageCode, final String defaultUserMessage,
|
||||
List<ApiParameterError> errors) {
|
||||
|
||||
ApiGlobalErrorResponse globalErrorResponse = new ApiGlobalErrorResponse();
|
||||
globalErrorResponse.setHttpStatusCode("400");
|
||||
globalErrorResponse.setDeveloperMessage("The request was invalid. This typically will happen due to validation errors which are provided.");
|
||||
globalErrorResponse.setDeveloperDocLink("https://github.com/keithwoodlock/mifosx/wiki/HTTP-API-Error-codes");
|
||||
globalErrorResponse.setUserMessageGlobalisationCode(globalisationMessageCode);
|
||||
globalErrorResponse.setDefaultUserMessage(defaultUserMessage);
|
||||
|
||||
globalErrorResponse.setErrors(errors);
|
||||
|
||||
return globalErrorResponse;
|
||||
}
|
||||
|
||||
public static ApiGlobalErrorResponse serverSideError(String globalisationMessageCode, String defaultUserMessage, Object... defaultUserMessageArgs) {
|
||||
|
||||
ApiGlobalErrorResponse globalErrorResponse = new ApiGlobalErrorResponse();
|
||||
globalErrorResponse.setHttpStatusCode("500");
|
||||
globalErrorResponse.setDeveloperMessage("An unexpected error occured on the platform server.");
|
||||
globalErrorResponse.setDeveloperDocLink("https://github.com/keithwoodlock/mifosx/wiki/HTTP-API-Error-codes");
|
||||
globalErrorResponse.setUserMessageGlobalisationCode("error.msg.platform.server.side.error");
|
||||
globalErrorResponse.setDefaultUserMessage("An unexpected error occured on the platform server.");
|
||||
|
||||
List<ApiParameterError> errors = new ArrayList<ApiParameterError>();
|
||||
errors.add(ApiParameterError.generalError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs));
|
||||
globalErrorResponse.setErrors(errors);
|
||||
|
||||
return globalErrorResponse;
|
||||
}
|
||||
|
||||
protected ApiGlobalErrorResponse() {
|
||||
//
|
||||
}
|
||||
|
||||
public ApiGlobalErrorResponse(final List<ApiParameterError> errors) {
|
||||
this.errors = errors;
|
||||
}
|
||||
|
||||
@XmlElementWrapper(name="errors")
|
||||
@XmlElement(name="errorResponse")
|
||||
public List<ApiParameterError> getErrors() {
|
||||
return errors;
|
||||
}
|
||||
|
||||
public void setErrors(List<ApiParameterError> errors) {
|
||||
this.errors = errors;
|
||||
}
|
||||
|
||||
public String getDeveloperMessage() {
|
||||
return developerMessage;
|
||||
}
|
||||
|
||||
public void setDeveloperMessage(String developerMessage) {
|
||||
this.developerMessage = developerMessage;
|
||||
}
|
||||
|
||||
public String getHttpStatusCode() {
|
||||
return httpStatusCode;
|
||||
}
|
||||
|
||||
public void setHttpStatusCode(String httpStatusCode) {
|
||||
this.httpStatusCode = httpStatusCode;
|
||||
}
|
||||
|
||||
public String getDefaultUserMessage() {
|
||||
return defaultUserMessage;
|
||||
}
|
||||
|
||||
public void setDefaultUserMessage(String defaultUserMessage) {
|
||||
this.defaultUserMessage = defaultUserMessage;
|
||||
}
|
||||
|
||||
public String getUserMessageGlobalisationCode() {
|
||||
return userMessageGlobalisationCode;
|
||||
}
|
||||
|
||||
public void setUserMessageGlobalisationCode(String userMessageGlobalisationCode) {
|
||||
this.userMessageGlobalisationCode = userMessageGlobalisationCode;
|
||||
}
|
||||
|
||||
public String getDeveloperDocLink() {
|
||||
return developerDocLink;
|
||||
}
|
||||
|
||||
public void setDeveloperDocLink(String developerDocLink) {
|
||||
this.developerDocLink = developerDocLink;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package org.mifosng.platform.api.data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ApiParameterError {
|
||||
|
||||
/**
|
||||
* A developer friendly plain English description of why the HTTP error response was returned from the API.
|
||||
*/
|
||||
private String developerMessage;
|
||||
|
||||
/**
|
||||
* A user friendly plain English description of why the HTTP error response was returned from the API that can be presented to end users.
|
||||
*/
|
||||
private String defaultUserMessage;
|
||||
|
||||
/**
|
||||
* A code that can be used for globalisation support by client applications of the API.
|
||||
*/
|
||||
private String userMessageGlobalisationCode;
|
||||
|
||||
/**
|
||||
* The name of the field or parameter passed to the API that this error relates to.
|
||||
*/
|
||||
private String parameterName;
|
||||
|
||||
/**
|
||||
* The actual value of the parameter (if any) as passed to API.
|
||||
*/
|
||||
private Object value;
|
||||
|
||||
/**
|
||||
* Arguments related to the user error message.
|
||||
*/
|
||||
private List<ApiErrorMessageArg> args = new ArrayList<ApiErrorMessageArg>();
|
||||
|
||||
public static ApiParameterError generalError(String globalisationMessageCode, String defaultUserMessage, Object... defaultUserMessageArgs) {
|
||||
return new ApiParameterError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs);
|
||||
}
|
||||
|
||||
public static ApiParameterError resourceIdentifierNotFound(String globalisationMessageCode, String defaultUserMessage, Object... defaultUserMessageArgs) {
|
||||
return new ApiParameterError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs);
|
||||
}
|
||||
|
||||
public static ApiParameterError parameterError(final String globalisationMessageCode, final String defaultUserMessage,
|
||||
final String parameterName, final Object... defaultUserMessageArgs) {
|
||||
ApiParameterError error = new ApiParameterError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs);
|
||||
error.setParameterName(parameterName);
|
||||
return error;
|
||||
}
|
||||
|
||||
protected ApiParameterError() {
|
||||
//
|
||||
}
|
||||
|
||||
private ApiParameterError(final String globalisationMessageCode, final String defaultUserMessage, final Object[] defaultUserMessageArgs) {
|
||||
this.userMessageGlobalisationCode = globalisationMessageCode;
|
||||
this.developerMessage = defaultUserMessage;
|
||||
this.defaultUserMessage = defaultUserMessage;
|
||||
|
||||
List<ApiErrorMessageArg> messageArgs = new ArrayList<ApiErrorMessageArg>();
|
||||
if (defaultUserMessageArgs != null) {
|
||||
for (Object object : defaultUserMessageArgs) {
|
||||
messageArgs.add(ApiErrorMessageArg.from(object));
|
||||
}
|
||||
}
|
||||
this.args = messageArgs;
|
||||
|
||||
this.parameterName="id";
|
||||
}
|
||||
|
||||
public String getDeveloperMessage() {
|
||||
return developerMessage;
|
||||
}
|
||||
|
||||
public void setDeveloperMessage(String developerMessage) {
|
||||
this.developerMessage = developerMessage;
|
||||
}
|
||||
|
||||
public String getDefaultUserMessage() {
|
||||
return defaultUserMessage;
|
||||
}
|
||||
|
||||
public void setDefaultUserMessage(String defaultUserMessage) {
|
||||
this.defaultUserMessage = defaultUserMessage;
|
||||
}
|
||||
|
||||
public String getUserMessageGlobalisationCode() {
|
||||
return userMessageGlobalisationCode;
|
||||
}
|
||||
|
||||
public void setUserMessageGlobalisationCode(String userMessageGlobalisationCode) {
|
||||
this.userMessageGlobalisationCode = userMessageGlobalisationCode;
|
||||
}
|
||||
|
||||
public String getParameterName() {
|
||||
return parameterName;
|
||||
}
|
||||
|
||||
public void setParameterName(String parameterName) {
|
||||
this.parameterName = parameterName;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Object value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public List<ApiErrorMessageArg> getArgs() {
|
||||
return args;
|
||||
}
|
||||
|
||||
public void setArgs(List<ApiErrorMessageArg> args) {
|
||||
this.args = args;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package org.mifosng.platform.api.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.codehaus.jackson.map.annotate.JsonFilter;
|
||||
import org.mifosng.data.CurrencyData;
|
||||
|
||||
@JsonFilter("myFilter")
|
||||
public class ConfigurationData implements Serializable {
|
||||
|
||||
private List<CurrencyData> selectedCurrencyOptions = new ArrayList<CurrencyData>();
|
||||
private List<CurrencyData> currencyOptions = new ArrayList<CurrencyData>();
|
||||
|
||||
public ConfigurationData() {
|
||||
//
|
||||
}
|
||||
|
||||
public List<CurrencyData> getSelectedCurrencyOptions() {
|
||||
return selectedCurrencyOptions;
|
||||
}
|
||||
|
||||
public void setSelectedCurrencyOptions(
|
||||
List<CurrencyData> selectedCurrencyOptions) {
|
||||
this.selectedCurrencyOptions = selectedCurrencyOptions;
|
||||
}
|
||||
|
||||
public List<CurrencyData> getCurrencyOptions() {
|
||||
return currencyOptions;
|
||||
}
|
||||
|
||||
public void setCurrencyOptions(List<CurrencyData> currencyOptions) {
|
||||
this.currencyOptions = currencyOptions;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.mifosng.platform.api.data;
|
||||
|
||||
|
||||
public class EntityIdentifier {
|
||||
|
||||
private Long entityId;
|
||||
|
||||
public EntityIdentifier() {
|
||||
//
|
||||
}
|
||||
|
||||
public EntityIdentifier(final Long entityId) {
|
||||
this.entityId = entityId;
|
||||
}
|
||||
|
||||
public Long getEntityId() {
|
||||
return this.entityId;
|
||||
}
|
||||
|
||||
public void setEntityId(final Long entityId) {
|
||||
this.entityId = entityId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package org.mifosng.platform.api.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class EnumOptionData implements Serializable {
|
||||
|
||||
private Long id;
|
||||
private String code;
|
||||
private String value;
|
||||
|
||||
protected EnumOptionData() {
|
||||
//
|
||||
}
|
||||
|
||||
public EnumOptionData(final Long id, final String code, final String value) {
|
||||
this.id = id;
|
||||
this.code = code;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public void setValue(final String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import java.util.List;
|
||||
import org.codehaus.jackson.map.annotate.JsonFilter;
|
||||
import org.joda.time.DateTime;
|
||||
import org.mifosng.data.CurrencyData;
|
||||
import org.mifosng.data.EnumOptionData;
|
||||
import org.mifosng.data.MoneyData;
|
||||
|
||||
@JsonFilter("myFilter")
|
||||
|
||||
+2
-5
@@ -4,17 +4,14 @@ import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||
import org.codehaus.jackson.map.annotate.JsonFilter;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.mifosng.data.LoanSchedule;
|
||||
|
||||
@XmlRootElement(name = "newloanworkflow")
|
||||
@JsonIgnoreProperties({ "organisationId", "organisationName" })
|
||||
@JsonFilter("myFilter")
|
||||
public class NewLoanWorkflowStepOneData implements Serializable {
|
||||
public class NewLoanData implements Serializable {
|
||||
|
||||
private Long organisationId;
|
||||
private String organisationName;
|
||||
@@ -44,7 +41,7 @@ public class NewLoanWorkflowStepOneData implements Serializable {
|
||||
|
||||
private LoanProductData selectedProduct;
|
||||
|
||||
public NewLoanWorkflowStepOneData() {
|
||||
public NewLoanData() {
|
||||
//
|
||||
}
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
package org.mifosng.platform.api.data;
|
||||
|
||||
import org.codehaus.jackson.map.annotate.JsonFilter;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
@JsonFilter("myFilter")
|
||||
public class NoteData {
|
||||
|
||||
private Long id;
|
||||
private Long clientId;
|
||||
private Long loanId;
|
||||
private Long loanTransactionId;
|
||||
private Integer noteTypeId;
|
||||
|
||||
private String note;
|
||||
|
||||
private Long createdById;
|
||||
private String createdByUsername;
|
||||
private DateTime createdOn;
|
||||
private Long updatedById;
|
||||
private String updatedByUsername;
|
||||
private DateTime updatedOn;
|
||||
|
||||
public NoteData() {
|
||||
//
|
||||
}
|
||||
|
||||
public NoteData(Long id, Long clientId, Long loanId,
|
||||
Long transactionId, Integer noteTypeId, String note,
|
||||
DateTime createdDate, Long createdById, String createdByUsername,
|
||||
DateTime lastModifiedDate, Long lastModifiedById, String updatedByUsername) {
|
||||
this.id = id;
|
||||
this.clientId = clientId;
|
||||
this.loanId = loanId;
|
||||
this.loanTransactionId = transactionId;
|
||||
this.noteTypeId = noteTypeId;
|
||||
this.note = note;
|
||||
this.createdOn = createdDate;
|
||||
this.createdById = createdById;
|
||||
this.createdByUsername = createdByUsername;
|
||||
this.updatedOn = lastModifiedDate;
|
||||
this.updatedById = lastModifiedById;
|
||||
this.updatedByUsername = updatedByUsername;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getClientId() {
|
||||
return clientId;
|
||||
}
|
||||
|
||||
public void setClientId(Long clientId) {
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
public Long getLoanId() {
|
||||
return loanId;
|
||||
}
|
||||
|
||||
public void setLoanId(Long loanId) {
|
||||
this.loanId = loanId;
|
||||
}
|
||||
|
||||
public Long getLoanTransactionId() {
|
||||
return loanTransactionId;
|
||||
}
|
||||
|
||||
public void setLoanTransactionId(Long loanTransactionId) {
|
||||
this.loanTransactionId = loanTransactionId;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
public Long getCreatedById() {
|
||||
return createdById;
|
||||
}
|
||||
|
||||
public void setCreatedById(Long createdById) {
|
||||
this.createdById = createdById;
|
||||
}
|
||||
|
||||
public String getCreatedByUsername() {
|
||||
return createdByUsername;
|
||||
}
|
||||
|
||||
public void setCreatedByUsername(String createdByUsername) {
|
||||
this.createdByUsername = createdByUsername;
|
||||
}
|
||||
|
||||
public DateTime getCreatedOn() {
|
||||
return createdOn;
|
||||
}
|
||||
|
||||
public void setCreatedOn(DateTime createdOn) {
|
||||
this.createdOn = createdOn;
|
||||
}
|
||||
|
||||
public Long getUpdatedById() {
|
||||
return updatedById;
|
||||
}
|
||||
|
||||
public void setUpdatedById(Long updatedById) {
|
||||
this.updatedById = updatedById;
|
||||
}
|
||||
|
||||
public String getUpdatedByUsername() {
|
||||
return updatedByUsername;
|
||||
}
|
||||
|
||||
public void setUpdatedByUsername(String updatedByUsername) {
|
||||
this.updatedByUsername = updatedByUsername;
|
||||
}
|
||||
|
||||
public DateTime getUpdatedOn() {
|
||||
return updatedOn;
|
||||
}
|
||||
|
||||
public void setUpdatedOn(DateTime updatedOn) {
|
||||
this.updatedOn = updatedOn;
|
||||
}
|
||||
|
||||
public Integer getNoteTypeId() {
|
||||
return noteTypeId;
|
||||
}
|
||||
|
||||
public void setNoteTypeId(Integer noteTypeId) {
|
||||
this.noteTypeId = noteTypeId;
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,6 @@ package org.mifosng.platform.api.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@XmlRootElement(name = "officeLookup")
|
||||
public class OfficeLookup implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import javax.ws.rs.core.Response.Status;
|
||||
import javax.ws.rs.ext.ExceptionMapper;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
|
||||
import org.mifosng.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.api.data.ApiGlobalErrorResponse;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import javax.ws.rs.core.Response.Status;
|
||||
import javax.ws.rs.ext.ExceptionMapper;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
|
||||
import org.mifosng.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.api.data.ApiGlobalErrorResponse;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.security.authentication.BadCredentialsException;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import javax.ws.rs.core.Response.Status;
|
||||
import javax.ws.rs.ext.ExceptionMapper;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
|
||||
import org.mifosng.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.api.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.exceptions.NoAuthorizationException;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import javax.ws.rs.core.Response.Status;
|
||||
import javax.ws.rs.ext.ExceptionMapper;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
|
||||
import org.mifosng.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.api.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.exceptions.PlatformApiDataValidationException;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import javax.ws.rs.core.Response.Status;
|
||||
import javax.ws.rs.ext.ExceptionMapper;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
|
||||
import org.mifosng.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.api.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.exceptions.PlatformDataIntegrityException;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import javax.ws.rs.core.Response.Status;
|
||||
import javax.ws.rs.ext.ExceptionMapper;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
|
||||
import org.mifosng.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.api.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.exceptions.AbstractPlatformDomainRuleException;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import javax.ws.rs.core.Response.Status;
|
||||
import javax.ws.rs.ext.ExceptionMapper;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
|
||||
import org.mifosng.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.api.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.exceptions.PlatformInternalServerException;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import javax.ws.rs.core.Response.Status;
|
||||
import javax.ws.rs.ext.ExceptionMapper;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
|
||||
import org.mifosng.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.api.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.exceptions.AbstractPlatformResourceNotFoundException;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import javax.ws.rs.core.Response.Status;
|
||||
import javax.ws.rs.ext.ExceptionMapper;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
|
||||
import org.mifosng.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.api.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.exceptions.UnAuthenticatedUserException;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
+2
-2
@@ -9,8 +9,8 @@ import javax.ws.rs.ext.ExceptionMapper;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
|
||||
import org.codehaus.jackson.map.exc.UnrecognizedPropertyException;
|
||||
import org.mifosng.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.platform.api.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
+2
-2
@@ -9,8 +9,8 @@ import javax.ws.rs.ext.ExceptionMapper;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
|
||||
import org.codehaus.jackson.map.exc.UnrecognizedPropertyException;
|
||||
import org.mifosng.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.platform.api.data.ApiGlobalErrorResponse;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
import org.mifosng.platform.exceptions.UnrecognizedQueryParamException;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import java.util.Locale;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.format.DateTimeFormat;
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
import org.mifosng.platform.exceptions.PlatformApiDataValidationException;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
+1
-1
@@ -4,9 +4,9 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.platform.DataValidatorBuilder;
|
||||
import org.mifosng.platform.api.commands.ClientCommand;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
import org.mifosng.platform.exceptions.PlatformApiDataValidationException;
|
||||
|
||||
public class ClientCommandValidator {
|
||||
|
||||
+1
-1
@@ -3,8 +3,8 @@ package org.mifosng.platform.client.service;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.mifosng.data.ClientLoanAccountSummaryCollectionData;
|
||||
import org.mifosng.data.NoteData;
|
||||
import org.mifosng.platform.api.data.ClientData;
|
||||
import org.mifosng.platform.api.data.NoteData;
|
||||
|
||||
public interface ClientReadPlatformService {
|
||||
|
||||
|
||||
+1
-1
@@ -13,9 +13,9 @@ import org.joda.time.DateTime;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.mifosng.data.ClientLoanAccountSummaryCollectionData;
|
||||
import org.mifosng.data.ClientLoanAccountSummaryData;
|
||||
import org.mifosng.data.NoteData;
|
||||
import org.mifosng.platform.api.data.AppUserData;
|
||||
import org.mifosng.platform.api.data.ClientData;
|
||||
import org.mifosng.platform.api.data.NoteData;
|
||||
import org.mifosng.platform.api.data.OfficeData;
|
||||
import org.mifosng.platform.api.data.OfficeLookup;
|
||||
import org.mifosng.platform.exceptions.ClientNotFoundException;
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
package org.mifosng.platform.client.service;
|
||||
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.platform.api.commands.ClientCommand;
|
||||
import org.mifosng.platform.api.commands.NoteCommand;
|
||||
import org.mifosng.platform.api.data.EntityIdentifier;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
||||
public interface ClientWritePlatformService {
|
||||
|
||||
+1
-1
@@ -5,9 +5,9 @@ import static org.mifosng.platform.Specifications.notesThatMatch;
|
||||
import static org.mifosng.platform.Specifications.officesThatMatch;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.platform.api.commands.ClientCommand;
|
||||
import org.mifosng.platform.api.commands.NoteCommand;
|
||||
import org.mifosng.platform.api.data.EntityIdentifier;
|
||||
import org.mifosng.platform.client.domain.Client;
|
||||
import org.mifosng.platform.client.domain.ClientRepository;
|
||||
import org.mifosng.platform.client.domain.Note;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package org.mifosng.platform.configuration.service;
|
||||
|
||||
import org.mifosng.data.ConfigurationData;
|
||||
import org.mifosng.platform.api.data.ConfigurationData;
|
||||
|
||||
public interface ConfigurationReadPlatformService {
|
||||
|
||||
|
||||
+1
-1
@@ -3,8 +3,8 @@ package org.mifosng.platform.configuration.service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosng.data.ConfigurationData;
|
||||
import org.mifosng.data.CurrencyData;
|
||||
import org.mifosng.platform.api.data.ConfigurationData;
|
||||
import org.mifosng.platform.currency.service.CurrencyReadPlatformService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
+1
-1
@@ -5,9 +5,9 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.platform.DataValidatorBuilder;
|
||||
import org.mifosng.platform.api.commands.OrganisationCurrencyCommand;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
import org.mifosng.platform.currency.domain.ApplicationCurrency;
|
||||
import org.mifosng.platform.currency.domain.ApplicationCurrencyRepository;
|
||||
import org.mifosng.platform.exceptions.PlatformApiDataValidationException;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package org.mifosng.platform.exceptions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
|
||||
public class PlatformApiDataValidationException extends RuntimeException {
|
||||
|
||||
|
||||
-1
@@ -9,7 +9,6 @@ import org.mifosng.data.CurrencyData;
|
||||
import org.mifosng.data.DerivedLoanData;
|
||||
import org.mifosng.data.LoanAccountSummaryData;
|
||||
import org.mifosng.data.LoanRepaymentData;
|
||||
import org.mifosng.data.LoanRepaymentDataComparator;
|
||||
import org.mifosng.data.LoanRepaymentPeriodData;
|
||||
import org.mifosng.data.LoanRepaymentScheduleData;
|
||||
import org.mifosng.data.MoneyData;
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package org.mifosng.platform.loan.domain;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import org.mifosng.data.LoanRepaymentData;
|
||||
|
||||
|
||||
public class LoanRepaymentDataComparator implements Comparator<LoanRepaymentData> {
|
||||
|
||||
@Override
|
||||
public int compare(final LoanRepaymentData o1, final LoanRepaymentData o2) {
|
||||
return o2.getDate().compareTo(o1.getDate());
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -4,8 +4,8 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.platform.api.commands.AdjustLoanTransactionCommand;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
import org.mifosng.platform.exceptions.PlatformApiDataValidationException;
|
||||
|
||||
public class AdjustLoanTransactionCommandValidator {
|
||||
|
||||
+1
-1
@@ -3,9 +3,9 @@ package org.mifosng.platform.loan.service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.platform.DataValidatorBuilder;
|
||||
import org.mifosng.platform.api.commands.CalculateLoanScheduleCommand;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
import org.mifosng.platform.exceptions.PlatformApiDataValidationException;
|
||||
|
||||
public class CalculateLoanScheduleCommandValidator {
|
||||
|
||||
-1
@@ -1,7 +1,6 @@
|
||||
package org.mifosng.platform.loan.service;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
import org.mifosng.data.LoanPayoffReadModel;
|
||||
import org.mifosng.data.LoanSchedule;
|
||||
import org.mifosng.platform.api.commands.CalculateLoanScheduleCommand;
|
||||
|
||||
|
||||
-1
@@ -4,7 +4,6 @@ import java.math.BigDecimal;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
import org.mifosng.data.CurrencyData;
|
||||
import org.mifosng.data.LoanPayoffReadModel;
|
||||
import org.mifosng.data.LoanSchedule;
|
||||
import org.mifosng.data.MoneyData;
|
||||
import org.mifosng.platform.api.commands.CalculateLoanScheduleCommand;
|
||||
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
package org.mifosng.platform.loan.service;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.format.DateTimeFormatter;
|
||||
import org.mifosng.data.MoneyData;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class LoanPayoffReadModel {
|
||||
|
||||
private String reference;
|
||||
private String acutalDisbursementDate;
|
||||
private String expectedMaturityDate;
|
||||
private String projectedMaturityDate;
|
||||
private Integer expectedLoanTermInDays;
|
||||
private Integer projectedLoanTermInDays;
|
||||
private MoneyData totalPaidToDate;
|
||||
private MoneyData totalOutstandingBasedOnExpectedMaturityDate;
|
||||
private MoneyData totalOutstandingBasedOnPayoffDate;
|
||||
private MoneyData interestRebateOwed;
|
||||
|
||||
protected LoanPayoffReadModel() {
|
||||
//
|
||||
}
|
||||
|
||||
public LoanPayoffReadModel(
|
||||
final String reference,
|
||||
final LocalDate acutalDisbursementDate,
|
||||
final LocalDate expectedMaturityDate,
|
||||
final LocalDate projectedMaturityDate,
|
||||
final Integer expectedLoanTermInDays,
|
||||
final Integer projectedLoanTermInDays,
|
||||
final MoneyData totalPaidToDate,
|
||||
final MoneyData totalOutstandingBasedOnExpectedMaturityDate,
|
||||
final MoneyData totalOutstandingBasedOnPayoffDate,
|
||||
final MoneyData interestRebateOwed) {
|
||||
|
||||
this.reference = reference;
|
||||
|
||||
DateTimeFormatter formatter = org.joda.time.format.DateTimeFormat
|
||||
.forPattern("yyyy-MM-dd");
|
||||
this.acutalDisbursementDate = formatter.print(acutalDisbursementDate);
|
||||
this.expectedMaturityDate = formatter.print(expectedMaturityDate);
|
||||
this.projectedMaturityDate = formatter.print(projectedMaturityDate);
|
||||
this.expectedLoanTermInDays = expectedLoanTermInDays;
|
||||
this.projectedLoanTermInDays = projectedLoanTermInDays;
|
||||
|
||||
this.totalPaidToDate = totalPaidToDate;
|
||||
this.totalOutstandingBasedOnExpectedMaturityDate = totalOutstandingBasedOnExpectedMaturityDate;
|
||||
this.totalOutstandingBasedOnPayoffDate = totalOutstandingBasedOnPayoffDate;
|
||||
this.interestRebateOwed = interestRebateOwed;
|
||||
}
|
||||
|
||||
public String getReference() {
|
||||
return this.reference;
|
||||
}
|
||||
|
||||
public void setReference(final String reference) {
|
||||
this.reference = reference;
|
||||
}
|
||||
|
||||
public String getAcutalDisbursementDate() {
|
||||
return this.acutalDisbursementDate;
|
||||
}
|
||||
|
||||
public void setAcutalDisbursementDate(final String acutalDisbursementDate) {
|
||||
this.acutalDisbursementDate = acutalDisbursementDate;
|
||||
}
|
||||
|
||||
public String getExpectedMaturityDate() {
|
||||
return this.expectedMaturityDate;
|
||||
}
|
||||
|
||||
public void setExpectedMaturityDate(final String expectedMaturityDate) {
|
||||
this.expectedMaturityDate = expectedMaturityDate;
|
||||
}
|
||||
|
||||
public String getProjectedMaturityDate() {
|
||||
return this.projectedMaturityDate;
|
||||
}
|
||||
|
||||
public void setProjectedMaturityDate(final String projectedMaturityDate) {
|
||||
this.projectedMaturityDate = projectedMaturityDate;
|
||||
}
|
||||
|
||||
public Integer getExpectedLoanTermInDays() {
|
||||
return this.expectedLoanTermInDays;
|
||||
}
|
||||
|
||||
public void setExpectedLoanTermInDays(final Integer expectedLoanTermInDays) {
|
||||
this.expectedLoanTermInDays = expectedLoanTermInDays;
|
||||
}
|
||||
|
||||
public Integer getProjectedLoanTermInDays() {
|
||||
return this.projectedLoanTermInDays;
|
||||
}
|
||||
|
||||
public void setProjectedLoanTermInDays(final Integer projectedLoanTermInDays) {
|
||||
this.projectedLoanTermInDays = projectedLoanTermInDays;
|
||||
}
|
||||
|
||||
public MoneyData getTotalPaidToDate() {
|
||||
return this.totalPaidToDate;
|
||||
}
|
||||
|
||||
public void setTotalPaidToDate(final MoneyData totalPaidToDate) {
|
||||
this.totalPaidToDate = totalPaidToDate;
|
||||
}
|
||||
|
||||
public MoneyData getInterestRebateOwed() {
|
||||
return this.interestRebateOwed;
|
||||
}
|
||||
|
||||
public void setInterestRebateOwed(final MoneyData interestRebateOwed) {
|
||||
this.interestRebateOwed = interestRebateOwed;
|
||||
}
|
||||
|
||||
public MoneyData getTotalOutstandingBasedOnExpectedMaturityDate() {
|
||||
return this.totalOutstandingBasedOnExpectedMaturityDate;
|
||||
}
|
||||
|
||||
public void setTotalOutstandingBasedOnExpectedMaturityDate(
|
||||
final MoneyData totalOutstandingBasedOnExpectedMaturityDate) {
|
||||
this.totalOutstandingBasedOnExpectedMaturityDate = totalOutstandingBasedOnExpectedMaturityDate;
|
||||
}
|
||||
|
||||
public MoneyData getTotalOutstandingBasedOnPayoffDate() {
|
||||
return this.totalOutstandingBasedOnPayoffDate;
|
||||
}
|
||||
|
||||
public void setTotalOutstandingBasedOnPayoffDate(
|
||||
final MoneyData totalOutstandingBasedOnPayoffDate) {
|
||||
this.totalOutstandingBasedOnPayoffDate = totalOutstandingBasedOnPayoffDate;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -2,13 +2,13 @@ package org.mifosng.platform.loan.service;
|
||||
|
||||
import org.mifosng.data.LoanAccountData;
|
||||
import org.mifosng.data.LoanRepaymentData;
|
||||
import org.mifosng.platform.api.data.NewLoanWorkflowStepOneData;
|
||||
import org.mifosng.platform.api.data.NewLoanData;
|
||||
|
||||
public interface LoanReadPlatformService {
|
||||
|
||||
LoanAccountData retrieveLoanAccountDetails(Long loanId);
|
||||
|
||||
NewLoanWorkflowStepOneData retrieveClientAndProductDetails(Long clientId, Long productId);
|
||||
NewLoanData retrieveClientAndProductDetails(Long clientId, Long productId);
|
||||
|
||||
LoanRepaymentData retrieveNewLoanRepaymentDetails(Long loanId);
|
||||
|
||||
|
||||
+3
-3
@@ -14,7 +14,7 @@ import org.mifosng.data.LoanRepaymentData;
|
||||
import org.mifosng.data.MoneyData;
|
||||
import org.mifosng.platform.api.data.ClientData;
|
||||
import org.mifosng.platform.api.data.LoanProductData;
|
||||
import org.mifosng.platform.api.data.NewLoanWorkflowStepOneData;
|
||||
import org.mifosng.platform.api.data.NewLoanData;
|
||||
import org.mifosng.platform.client.service.ClientReadPlatformService;
|
||||
import org.mifosng.platform.currency.domain.ApplicationCurrency;
|
||||
import org.mifosng.platform.currency.domain.ApplicationCurrencyRepository;
|
||||
@@ -168,11 +168,11 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public NewLoanWorkflowStepOneData retrieveClientAndProductDetails(final Long clientId, final Long productId) {
|
||||
public NewLoanData retrieveClientAndProductDetails(final Long clientId, final Long productId) {
|
||||
|
||||
AppUser currentUser = context.authenticatedUser();
|
||||
|
||||
NewLoanWorkflowStepOneData workflowData = new NewLoanWorkflowStepOneData();
|
||||
NewLoanData workflowData = new NewLoanData();
|
||||
workflowData.setOrganisationId(currentUser.getOrganisation().getId());
|
||||
workflowData.setOrganisationName(currentUser.getOrganisation().getName());
|
||||
|
||||
|
||||
+1
-1
@@ -3,9 +3,9 @@ package org.mifosng.platform.loan.service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.platform.DataValidatorBuilder;
|
||||
import org.mifosng.platform.api.commands.LoanStateTransitionCommand;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
import org.mifosng.platform.exceptions.PlatformApiDataValidationException;
|
||||
|
||||
public class LoanStateTransitionCommandValidator {
|
||||
|
||||
+1
-1
@@ -4,8 +4,8 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.platform.api.commands.LoanTransactionCommand;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
import org.mifosng.platform.exceptions.PlatformApiDataValidationException;
|
||||
|
||||
public class LoanTransactionCommandValidator {
|
||||
|
||||
+1
-1
@@ -1,11 +1,11 @@
|
||||
package org.mifosng.platform.loan.service;
|
||||
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.platform.api.commands.AdjustLoanTransactionCommand;
|
||||
import org.mifosng.platform.api.commands.LoanStateTransitionCommand;
|
||||
import org.mifosng.platform.api.commands.LoanTransactionCommand;
|
||||
import org.mifosng.platform.api.commands.SubmitLoanApplicationCommand;
|
||||
import org.mifosng.platform.api.commands.UndoStateTransitionCommand;
|
||||
import org.mifosng.platform.api.data.EntityIdentifier;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
||||
public interface LoanWritePlatformService {
|
||||
|
||||
+1
-1
@@ -7,7 +7,6 @@ import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.data.LoanSchedule;
|
||||
import org.mifosng.data.ScheduledLoanInstallment;
|
||||
import org.mifosng.platform.api.commands.AdjustLoanTransactionCommand;
|
||||
@@ -16,6 +15,7 @@ import org.mifosng.platform.api.commands.LoanStateTransitionCommand;
|
||||
import org.mifosng.platform.api.commands.LoanTransactionCommand;
|
||||
import org.mifosng.platform.api.commands.SubmitLoanApplicationCommand;
|
||||
import org.mifosng.platform.api.commands.UndoStateTransitionCommand;
|
||||
import org.mifosng.platform.api.data.EntityIdentifier;
|
||||
import org.mifosng.platform.client.domain.Note;
|
||||
import org.mifosng.platform.client.domain.NoteRepository;
|
||||
import org.mifosng.platform.currency.domain.MonetaryCurrency;
|
||||
|
||||
+1
-1
@@ -3,9 +3,9 @@ package org.mifosng.platform.loan.service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.platform.api.commands.CalculateLoanScheduleCommand;
|
||||
import org.mifosng.platform.api.commands.SubmitLoanApplicationCommand;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
import org.mifosng.platform.exceptions.PlatformApiDataValidationException;
|
||||
|
||||
public class SubmitLoanApplicationCommandValidator {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package org.mifosng.platform.loanproduct.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosng.data.EnumOptionData;
|
||||
import org.mifosng.platform.api.data.EnumOptionData;
|
||||
|
||||
public interface LoanDropdownReadPlatformService {
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import static org.mifosng.platform.loanproduct.service.LoanEnumerations.repaymen
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosng.data.EnumOptionData;
|
||||
import org.mifosng.platform.api.data.EnumOptionData;
|
||||
import org.mifosng.platform.loan.domain.AmortizationMethod;
|
||||
import org.mifosng.platform.loan.domain.InterestCalculationPeriodMethod;
|
||||
import org.mifosng.platform.loan.domain.InterestMethod;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package org.mifosng.platform.loanproduct.service;
|
||||
|
||||
import org.mifosng.data.EnumOptionData;
|
||||
import org.mifosng.platform.api.data.EnumOptionData;
|
||||
import org.mifosng.platform.loan.domain.AmortizationMethod;
|
||||
import org.mifosng.platform.loan.domain.InterestCalculationPeriodMethod;
|
||||
import org.mifosng.platform.loan.domain.InterestMethod;
|
||||
|
||||
+1
-1
@@ -3,9 +3,9 @@ package org.mifosng.platform.loanproduct.service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.platform.DataValidatorBuilder;
|
||||
import org.mifosng.platform.api.commands.LoanProductCommand;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
import org.mifosng.platform.exceptions.PlatformApiDataValidationException;
|
||||
|
||||
public class LoanProductCommandValidator {
|
||||
|
||||
+1
-1
@@ -10,8 +10,8 @@ import javax.sql.DataSource;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
import org.mifosng.data.CurrencyData;
|
||||
import org.mifosng.data.EnumOptionData;
|
||||
import org.mifosng.data.MoneyData;
|
||||
import org.mifosng.platform.api.data.EnumOptionData;
|
||||
import org.mifosng.platform.api.data.LoanProductData;
|
||||
import org.mifosng.platform.currency.service.CurrencyReadPlatformService;
|
||||
import org.mifosng.platform.exceptions.LoanProductNotFoundException;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package org.mifosng.platform.loanproduct.service;
|
||||
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.platform.api.commands.LoanProductCommand;
|
||||
import org.mifosng.platform.api.data.EntityIdentifier;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
||||
public interface LoanProductWritePlatformService {
|
||||
|
||||
+1
-1
@@ -4,8 +4,8 @@ import static org.mifosng.platform.Specifications.productThatMatches;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.platform.api.commands.LoanProductCommand;
|
||||
import org.mifosng.platform.api.data.EntityIdentifier;
|
||||
import org.mifosng.platform.currency.domain.MonetaryCurrency;
|
||||
import org.mifosng.platform.exceptions.LoanProductNotFoundException;
|
||||
import org.mifosng.platform.loan.domain.AmortizationMethod;
|
||||
|
||||
+1
-1
@@ -3,9 +3,9 @@ package org.mifosng.platform.organisation.service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.platform.DataValidatorBuilder;
|
||||
import org.mifosng.platform.api.commands.OfficeCommand;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
import org.mifosng.platform.exceptions.PlatformApiDataValidationException;
|
||||
|
||||
public class OfficeCommandValidator {
|
||||
|
||||
@@ -15,9 +15,9 @@ import org.codehaus.jettison.json.JSONObject;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.format.DateTimeFormatter;
|
||||
import org.joda.time.format.ISODateTimeFormat;
|
||||
import org.mifosng.data.LoanPayoffReadModel;
|
||||
import org.mifosng.data.MoneyData;
|
||||
import org.mifosng.platform.loan.service.CalculationPlatformService;
|
||||
import org.mifosng.platform.loan.service.LoanPayoffReadModel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
+1
-1
@@ -8,8 +8,8 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.platform.api.commands.UserCommand;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
import org.mifosng.platform.exceptions.OfficeNotFoundException;
|
||||
import org.mifosng.platform.exceptions.PlatformApiDataValidationException;
|
||||
import org.mifosng.platform.exceptions.PlatformDataIntegrityException;
|
||||
|
||||
+1
-1
@@ -3,9 +3,9 @@ package org.mifosng.platform.user.service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.platform.DataValidatorBuilder;
|
||||
import org.mifosng.platform.api.commands.RoleCommand;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
import org.mifosng.platform.exceptions.PlatformApiDataValidationException;
|
||||
|
||||
public class RoleCommandValidator {
|
||||
|
||||
+1
-1
@@ -3,9 +3,9 @@ package org.mifosng.platform.user.service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosng.data.ApiParameterError;
|
||||
import org.mifosng.platform.DataValidatorBuilder;
|
||||
import org.mifosng.platform.api.commands.UserCommand;
|
||||
import org.mifosng.platform.api.data.ApiParameterError;
|
||||
import org.mifosng.platform.exceptions.PlatformApiDataValidationException;
|
||||
|
||||
public class UserCommandValidator {
|
||||
|
||||
Reference in New Issue
Block a user