Skip to content

Commit

Permalink
Merge pull request apache#1 from apache/develop
Browse files Browse the repository at this point in the history
sync from original repo
  • Loading branch information
hungnguyen2712 authored Mar 14, 2019
2 parents fa41f0c + 2cb760f commit 8dc8166
Show file tree
Hide file tree
Showing 59 changed files with 1,831 additions and 48 deletions.
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Description
Describe the changes made and why they were made. Ignore if these details are present on the associated Jira ticket

## Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!

- [ ] Commit message starts with the issue number from https://issues.apache.org/jira/projects/FINERACT/. Ex: FINERACT-646 Pockets API.

- [ ] Coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions have been followed.

- [ ] API documentation at https://github.com/apache/fineract/blob/develop/api-docs/apiLive.htm has been updated with details of any API changes.

- [ ] Integration tests have been created/updated for verifying the changes made.

- [ ] All Integrations tests are passing with the new commit.

- [ ] PR contains a single commit (If you have multiple commits, please squash them into a single commit).

Our guidelines for code reviews is at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@
*.ear
.gradle
build
*.iml
*.ipr
*.iws
*.DS_Store
.idea
gradle
21 changes: 19 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ language: java
jdk:
- openjdk8

services:
- mysql

# Hardcoding system time as a temporary fix for running buggy test cases
before_install:
- echo "USE mysql;\nUPDATE user SET password=PASSWORD('mysql') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root
- mysql -u root -pmysql -e 'CREATE DATABASE IF NOT EXISTS `mifosplatform-tenants`;'
- mysql -u root -pmysql -e 'CREATE DATABASE IF NOT EXISTS `mifostenant-default`;'
- export TZ=Asia/Kolkata
- sudo service ntp stop
- sudo date --set="23 February 2019 01:02:03"

# https://docs.travis-ci.com/user/languages/java/#caching
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
Expand All @@ -30,9 +42,14 @@ cache:
- $HOME/.gradle/wrapper/
- $HOME/.m2

