FINERACT-821 Added and Enforced MethodName Checkstyle

This commit is contained in:
Manthan Surkar
2020-06-07 02:05:40 +02:00
committed by Michael Vorburger ⛑️
parent 73e1fe77e9
commit b0ff8dbb60
38 changed files with 88 additions and 88 deletions
@@ -101,6 +101,11 @@
<property name="message" value="Avoid using corresponding octal or Unicode escape."/>
</module>
<module name="OneTopLevelClass"/>
<module name="MethodName">
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
<!-- TODO Enable many more checks (go about this one by one, step by step, raise separate PRs fixing and then enforcing):
<module name="HiddenField">
@@ -240,11 +245,6 @@
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
<! - - Enable some JavaDoc validation (requires quite a lot of manual clean up work; not a top priority for initial Checkstyle adoption - ->
<module name="JavadocTagContinuationIndentation"/>
@@ -57,7 +57,7 @@ public class LoanApplicationUndoLastTrancheTest {
}
@Test
public void LoanApplicationUndoLastTranche() {
public void loanApplicationUndoLastTranche() {
final String proposedAmount = "5000";
final String approvalAmount = "2000";
@@ -57,7 +57,7 @@ public class LoanDisbursalDateValidationTest {
}
@Test
public void LoanApplicationValidateDisbursalDate() {
public void loanApplicationValidateDisbursalDate() {
final String proposedAmount = "5000";
final String approveDate = "1 March 2014";
@@ -68,7 +68,7 @@ public class GLClosure extends AbstractAuditableCustom {
}
public static GLClosure fromJson(final Office office, final JsonCommand command) {
final Date closingDate = command.DateValueOfParameterNamed(GLClosureJsonInputParams.CLOSING_DATE.getValue());
final Date closingDate = command.dateValueOfParameterNamed(GLClosureJsonInputParams.CLOSING_DATE.getValue());
final String comments = command.stringValueOfParameterNamed(GLClosureJsonInputParams.COMMENTS.getValue());
return new GLClosure(office, closingDate, comments);
}
@@ -74,7 +74,7 @@ public class GLClosureWritePlatformServiceJpaRepositoryImpl implements GLClosure
// TODO: Get Tenant specific date
// ensure closure date is not in the future
final Date todaysDate = new Date();
final Date closureDate = command.DateValueOfParameterNamed(GLClosureJsonInputParams.CLOSING_DATE.getValue());
final Date closureDate = command.dateValueOfParameterNamed(GLClosureJsonInputParams.CLOSING_DATE.getValue());
if (closureDate.after(todaysDate)) { throw new GLClosureInvalidException(GlClosureInvalidReason.FUTURE_DATE, closureDate); }
// shouldn't be before an existing accounting closure
final GLClosure latestGLClosure = this.glClosureRepository.getLatestGLClosureByBranch(officeId);
@@ -142,7 +142,7 @@ public class GLClosureWritePlatformServiceJpaRepositoryImpl implements GLClosure
final Throwable realCause = dve.getMostSpecificCause();
if (realCause.getMessage().contains("office_id_closing_date")) { throw new GLClosureDuplicateException(
command.longValueOfParameterNamed(GLClosureJsonInputParams.OFFICE_ID.getValue()), new LocalDate(
command.DateValueOfParameterNamed(GLClosureJsonInputParams.CLOSING_DATE.getValue()))); }
command.dateValueOfParameterNamed(GLClosureJsonInputParams.CLOSING_DATE.getValue()))); }
LOG.error("Error occured.", dve);
throw new PlatformDataIntegrityException("error.msg.glClosure.unknown.data.integrity.issue",
@@ -158,7 +158,7 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
final PaymentDetail paymentDetail = this.paymentDetailWritePlatformService.createAndPersistPaymentDetail(command, changes);
/** Set a transaction Id and save these Journal entries **/
final Date transactionDate = command.DateValueOfParameterNamed(JournalEntryJsonInputParams.TRANSACTION_DATE.getValue());
final Date transactionDate = command.dateValueOfParameterNamed(JournalEntryJsonInputParams.TRANSACTION_DATE.getValue());
final String transactionId = generateTransactionId(officeId);
final String referenceNumber = command.stringValueOfParameterNamed(JournalEntryJsonInputParams.REFERENCE_NUMBER.getValue());
@@ -680,7 +680,7 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
}
/** Set a transaction Id and save these Journal entries **/
final Date transactionDate = command.DateValueOfParameterNamed(JournalEntryJsonInputParams.TRANSACTION_DATE.getValue());
final Date transactionDate = command.dateValueOfParameterNamed(JournalEntryJsonInputParams.TRANSACTION_DATE.getValue());
final String transactionId = generateTransactionId(officeId);
saveAllDebitOrCreditOpeningBalanceEntries(journalEntryCommand, office, currencyCode, transactionDate,
@@ -2434,7 +2434,7 @@ public class CommandWrapperBuilder {
return this;
}
public CommandWrapperBuilder SavingsInterestPostingAsOnDate(final Long accountId) {
public CommandWrapperBuilder savingsInterestPostingAsOnDate(final Long accountId) {
this.actionName = "POSTINTERESTASONDATE";
this.entityName = "SAVINGSACCOUNT";
this.savingsId = accountId;
@@ -75,13 +75,13 @@ public class GuarantorImportHandler implements ImportHandler {
Row row;
row = addGuarantorSheet.getRow(rowIndex);
if (ImportHandlerUtils.isNotImported(row, GuarantorConstants.STATUS_COL)) {
guarantors.add(ReadGuarantor(row, locale, dateFormat));
guarantors.add(readGuarantor(row, locale, dateFormat));
}
}
}
private GuarantorData ReadGuarantor(Row row,String locale,String dateFormat) {
private GuarantorData readGuarantor(Row row,String locale,String dateFormat) {
String loanaccountInfo=ImportHandlerUtils.readAsString(GuarantorConstants.LOAN_ACCOUNT_NO_COL, row);
if (loanaccountInfo!=null){
String[] loanAccountAr=loanaccountInfo.split("-");
@@ -239,7 +239,7 @@ public class EmailCampaignValidator {
throwExceptionIfValidationWarningsExist(dataValidationErrors);
}
public void ValidateClosure(String json){
public void validateClosure(String json){
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
@@ -297,7 +297,7 @@ public class SmsCampaignValidator {
throwExceptionIfValidationWarningsExist(dataValidationErrors);
}
public void ValidateClosure(String json) {
public void validateClosure(String json) {
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
@@ -107,7 +107,7 @@ public class GlobalConfigurationProperty extends AbstractPersistableCustom {
final String dateValueParamName = "dateValue";
if(command.isChangeInDateParameterNamed(dateValueParamName, this.dateValue)){
final Date newDateValue = command.DateValueOfParameterNamed(dateValueParamName);
final Date newDateValue = command.dateValueOfParameterNamed(dateValueParamName);
actualChanges.put(dateValueParamName, newDateValue);
this.dateValue = newDateValue;
}
@@ -410,7 +410,7 @@ public final class JsonCommand {
return this.fromApiJsonHelper.extractMonthDayNamed(parameterName, this.parsedCommand);
}
public Date DateValueOfParameterNamed(final String parameterName) {
public Date dateValueOfParameterNamed(final String parameterName) {
final LocalDate localDate = this.fromApiJsonHelper.extractLocalDateNamed(parameterName, this.parsedCommand);
if (localDate == null) { return null; }
return localDate.toDateTimeAtStartOfDay().toDate();
@@ -215,8 +215,8 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
Integer category = DataTableApiConstant.CATEGORY_DEFAULT;
final String permissionSql = this._getPermissionSql(dataTableName);
this._registerDataTable(applicationTableName, dataTableName, category, permissionSql);
final String permissionSql = this.getPermissionSql(dataTableName);
this.registerDataTable(applicationTableName, dataTableName, category, permissionSql);
}
@@ -230,8 +230,8 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
Integer category = this.getCategory(command);
this.dataTableValidator.validateDataTableRegistration(command.json());
final String permissionSql = this._getPermissionSql(dataTableName);
this._registerDataTable(applicationTableName, dataTableName, category, permissionSql);
final String permissionSql = this.getPermissionSql(dataTableName);
this.registerDataTable(applicationTableName, dataTableName, category, permissionSql);
}
@@ -245,12 +245,12 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
this.dataTableValidator.validateDataTableRegistration(command.json());
this._registerDataTable(applicationTableName, dataTableName, category, permissionSql);
this.registerDataTable(applicationTableName, dataTableName, category, permissionSql);
}
@Transactional
private void _registerDataTable(final String applicationTableName, final String dataTableName, final Integer category,
private void registerDataTable(final String applicationTableName, final String dataTableName, final Integer category,
final String permissionsSql) {
validateAppTable(applicationTableName);
@@ -301,7 +301,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
}
private String _getPermissionSql(final String dataTableName) {
private String getPermissionSql(final String dataTableName) {
final String createPermission = "'CREATE_" + dataTableName + "'";
final String createPermissionChecker = "'CREATE_" + dataTableName + "_CHECKER'";
final String readPermission = "'READ_" + dataTableName + "'";
@@ -95,14 +95,14 @@ public class FineractEntityToEntityMapping extends AbstractPersistableCustom {
if (command.isChangeInDateParameterNamed(FineractEntityApiResourceConstants.startDate, this.startDate)) {
final String valueAsInput = command.stringValueOfParameterNamed(FineractEntityApiResourceConstants.startDate);
actualChanges.put(FineractEntityApiResourceConstants.startDate, valueAsInput);
final Date startDate = command.DateValueOfParameterNamed(FineractEntityApiResourceConstants.startDate);
final Date startDate = command.dateValueOfParameterNamed(FineractEntityApiResourceConstants.startDate);
this.startDate = startDate;
}
if (command.isChangeInDateParameterNamed(FineractEntityApiResourceConstants.endDate, this.endDate)) {
final String valueAsInput = command.stringValueOfParameterNamed(FineractEntityApiResourceConstants.endDate);
actualChanges.put(FineractEntityApiResourceConstants.endDate, valueAsInput);
final Date endDate = command.DateValueOfParameterNamed(FineractEntityApiResourceConstants.endDate);
final Date endDate = command.dateValueOfParameterNamed(FineractEntityApiResourceConstants.endDate);
this.endDate = endDate;
}
if (startDate != null && endDate != null) {
@@ -93,8 +93,8 @@ public class FineractEntityAccessWriteServiceImpl implements FineractEntityAcces
final Long fromId = command.longValueOfParameterNamed(FineractEntityApiResourceConstants.fromEnityType);
final Long toId = command.longValueOfParameterNamed(FineractEntityApiResourceConstants.toEntityType);
final Date startDate = command.DateValueOfParameterNamed(FineractEntityApiResourceConstants.startDate);
final Date endDate = command.DateValueOfParameterNamed(FineractEntityApiResourceConstants.endDate);
final Date startDate = command.dateValueOfParameterNamed(FineractEntityApiResourceConstants.startDate);
final Date endDate = command.dateValueOfParameterNamed(FineractEntityApiResourceConstants.endDate);
fromApiJsonDeserializer.checkForEntity(relId.toString(), fromId, toId);
if (startDate != null && endDate != null) {
@@ -46,7 +46,7 @@ public class ReportMailingJobConfigurationReadPlatformServiceImpl implements Rep
@Override
public Collection<ReportMailingJobConfigurationData> retrieveAllReportMailingJobConfigurations() {
final ReportMailingJobConfigurationMapper mapper = new ReportMailingJobConfigurationMapper();
final String sql = "select " + mapper.ReportMailingJobConfigurationSchema();
final String sql = "select " + mapper.reportMailingJobConfigurationSchema();
return this.jdbcTemplate.query(sql, mapper, new Object[] {});
}
@@ -55,7 +55,7 @@ public class ReportMailingJobConfigurationReadPlatformServiceImpl implements Rep
public ReportMailingJobConfigurationData retrieveReportMailingJobConfiguration(String name) {
try {
final ReportMailingJobConfigurationMapper mapper = new ReportMailingJobConfigurationMapper();
final String sql = "select " + mapper.ReportMailingJobConfigurationSchema() + " where rmjc.name = ?";
final String sql = "select " + mapper.reportMailingJobConfigurationSchema() + " where rmjc.name = ?";
return this.jdbcTemplate.queryForObject(sql, mapper, new Object[] { name });
}
@@ -66,7 +66,7 @@ public class ReportMailingJobConfigurationReadPlatformServiceImpl implements Rep
}
private static final class ReportMailingJobConfigurationMapper implements RowMapper<ReportMailingJobConfigurationData> {
public String ReportMailingJobConfigurationSchema() {
public String reportMailingJobConfigurationSchema() {
return "rmjc.id, rmjc.name, rmjc.value "
+ "from m_report_mailing_job_configuration rmjc";
}
@@ -64,7 +64,7 @@ public class ReportMailingJobReadPlatformServiceImpl implements ReportMailingJob
final PaginationHelper<ReportMailingJobData> paginationHelper = new PaginationHelper<>();
sqlStringBuilder.append("select SQL_CALC_FOUND_ROWS ");
sqlStringBuilder.append(mapper.ReportMailingJobSchema());
sqlStringBuilder.append(mapper.reportMailingJobSchema());
sqlStringBuilder.append(" where rmj.is_deleted = 0");
if (searchParameters.isOrderByRequested()) {
@@ -93,7 +93,7 @@ public class ReportMailingJobReadPlatformServiceImpl implements ReportMailingJob
@Override
public Collection<ReportMailingJobData> retrieveAllActiveReportMailingJobs() {
final ReportMailingJobMapper mapper = new ReportMailingJobMapper();
final String sql = "select " + mapper.ReportMailingJobSchema() + " where rmj.is_deleted = 0 and is_active = 1"
final String sql = "select " + mapper.reportMailingJobSchema() + " where rmj.is_deleted = 0 and is_active = 1"
+ " order by rmj.name";
return this.jdbcTemplate.query(sql, mapper, new Object[] {});
@@ -103,7 +103,7 @@ public class ReportMailingJobReadPlatformServiceImpl implements ReportMailingJob
public ReportMailingJobData retrieveReportMailingJob(final Long reportMailingJobId) {
try {
final ReportMailingJobMapper mapper = new ReportMailingJobMapper();
final String sql = "select " + mapper.ReportMailingJobSchema() + " where rmj.id = ? and rmj.is_deleted = 0";
final String sql = "select " + mapper.reportMailingJobSchema() + " where rmj.id = ? and rmj.is_deleted = 0";
return this.jdbcTemplate.queryForObject(sql, mapper, new Object[] { reportMailingJobId });
}
@@ -122,7 +122,7 @@ public class ReportMailingJobReadPlatformServiceImpl implements ReportMailingJob
}
private static final class ReportMailingJobMapper implements RowMapper<ReportMailingJobData> {
public String ReportMailingJobSchema() {
public String reportMailingJobSchema() {
return "rmj.id, rmj.name, rmj.description, rmj.start_datetime as startDateTime, rmj.recurrence, rmj.created_date as createdOnDate, "
+ "cbu.username as createdByUsername, cbu.firstname as createdByFirstname, cbu.lastname as createdByLastname, "
+ "rmj.lastmodified_date as updatedOnDate, "
@@ -57,7 +57,7 @@ public class ReportMailingJobRunHistoryReadPlatformServiceImpl implements Report
final List<Object> queryParameters = new ArrayList<>();
sqlStringBuilder.append("select SQL_CALC_FOUND_ROWS ");
sqlStringBuilder.append(this.reportMailingJobRunHistoryMapper.ReportMailingJobRunHistorySchema());
sqlStringBuilder.append(this.reportMailingJobRunHistoryMapper.reportMailingJobRunHistorySchema());
if (reportMailingJobId != null) {
sqlStringBuilder.append(" where rmjrh.job_id = ? ");
@@ -86,7 +86,7 @@ public class ReportMailingJobRunHistoryReadPlatformServiceImpl implements Report
}
private static final class ReportMailingJobRunHistoryMapper implements RowMapper<ReportMailingJobRunHistoryData> {
public String ReportMailingJobRunHistorySchema() {
public String reportMailingJobRunHistorySchema() {
return "rmjrh.id, rmjrh.job_id as reportMailingJobId, rmjrh.start_datetime as startDateTime, "
+ "rmjrh.end_datetime as endDateTime, rmjrh.status, rmjrh.error_message as errorMessage, "
+ "rmjrh.error_log as errorLog "
@@ -46,9 +46,9 @@ public class PovertyLineServiceImpl implements PovertyLineService {
@Override
public PpiPovertyLineData retrieveAll(final String ppiName) {
final SqlRowSet povertyLines = this._getPovertyLines(ppiName);
final SqlRowSet povertyLines = this.getPovertyLines(ppiName);
final SqlRowSet likelihoods = this._getLikelihoods();
final SqlRowSet likelihoods = this.getLikelihoods();
List<LikeliHoodPovertyLineData> listOfLikeliHoodPovertyLineData = new ArrayList<>();
@@ -88,7 +88,7 @@ public class PovertyLineServiceImpl implements PovertyLineService {
@Override
public LikeliHoodPovertyLineData retrieveForLikelihood(final String ppiName, final Long likelihoodId) {
final SqlRowSet povertyLines = this._getPovertyLines(likelihoodId);
final SqlRowSet povertyLines = this.getPovertyLines(likelihoodId);
List<PovertyLineData> povertyLineDatas = new ArrayList<>();
@@ -108,13 +108,13 @@ public class PovertyLineServiceImpl implements PovertyLineService {
}
private SqlRowSet _getLikelihoods() {
private SqlRowSet getLikelihoods() {
String sql = "SELECT lkp.id, lkh.code , lkh.name, lkp.enabled " + " FROM ppi_likelihoods lkh "
+ " JOIN ppi_likelihoods_ppi lkp on lkp.likelihood_id = lkh.id ";
return this.jdbcTemplate.queryForRowSet(sql);
}
private SqlRowSet _getPovertyLines(final String ppiName) {
private SqlRowSet getPovertyLines(final String ppiName) {
String sql = "SELECT pl.id, sc.score_from, sc.score_to , pl.poverty_line,lkh.code , lkh.name , lkp.ppi_name "
+ " FROM ppi_poverty_line pl " + " JOIN ppi_likelihoods lkh on lkh.id = pl.likelihood_ppi_id "
+ " JOIN ppi_likelihoods_ppi lkp on lkp.id = pl.likelihood_ppi_id " + " JOIN ppi_scores sc on sc.id = pl.score_id "
@@ -124,7 +124,7 @@ public class PovertyLineServiceImpl implements PovertyLineService {
}
private SqlRowSet _getPovertyLines(final Long likelihoodId) {
private SqlRowSet getPovertyLines(final Long likelihoodId) {
String sql = "SELECT pl.id, sc.score_from, sc.score_to , pl.poverty_line,lkh.code , lkp.enabled, lkp.id as likelihood_id , lkh.name , lkp.ppi_name "
+ " FROM ppi_poverty_line pl "
+ " JOIN ppi_likelihoods_ppi lkp on lkp.id = pl.likelihood_ppi_id "
@@ -43,7 +43,7 @@ public class ReadLikelihoodServiceImpl implements ReadLikelihoodService {
@Override
public List<LikelihoodData> retrieveAll(final String ppiName) {
final SqlRowSet likelihood = this._getLikelihood(ppiName);
final SqlRowSet likelihood = this.getLikelihood(ppiName);
List<LikelihoodData> likelihoodDatas = new ArrayList<>();
@@ -58,7 +58,7 @@ public class ReadLikelihoodServiceImpl implements ReadLikelihoodService {
return likelihoodDatas;
}
private SqlRowSet _getLikelihood(final String ppiName) {
private SqlRowSet getLikelihood(final String ppiName) {
String sql = "SELECT lkp.id, lkh.code , lkh.name, lkp.enabled " + " FROM ppi_poverty_line pl "
+ " JOIN ppi_likelihoods_ppi lkp on lkp.id = pl.likelihood_ppi_id "
+ " JOIN ppi_likelihoods lkh on lkp.likelihood_id = lkh.id " + " WHERE lkp.ppi_name = ? "
@@ -70,7 +70,7 @@ public class ReadLikelihoodServiceImpl implements ReadLikelihoodService {
@Override
public LikelihoodData retrieve(final Long likelihoodId) {
final SqlRowSet likelihood = this._getLikelihood(likelihoodId);
final SqlRowSet likelihood = this.getLikelihood(likelihoodId);
likelihood.first();
@@ -81,7 +81,7 @@ public class ReadLikelihoodServiceImpl implements ReadLikelihoodService {
}
private SqlRowSet _getLikelihood(final Long likelihoodId) {
private SqlRowSet getLikelihood(final Long likelihoodId) {
String sql = "SELECT lkp.id, lkh.code , lkh.name, lkp.enabled " + " FROM ppi_likelihoods lkh "
+ " JOIN ppi_likelihoods_ppi lkp on lkp.likelihood_id = lkh.id " + " WHERE lkp.id = ? ";
@@ -44,14 +44,14 @@ public class WriteSurveyServiceImpl implements WriteSurveyService {
public CommandProcessingResult registerSurvey(JsonCommand command) {
final String dataTableName = this.readWriteNonCoreDataService.getDataTableName(command.getUrl());
final String permissionSql = this._getPermissionSql(dataTableName);
final String permissionSql = this.getPermissionSql(dataTableName);
this.readWriteNonCoreDataService.registerDatatable(command, permissionSql);
return CommandProcessingResult.commandOnlyResult(command.commandId());
}
private String _getPermissionSql(final String dataTableName) {
private String getPermissionSql(final String dataTableName) {
final String createPermission = "'CREATE_" + dataTableName + "'";
final String createPermissionChecker = "'CREATE_" + dataTableName + "_CHECKER'";
final String readPermission = "'READ_" + dataTableName + "'";
@@ -90,7 +90,7 @@ public class AccountTransferAssembler {
final String description = command.stringValueOfParameterNamed(transferDescriptionParamName);
AccountTransferTransaction accountTransferTransaction = AccountTransferTransaction.LoanTosavingsTransfer(accountTransferDetails,
AccountTransferTransaction accountTransferTransaction = AccountTransferTransaction.loanTosavingsTransfer(accountTransferDetails,
deposit, loanRefundTransaction, transactionDate, transactionMonetaryAmount, description);
accountTransferDetails.addAccountTransferTransaction(accountTransferTransaction);
return accountTransferDetails;
@@ -137,7 +137,7 @@ public class AccountTransferAssembler {
accountTransferDetails = this.accountTransferDetailAssembler.assembleLoanToSavingsTransfer(fromLoanAccount, toSavingsAccount,
accountTransferDTO.getTransferType());
}
AccountTransferTransaction accountTransferTransaction = AccountTransferTransaction.LoanTosavingsTransfer(accountTransferDetails,
AccountTransferTransaction accountTransferTransaction = AccountTransferTransaction.loanTosavingsTransfer(accountTransferDetails,
deposit, loanRefundTransaction, accountTransferDTO.getTransactionDate(), transactionMonetaryAmount,
accountTransferDTO.getDescription());
accountTransferDetails.addAccountTransferTransaction(accountTransferTransaction);
@@ -152,7 +152,7 @@ public class AccountTransferAssembler {
accountTransferDetails = this.accountTransferDetailAssembler.assembleLoanToLoanTransfer(fromLoanAccount, toLoanAccount,
accountTransferDTO.getFromTransferType());
}
AccountTransferTransaction accountTransferTransaction = AccountTransferTransaction.LoanToLoanTransfer(accountTransferDetails,
AccountTransferTransaction accountTransferTransaction = AccountTransferTransaction.loanToLoanTransfer(accountTransferDetails,
disburseTransaction, repaymentTransaction, accountTransferDTO.getTransactionDate(), transactionMonetaryAmount,
accountTransferDTO.getDescription());
accountTransferDetails.addAccountTransferTransaction(accountTransferTransaction);
@@ -162,7 +162,7 @@ public class AccountTransferDetailAssembler {
final Client toClient = this.clientRepository.findOneWithNotFoundDetection(toClientId);
final Integer transfertype = this.fromApiJsonHelper.extractIntegerNamed(transferTypeParamName, element, Locale.getDefault());
return AccountTransferDetails.LoanTosavingsTransfer(fromOffice, fromClient, fromLoanAccount, toOffice, toClient, toSavingsAccount,
return AccountTransferDetails.loanTosavingsTransfer(fromOffice, fromClient, fromLoanAccount, toOffice, toClient, toSavingsAccount,
transfertype);
}
@@ -196,7 +196,7 @@ public class AccountTransferDetailAssembler {
final Office toOffice = toSavingsAccount.office();
final Client toClient = toSavingsAccount.getClient();
return AccountTransferDetails.LoanTosavingsTransfer(fromOffice, fromClient, fromLoanAccount, toOffice, toClient, toSavingsAccount,
return AccountTransferDetails.loanTosavingsTransfer(fromOffice, fromClient, fromLoanAccount, toOffice, toClient, toSavingsAccount,
transferType);
}
@@ -206,7 +206,7 @@ public class AccountTransferDetailAssembler {
final Office toOffice = toLoanAccount.getOffice();
final Client toClient = toLoanAccount.client();
return AccountTransferDetails.LoanToLoanTransfer(fromOffice, fromClient, fromLoanAccount, toOffice, toClient, toLoanAccount,
return AccountTransferDetails.loanToLoanTransfer(fromOffice, fromClient, fromLoanAccount, toOffice, toClient, toLoanAccount,
transferType);
}
}
@@ -95,7 +95,7 @@ public class AccountTransferDetails extends AbstractPersistableCustom {
transferType, null);
}
public static AccountTransferDetails LoanTosavingsTransfer(final Office fromOffice, final Client fromClient,
public static AccountTransferDetails loanTosavingsTransfer(final Office fromOffice, final Client fromClient,
final Loan fromLoanAccount, final Office toOffice, final Client toClient, final SavingsAccount toSavingsAccount,
Integer transferType) {
return new AccountTransferDetails(fromOffice, fromClient, null, fromLoanAccount, toOffice, toClient, toSavingsAccount, null,
@@ -154,7 +154,7 @@ public class AccountTransferDetails extends AbstractPersistableCustom {
return AccountTransferType.fromInt(this.transferType);
}
public static AccountTransferDetails LoanToLoanTransfer(Office fromOffice, Client fromClient, Loan fromLoanAccount, Office toOffice, Client toClient,
public static AccountTransferDetails loanToLoanTransfer(Office fromOffice, Client fromClient, Loan fromLoanAccount, Office toOffice, Client toClient,
Loan toLoanAccount, Integer transferType) {
return new AccountTransferDetails(fromOffice, fromClient, null, fromLoanAccount, toOffice, toClient, null, toLoanAccount,
transferType, null);
@@ -90,7 +90,7 @@ public class AccountTransferTransaction extends AbstractPersistableCustom {
transactionAmount, description);
}
public static AccountTransferTransaction LoanTosavingsTransfer(final AccountTransferDetails accountTransferDetails,
public static AccountTransferTransaction loanTosavingsTransfer(final AccountTransferDetails accountTransferDetails,
final SavingsAccountTransaction deposit, final LoanTransaction loanRefundTransaction, final LocalDate transactionDate,
final Money transactionAmount, final String description) {
return new AccountTransferTransaction(accountTransferDetails, null, deposit, null, loanRefundTransaction, transactionDate,
@@ -144,7 +144,7 @@ public class AccountTransferTransaction extends AbstractPersistableCustom {
return this.accountTransferDetails;
}
public static AccountTransferTransaction LoanToLoanTransfer(AccountTransferDetails accountTransferDetails, LoanTransaction disburseTransaction,
public static AccountTransferTransaction loanToLoanTransfer(AccountTransferDetails accountTransferDetails, LoanTransaction disburseTransaction,
LoanTransaction repaymentTransaction, LocalDate transactionDate, Money transactionMonetaryAmount, String description) {
return new AccountTransferTransaction(accountTransferDetails, null, null, repaymentTransaction, disburseTransaction, transactionDate,
transactionMonetaryAmount, description);
@@ -111,7 +111,7 @@ public class ClientAddressApiResources {
@ApiOperation(value = "Create an address for a Client", notes = "Mandatory Fields : \n" + "type and clientId")
@ApiImplicitParams({@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ClientAddressApiResourcesSwagger.PostClientClientIdAddressesRequest.class)})
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ClientAddressApiResourcesSwagger.PostClientClientIdAddressesResponse.class)})
public String AddClientAddress(@QueryParam("type") @ApiParam(value = "type") final long addressTypeId,
public String addClientAddress(@QueryParam("type") @ApiParam(value = "type") final long addressTypeId,
@PathParam("clientid") @ApiParam(value = "clientId") final long clientid, @ApiParam(hidden = true) final String apiRequestBodyAsJson) {
final CommandWrapper commandRequest = new CommandWrapperBuilder().addClientAddress(clientid, addressTypeId)
@@ -157,7 +157,7 @@ public class ClientAddressApiResources {
@ApiOperation(value = "Update an address for a Client", notes = "All the address fields can be updated by using update client address API\n" + "\n" + "Mandatory Fields\n" + "type and addressId")
@ApiImplicitParams({@ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ClientAddressApiResourcesSwagger.PutClientClientIdAddressesRequest.class)})
@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = ClientAddressApiResourcesSwagger.PutClientClientIdAddressesResponse.class)})
public String UpdateClientAddress(@PathParam("clientid") @ApiParam(value = "clientId") final long clientid, @ApiParam(hidden = true) final String apiRequestBodyAsJson) {
public String updateClientAddress(@PathParam("clientid") @ApiParam(value = "clientId") final long clientid, @ApiParam(hidden = true) final String apiRequestBodyAsJson) {
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateClientAddress(clientid)
.withJson(apiRequestBodyAsJson).build();
@@ -146,9 +146,9 @@ public class ClientFamilyMembersWritePlatformServiceImpl implements ClientFamily
profession = this.codeValueRepository.getOne(professionId);
}
if(command.DateValueOfParameterNamed("dateOfBirth")!=null)
if(command.dateValueOfParameterNamed("dateOfBirth")!=null)
{
dateOfBirth=command.DateValueOfParameterNamed("dateOfBirth");
dateOfBirth=command.dateValueOfParameterNamed("dateOfBirth");
}
@@ -391,9 +391,9 @@ public class ClientFamilyMembersWritePlatformServiceImpl implements ClientFamily
clientFamilyMember.setProfession(profession);
}
if(command.DateValueOfParameterNamed("dateOfBirth")!=null)
if(command.dateValueOfParameterNamed("dateOfBirth")!=null)
{
dateOfBirth=command.DateValueOfParameterNamed("dateOfBirth");
dateOfBirth=command.dateValueOfParameterNamed("dateOfBirth");
clientFamilyMember.setDateOfBirth(dateOfBirth);
@@ -259,7 +259,7 @@ public class LoanTransactionData {
manuallyReversed);
}
public static LoanTransactionData LoanTransactionDataForDisbursalTemplate(final LoanTransactionEnumData transactionType, final LocalDate expectedDisbursedOnLocalDateForTemplate,
public static LoanTransactionData loanTransactionDataForDisbursalTemplate(final LoanTransactionEnumData transactionType, final LocalDate expectedDisbursedOnLocalDateForTemplate,
final BigDecimal disburseAmountForTemplate, final Collection<PaymentTypeData> paymentOptions,
final BigDecimal retriveLastEmiAmount, final LocalDate possibleNextRepaymentDate) {
final Long id = null;
@@ -139,7 +139,7 @@ public class Guarantor extends AbstractPersistableCustom {
if (GuarantorType.EXTERNAL.getValue().equals(gurantorType)) {
final String firstname = command.stringValueOfParameterNamed(GuarantorJSONinputParams.FIRSTNAME.getValue());
final String lastname = command.stringValueOfParameterNamed(GuarantorJSONinputParams.LASTNAME.getValue());
final Date dateOfBirth = command.DateValueOfParameterNamed(GuarantorJSONinputParams.DATE_OF_BIRTH.getValue());
final Date dateOfBirth = command.dateValueOfParameterNamed(GuarantorJSONinputParams.DATE_OF_BIRTH.getValue());
final String addressLine1 = command.stringValueOfParameterNamed(GuarantorJSONinputParams.ADDRESS_LINE_1.getValue());
final String addressLine2 = command.stringValueOfParameterNamed(GuarantorJSONinputParams.ADDRESS_LINE_2.getValue());
final String city = command.stringValueOfParameterNamed(GuarantorJSONinputParams.CITY.getValue());
@@ -252,7 +252,7 @@ public class Guarantor extends AbstractPersistableCustom {
private void handlePropertyUpdate(final JsonCommand command, final Map<String, Object> actualChanges, final String paramName,
Date propertyToBeUpdated) {
if (command.isChangeInDateParameterNamed(paramName, propertyToBeUpdated)) {
final Date newValue = command.DateValueOfParameterNamed(paramName);
final Date newValue = command.dateValueOfParameterNamed(paramName);
actualChanges.put(paramName, newValue);
//propertyToBeUpdated = newValue;
@@ -113,7 +113,7 @@ public class LoanSchedulePeriodData {
totalActualCostOfLoanForPeriod, totalInstallmentAmountForPeriod);
}
public static LoanSchedulePeriodData WithPaidDetail(final LoanSchedulePeriodData loanSchedulePeriodData, final boolean complete,
public static LoanSchedulePeriodData withPaidDetail(final LoanSchedulePeriodData loanSchedulePeriodData, final boolean complete,
final BigDecimal principalPaid, final BigDecimal interestPaid, final BigDecimal feeChargesPaid,
final BigDecimal penaltyChargesPaid) {
@@ -390,7 +390,7 @@ public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService, Bus
penaltyAmt = penaltyAmt.subtract(loanSchedulePeriodData.penaltyChargesDue());
}
LoanSchedulePeriodData periodData = LoanSchedulePeriodData.WithPaidDetail(loanSchedulePeriodData, isComplete,
LoanSchedulePeriodData periodData = LoanSchedulePeriodData.withPaidDetail(loanSchedulePeriodData, isComplete,
principalPaid, interestPaid, feeChargesPaid, penaltyChargesPaid);
updatedPeriodData.add(periodData);
}
@@ -285,7 +285,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
* TODO Vishwas: Remove references to "Contra" from the codebase
***/
final String sql = "select "
+ rm.LoanPaymentsSchema()
+ rm.loanPaymentsSchema()
+ " where tr.loan_id = ? and tr.transaction_type_enum not in (0, 3) and (tr.is_reversed=0 or tr.manually_adjusted_or_reversed = 1) order by tr.transaction_date ASC,id ";
return this.jdbcTemplate.query(sql, rm, new Object[] { loanId });
} catch (final EmptyResultDataAccessException e) {
@@ -546,7 +546,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
if (paymentDetailsRequired) {
paymentOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
}
return LoanTransactionData.LoanTransactionDataForDisbursalTemplate(transactionType, loan.getExpectedDisbursedOnLocalDateForTemplate(), loan.getDisburseAmountForTemplate(),
return LoanTransactionData.loanTransactionDataForDisbursalTemplate(transactionType, loan.getExpectedDisbursedOnLocalDateForTemplate(), loan.getDisburseAmountForTemplate(),
paymentOptions, loan.retriveLastEmiAmount(), loan.getNextPossibleRepaymentDateForRescheduling());
}
@@ -556,7 +556,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
this.context.authenticatedUser();
try {
final LoanTransactionsMapper rm = new LoanTransactionsMapper();
final String sql = "select " + rm.LoanPaymentsSchema() + " where l.id = ? and tr.id = ? ";
final String sql = "select " + rm.loanPaymentsSchema() + " where l.id = ? and tr.id = ? ";
return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { loanId, transactionId });
} catch (final EmptyResultDataAccessException e) {
throw new LoanTransactionNotFoundException(transactionId);
@@ -1278,7 +1278,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
private static final class LoanTransactionsMapper implements RowMapper<LoanTransactionData> {
public String LoanPaymentsSchema() {
public String loanPaymentsSchema() {
return " tr.id as id, tr.transaction_type_enum as transactionType, tr.transaction_date as `date`, tr.amount as total, "
+ " tr.principal_portion_derived as principal, tr.interest_portion_derived as interest, "
@@ -367,7 +367,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
checkClientOrGroupActive(loan);
final LocalDate nextPossibleRepaymentDate = loan.getNextPossibleRepaymentDateForRescheduling();
final Date rescheduledRepaymentDate = command.DateValueOfParameterNamed("adjustRepaymentDate");
final Date rescheduledRepaymentDate = command.dateValueOfParameterNamed("adjustRepaymentDate");
entityDatatableChecksWritePlatformService.runTheCheckForProduct(loanId, EntityTables.LOAN.getName(),
StatusEnum.DISBURSE.getCode().longValue(), EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(), loan.productId());
@@ -96,7 +96,7 @@ public class MeetingWritePlatformServiceJpaRepositoryImpl implements MeetingWrit
this.meetingDataValidator.validateForCreate(command);
final Date meetingDate = command.DateValueOfParameterNamed(meetingDateParamName);
final Date meetingDate = command.dateValueOfParameterNamed(meetingDateParamName);
final Boolean isTransactionDateOnNonMeetingDate = false;
/*Boolean isSkipRepaymentOnFirstMonth = false;
Integer numberOfDays = 0;
@@ -305,7 +305,7 @@ public class MeetingWritePlatformServiceJpaRepositoryImpl implements MeetingWrit
@Override
public void updateCollectionSheetAttendance(final JsonCommand command) {
final Date meetingDate = command.DateValueOfParameterNamed(transactionDateParamName);
final Date meetingDate = command.dateValueOfParameterNamed(transactionDateParamName);
final Boolean isTransactionDateOnNonMeetingDate = command.booleanPrimitiveValueOfParameterNamed(isTransactionDateOnNonMeetingDateParamName);
try {
@@ -130,7 +130,7 @@ public class ShareAccountDividendReadPlatformServiceImpl implements ShareAccount
final Long id = rs.getLong("id");
final BigDecimal amount = rs.getBigDecimal("amount");
final Integer status = JdbcSupport.getInteger(rs, "status");
final EnumOptionData statusEnum = SharesEnumerations.ShareAccountDividendStatusEnum(status);
final EnumOptionData statusEnum = SharesEnumerations.shareAccountDividendStatusEnum(status);
final Long savingsTransactionId = JdbcSupport.getLong(rs, "savingsTransactionId");
final Long accounId = rs.getLong("accountId");
@@ -494,7 +494,7 @@ public class ShareAccountReadPlatformServiceImpl implements ShareAccountReadPlat
final BigDecimal postedAmount = JdbcSupport.getBigDecimalDefaultToNullIfZero(rs, "amount");
final Long savingTransactionId = rs.getLong("savings_transaction_id");
final Integer status = rs.getInt("status") ;
final EnumOptionData statusEnum = SharesEnumerations.ShareAccountDividendStatusEnum(status);
final EnumOptionData statusEnum = SharesEnumerations.shareAccountDividendStatusEnum(status);
final ShareAccountData shareAccountData = null;
return new ShareAccountDividendData(id, postedDate, shareAccountData, postedAmount, statusEnum, savingTransactionId);
}
@@ -179,7 +179,7 @@ public class SharesEnumerations {
return optionData;
}
public static EnumOptionData ShareAccountDividendStatusEnum(ShareAccountDividendStatusType type) {
public static EnumOptionData shareAccountDividendStatusEnum(ShareAccountDividendStatusType type) {
EnumOptionData data = new EnumOptionData(ShareAccountDividendStatusType.INVALID.getValue().longValue(),
ShareAccountDividendStatusType.INVALID.getCode(), "Invalid");
switch (type) {
@@ -198,11 +198,11 @@ public class SharesEnumerations {
return data;
}
public static EnumOptionData ShareAccountDividendStatusEnum(final Integer enumValue) {
return ShareAccountDividendStatusEnum(ShareAccountDividendStatusType.fromInt(enumValue));
public static EnumOptionData shareAccountDividendStatusEnum(final Integer enumValue) {
return shareAccountDividendStatusEnum(ShareAccountDividendStatusType.fromInt(enumValue));
}
public static EnumOptionData ShareProductDividendStatusEnum(ShareProductDividendStatusType type) {
public static EnumOptionData shareProductDividendStatusEnum(ShareProductDividendStatusType type) {
EnumOptionData data = new EnumOptionData(ShareAccountDividendStatusType.INVALID.getValue().longValue(),
ShareAccountDividendStatusType.INVALID.getCode(), "Invalid");
switch (type) {
@@ -221,7 +221,7 @@ public class SharesEnumerations {
return data;
}
public static EnumOptionData ShareProductDividendStatusEnum(final Integer enumValue) {
return ShareProductDividendStatusEnum(ShareProductDividendStatusType.fromInt(enumValue));
public static EnumOptionData shareProductDividendStatusEnum(final Integer enumValue) {
return shareProductDividendStatusEnum(ShareProductDividendStatusType.fromInt(enumValue));
}
}
@@ -116,7 +116,7 @@ public class ShareProductDividendReadPlatformServiceImpl implements ShareProduct
final Long id = rs.getLong("id");
final BigDecimal amount = rs.getBigDecimal("amount");
final Integer status = JdbcSupport.getInteger(rs, "status");
final EnumOptionData statusEnum = SharesEnumerations.ShareProductDividendStatusEnum(status);
final EnumOptionData statusEnum = SharesEnumerations.shareProductDividendStatusEnum(status);
final LocalDate startDate = JdbcSupport.getLocalDate(rs, "startDate");
final LocalDate endDate = JdbcSupport.getLocalDate(rs, "endDate");