# NOTE: The --info, while quite a bit more verbose, is VERY useful to understand failures on Travis,
# NOTE: We used to run with --info, which is quite a bit more verbose, but is VERY useful to understand failures on Travis,
# where you do not have access to any files like build/reports/tests/index.html, only the Console.
# @see http://mrhaki.blogspot.ch/2013/05/gradle-goodness-show-more-information.html
# @see http://forums.gradle.org/gradle/topics/whats_new_in_gradle_1_1_test_logging for alternative
# https://jira.apache.org/jira/browse/FINERACT-732 removed that again, because it made Travis CI fail.
script:
- ./gradlew --info licenseMain licenseTest licenseIntegrationTest test
- date
- ./gradlew --console=plain licenseMain licenseTest licenseIntegrationTest test
- ./gradlew --console=plain migrateTenantListDB -PdbName=mifosplatform-tenants
- ./gradlew --console=plain migrateTenantDB -PdbName=mifostenant-default
- ./gradlew --console=plain clean integrationTest
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Apache Fineract: A Platform for Microfinance [![Build Status](https://travis-ci.org/apache/fineract.svg?branch=develop)](https://travis-ci.org/apache/fineract)
============

The next evolution of Apache Fineract focuses on being faster, lighter and cheaper to change (than the existing Mifos) so that it is more responsive to the needs of Microfinance Institutions and Integrators.
Fineract is a mature platform with open APIs that provides a reliable, robust, and affordable core banking solution for financial institutions offering services to the world’s 2 billion underbanked and unbanked.

Requirements
============
Expand All @@ -11,13 +10,13 @@ Requirements

Instructions to download gradle wrapper
============
By running following command, it will download the gradle wrapper from Fineract git repository and put it under fineract-provider/gradle/wrapper
If the file fineract-provider/gradle/wrapper/gradle-wrapper.jar doesn't already exist in your copy of the Fineract codebase, the same needs to be downloaded using the commands below

wget --no-check-certificate -P fineract-provider/gradle/wrapper https://github.com/apache/incubator-fineract/raw/develop/fineract-provider/gradle/wrapper/gradle-wrapper.jar
wget --no-check-certificate -P fineract-provider/gradle/wrapper https://github.com/apache/fineract/raw/develop/fineract-provider/gradle/wrapper/gradle-wrapper.jar

(or)

curl --insecure -L https://github.com/apache/incubator-fineract/raw/develop/fineract-provider/gradle/wrapper/gradle-wrapper.jar > fineract-provider/gradle/wrapper/gradle-wrapper.jar
curl --insecure -L https://github.com/apache/fineract/raw/develop/fineract-provider/gradle/wrapper/gradle-wrapper.jar > fineract-provider/gradle/wrapper/gradle-wrapper.jar

Instructions to run Apache RAT (Release Audit Tool)
============
Expand All @@ -28,16 +27,16 @@ Instructions to run Apache RAT (Release Audit Tool)
Instructions to build a war file
============
1. Extract the archive file to your local directory.
2. Download gradle-wrapper.jar version 2.10 and place it in the fineract-provider/gradle/wrapper folder. See 'Instructions to download gradle wrapper' above.
2. Ensure gradle-wrapper.jar version 2.10 is present in the fineract-provider/gradle/wrapper folder. See 'Instructions to download gradle wrapper' above.
3. Run `./gradlew clean war` or `./gradlew build` to build deployable war file which will be created at build/libs directory.


Instructions to execute Integration tests
============
1. Login to mysql DB using `mysql -u root -p mysql`
> Note that if this is the first time to access MySQL DB, then you may need to reset your password.
2. Create the mifosplatform-tenants database using `CREATE DATABASE mifosplatform_tenants`.
3. Create the default tenant database using `CREATE DATABASE mifostenant_default`.
2. Create the mifosplatform-tenants database using `CREATE DATABASE mifosplatform-tenants`.
3. Create the default tenant database using `CREATE DATABASE mifostenant-default`.
4. Download gradle-wrapper.jar version 2.10 and place it in the fineract-provider/gradle/wrapper folder. See 'Instructions to download gradle wrapper' above.
5. Run the following commands:
1. `./gradlew migrateTenantListDB -PdbName=mifosplatform-tenants`
Expand All @@ -48,9 +47,9 @@ Instructions to execute Integration tests
Version
============

The latest stable release can be viewed on the develop branch: [Latest Release on Develop](https://github.com/apache/incubator-fineract/tree/develop "Latest Release").
The latest stable release can be viewed on the develop branch: [Latest Release on Develop](https://github.com/apache/fineract/tree/develop "Latest Release").

The progress of this project can be viewed here: [View change log](https://github.com/apache/incubator-fineract/blob/develop/CHANGELOG.md "Latest release change log")
The progress of this project can be viewed here: [View change log](https://github.com/apache/fineract/blob/develop/CHANGELOG.md "Latest release change log")

License
============
Expand Down Expand Up @@ -87,6 +86,15 @@ Video Demonstration

Apache Fineract / Mifos X Demo (November 2016) - <https://www.youtube.com/watch?v=h61g9TptMBo>

Governance and Policies
=======================

[Becoming a Committer](https://cwiki.apache.org/confluence/display/FINERACT/Becoming+a+Committer)
documents the process through which you can become a committer in this project.

[Pull Request Size Limit](https://cwiki.apache.org/confluence/display/FINERACT/Pull+Request+Size+Limit)
documents that we cannot accept huge "code dump" Pull Requests, with some related suggestions.

More Information
============
More details of the project can be found at <https://cwiki.apache.org/confluence/display/FINERACT>.
123 changes: 122 additions & 1 deletion api-docs/apiLive.htm
Original file line number Diff line number Diff line change
Expand Up @@ -3864,7 +3864,7 @@ <h2 class="flybar-button">Self Service</h2>
<td>self/loans/{loanId}/guarantors</td>
<td></td>
<td><a href="#self_guarantors_list">Guarantors list</a></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
Expand All @@ -3875,6 +3875,7 @@ <h2 class="flybar-button">Self Service</h2>
</td>
</td>
</tr>

<tr>
<td><a href="#self_service_user_reports">Run Report</a></td>
<td>self/runreports/{reportName}</td>
Expand Down Expand Up @@ -3904,6 +3905,30 @@ <h2 class="flybar-button">Self Service</h2>
<td>self/surveys/scorecards/clients/{clientId}</td>
<td></td>
<td><a href="#survey_score">Survey Scorecards</a></td>
<td></td>
<td></td>
</tr>
<tr>
<td><a href="#linkaccountstopocket">Link/Delink accounts to pocket</a></td>
<td>self/pockets?command=linkAccounts</td>
<td><a href="#linkaccountstopocket">Link accounts to pocket</a></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>self/pockets?command=delinkAccounts</td>
<td><a href="#delinkaccountstopocket">Delink accounts from pocket</a></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>self/pockets</td>
<td></td>
<td><a href="#retrievepocketaccounts">Retrieve accounts linked to pocket</a></td>
<td></td>
<td></td>
</tr>
Expand Down Expand Up @@ -50691,6 +50716,102 @@ <h5>Arguments</h5>
</code>
</div>
</div>

<a id="linkaccountstopocket" name="linkaccountstopocket" class="old-syle-anchor">&nbsp;</a>
<div class="method-section">
<div class="method-description">
<h2>Link/delink accounts to/from pocket</h2>
<p>Pockets behave as favourites. An user can link his/her Loan, Savings and Share accounts to pocket for faster access. In a similar way linked accounts can be delinked from the pocket.</p>
<h2>Link accounts to pocket</h2>
<p>Example Requests:</p>
<div class=apiClick>self/pockets?command=linkAccounts</div>
</div>
<div class="method-example">
<code class="method-declaration">POST https://DomainName/api/v1/self/pockets?command=linkAccounts</code>
<code class="method-request">POST self/pockets?command=linkAccounts
Content-Type: application/json
Request Body:

{
"accountsDetail":[
{
"accountId":"11",
"accountType":"LOAN"
},
{
"accountId":"2",
"accountType":"SAVINGS"
}
]
}
</code>
<code class="method-response">
{
"resourceId": 6
}
</code>
</div>
</div>

<a id="delinkaccountstopocket" name="delinkaccountstopocket" class="old-syle-anchor">&nbsp;</a>
<div class="method-section">
<div class="method-description">
<h2>Delink accounts from pocket</h2>
<p>Example Requests:</p>
<div class=apiClick>self/pockets?command=delinkAccounts</div>
</div>
<div class="method-example">
<code class="method-declaration">POST https://DomainName/api/v1/self/pockets?command=delinkAccounts</code>
<code class="method-request">POST self/pockets?command=delinkAccounts
Content-Type: application/json
Request Body:

{ "pocketAccountMappingIds" :[8,9]
}
</code>
<code class="method-response">
{
"resourceId":10
}
</code>
</div>
</div>

<a id="retrievepocketaccounts" name="retrievepocketaccounts" class="old-syle-anchor">&nbsp;</a>
<div class="method-section">
<div class="method-description">
<h2>Retrieve accounts linked to pocket</h2>
<p>All linked loan </p>
<p>Example Requests:</p>
<div class=apiClick>self/pockets</div>
</div>
<div class="method-example">
<code class="method-declaration">POST https://DomainName/api/v1/self/pockets</code>
<code class="method-response">
{
"loanAccounts": [
{
"pocketId": 6,
"accountId": 11,
"accountType": 2,
"accountNumber": "000000011",
"id": 10
}
],
"savingsAccounts": [
{
"pocketId": 6,
"accountId": 2,
"accountType": 3,
"accountNumber": "000000002",
"id": 11
}
],
"shareAccounts": []
}
</code>
</div>
</div>
<!-- end of Customer Self Service APIs-->
</div>
<!-- main-content-wrapper -->
Expand Down
11 changes: 8 additions & 3 deletions fineract-provider/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ sourceCompatibility = JavaVersion.VERSION_1_8
/* define binary compatibility version */
targetCompatibility = JavaVersion.VERSION_1_8

project.ext.springBootVersion = '1.1.6.RELEASE'
project.ext.springVersion = '4.0.7.RELEASE'
project.ext.springBootVersion = '1.2.8.RELEASE'
project.ext.springVersion = '4.1.9.RELEASE'
project.ext.springOauthVersion = '2.0.4.RELEASE'
project.ext.jerseyVersion = '1.17'
project.ext.springDataJpaVersion = '1.7.0.RELEASE' // also change spring-boot-gradle-plugin version above
Expand Down Expand Up @@ -92,6 +92,7 @@ rat {
excludes = [
'**/licenses/**',
'**/*.md',
'**/*.github/*',
'**/MANIFEST.MF',
'**/*.txt',
'**/*.log',
Expand All @@ -101,6 +102,8 @@ rat {
'**/.classpath',
'**/.project',
'**/.idea/**',
'**/*.ipr',
'**/*.iws',
'**/.settings/**',
'**/bin/**',
'**/.git/**',
Expand Down Expand Up @@ -155,7 +158,9 @@ rat {
'**/assets/html5shiv.js',

//BSD License
'**/assets/uglify.js'
'**/assets/uglify.js',
//Ignore out folder
'**/out/**'
]
}

Expand Down
2 changes: 1 addition & 1 deletion fineract-provider/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies {
}
tomcat "org.apache.tomcat:tomcat-dbcp:${tomcatVersion}"

providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat:${springBootVersion}")

providedCompile(
// [group: 'javax.servlet', name: 'servlet-api', version: '2.5'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1634,9 +1634,10 @@ public void testSavingsAccountPostInterestWithOverdraft() {
final String INTEREST_POSTING_DATE = dateFormat.format(interestPostingDate.getTime());
final String TODYS_POSTING_DATE = dateFormat.format(todysDate.getTime());
String withdrawBalance = "true";


if (TODYS_POSTING_DATE.equalsIgnoreCase(INTEREST_POSTING_DATE)) {
final SavingsAccountHelper validationErrorHelper = new SavingsAccountHelper(this.requestSpec, errorResponse);
final SavingsAccountHelper validationErrorHelper = new SavingsAccountHelper(this.requestSpec, responseSpec);
validationErrorHelper.closeSavingsAccountPostInterestAndGetBackRequiredField(savingsId, withdrawBalance,
CommonConstants.RESPONSE_ERROR, CLOSEDON_DATE);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void testSchedulerJobs() throws InterruptedException {
Thread.sleep(15000);
schedulerJob = this.schedulerJobHelper.getSchedulerJobById(this.requestSpec, this.responseSpec, jobId.toString());
Assert.assertNotNull(schedulerJob);
System.out.println("Job is Still Running");
System.out.println("Job " +jobId.toString() +" is Still Running");
}
ArrayList<HashMap> jobHistoryData = this.schedulerJobHelper.getSchedulerJobHistory(this.requestSpec, this.responseSpec,
jobId.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
Expand Down Expand Up @@ -136,17 +138,21 @@ public void testApplyAnnualFeeForSavingsJobOutcome() throws InterruptedException
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);

HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
String JobName = "Apply Annual Fee For Savings";

this.schedulerJobHelper.executeJob(JobName);
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, annualFeeChargeId);

Float chargeAmount = (Float) chargeData.get("amount");

final HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
Assert.assertEquals("Verifying Annual Fee after Running Scheduler Job for Apply Anual Fee", chargeAmount,
(Float) summaryAfter.get("totalAnnualFees"));
final HashMap savingsDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
final HashMap annualFeeDetails = (HashMap) savingsDetails.get("annualFee");
ArrayList<Integer> annualFeeDueDateAsArrayList = (ArrayList<Integer>) annualFeeDetails.get("dueDate");
LocalDate nextDueDateForAnnualFee = LocalDate.of(annualFeeDueDateAsArrayList.get(0), annualFeeDueDateAsArrayList.get(1), annualFeeDueDateAsArrayList.get(2));
LocalDate todaysDate = LocalDate.now(ZoneId.of("Asia/Kolkata"));

Assert.assertTrue("Verifying that all due Annual Fees have been paid ",
nextDueDateForAnnualFee.isAfter(todaysDate));

}

Expand Down
Loading

0 comments on commit 8dc8166

Please sign in to comment.