Compare commits

...
516 Commits
Author SHA1 Message Date
Vishwas Babu A J aa9643429b Merge pull request #938 from pramodn02/MIFOSX-1274
MIFOSX-1274,MIFOSX-1268 : added check for negative account balance while...
2014-06-10 16:50:32 -07:00
Pramod Nuthakki 21de2bd5ab MIFOSX-1274,MIFOSX-1268 : added check for negative account balance while creating active savings account 2014-06-11 03:44:16 +05:30
Vishwas Babu A J 1f86299cf1 Merge pull request #937 from pramodn02/MIFOSX-1270
MIFOSX-1270 : corrected accounting for  activation charge
2014-06-10 14:50:48 -07:00
Pramod Nuthakki 38c6702cae MIFOSX-1270 : corrected accounting for activation charge 2014-06-11 02:47:28 +05:30
Vishwas Babu A J 123a59f2e7 Merge pull request #935 from pramodn02/MIFOSX-1306
MIFOSX-1306 : added check to identify account transfer
2014-06-10 12:22:38 -07:00
Pramod Nuthakki 84f0aaf32a MIFOSX-1306 : added check to identify account transfer 2014-06-11 00:10:39 +05:30
Vishwas Babu A J 6df2f48bc9 Merge pull request #933 from lingalamadhukar/MIFOSX-1267
MIFOSX-1260,MIFOSX-1287,MIFOSX-1311
2014-06-10 07:55:38 -07:00
Madhukar d743c3e5f9 MIFOSX-1260,MIFOSX-1311
MIFOSX-1260,MIFOSX-1287
2014-06-10 18:07:20 +05:30
Vishwas Babu A J 45e12ac91e Merge pull request #931 from pramodn02/latest
MIFOSX-1313 :  changes for interest  incentives
2014-06-09 22:06:20 -07:00
Pramod Nuthakki 77e23c8e9d MIFOSX-1313 : changes for interest incentives 2014-06-10 03:01:28 +05:30
Vishwas Babu A J 8bd0e29ba5 MIFOSX-1183 and adding upfront accrual transaction back for cash based and no accounting rules 2014-06-08 03:24:18 -07:00
Vishwas Babu A J 59c8671522 removed addition of main compile classpath to test compile classpath 2014-06-07 10:56:43 -07:00
Vishwas Babu A J 2d7c828eee Merge pull request #929 from vishwasbabu/develop
augument runtime and compile classpath for integration tests to include ...
2014-06-07 10:54:40 -07:00
Vishwas Babu A J f9397725cd augument runtime and compile classpath for integration tests to include main and test 2014-06-07 10:50:21 -07:00
Vishwas Babu A J 6c52c91dbe Merge pull request #928 from lingalamadhukar/MIFOSX-1267
Bug Fixes for 1.23 release
2014-06-07 00:35:49 -07:00
Madhukar 325c87b121 Bug Fixes for 1.23 release 2014-06-07 01:43:31 +05:30
Vishwas Babu A J 8e61abe4ed removing most warnings in ppi/survey related code 2014-06-06 11:23:50 -07:00
Vishwas Babu A J b63364962d resolving compilation errors in survey integration test 2014-06-05 21:27:12 -07:00
Vishwas Babu A J 10fd3be477 MIFOSX-merging musonis work around ppi 2014-06-05 21:06:30 -07:00
Vishwas Babu A J 941d732cfb Merge branch 'MIFOSX-1023' of git://github.com/Musoni/mifosx into Musoni-MIFOSX-1023 2014-06-05 18:49:13 -07:00
Vishwas Babu A J 4e53e3b94d changing visibility of lockinPeriodFrequencyTypeValue variable in DepositAccountAssembler 2014-06-05 14:39:25 -07:00
Vishwas Babu A J d41cea8d46 Merge pull request #927 from lingalamadhukar/MIFOSX-1267
MIFOSX-1288,MIFOSX-1280,build#699 testcase fixes
2014-06-05 14:37:04 -07:00
Madhukar 43225c38f6 MIFOSX-1288,MIFOSX-1280,build#699 testcase fixes 2014-06-05 15:10:02 +05:30
Vishwas Babu A J 7dcb9913a4 bumping up version number for sql patch related to accounting cleanup for transfers 2014-06-04 18:09:56 -07:00
Vishwas Babu A J 03028fc4ee merging pramods pr around account transfers accounting clean up 2014-06-04 18:07:24 -07:00
Vishwas Babu A J 19833af1a9 Merge pull request #926 from lingalamadhukar/MIFOSX-1267
MIFOSX-1267 and fix for view loan audit entry
2014-06-04 09:00:30 -07:00
Madhukar 4c9ccd2d53 MIFOSX-1267 and fix for view loan audit entry 2014-06-04 09:24:05 +05:30
Vishwas Babu A J 75ac5c2d68 renaming get_url to url in Audit Data response 2014-06-03 17:56:07 -07:00
Vishwas Babu A J adc42ddaf1 Merge pull request #917 from ashok-conflux/NBLMS-9
added api_get_url value to audit api response data
2014-06-03 17:43:00 -07:00
Vishwas Babu A J 528423ddc2 Merge pull request #925 from lingalamadhukar/MIFOSX-1166
MIFOSX-1216 and loan integration tests with accounting
2014-06-03 06:17:22 -07:00
Madhukar d80e574b3b MIFOSX-1216 and loan integration tests with accounting 2014-06-03 10:36:12 +05:30
Vishwas Babu A J a3a414ff0a Merge pull request #924 from lingalamadhukar/MIFOSX-1242
MIFOSX-1245,MIFOSX-1244,MIFOSX-1243,MIFOSX-1242,MIFOSX-1241,MIFOSX-1240
2014-06-02 16:15:48 -07:00
Madhukar 95e78699d6 MIFOSX-1245,MIFOSX-1244,MIFOSX-1243,MIFOSX-1242,MIFOSX-1241,MIFOSX-1240 2014-06-02 11:05:55 +05:30
Vishwas Babu A J 761c3b1e8d Merge pull request #918 from Nayan/MIFOSX-1228
#MIFOSX-1228 Templates should not show inactive staff under staff drop down
2014-05-28 11:47:05 +05:30
Vishwas Babu A J d59683c9f8 Merge pull request #920 from ashok-conflux/CONFLUX-39-CR
Added support to mandatory savings
2014-05-28 11:45:07 +05:30
Pramod Nuthakki c7e7a00071 API doc changes 2014-05-28 00:17:58 +05:30
Pramod Nuthakki 6fc0c1b4a5 MIFOSX-695 - accounting changes for account transfers 2014-05-27 18:55:30 +05:30
Vishwas Babu A J 00a10a31ac Merge pull request #922 from lingalamadhukar/MIFOSX-1237
FIXED MIFSOX-1237,MIFOSX-1238
2014-05-26 19:13:10 +05:30
Madhukar 45d4eb43d5 FIXED MIFSOX-1237,MIFOSX-1238 2014-05-26 16:00:28 +05:30
ashok-conflux 2f8278331e Added support to mandatory savings 2014-05-24 21:47:11 +05:30
goutham-M bd8aa4e7ca Templates should not show inactive staff under staff drop down 2014-05-23 17:39:52 +05:30
ashok-conflux a88bad2a7f added api_get_url value to audit api response data 2014-05-23 11:57:43 +05:30
Vishwas Babu A J b2131b52a7 Merge pull request #915 from Vishwa1311/MIFOSX-1208
[MIFOSX-1208] Issue with retrieving datatables for offices has been fixed
2014-05-21 12:18:02 +05:30
Vishwa1311 1dddcae84a [MIFOSX-1208] Issue with retrieving datatables for offices has been fixed 2014-05-20 15:02:12 +05:30
CieyouRaoul 1ca510b0ca work in porgress integration test 2014-05-20 10:08:54 +02:00
Vishwas Babu A J f67b82d0b9 Merge pull request #914 from lingalamadhukar/dailycheck
MIFOSX-1203 and test case fix for build history 692
2014-05-19 15:36:00 +05:30
Madhukar de7c25635c MIFOSX-1203 and test case fix for build history 692 2014-05-19 12:06:26 +05:30
Vishwas Babu A J 64c8121362 Merge pull request #911 from pramodn02/MIFOSX-1200
MIFOSX-1200 : corrected openning balance while calculations
2014-05-19 09:55:11 +05:30
Vishwas Babu A J 9c9c24060f Merge pull request #910 from lingalamadhukar/MIFOSX-1166
Integration tests for loan accounting flow
2014-05-19 09:53:42 +05:30
Vishwas Babu A J c3cd9aacbf Merge pull request #912 from pramodn02/MIFOSX-1196
MIFOSX-1196 - corrected the validation for update
2014-05-19 09:52:13 +05:30
Vishwas Babu A J a86ef1da2d Merge pull request #913 from pramodn02/MIFOSX-1187
MIFOSX-1187 - added null checks before compare with min and max values
2014-05-19 09:48:05 +05:30
Pramod Nuthakki 99822a32e2 MIFOSX-1187 - added null checks before compare with min and max values 2014-05-15 22:21:04 +05:30
CieyouRaoul 712b5e000c implement jpa for likelihood write operation, set default value for registered table category, add likelihood table sql 2014-05-15 13:32:24 +02:00
Vishwas Babu A J 0a3e039122 cleaning up PR for MIFOSX-709 2014-05-15 13:01:34 +05:30
Vishwas Babu A J b2771704f6 Merge pull request #909 from erikbarbara/MIFOSX-709
MIFOSX-709: adding functionality to prevent closing of client with overd...
2014-05-15 12:33:17 +05:30
Pramod Nuthakki ae035ff2c9 MIFOSX-1200 : corrected openning balance while calculations 2014-05-14 23:00:49 +05:30
Pramod Nuthakki 99025b4eb3 MIFOSX-1196 - corrected the validation for update 2014-05-14 21:43:11 +05:30
Madhukar 38b5047bfe Integration tests for loan accounting flow 2014-05-14 12:45:32 +05:30
Erik Barbara ab23a26ab2 MIFOSX-709: adding functionality to prevent closing of client with overdue loan 2014-05-13 20:29:40 -04:00
Vishwas Babu A J 363ca7dc0e Merge pull request #902 from vorburger/JobLogImprovementIllustratingBug
JobRegisterServiceImpl error logging improvement
2014-05-11 03:39:01 +05:30
Michael Vorburger b0132db815 Logging 2x, for otherwise silent failures in a) initial loadAllJobs(),
and b) subsequent manual executeJob()
2014-05-11 00:01:07 +02:00
Vishwas Babu A J 9e8ead2045 Merge pull request #901 from lingalamadhukar/MIFOSX-1166
Update users api docs with staff details
2014-05-11 01:13:34 +05:30
Madhukar 0a9de45ced Update users api docs with staff details 2014-05-10 13:39:33 +05:30
Vishwas Babu A J 7ff989dbe0 Merge pull request #900 from vorburger/newKeystoreToReplacedExpiredCert
keystore.jks with new self-signed cert
2014-05-10 12:10:29 +05:30
Michael Vorburger 490512eb35 keystore.jks with new self-signed cert, as the old one expired (http://blog2.vorburger.ch/2014/05/how-to-renew-expired-self-signed-ssl.html) 2014-05-10 00:42:13 +02:00
Vishwas Babu A J 7f25cc3a91 fixing compilation issues 2014-05-09 20:12:19 +05:30
Vishwas Babu A J a37edf45d8 resoving merge conflicts with MIFOSX-1182 2014-05-09 19:26:48 +05:30
Vishwas Babu A J 4d2913be8f Merge branch 'develop' of git://github.com/pramodn02/mifosx into pramodn02-develop 2014-05-09 19:16:06 +05:30
Vishwas Babu A J c0a6ed8081 Merge pull request #898 from Vishwa1311/NEW-ONE-MIFOSX-1117
[MIFOSX-1117] JUnit Test Cases for FD and RD accounts
2014-05-09 18:16:52 +05:30
Vishwas Babu A J c7e21fc39d cleaning up MIFOSX-1024 2014-05-09 18:07:50 +05:30
andrew-dzakandVishwas Babu A J e2a9d8afbc fixing merge issues with MIFOSX-1024 2014-05-09 18:00:34 +05:30
Vishwa1311 7dd49de5af [MIFOSX-1117] FD RD Test Cases 2014-05-09 17:27:41 +05:30
Pramod Nuthakki 00f91c8c6e MIFOSX-1182 - added support for interest transfer on fixed deposit account 2014-05-09 17:21:49 +05:30
Vishwas Babu A J 9472ec236c cleaning up commit for MIFOSX-982 2014-05-09 14:50:44 +05:30
Ishan KhannaandVishwas Babu A J cf4bf988a4 MIFOSX-982 Issue Fix
Updated Fix
2014-05-09 14:50:34 +05:30
Vishwas Babu A J 67ec9163bd Merge pull request #896 from lingalamadhukar/MIFOSX-1166
MIFOSX-281 Add template for recovery payments
2014-05-06 18:25:26 +05:30
Madhukar 466f3f8b95 MIFOSX-281 Add template for recovery payments 2014-05-06 18:20:22 +05:30
Vishwas Babu A J 37e84789c2 Merge pull request #895 from vishwasbabu/develop
MIFOSX-281 adding accrual accounting support
2014-05-06 18:16:34 +05:30
Vishwas Babu A J 6ddacc7cdb MIFOSX-281 adding accrual accounting support 2014-05-06 18:15:22 +05:30
Vishwas Babu A J 6b33966b54 Merging Michael's changes around FD and RD 2014-05-06 15:53:01 +05:30
Vishwas Babu A J 285cce1bf8 fix for MIFOSX-1019 2014-05-05 21:20:21 +05:30
Vishwas Babu A J a0c26c65d9 Merge pull request #893 from lingalamadhukar/MIFOSX-1166
MIFOSX-1166 Rename sql schema name
2014-05-05 17:51:20 +05:30
Vishwas Babu A J 62e4b6f6e3 Merge pull request #892 from lingalamadhukar/Docs
Update API docs
2014-05-05 17:50:40 +05:30
Madhukar 9c7c81d93b MIFOSX-1166 Rename sql schema name 2014-05-05 12:29:47 +05:30
Madhukar 9327f1eef0 Update API docs
Update collection sheet api-doc
2014-05-05 12:17:00 +05:30
Vishwas Babu A J 0e93b4a4df cleaning up recovery payments functionality 2014-05-04 18:02:59 +05:30
Vishwas Babu A J 52d140bb17 correcting error message for MIFOSX-1163 2014-05-04 14:27:09 +05:30
Vishwas Babu A J 5343b3c676 Merge pull request #890 from pramodn02/develop
MIFOSX-1163 : added functionality to transfer fixed deposit amount from ...
2014-05-04 14:21:28 +05:30
Vishwas Babu A J d57d1c7d88 Merge pull request #891 from pramodn02/MIFOSX-1162
MIFOSX-1162 : removed overdue loan charge on undo disburse
2014-05-04 14:01:29 +05:30
Pramod Nuthakki 68216e5652 MIFOSX-1163 - corrected accounting entries 2014-05-03 02:04:42 +05:30
Pramod Nuthakki 29478ca023 MIFOSX-1162 : removed overdue loan charge on undo disburse 2014-05-03 01:07:01 +05:30
Pramod Nuthakki 3677d4eb53 MIFOSX-1163 : added functionality to transfer fixed deposit amount from savings account 2014-05-02 11:26:48 +05:30
Vishwas Babu A J 78c0761ae5 cleaning up sample data for 1.22.0 release 2014-05-01 16:44:56 +05:30
Vishwas Babu A J 742c357dfb Update CHANGELOG.md
with details of dropped tables in 1.22.0 release
2014-05-01 16:36:33 +05:30
Michael Duku-Kaakyire 31a6e07e87 Advanced deposit products and accounts (FD & RD) with interest rate
extensions bug fixes
2014-04-30 21:42:56 +00:00
Vishwas Babu A J a109a1cee9 Merge pull request #887 from lingalamadhukar/FDProduct
Added deposit amount fields in Read FD Product
2014-04-30 21:16:05 +05:30
Madhukar 697a322210 Added deposit amount fields in Read deposit 2014-04-30 20:02:13 +05:30
Vishwas Babu A J 1986047ae1 commenting out unused rd validation 2014-04-30 18:59:30 +05:30
Vishwas Babu A J 1b4e03aa6e fix warnings in savings code 2014-04-30 17:48:53 +05:30
Vishwas Babu A J b69b071ffe null checks for fixing failing test cases in RD 2014-04-30 17:46:18 +05:30
Vishwas Babu A J 508fe4b60d adding null check for fixed deposit suggested amount for failing test cases 2014-04-30 17:40:33 +05:30
Vishwas Babu A J 656fc88aae updating release number to 1.22.0 2014-04-30 17:04:27 +05:30
Vishwas Babu A J e49f44b811 Update CHANGELOG.md
for 1.22.0 release
2014-04-30 15:50:58 +05:30
Vishwas Babu A J 4f3b7f91a1 Merge pull request #886 from Vishwa1311/MIFOSX-1117
[MIFOSX-1117] Fixed test case failure issue
2014-04-30 15:19:54 +05:30
Vishwa1311 8191ef0211 [MIFOSX-1117] Fixed test case failure issue 2014-04-30 15:14:43 +05:30
Vishwas Babu A J d033ea22ca Merge pull request #885 from vishwasbabu/develop
fixing test failure in fd and rd
2014-04-29 21:23:30 +05:30
Vishwas Babu A J 166a381556 fixing test failure in fd and rd 2014-04-29 21:17:49 +05:30
Vishwas Babu A J 5cf6b9a34e Merge pull request #883 from lingalamadhukar/MIFOSX-885
Update Api docs
2014-04-29 20:44:07 +05:30
Madhukar f5e9342446 Update Api docs 2014-04-29 16:57:14 +05:30
Vishwas Babu A J 1af5b5043d Merge pull request #880 from michaeldk-miagstan/michael-miagstan-github
Advanced deposit products and accounts (FD & RD) with interest rate extensions
2014-04-29 10:24:17 +05:30
Vishwas Babu A J bec0a36644 Merge pull request #882 from pramodn02/develop
MIFOSX-1146: added support for disbursing loan amount to savings account
2014-04-29 09:42:12 +05:30
Pramod Nuthakki d34dcb1037 MIFOSX-1146: added support for disbursing loan amount to savings account 2014-04-28 21:26:57 +05:30
Vishwas Babu A J f0bfec3459 Merge pull request #881 from vishwasbabu/develop-new
MIFOSX-865 bug fixes for accruals batch job
2014-04-28 18:16:05 +05:30
Vishwas Babu A J dcee94e732 MIFOSX-865 bug fixes for accruals batch job 2014-04-28 18:13:54 +05:30
Michael Duku-Kaakyire e9b8294f80 Advanced deposit products and accounts (FD & RD) with interest rate
slabs extensions
2014-04-28 08:22:25 +00:00
Vishwas Babu A J 3cc95e3cf1 Merge pull request #876 from pramodn02/MIFOSX-1094
MIFOSX-1094 - changes for passing DB url as param
2014-04-26 23:17:30 -07:00
Pramod Nuthakki f8416fe714 MIFOSX-1094 - changes for passing DB url as param 2014-04-25 17:53:58 +05:30
Vishwas Babu A J dca28356ba Merge pull request #870 from ashok-conflux/CONFLUX-39-api-1
API documentation updated for FD and RD
2014-04-23 01:06:54 -07:00
Vishwas Babu A J b81a3ed502 Merge pull request #875 from ashok-conflux/CONFLUX-39-testcase-fix
fixed failing Post Interest Test case
2014-04-22 23:45:10 -07:00
ashok-conflux c452340e2e fixed failing Post Interest Test case 2014-04-23 12:12:52 +05:30
Vishwas Babu A J a7cee7ee8e Merge pull request #874 from pramodn02/MIFOSX-1056
MIFOSX-1056 - changed to use create validation from preview
2014-04-22 18:19:38 -07:00
Vishwas Babu A J 6069379af9 Merge pull request #872 from pramodn02/MIFOSX-1076
added loan charge junits
2014-04-22 18:18:30 -07:00
Pramod Nuthakki a032ad2133 MIFOSX-1056 - changed to use create validation from preview 2014-04-22 22:31:36 +05:30
andrew-dzak ece7c9a600 mifosx-281 done 2014-04-22 11:55:49 +02:00
Pramod Nuthakki 40c6223d8c added loan charge junits 2014-04-21 22:08:30 +05:30
Vishwas Babu A J bf6ffb27eb Merge pull request #869 from pramodn02/MIFOSX-1076
MIFOSX-1076 - Added recalculation of charges on updating amount
2014-04-20 09:09:07 -07:00
Vishwas Babu A J 9399314ed4 Merge pull request #871 from Vishwa1311/MIFOSX-1117
[MIFISX-1117] JUnit Test Cases for Fixed and Recurring deposits
2014-04-20 08:50:42 -07:00
Vishwanath R 3bca8e3215 [MIFISX-1117] JUnit Test Cases for Fixed and Recurring deposits 2014-04-20 13:35:22 +05:30
ashok-conflux 09cbbcd70d API documentation updated for FD and RD 2014-04-19 18:10:47 +05:30
Pramod Nuthakki d4c897af8b MIFOSX-1076 - Added recalculation of charges on updating amount 2014-04-18 23:43:08 +05:30
Vishwas Babu A J 84f2ccfb85 Merge pull request #865 from ashok-conflux/CONFLUX-39-JobChanges
Removed duplicate Job POST_INTEREST_FOR_SAVINGS
2014-04-17 13:19:38 -07:00
Vishwas Babu A J fdf04dfe0a Merge pull request #866 from pramodn02/MIFOSX-1077
MIFOSX-1077- added installment charge check to aviod wrong calculation
2014-04-17 13:18:59 -07:00
Pramod Nuthakki 9279446833 MIFOSX-1077- added installment charge check to aviod wrong calculation 2014-04-18 00:46:23 +05:30
ashok-conflux 23751e7017 Removed duplicate Job POST_INTEREST_FOR_SAVINGS 2014-04-17 20:25:24 +05:30
Vishwas Babu A J 70693283d5 Merge pull request #862 from pramodn02/MIFOSX-1090
MIFOSX-1090 - moved saving of loan out of upfront accrual check
2014-04-16 12:17:47 -07:00
Vishwas Babu A J a0749d26d1 Merge pull request #863 from pramodn02/MIFOSX-1093
MIFOSX-1093- modified scheduler jobs for performence issues
2014-04-16 12:16:31 -07:00
Pramod Nuthakki 7c399ce653 MIFOSX-1093- modified scheduler jobs for performence issues 2014-04-16 23:04:20 +05:30
Pramod Nuthakki 4e3289621c MIFOSX-1090 - moved saving of loan out of upfront accrual check 2014-04-16 18:39:44 +05:30
Vishwas Babu A J e60c4ec40d Merge pull request #861 from ashok-conflux/CONFLUX-39-1
Advanced deposit products and accounts (FD & RD) with interest rate slabs
2014-04-15 18:58:00 -07:00
ashok-conflux 75635b3b6f Advanced deposit products and accounts (FD & RD) with interest rate slabs 2014-04-15 20:36:28 +05:30
Vishwas Babu A J d1e74d72d6 adding details of new optional field overdueDaysForNPA to loan product definition 2014-04-15 05:45:24 -07:00
Vishwas Babu A J 131c87c163 Merge pull request #860 from vishwasbabu/develop
update loan product api docs to reflect upfront and periodic accrual acc...
2014-04-15 03:13:32 -07:00
Vishwas Babu A J d10c27bd16 update loan product api docs to reflect upfront and periodic accrual accounting 2014-04-15 03:12:02 -07:00
Vishwas Babu A J 9a26ba50ff Merge pull request #859 from pramodn02/MIFOSX-1081
MIFOSX-1081 - Added Non Performing assets to Loan
2014-04-14 13:32:39 -07:00
Pramod Nuthakki 025e727757 MIFOSX-1081 - Added Non Performing assets to Loan 2014-04-15 00:16:14 +05:30
Vishwas Babu A J b85c47ad75 MIFOSX-865 update validation to allow two flavours of accrual accounting 2014-04-13 11:56:52 -07:00
Vishwas Babu A J e82bffa944 MIFOSX-865 update test case to use UPFRONT_ACCRUALS 2014-04-13 10:59:01 -07:00
Vishwas Babu A J b30aa2839e Merge pull request #856 from vishwasbabu/develop
MIFOSX-865 introduce new transaction type for accrual and deprecate inte...
2014-04-13 01:11:07 -07:00
Vishwas Babu A J 739ca7897a MIFOSX-865 introduce new transaction type for accrual and deprecate interest applied and charge applied transaction types 2014-04-13 01:08:27 -07:00
Vishwas Babu A J 33ae3b6365 Merge pull request #855 from Vishwa1311/MIFOSX-1047
[MIFOSX-1047] Added test cases for Apply Penalty to overdue loans Job
2014-04-12 17:04:16 -07:00
Vishwa1311 ea6842eced [MIFOSX-1047] Added test cases for Apply Penalty to overdue loans Job 2014-04-12 19:42:16 +05:30
Vishwas Babu A J bf04f97333 MIFOSX-865: fixing failing testing cases for accrual accounting 2014-04-11 17:36:38 -07:00
Vishwas Babu A J 4a0eae6fa1 MIFOSX-865: compilation issues with batch job for accruals for periodic posting 2014-04-11 14:37:54 -07:00
Vishwas Babu A J 304fde46bd Merge pull request #854 from vishwasbabu/develop
MIFOSX-865: initial work around adding support for accrual accounting
2014-04-11 14:28:40 -07:00
Vishwas Babu A J fbc55d5dd1 MIFOSX-865: initial work around adding support for accrual accounting 2014-04-11 14:25:29 -07:00
Vishwas Babu A J 9ddec84740 Merge pull request #850 from smhom/MIFOSX-1046
MIFOSX-1046
2014-04-11 12:42:14 -07:00
Vishwas Babu A J 64d27951a3 Merge pull request #853 from pramodn02/MIFOSX-1075
MIFOSX-1075- added overdue penalty batch job in DB
2014-04-11 12:39:28 -07:00
Vishwas Babu A J ccde8666e0 Merge pull request #851 from pramodn02/MIFOSX-1074
MIFOSX-1074 - Added batch job for accrual accounting journal entry
2014-04-11 12:39:22 -07:00
Vishwas Babu A J 098060a44b Merge pull request #852 from Vishwa1311/MIFOSX-1047
[MIFOSX-1047] Updated and Completed JUnit Test Cases for Scheduler Jobs
2014-04-11 12:39:08 -07:00
Pramod Nuthakki 506721a5d8 MIFOSX-1075- added overdue penalty batch job in DB 2014-04-11 19:56:33 +05:30
Pramod Nuthakki a9eb4e4f4d MIFOSX-1074 - Added batch job for accrual accounting journal entry 2014-04-11 19:06:31 +05:30
Vishwa1311 f8f3ddc069 [MIFOSX-1047] Updated and Completed JUnit Test Cases for Scheduler Jobs 2014-04-11 18:51:08 +05:30
Sherry Hom 20b0251a9e MIFOSX-1046
JUnit test cases for code and code values API's
2014-04-10 23:47:19 -07:00
Vishwas Babu A J 8dd9bfc087 cleaning up warnings in account transfers 2014-04-10 13:53:57 -07:00
CieyouRaoul c1acf1baae modified the ppi call to retrieve ppi entry. instead of returning the entry of the active ppi now return all the entries of a user 2014-04-10 12:22:40 +02:00
Vishwas Babu A J a4ec520853 Merge pull request #848 from lingalamadhukar/MIFOSX-1049
MIFOSX-1027 Adding missed subresources
2014-04-09 21:58:50 -07:00
Madhukar 145318c260 MIFOSX-1027 Adding missed subresources 2014-04-10 09:59:51 +05:30
Vishwas Babu A J 179e1e087f Merge pull request #847 from Vishwa1311/MIFOSX-1047
[MIFOSX-1047] Updated Test Cases for Scheduler Jobs
2014-04-09 10:00:48 -07:00
Vishwa1311 2489997e8b [MIFOSX-1047] Updated Test Cases for Scheduler Jobs 2014-04-09 19:48:13 +05:30
Vishwas Babu A J 594d54f099 Merge pull request #846 from pramodn02/MIFOSX-1025
MIFOSX-1055 - added standing instructions
2014-04-08 13:25:37 -07:00
Vishwas Babu A J 6638bf87e4 Merge pull request #845 from Vishwa1311/MIFOSX-1047
[MIFOSX-1047] Fixed failure Test Cases and updated Scheduler Job Test Cases
2014-04-08 13:22:01 -07:00
Pramod Nuthakki 209dd48031 MIFOSX-1055 - added standing instructions 2014-04-08 23:01:10 +05:30
Vishwa1311 b59bcbff09 [MIFOSX-1047] Fixed failure Test Cases and updated Scheduler Job Test Cases 2014-04-08 20:16:14 +05:30
Vishwas Babu A J b9bfced9c5 Merge pull request #843 from lingalamadhukar/MIFOSX-1049
MIFOSX-1053 Fix PAY_DUE_SAVINGS_CHARGES job
2014-04-07 17:59:28 -07:00
Vishwas Babu A J e385185892 Merge pull request #844 from Vishwa1311/MIFOSX-1047
[MIFOSX-1047] New udated Test Cases for Scheduler Jobs
2014-04-07 17:58:30 -07:00
Vishwa1311 d842dee5dd [MIFOSX-1047] New udated Test Cases for Scheduler Jobs 2014-04-07 20:05:09 +05:30
Madhukar 23759af6e0 MIFOSX-1053 Fix PAY_DUE_SAVINGS_CHARGES job 2014-04-07 12:47:43 +05:30
Vishwas Babu A J bf67700e67 Update INSTALL.md
and fix typos
2014-04-04 22:45:15 -07:00
Vishwas Babu A J 1d0b202806 Update INSTALL.md
with reference to sample data
2014-04-04 22:43:55 -07:00
Vishwas Babu A J 1fdbc59e86 Update INSTALL.md
with details of loading sample data
2014-04-04 22:42:03 -07:00
Vishwas Babu A J 40efe1c100 Merge pull request #842 from Vishwa1311/MIFOSX-1047
[MIFOSX-1047] Updated JUnit Test Cases for Scheduler Jobs
2014-04-04 18:01:37 -07:00
Vishwas Babu A J 1bd685e980 Merge pull request #841 from goutham-M/mifosx-collectionsheer-1041
mifosx-1041 collection sheet issue fix
2014-04-04 18:00:16 -07:00
Vishwa1311 9c4ef176ec [MIFOSX-1047] Updated JUnit Test Cases for Scheduler Jobs 2014-04-04 19:42:28 +05:30
goutham-M c6f4a085db mifosx-1041 collection sheet issue fix 2014-04-04 17:47:34 +05:30
Vishwas Babu A J 25c35b60d5 Merge pull request #838 from Vishwa1311/MIFOSX-1047
[MIFOSX-1047] Latest updated Scheduler Job test cases
2014-04-03 21:56:46 -07:00
Vishwa1311 b8668af49c [MIFOSX-1047] Latest updated Scheduler Job test cases 2014-04-03 20:01:46 +05:30
andrew-dzak 0426325e03 MIFOSX-1023 2014-04-03 15:27:05 +02:00
Vishwas Babu A J 872074fe8e Merge pull request #836 from lingalamadhukar/MIFOSX-1049
MIFOSX-1008 post journalentries if earned interest is > 0
2014-04-03 00:32:01 -07:00
Madhukar e5316d3559 MIFOSX-1008 post journalentries if earned interest is > 0 2014-04-03 12:10:54 +05:30
Vishwas Babu A J 235d4f010c Merge pull request #833 from lingalamadhukar/MIFOSX-1027
MIFOSX-1027 Fixing issues with maker checker
2014-04-02 09:40:47 -07:00
Vishwas Babu A J 155cfce9b2 Merge pull request #834 from Vishwa1311/MIFOSX-1047
[MIFOSX-1047] Updated Test Cases for Scheduler Jobs
2014-04-02 09:35:25 -07:00
Vishwas Babu A J 693d75a67c Merge pull request #835 from lingalamadhukar/MIFOSX-1049
MIFOSX-1049 mifosx_sample_data
2014-04-02 09:33:22 -07:00
Madhukar a64c31fd76 MIFOSX-1049 mifosx_sample_data 2014-04-02 21:05:25 +05:30
Vishwa1311 77082ab6a0 [MIFOSX-1047] Updated Test Cases for Scheduler Jobs 2014-04-02 19:35:41 +05:30
Madhukar 1c49268e77 MIFOSX-1027 Fixing issues with maker checker 2014-04-02 13:09:00 +05:30
Vishwas Babu A J 1091eff2bf Merge pull request #829 from lingalamadhukar/MIFOSX-1008
MIFOSX-998,MIFOSX-1008 Interest posting issue
2014-04-01 20:44:53 -07:00
Vishwas Babu A J 591080b843 Merge pull request #832 from Vishwa1311/MIFOSX-1047
[MIFOSX-1047] JUnit test cases for Scheduler Jobs
2014-04-01 11:17:32 -07:00
Vishwas Babu A J bf5b6f695e Merge pull request #830 from Vishwa1311/MIFOSX-1035
[MIFOSX-1035] Updated Test Cases for Charges
2014-04-01 11:15:56 -07:00
Vishwa1311 9cd7a9fe0d [MIFOSX-1047] JUnit test cases for Scheduler Jobs 2014-04-01 19:23:57 +05:30
Vishwas Babu A J c007785fba Update README.md
with minor edits
2014-03-31 15:33:06 -07:00
Vishwas Babu A J bed30fcd47 fixing typos in install.md 2014-03-31 15:28:34 -07:00
Vishwas Babu A J 2de2bb95c4 update the readme for community apps 2014-03-31 15:20:24 -07:00
Vishwas Babu A J f1c2c4a519 fix insert script for mifosplatform-tenants database 2014-03-31 15:13:15 -07:00
Vishwas Babu A J 954d65c83a Update INSTALL.md
move reference to database updates to section  2.2.2
2014-03-31 15:02:01 -07:00
Vishwas Babu A J b8042daa67 Update INSTALL.md
with instructions for those upgrading an existing Mifosx installation to version 1.21.* or higher
2014-03-31 14:44:20 -07:00
Vishwas Babu A J a997e0ac5d Update README.md
with links to API docs
2014-03-31 14:32:27 -07:00
Vishwas Babu A J e323fe8fc4 bump up the release number to 1.21.0 2014-03-31 14:19:07 -07:00
Vishwas Babu A J 7631a00398 Update CHANGELOG.md
for 1.21.0 RELEASE
2014-03-31 14:03:02 -07:00
Vishwas Babu A J efb83a8b82 Update README.md
and strike out the reference app link
2014-03-31 13:42:13 -07:00
Vishwas Babu A J a2bc6b61ad Update README.md
and update links to community and demo app
2014-03-31 13:40:36 -07:00
Vishwas Babu A J 4ce27ba0f3 updating insert script for tenants table 2014-03-31 13:37:38 -07:00
Vishwa1311 6d6c7af5fd [MIFOSX-1035] Updated Test Cases for Charges 2014-03-29 19:15:32 +05:30
Madhukar 646956ac99 MIFOSX-998,MIFOSX-1008 Interest posting issue 2014-03-29 12:21:04 +05:30
Vishwas Babu A J dccbec3701 Merge pull request #828 from Vishwa1311/MIFOSX-1026-1
[MIFOSX-1026] Failure test cases has been fixed
2014-03-28 22:39:02 -07:00
Vishwas Babu A J 10b0baf349 Update INSTALL.md
and remove references to deprecated Reference App
2014-03-28 22:33:44 -07:00
Vishwa1311 67b4442c03 [MIFOSX-1026] Failure test cases has been fixed 2014-03-29 11:01:00 +05:30
Vishwas Babu A J fff47689f7 Merge pull request #827 from Vishwa1311/MIFOSX-1035
[MIFOSX-1035] JUnit Test Cases for Charges
2014-03-28 19:32:59 -07:00
Vishwas Babu A J d2289689c4 Merge pull request #826 from Vishwa1311/MIFOSX-1026_1
[MIFOSX-1026] JUnit Test Cases for Global Configuration
2014-03-28 19:31:58 -07:00
Vishwa1311 7c3d011db0 [MIFOSX-1035] JUnit Test Cases for Charges
[MIFOSX-1035] JUnit Test Cases for Charges
2014-03-28 19:19:38 +05:30
Vishwa1311 d926822573 [MIFOSX-1026] JUnit Test Cases for Global Configuration
[MIFOSX-1026] JUnit Test Cases for Global Configuration
2014-03-28 19:04:06 +05:30
Vishwas Babu A J c9be118c32 Merge pull request #825 from Vishwa1311/MIFOSX-1003
[MIFOSX-1003] All the failing test cases has been fixed
2014-03-28 00:33:25 -07:00
Vishwa1311 59b7acee94 [MIFOSX-1003] Failing test cases has been fixed 2014-03-28 12:03:04 +05:30
Vishwas Babu A J 66178b27a4 Merge pull request #823 from lingalamadhukar/MIFOSX-998
Activation permission check for group and center
2014-03-27 04:02:09 -07:00
Madhukar d8528aa96c Activation permission check for group and center 2014-03-27 15:58:51 +05:30
Vishwas Babu A J 7319c21890 minor refactor for LoanWritePlatformServiceJpaRepositoryImpl 2014-03-27 02:51:41 -07:00
Vishwas Babu A J 1fdee8aa70 Merge pull request #807 from lingalamadhukar/MIFOSX-909
#MIFOSX-886,#MIFOSX-835,#MIFOSX-996,#MIFOSX-990,#MIFOSX-957
2014-03-27 02:39:09 -07:00
Vishwas Babu A J 25881904f1 Merge pull request #808 from Vishwa1311/MIFOSX-1003
[MIFOSX-1003] JUnit Test Cases for Accounting with Savings
2014-03-27 00:11:23 -07:00
Vishwas Babu A J 4f231f2888 Merge pull request #816 from Vishwa1311/MIFOSX-1012
[MIFOSX-1012] JUnit Test Cases for Savings Account Transfer
2014-03-27 00:11:13 -07:00
CieyouRaoulandroot 59429326d1 PPI implementation
ppi step 2 work in progress

wip

work in progress

wip

ppi permission

 done
2014-03-26 15:41:13 +01:00
Vishwas Babu A J c870e0d26f changing table collation for patch v_157 2014-03-26 02:55:28 -07:00
Vishwas Babu A J d940c72d61 Merge pull request #818 from pramodn02/MIFOSX-1025
MIFOSX-1025 - Added Overdue Penalty recurrence
2014-03-26 02:53:18 -07:00
Vishwas Babu A J e3637bb2af cleaning up MIFOSX-1013 2014-03-26 02:50:37 -07:00
Pramod Nuthakki e1917f99a2 MIFOSX-1025 - Added Overdue Penalty recurrence 2014-03-26 15:14:22 +05:30
Vishwas Babu A J d3ebc2b4dd bumping up sql patch revision number for mifosx-1015 2014-03-26 01:51:08 -07:00
Vishwas Babu A J da2365caa0 Merge pull request #817 from goutham-M/mifosx-savingloan-a/c-reports
loan txn, repayment. saving txns mifosx-1015
2014-03-26 01:49:52 -07:00
Vishwas Babu A J f28e26c1e4 cleaning up MIFOSX-1014 2014-03-26 01:21:31 -07:00
Vishwas Babu A J 8b86bde18b Merge pull request #814 from Musoni/MIFOSX-1014
MIFOSX-1014 - Fixed MakerChecker for Loans,Savings and possibly many mor...
2014-03-26 01:09:45 -07:00
andrew-dzakandVishwas Babu A J 09f26f1213 mifosx-986 fixes from andrew 2014-03-26 00:15:10 -07:00
Vishwas Babu A J 025a18b54a cleaning up MIFOSX-1013 2014-03-25 23:19:24 -07:00
andrew-dzakandVishwas Babu A J 598091b1b2 Mifosx-1013 done 2014-03-25 23:19:23 -07:00
Vishwas Babu A J 33aff878f5 Delete report-designer.properties
as it seems to be checked in by accident....
2014-03-25 22:25:54 -07:00
Vishwas Babu A J d3cc54b738 Merge pull request #815 from awesh/mifosx-1010
Converted Stretchy Report Into Pentaho Pentaho mifosx-1010
2014-03-25 22:24:41 -07:00
Vishwas Babu A J a9cff14e91 Update CHANGELOG.md
with new link to sql patch file
2014-03-25 18:20:34 -07:00
Vishwas Babu A J d8156dc8a0 deleting duplicate update scripts for tenant schema 2014-03-25 18:17:22 -07:00
Vishwas Babu A J dc377c1d5c adding tenant schema migration patch for flyway 2014-03-25 17:41:24 -07:00
Vishwas Babu A J 3681e3af33 Update CHANGELOG.md
to add a note that for users updating to latest version on dev branch, an sql patch needs to be run on mifosplatform-tenants schema
2014-03-25 17:15:28 -07:00
Vishwas Babu A J 0ca68e98d5 MIFOSX-949 cleaning up db upgrades and externalizing remaining properties 2014-03-25 17:10:17 -07:00
Vishwa1311 d26b14b85a [MIFOSX-1012] JUnit Test Cases for Account Transfer 2014-03-25 16:48:43 +05:30
Vishwa1311 f89a5737a7 [MIFOSX-1012] JUnit Test Cases for Savings Account Transfer
JUnit Test Cases for Savings Account Transfer
2014-03-24 19:00:56 +05:30
goutham-M 06785331e1 loan txn, repayment. saving txns mifosx-1015 2014-03-24 18:42:28 +05:30
Awesh f58dc4b737 Converted Stretchy Report Into Pentaho Pentaho mifosx-1010 2014-03-24 13:43:43 +05:30
Sander van der Heyden b25e121f57 MIFOSX-1014 - Fixed MakerChecker for Loans,Savings and possibly many more 2014-03-21 18:51:29 +01:00
Vishwa1311 71a6399d3d JUnit Test Cases for Accounting with Savings 2014-03-21 17:07:13 +05:30
Vishwa1311 b7e30f1aa4 [MIFOSX-1003] JUnit Test Cases for Accounting with Savings
[MIFOSX-1003] JUnit Test Cases for Accounting with Savings Updated
2014-03-20 18:55:16 +05:30
Madhukar e2ee6d1f5e #MIFOSX-886,#MIFOSX-835,#MIFOSX-996,#MIFOSX-990,#MIFOSX-957 2014-03-19 21:31:41 +05:30
Channa GayanandVishwas Babu A J d079442e0e Changes to issue: MIFOSX-949 2014-03-18 20:51:28 -07:00
Vishwas Babu A J e496ccf02a Merge pull request #805 from Vishwa1311/MIFOSX-993
[MIFOSX-993] JUnit Integration Test Cases for GroupSavings.
2014-03-18 12:47:56 -07:00
Vishwas Babu A J 1c0bf0ef3c Merge branch 'master' into develop 2014-03-18 01:33:17 -07:00
Vishwas Babu A J 5e9e43e1f4 Updates for 1.20.1 Release 2014-03-18 01:30:32 -07:00
Vishwas Babu A J 074c0a9fb5 Update CHANGELOG.md
for 1.20.1 Release
2014-03-18 01:28:23 -07:00
Vishwas Babu A J b9b5dd1da5 Merge pull request #802 from pramodn02/MIFOSX-994
MIFOSX-994 - removed the constrain for overdraft account
2014-03-17 20:30:33 -07:00
Vishwas Babu A J 412ab773f8 Merge pull request #803 from lingalamadhukar/MIFOSX-909
#MIFOSX-941,#MIFOSX-942,#MIFOSX-909
2014-03-17 20:13:07 -07:00
Madhukar 783bacbcb5 #MIFOSX-941,#MIFOSX-942,#MIFOSX-909 2014-03-17 20:18:39 +05:30
Sander van der Heyden 6c1db9f4fb MIFOSX-995 - Fixed Grace periods 2014-03-17 13:42:17 +01:00
Pramod Nuthakki 71508780a0 MIFOSX-994 - removed the constrain for overdraft account 2014-03-17 17:13:21 +05:30
Vishwa1311 d05dd0e9b6 [MIFOSX-993] JUnit Integration Test Cases for GroupSavings 2014-03-17 11:44:05 +05:30
Vishwas Babu A J aede1995c6 gradle property updates for 1.20.0.Release 2014-03-16 21:00:12 -07:00
Vishwas Babu A J ac33892bb6 Update CHANGELOG.md 2014-03-16 19:56:04 -07:00
Vishwas Babu A J e12bd4de32 Update CHANGELOG.md
for 1.20.0.RELEASE
2014-03-16 19:55:45 -07:00
Vishwas Babu A J f2766a7e66 minor updates to ageing details query 2014-03-16 14:13:15 -07:00
AweshandVishwas Babu A J 45fbdadff2 MIFOSX-955 strechy reporty issue(fixed) 2014-03-16 14:13:03 -07:00
Vishwas Babu A J 85aa76eaa1 Merge pull request #798 from lingalamadhukar/MIFOSX-985
#MIFOSX-985, Added missed permissions
2014-03-13 18:28:40 -07:00
Vishwas Babu A J 76c1f83502 Merge pull request #799 from pramodn02/MIFOSX-975
MIFOSX-976 - added editing values for global configurations
2014-03-13 18:26:28 -07:00
Pramod Nuthakki 6b057e5492 MIFOSX-976 - added editing values for global configurations 2014-03-13 13:56:50 +05:30
Madhukar d92d2f7d8c #MIFOSX-985, Added missed permissions 2014-03-13 13:16:45 +05:30
Vishwas Babu A J 0862c4b7c6 resolvings conflicts for MIFOSX-216 2014-03-12 18:50:37 -07:00
Vishwas Babu A J 41e6154622 Merge pull request #795 from pramodn02/MIFOSX-945
MIFOSX-945 - added null check for id while sorting the transactions
2014-03-12 16:06:07 -07:00
Vishwas Babu A J 9746555ceb Merge pull request #794 from pramodn02/MIFOSX-980
MIFOSX-980 - added boolean flag for first repayment date caculation
2014-03-12 16:05:14 -07:00
Vishwas Babu A J 0e9c0f7c8f Merge pull request #797 from pramodn02/MIFOSX-975
MIFOSX-975 - added Arrears status
2014-03-12 16:01:11 -07:00
Pramod Nuthakki a76e7107b3 MIFOSX-975 - added Arrears status 2014-03-12 21:25:26 +05:30
Pramod Nuthakki 2dd6dea1a2 MIFOSX-216 - added grace before In Arrears 2014-03-12 12:01:07 +05:30
Pramod Nuthakki e81e8edafa MIFOSX-945 - added null check for id while sorting the transactions 2014-03-11 17:33:48 +05:30
Pramod Nuthakki f7ab111190 MIFOSX-980 - added boolean flag for first repayment date caculation 2014-03-11 15:03:58 +05:30
Vishwas Babu A J c67921a014 Merge pull request #793 from pramodn02/savings_test
test case corrections
2014-03-11 00:13:07 -07:00
Pramod Nuthakki 6d11356204 test case corrections 2014-03-11 12:35:40 +05:30
Vishwas Babu A J e73b5cf365 Merge pull request #791 from pramodn02/savings_test
added savings test cases
2014-03-08 11:28:59 -08:00
Pramod Nuthakki 286aaf9ea9 added savings test cases 2014-03-08 22:42:02 +05:30
Vishwas Babu A J 3531601ed6 Merge pull request #788 from pramodn02/MIFOSX-954
MIFOSX-954 - added update of default savings
2014-03-06 01:00:55 -08:00
Vishwas Babu A J 34d0d83c7b Merge pull request #790 from pawandubey/api-doc
MIFOSX-948 Added UGD links to API DOCS
2014-03-06 00:59:36 -08:00
Pawan Dubey 363e448521 MIFOSX-948 Added UGD links to API DOCS 2014-03-05 22:41:49 +05:30
Vishwas Babu A J 119a49602c updates for 1.19.0 release 2014-03-05 05:38:16 -08:00
Vishwas Babu A J 52a564c74a adding missing property to clientSavingsSummar 2014-03-05 05:25:56 -08:00
Pramod Nuthakki 123ec128c6 MIFOSX-954 - added update of default savings 2014-03-05 10:21:38 +05:30
Vishwas Babu A J 1d187f7ddf adding category for newly added savings reports 2014-03-04 18:29:14 -08:00
Vishwas Babu A J cbd09dffcc Update CHANGELOG.md 2014-03-04 08:27:03 -08:00
Vishwas Babu A J e72734bfd6 Update CHANGELOG.md
for 1.19.0 release
2014-03-04 08:26:10 -08:00
Vishwas Babu A J 75dc87cccf Merge pull request #785 from pramodn02/MIFOSX-932
MIFOSX-932 - chaged the query to fetch hierarchy
2014-03-03 22:32:53 -08:00
Pramod Nuthakki df88e7d17a MIFOSX-932 - chaged the query to fetch hierarchy 2014-03-04 12:00:15 +05:30
Vishwas Babu A J fb1c158e95 Merge pull request #784 from pramodn02/MIFOSX-931
MIFOSX-931 - added API doc for overdraft account
2014-03-03 21:31:35 -08:00
Pramod Nuthakki cf9a90042a MIFOSX-931 - added API doc for overdraft account 2014-03-04 10:43:49 +05:30
Vishwas Babu A J 1e63957dc9 Merge pull request #783 from pramodn02/MIFOSX-932
MIFOSX-932 - Basic Savings reports
2014-03-03 15:21:18 -08:00
Pramod Nuthakki ea232576ba MIFOSX-932 - Basic Savings reports 2014-03-04 00:27:47 +05:30
Vishwas Babu A J b02a357581 Merge pull request #781 from vishwasbabu/develop-new
applying format across the project and fixing all warnings
2014-03-01 04:54:10 -08:00
Vishwas Babu A J 1c1e83eb5e applying format across the project and fixing all warnings
Conflicts:
	mifosng-provider/src/main/java/org/mifosplatform/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java
	mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanAssembler.java
	mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/service/SavingsApplicationProcessWritePlatformService.java
	mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/service/SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.java
2014-03-01 04:50:17 -08:00
Vishwas Babu A J c404dfdeb1 Merge pull request #779 from lingalamadhukar/MIFOSX-946
MIFOSX-946 capture loanpurpose for group and jlg loans
2014-03-01 02:47:22 -08:00
Vishwas Babu A J 975ae07cf7 Merge pull request #780 from vishwasbabu/develop
fix for MIFOSX-884
2014-03-01 02:40:11 -08:00
Vishwas Babu A J fb6c5440dc fix for MIFOSX-884 2014-03-01 02:37:12 -08:00
Madhukar 4fef1d0b48 MIFOSX-946 capture loanpurpose for group and jlg loans 2014-03-01 14:09:42 +05:30
Vishwas Babu A J 4ae3e99c18 Merge pull request #774 from pramodn02/MIFOSX-929
MIFOSX-929 - added check for multiple permission for client
2014-02-28 11:09:58 -08:00
Vishwas Babu A J 85193881b5 clean up to created Date field in SavingsAccountTransactionDTO 2014-02-28 10:56:34 -08:00
Vishwas Babu A J 9a668e6cac Merge pull request #778 from pramodn02/savingstransaction
MIFOSX-939 - corrected order of saving transactions
2014-02-28 10:45:59 -08:00
Pramod Nuthakki b9fa92f4e6 removed commented code 2014-02-28 22:52:36 +05:30
Pramod Nuthakki 59b7bcc499 MIFOSX-939 - corrected order of saving transactions 2014-02-28 22:47:58 +05:30
Vishwas Babu A J e6b2a35f41 updates to MIFOSX-888 2014-02-27 22:28:19 -08:00
Pramod Nuthakki ca24c402f9 removed boolean value from result 2014-02-27 09:33:27 +05:30
Pramod Nuthakki 85297aaa65 MIFOSX-929 - added check for multiple permission for client 2014-02-26 20:10:35 +05:30
Vishwas Babu A J fd32d997e7 Merge pull request #773 from pramodn02/savings
MIFOSX-931 - added current account
2014-02-25 01:44:38 -08:00
Pramod Nuthakki 69861ba624 MIFOSX-931 - added current account 2014-02-25 13:50:04 +05:30
Vishwas Babu A J 7ad240b1af updates for 1.18.0 release 2014-02-23 16:52:19 -08:00
Vishwas Babu A J cf51a85cdc Update CHANGELOG.md
for 1.18.0 release
2014-02-23 16:46:24 -08:00
Vishwas Babu A J 6653dae41b merging 1.17.1 into develop 2014-02-23 16:40:15 -08:00
Vishwas Babu A J 219bd33adf updating gradle properties for 1.17.1 release 2014-02-23 16:35:24 -08:00
Vishwas Babu A J 61236ae249 Update CHANGELOG.md
for 1.17.1 release
2014-02-23 16:29:59 -08:00
Vishwas Babu A J 6ef342a486 Merge pull request #772 from emmanuelnnaa/MIFOSX-923
MIFOSX-923 - entity status property added to the search resultset
2014-02-23 15:34:09 -08:00
Emmanuel Nnaa b1201087c2 MIFOSX-923 - entity status property added to the search resultset 2014-02-21 16:56:01 +01:00
Vishwas Babu A J a3a643258a Merge pull request #771 from pramodn02/MIFOSX-920
MIFOSX-920 - corrected parser to return number if it is bigdecimal
2014-02-19 21:25:30 -08:00
Pramod Nuthakki bd816e27bd MIFOSX-920 - corrected parser to return number if it is bigdecimal 2014-02-20 10:41:21 +05:30
Vishwas Babu A J 4865e2a156 Merge pull request #750 from lingalamadhukar/MIFOSX-880
MIFOSX-880 calculate interest from interestChargedFromDate
2014-02-18 20:45:12 -08:00
Vishwas Babu A J 3277f84811 Merge pull request #753 from goutham-M/mifosx-collectionsheet-enhancement
MIFOSX-902 productive collection sheet feature is added
2014-02-18 20:09:20 -08:00
Vishwas Babu A J 89e3016fc9 Merge pull request #770 from pramodn02/MIFOSX-847_1
MIFOSX-847 - added variations in loan data for clients
2014-02-18 19:55:24 -08:00
Pramod Nuthakki 63615022df MIFOSX-847 - added variations in loan data for clients 2014-02-19 09:17:11 +05:30
Vishwas Babu A J 2a21eda984 Merge pull request #761 from lingalamadhukar/MIFOSX-911
MIFOSX-911 Update Api doc issues
2014-02-18 18:46:05 -08:00
Vishwas Babu A J 5e82d5c320 Merge pull request #769 from lingalamadhukar/MIFOSX-864
MIFOSX-864 Add timeline for list client loans
2014-02-18 18:43:18 -08:00
Vishwas Babu A J 05fa39ac1e Merge pull request #754 from Musoni/MIFOSX-900
MIFOSX-900 - Refuse deactivating charges that are currently in use
2014-02-18 18:30:29 -08:00
Vishwas Babu A J 65eab01daa Merge pull request #768 from pramodn02/MIFOSX-92_2
MIFOSX-92 - modified column names
2014-02-18 16:52:18 -08:00
Madhukar 2d44a28607 MIFOSX-864 Add timeline for list client loans 2014-02-18 16:54:36 +05:30
Pramod Nuthakki ade1bd38cf MIFOSX-92 - modified column names 2014-02-18 11:25:52 +05:30
Pramod NuthakkiandVishwas Babu A J c548f501de MIFOSX-92 Tranche loan functionality 2014-02-17 09:20:47 -08:00
Vishwas Babu A J 0bb6e0d9f4 Merge pull request #755 from pramodn02/MIFOSX-906
MIFOSX-906 - added creation of transaction id before creating Journal En...
2014-02-16 19:11:19 -08:00
Vishwas Babu A J 34600936aa Merge pull request #764 from vorburger/readMeDemoBeta
add link to demo.openmf.org/beta/ Community App to README
2014-02-16 19:07:11 -08:00
Vishwas Babu A J fd6551bcba Merge pull request #766 from pramodn02/MIFOSX-895
MIFOSX-895 : corrected validations
2014-02-16 19:06:01 -08:00
Pramod Nuthakki 07b026aee0 MIFOSX-895 : corrected validations 2014-02-15 14:14:24 +05:30
Michael Vorburger 908de1c849 add link to demo.openmf.org/beta/ Community App to README 2014-02-15 01:46:33 +01:00
Vishwas Babu A J 0651468beb Merge pull request #756 from Musoni/MIFOSX-867
MIFOSX-867 - Fixed disbursement or submit date after repayment startdate...
2014-02-13 23:05:23 -08:00
Vishwas Babu A J 25a32ea925 Merge pull request #760 from goutham-M/mifosx-journalentryerrmsgfix
MIFOSX-910 for journal entry posting not proper err msg displaying fixed
2014-02-13 23:03:15 -08:00
Vishwas Babu A J 13f8c6cac8 Merge pull request #751 from emmanuelnnaa/MIFOSX-901
MIFOSX-901 - "BIT" datatype/columntype missing displaytype, throws "error.msg.invalid.lookup.type" error message
2014-02-13 17:48:51 -08:00
Madhukar a7b4f77498 MIFOSX-911 Update Api doc issues 2014-02-12 13:25:14 +05:30
Sander van der Heyden a889dbdd2f MIFOSX-867 - Fixed disbursement or submit date after repayment startdate by adding validations 2014-02-11 11:00:30 +01:00
Pramod Nuthakki 4a2ffe5e48 MIFOSX-906 - added creation of transaction id before creating Journal Entries 2014-02-11 15:18:37 +05:30
Sander van der Heyden 289e5309fc MIFOSX-900 - Refuse deactivating charges that are currently in use 2014-02-11 10:11:50 +01:00
goutham-M d23335603f MIFOSX-902 productive collection sheet feature is added 2014-02-11 12:51:42 +05:30
Emmanuel Nnaa 57078ecdc4 added columntype 'BIT' to return as displaytype 'INTEGER' 2014-02-10 15:03:55 +01:00
Madhukar cd42134257 MIFOSX-880 calculate interest from interestChargedFromDate 2014-02-10 19:25:38 +05:30
Vishwas Babu A J ac932974f3 MIFOSX-751 updates 2014-02-10 09:07:10 +05:30
CieyouRaoulandVishwas Babu A J fe510e8e1a MIFOSX-751 password reset functionality added by Musoni 2014-02-10 04:04:16 +05:30
Vishwas Babu A J 36fcb9c069 correcting sql patch numbering 2014-02-09 02:39:13 +05:30
Vishwas Babu A J f0eea29fb2 Merge pull request #743 from Musoni/MIFOSX-888
MIFOSX-888 - Early Repayments Strategy
2014-02-09 01:09:50 +05:30
Vishwas Babu A J 9edb9ae219 Merge pull request #735 from lingalamadhukar/mifosx-871
MIFOSX-871 Advanced search query with search operators
2014-02-09 00:58:53 +05:30
Pramod NuthakkiandVishwas Babu A J 5004c14752 added disbursement charges to update summary job 2014-02-09 00:57:01 +05:30
Vishwas Babu A J 02191d6280 Merge pull request #736 from pramodn02/MIFOSX-870
MIFOSX-870 - added disbursement charges to update summary job
2014-02-09 00:56:05 +05:30
Vishwas Babu A J 103beaf56c correcting names for SQL patch files for MIFOSX-897 and MIFOSX-896 2014-02-09 00:53:39 +05:30
Pramod NuthakkiandVishwas Babu A J dc3ec32a43 MIFOSX-869 - Correct spelling mistakes 2014-02-09 00:50:00 +05:30
Vishwas Babu A J 6fed3899c5 Merge pull request #747 from emmanuelnnaa/MIFOS-6119
MIFOSX-896 - added permission for 'savingsaccountcharge' endpoint - simple SQL insert
2014-02-09 00:44:03 +05:30
Vishwas Babu A J 84c967b674 Merge pull request #748 from emmanuelnnaa/MIFOSX-897
MIFOSX-897 - SQL for create journalentry checker permission. Permission missing in m_permission table.
2014-02-08 19:16:59 +05:30
sumit-gupta-sgtandVishwas Babu A J 84087a71b8 Fix for Mifosx-814
Mifos-814 Add User for sendPasswordToEmail false
2014-02-08 17:48:14 +05:30
sumit-gupta-sgtandVishwas Babu A J 6fccaa82da Fix for Mifosx-814
Mifos-814 Add User for sendPasswordToEmail false
2014-02-08 17:46:46 +05:30
Vishwas Babu A J 062ae8905e MifosX-872 optionally capture payment type for a manual journal entry 2014-02-08 17:39:11 +05:30
Vishwas Babu A J 133e4e4d90 MifosX-872 optionally capture payment type for a manual journal entry 2014-02-08 16:54:52 +05:30
Emmanuel Nnaa 29de32a725 SQL for create journalentry checker permission. Permission should have been added to m_permission table. 2014-02-06 12:44:11 +01:00
Emmanuel Nnaa 064ac6dd39 added permission for 'savingsaccountcharge' endpoint - simple SQL insert 2014-02-06 09:46:47 +01:00
Vishwas Babu A JandSander van der Heyden f09cf9a433 MIFOSX-888 - Early Repayments Strategy 2014-02-03 15:41:04 +01:00
Vishwas Babu A J b78dd9e127 MIFOSX-879 correcting documentation issues 2014-01-29 04:05:30 +05:30
Vishwas Babu A J d58d2482ce MIFOSX-879 correcting documentation issues 2014-01-29 03:53:58 +05:30
Pramod Nuthakki d46663c630 added disbursement charges to update summary job 2014-01-28 23:17:43 +05:30
Madhukar 2b27f5b574 MIFOSX-871 Advanced search query with search operators 2014-01-28 20:02:32 +05:30
Vishwanath RandVishwas Babu A J 2e5c9b6eae [MIFOSX-876] AND [MIFOSX-877] has been fixed and resolved 2014-01-27 19:43:29 +05:30
Vishwanath RandVishwas Babu A J cb42ff118b [MIFOSX-875] Unknown Data Integrity Issue has been fixed 2014-01-27 19:43:23 +05:30
Vishwanath RandVishwas Babu A J 9f08539e59 [MIFOSX-876] AND [MIFOSX-877] has been fixed and resolved 2014-01-27 19:30:59 +05:30
Vishwanath R f523339ca0 [MIFOSX-875] Unknown Data Integrity Issue has been fixed 2014-01-27 13:36:14 +05:30
Pramod NuthakkiandVishwas Babu A J dfab937527 MIFOSX-827 corrected update loan charge functionality from modify application 2014-01-26 03:07:25 +05:30
Pramod NuthakkiandVishwas Babu A J 097189621f MIFOSX-827 corrected update loan charge functionality from modify application 2014-01-26 03:07:09 +05:30
sumit-gupta-sgtandVishwas Babu A J d365545ec1 Fix for Mifosx-873 2014-01-22 14:23:29 +05:30
Pramod NuthakkiandVishwas Babu A J 645f2c24aa MIFOSX-827 used money in loan charge 2014-01-22 14:23:19 +05:30
Pramod NuthakkiandVishwas Babu A J 9f9746d404 MIFOSX-868:corrected add loan charge schedule regenerate 2014-01-20 02:16:51 +05:30
Vishwas Babu A J 5ae9e5287f Merge pull request #722 from pramodn02/MIFOSX-720_243
MIFOSX-720 adding whitespace to query
2014-01-17 06:36:40 -08:00
Pramod Nuthakki a32739c1a6 MIFOSX-720 adding whitespace to query 2014-01-17 20:01:54 +05:30
Vishwas Babu A J b8b488c1be updating release details for 1.7.0 Release 2014-01-17 13:28:50 +05:30
Vishwas Babu A J bdbe2d2c51 Update CHANGELOG.md
for 1.7.0 Release
2014-01-16 19:21:32 +05:30
Vishwas Babu A J 74a058a6b1 MIFOSX-866 changes for returing transaction type associated with a journal entry 2014-01-16 12:23:48 +05:30
CieyouRaoulandVishwas Babu A J 5441f29b84 Added transaction type to journal Entry 2014-01-16 12:23:29 +05:30
Vishwas Babu A J 5757cba348 mifosx-720 update sql patch number 2014-01-16 10:03:25 +05:30
Pramod NuthakkiandVishwas Babu A J 8b5eab1d87 added status for charges 2014-01-16 09:59:41 +05:30
Vishwanath RandVishwas Babu A J 45785dff42 MIFOSX-861 #comment fixed issues with group/client creation 2014-01-10 23:38:32 +05:30
goutham-M 4b36019b98 MIFOSX-910 not proper err msg displaying fixed 2014-01-01 13:11:23 +05:30
Vishwas Babu A J 31a8a33ce6 Merge pull request #711 from ashok-conflux/MIFOSX-831-01
Added group by clause for generate collection sheet query
2013-12-31 04:23:51 -08:00
ashok-conflux 99c775790a Added group by clause for generate collection sheet query 2013-12-31 16:07:48 +05:30
Vishwas Babu A J a08f0db277 Merge pull request #708 from ashok-conflux/IntegrationTestFix
added product shortName to create Loan product test case
2013-12-29 22:52:55 -08:00
ashok-conflux 227685402a added product shortName to create Loan product test case 2013-12-30 11:37:07 +05:30
Emmanuel NnaaandVishwas Babu A J 0da887d11b added the group external_id scoped field in the search criteria 2013-12-29 23:27:40 +05:30
Vishwas Babu A J c8e007478d merge ashoks changes for collection sheet improvements 2013-12-29 22:47:05 +05:30
Vishwas Babu A J 5e7a259052 renaming sql patch for loan product short name 2013-12-29 22:37:53 +05:30
Vishwas Babu A J a86bbc5ebe Merge pull request #707 from Vishwa1311/MIFOSX845
SQL patch named "V137__added_is_active_column_in_m_staff.sql" has been added and also I have updated the API-docs for Staff.
2013-12-29 09:05:36 -08:00
Vishwas Babu A J 341aefa080 Merge pull request #703 from lingalamadhukar/mifosx-832
Adding short names for loan and saving products
2013-12-29 09:04:59 -08:00
Vishwas Babu A J a5e9a32c26 Merge branch 'master' into develop 2013-12-29 22:06:21 +05:30
Vishwas Babu A J f32ca69a37 update gradle.properties for 1.16.1 release 2013-12-29 21:44:35 +05:30
Vishwas Babu A J d0e5677b4d Update CHANGELOG.md
for 1.16.1 release
2013-12-29 21:43:29 +05:30
Vishwanath R bc55f70301 initial commit 2013-12-28 18:27:13 +05:30
Vishwanath R 37a039454a Added new column named is_active 2013-12-27 18:44:52 +05:30
ashok-conflux 027b818f27 Updated collection sheet changes raised in GK pilot 2013-12-26 19:33:49 +05:30
Madhukar f32225e275 Adding short names for loan and saving products 2013-12-24 17:38:24 +05:30
Vishwas Babu A J 570296d10a renaming sql patch 2013-12-22 02:14:41 +05:30
MadhukarandVishwas Babu A J d885e9b28a mifosx-834 update report parameter query 2013-12-22 02:14:25 +05:30
Vishwas Babu A J 6cb756bab1 renaming sql patch 2013-12-22 02:13:55 +05:30
MadhukarandVishwas Babu A J 99340eca74 mifosx-834 update report parameter query 2013-12-22 02:13:42 +05:30
Vishwas Babu A J fe36328184 Merge pull request #698 from ashok-conflux/MIFOSX-812
add currency details to journal entries api
2013-12-17 06:54:09 -08:00
Vishwas Babu A J e91ee2d1d1 Merge pull request #699 from ashok-conflux/MIFOSX-830
returning valid commandId for api actions when maker checker is enabled
2013-12-17 06:53:34 -08:00
ashok-conflux 14a7e6a067 returning valid commandId for api actions when maker checker is enabled 2013-12-17 13:35:34 +05:30
ashok-conflux 9d47f49e11 add currency details to journal entries api 2013-12-17 11:06:14 +05:30
ashok-confluxandVishwas Babu A J a354b3e664 added validation around Loan life cycle events like, repayment, disbursement etc.. 2013-12-16 17:08:19 +05:30
ashok-confluxandVishwas Babu A J 49a2f30e2c added timeline details to Center 2013-12-16 17:08:08 +05:30
Vishwas Babu A J fb45948c0d Update CHANGELOG.md
for 1.16 release
2013-12-16 02:45:32 +05:30
Vishwas Babu A J b2d8c517e3 merge master into develop 2013-12-16 02:35:36 +05:30
Vishwas Babu A J 7e9e3f4857 updates for 1.15.2 release 2013-12-16 02:18:47 +05:30
Vishwas Babu A J fa293d19ce Merge pull request #694 from ashok-conflux/MIFOSX-824
Added pagination support to audit API
2013-12-12 22:58:37 -08:00
ashok-conflux 5373263f6c Add pagination support to audit API 2013-12-12 19:09:50 +05:30
Vishwas Babu A J 66f974720f adding instructions for deploying the community app 2013-12-12 15:31:12 +05:30
Vishwas Babu A J 3789ac1f07 Update CHANGELOG.md 2013-12-12 15:11:47 +05:30
Vishwas Babu A J a9f01477e0 Merge pull request #693 from ashok-conflux/MIFOSX-826
added holiday status to response API data
2013-12-12 01:05:15 -08:00
ashok-conflux 1371a3f775 added holiday status to response 2013-12-11 17:20:09 +05:30
Vishwas Babu A J e7f0e60555 fix for MIFOSX-822 2013-12-11 06:48:39 +05:30
Vishwas Babu A J 5c30edc710 fix for MIFOSX-822 2013-12-11 06:42:46 +05:30
Keith Woodlock 35b489b793 Merge pull request #692 from gsluthra/gitignore
Added .gradletasknamecache to gitignore list
2013-12-09 03:21:02 -08:00
Gurpreet Luthra 8e6ca1f6b5 Added .gradletasknamecache to gitignore list 2013-12-09 16:46:47 +05:30
Vishwas Babu A J 68089e0360 fix for MIFOSX-821 2013-12-06 18:43:56 +05:30
Vishwas Babu A J cebdc5cfc1 fix for MIFOSX-821 2013-12-06 18:41:59 +05:30
Vishwas Babu A J 74606b424d fix for MIFOSX-818 2013-12-06 18:07:03 +05:30
Vishwas Babu A J 5aa6fecd5c fix for MIFOSX-818 2013-12-06 18:03:55 +05:30
Vishwas Babu A JandKeith Woodlock 584f0fd99f fix for MIFOSX-820 2013-12-05 16:30:04 +00:00
Vishwas Babu A J 3fa2c26897 fix for MIFOSX-820 2013-12-05 21:04:23 +05:30
Keith Woodlock 8ffd7c831b Merge pull request #690 from pramodn02/MIFOSX-816
mifosx-816 : corrected loan variations to pick based on loan product cou...
2013-12-05 02:05:50 -08:00
Keith Woodlock 5fa4423ba5 update changelog for 1.15.1 release 2013-12-05 10:03:02 +00:00
Pramod Nuthakki f991075cb7 mifosx-816 : corrected loan variations to pick based on loan product count 2013-12-04 23:40:12 +05:30
Keith Woodlock 865ce43de0 update changelog for 1.15.1 release 2013-12-04 18:02:33 +00:00
Keith Woodlock 93a39abf75 MIFOSX-811: ensure undo disbursement regenerated schedule when expected and actual disbursement dates are different. 2013-12-03 15:08:58 +00:00
Keith Woodlock 046b9aaf2d MIFOSX-811: ensure undo disbursement regenerated schedule when expected and actual disbursement dates are different. 2013-12-03 15:07:56 +00:00
Pramod NuthakkiandKeith Woodlock fa7a917f26 mifosx-801:submitted date updation for clients 2013-12-03 13:42:18 +00:00
Keith Woodlock 2c74e0cdfe Merge remote-tracking branch 'pramod/MIFOSX-801_1' into mifosplatform-1.15.1 2013-12-03 13:41:15 +00:00
Pramod Nuthakki c11e8d5627 mifosx-801:submitted date updation for clients 2013-12-03 19:01:26 +05:30
Keith Woodlock 9839258135 MIFSOX-810: exception message returned rather than clean error message when attempt to add user that already exists. 2013-12-03 13:26:12 +00:00
Keith Woodlock 8ffba8a732 MIFSOX-810: exception message returned rather than clean error message when attempt to add user that already exists. 2013-12-03 13:25:13 +00:00
Pramod NuthakkiandKeith Woodlock d86dfe4e66 MIFOS-805:Corrected update of loan product for term variation for loan cycle 2013-12-03 11:26:00 +00:00
Pramod Nuthakki f854e58050 MIFOS-805:Corrected update of loan product for term variation for loan cycle 2013-12-03 15:04:32 +05:30
Pramod NuthakkiandKeith Woodlock 96cefdddc5 added running balance as optional to GLAccount 2013-12-03 01:08:22 +00:00
Keith Woodlock ab1254ab68 update properties for release 2013-12-03 01:07:13 +00:00
Keith Woodlock ab718150ab Merge pull request #686 from pramodn02/MIFOSX-744
mifosx-744:added running balance as optional to GLAccount
2013-12-02 16:55:53 -08:00
Pramod Nuthakki fb3d5c9a0c added running balance as optional to GLAccount 2013-12-02 22:08:15 +05:30
Pramod Nuthakki 71803b20f5 added API changes 2013-12-02 18:10:34 +05:30
Pramod Nuthakki eb75708b66 added undo writeoff transaction 2013-12-02 17:58:40 +05:30
Keith Woodlock 40ec10ef11 update release properties for develop branch. 2013-12-01 14:01:16 +00:00
Keith Woodlock 3b660c1979 update changelog for 1.15.0 release 2013-12-01 13:54:59 +00:00
Keith Woodlock 5149668ab3 update release properties for 1.15.0 2013-12-01 13:48:36 +00:00
Keith Woodlock 8bbd028c6a MIFOSX-792: slight change to where call for configurable property happens. 2013-11-29 13:59:25 +00:00
Keith Woodlock bddf120878 Merge remote-tracking branch 'musoni/MIFOSX-792' into develop 2013-11-29 13:46:15 +00:00
Vishwas Babu A J 6df82f820a Merge pull request #683 from pramodn02/MIFOSX-569
MIFOSX-569 - Corrected validation for borrower cycle
2013-11-29 05:30:13 -08:00
Pramod Nuthakki 9ffbef4994 added validation for borrower cycle to start with equal 2013-11-29 18:49:39 +05:30
Pramod Nuthakki fe0a519247 Corrected validation for borrower cycle 2013-11-29 18:32:35 +05:30
andrew-dzak 7f5db0ff00 added configuration value for wait penalty period of 2 days 2013-11-29 12:35:46 +01:00
Vishwas Babu A J ef628d0997 Merge pull request #682 from pramodn02/MIFOSX-800
MIFOSX-800 - added empty data check
2013-11-29 01:49:59 -08:00
Vishwas Babu A J 797c44e48c Merge pull request #681 from pramodn02/MIFOSX-795
MIFOSX-795 : Products accounting API clean up
2013-11-29 01:49:42 -08:00
Pramod Nuthakki 1099e73039 added empty data check 2013-11-29 15:11:34 +05:30
Pramod Nuthakki c2b42df3ab savings product account detail API clean up 2013-11-29 13:33:37 +05:30
Pramod Nuthakki f587d83722 Products accounting API clean up 2013-11-28 23:09:51 +05:30
Keith Woodlock 9bcfea08d0 Merge pull request #680 from pramodn02/MIFOSX-790
linking payment details to journal entries
2013-11-27 02:47:53 -08:00
Pramod Nuthakki 499124b273 linking payment details to journal entries 2013-11-27 15:21:15 +05:30
Keith Woodlock bd7bdb2e57 remove test for group delete in GroupTest file as it consistently provides false positive. 2013-11-27 09:47:49 +00:00
Keith Woodlock 7d4284261c update to latest bug release of spring framework. 2013-11-26 01:30:20 +00:00
Keith Woodlock 100e096f64 remove eclipse warnings. 2013-11-25 14:37:42 +00:00
Vishwas Babu A J 37c04828dd Merge pull request #679 from pramodn02/MIFOSX-569
added borrower cycle to loan products
2013-11-24 22:06:43 -08:00
Vishwas Babu A J baec784db4 Merge pull request #677 from ashok-conflux/holidays-api-update
updated holidays api doc
2013-11-24 22:05:17 -08:00
Pramod Nuthakki 3832c8c2c4 added check for blank feilds 2013-11-25 11:33:46 +05:30
Pramod Nuthakki f8da9b4072 added check for blank feilds 2013-11-25 11:28:33 +05:30
Pramod Nuthakki a7632d4fae added borrower cycle to loan products 2013-11-24 12:35:50 +05:30
Keith Woodlock 35652b1abd MIFOSX-794: some changes to terms - userRoles not clientRoles. 2013-11-22 15:39:10 +00:00
andrew-dzak e64b502b17 add roles to list users 2013-11-22 15:01:38 +01:00
Keith Woodlock 23b250bd40 remove unused warnings. 2013-11-22 11:45:15 +00:00
Keith Woodlock 3fe1f7f058 update release properties for develop branch. 2013-11-22 11:30:55 +00:00
Keith Woodlock 3b9be1fa1c MIFOSX-790: remove warnings. 2013-11-22 11:21:00 +00:00
Keith Woodlock e87daef59a Merge remote-tracking branch 'musoni/MIFOSX-790' into develop 2013-11-22 11:06:14 +00:00
ashok-conflux 32a7323cbb updated holidays api doc 2013-11-22 15:31:04 +05:30
CieyouRaoul c337e34e4c Added payment details to journalEntry 2013-11-22 09:08:17 +01:00
Vishwas Babu A J f4cb8101e8 merge 1.14.0 release into master 2013-11-21 23:53:13 +05:30
Keith Woodlock 85395416b3 update changelog for 1.13.4 bug release 2013-11-03 02:45:50 +00:00
Pramod NuthakkiandKeith Woodlock 6dc59fac76 added reprocess of schedule for add and remove of loan charge 2013-11-03 02:29:44 +00:00
Sander van der HeydenandKeith Woodlock a8752cb70a MIFOSX-764 - Fixed default ordering of journal entries to make sure running balances add up 2013-10-31 16:05:14 +00:00
Sander van der HeydenandKeith Woodlock 983378ac59 MIFOSX-763 - Fixed issue with running balances being 0 and inability to retrieve GLs without transactions 2013-10-31 11:24:07 +00:00
Keith Woodlock b1fd110c10 update release properties 2013-10-31 10:49:55 +00:00
Keith Woodlock ffd332e975 update changelog for 1.13.3 bug release 2013-10-30 23:46:39 +00:00
Sander van der HeydenandKeith Woodlock 84674a2b26 MIFOS-762 - Fixed SubmittedBy userID for creating new savings 2013-10-30 10:26:53 +00:00
Keith Woodlock d7bcf02b24 MIFOSX-760: ensure charges cache is evicted on update. 2013-10-29 15:39:22 +00:00
ashok-confluxandKeith Woodlock b885296a80 allow to pay all pending arrears recurring charges through scheduled job 2013-10-29 14:25:55 +00:00
ashok-confluxandKeith Woodlock 4724fa12f7 updated montly recurring charge start dateto be after savings account activagtion date 2013-10-29 12:20:18 +00:00
Keith Woodlock e1c198fdb9 MIFOSX-757: fix issue with vaidation on chargeTimeType 2013-10-29 12:16:42 +00:00
Sander van der HeydenandKeith Woodlock 69780c0061 MIFOSX-759 - Hotfix for non-unique transaction IDs 2013-10-29 11:15:50 +00:00
Keith Woodlock 99371b6314 update to 1.13.3 release properties. 2013-10-29 10:02:02 +00:00
Keith Woodlock 888803baa0 update changelog for 1.13.2 bug release 2013-10-28 12:26:05 +00:00
Keith Woodlock 98baa38995 MIFOSX-722: approximate EMI for daily interest method 2013-10-27 22:56:11 +00:00
Keith Woodlock 64b11f8de3 MIFOSX-729: For flat loans, daily interest calculation not using daily periods when calulating interest, it was still using the installment period and as a result the interest calculated was not correct. 2013-10-27 18:14:14 +00:00
Keith Woodlock 392be623c2 MIFOSX-721: fix issue with daily interest calculation when using interest charged from date feature. 2013-10-25 13:11:47 +01:00
Keith Woodlock 5e09dce398 MIFOSX-750: earlier fix was incorrect and messed up paging results. 2013-10-25 11:28:17 +01:00
Keith Woodlock 35fa37818f MIFOSX-749, MIFSOX-750: client search using search term and office hierarchy scoping were no longer working. 2013-10-22 14:38:44 +01:00
Keith Woodlock 18799ed4a7 update release properties. 2013-10-22 13:34:55 +01:00
Keith Woodlock b188d46fde udpate changelog for 1.13.1 release 2013-10-22 01:20:16 +01:00
Keith Woodlock 85cd5ff5c0 MIFOSX-715: if the image resource is missing for whatever reason (backup didnt copy filestructure, someone removed file) pass back approp error message from API. 2013-10-22 01:16:12 +01:00
Keith Woodlock 3bbf7538b2 MIFOSX-733: undo of disbural when sending no note parameter was causing null pointer. Fix ensures null pointer exception doesnt occur when checking for existence of a parameter when no request body exists. 2013-10-22 00:56:53 +01:00
Keith Woodlock ce8f38694a MIFOSX-734: add further information on transaction processing strategy feature on platform. 2013-10-22 00:15:15 +01:00
Keith Woodlock 4e77b115c3 update release version for bug release. 2013-10-20 17:58:52 +01:00
851 changed files with 78650 additions and 5324 deletions
+1
View File
@@ -19,5 +19,6 @@ rebel.xml
*.sublime-workspace
*.DS_Store
*.ini
*.gradletasknamecache
*~
.metadata
+323
View File
@@ -5,6 +5,20 @@ See VERSIONING (https://github.com/openMF/mifosx/blob/master/VERSIONING.md) for
Releases
===============
1. 30 Apr 2014 - 1.22.0.RELEASE
1. 30 Mar 2014 - 1.21.0.RELEASE
1. 18 Mar 2014 - 1.20.1.RELEASE
1. 16 Mar 2014 - 1.20.0.RELEASE
1. 04 Mar 2014 - 1.19.0.RELEASE
1. 23 Feb 2014 - 1.18.0.RELEASE
1. 21 Feb 2014 - 1.17.1.RELEASE
1. 17 Jan 2014 - 1.17.0.RELEASE
1. 29 Dec 2013 - 1.16.1.RELEASE
1. 15 Dec 2013 - 1.16.0.RELEASE
1. 12 Dec 2013 - 1.15.2.RELEASE
1. 04 Dec 2013 - 1.15.1.RELEASE
1. 01 Dec 2013 - 1.15.0.RELEASE
1. 21 Nov 2013 - 1.14.0.RELEASE
1. 03 Nov 2013 - 1.13.4.RELEASE
1. 30 Oct 2013 - 1.13.3.RELEASE
@@ -49,6 +63,315 @@ Releases
1. 05 April 2013 - 0.11.1.beta
1. 05 April 2013 - 0.11.0.beta
1.22.0.RELEASE
=============
This feature release contains work around Fixed deposits with interest slabs , recurring deposits, accrual accounting (upfront and periodic accrual) for loan products including the ability to categorize loans as Non Performing Assets, standing instructions, ability to disburse loans to linked savings accounts and upgrading the community app to Bootstrap 3.
Important: Table `m_savings_account_transfer` has been dropped as a part of the work around Standing instructions. The database changes may be viewed at https://github.com/openMF/mifosx/blob/master/mifosng-db/migrations/core_db/V160__standing_instruction_changes.sql.
Platform & API
New Features & Improvements
- [MIFOSX-1111] - Add Support for Term Deposits or Fixed Deposits or Time Deposits
- [MIFOSX-1112] - Add Support for Recurring Deposits
- [MIFOSX-1049] - Ship sample Data with every stable release
- [MIFOSX-1065] - In saving product, need quarterly, biannually, yearly option for interest compounding.
- [MIFOSX-1081] - Ability to Categorize Loans as Non Performing Assets (NPA)
- [MIFOSX-865] - Accrual Accounting support for Loan Products
- [MIFOSX-1055] - Add Standing Instructions for account to account transfer
- [MIFOSX-1146] - add support for disbursing loan amount to savings account
- [MIFOSX-1094] - Passing Tenant Database host, port and credentials to Pentaho reports
- [MIFOSX-1008] - No Interest posting on saving account when Interest is set @ 0%
- [MIFOSX-1075] - Add overdue penalty batch job in DB and handle exceptions in batch job
- [MIFOSX-1035] - JUnit Integration Test Cases for Charges
- [MIFOSX-1046] - JUnit test cases for code and code values API's
- [MIFOSX-1047] - JUnit test cases for Scheduler Jobs API's
Bugs
- [MIFOSX-886] - In Modify Loan application adding charge on specified due date/Overdue fees results in Unknown data integrity issue
- [MIFOSX-998] - Should not be allowed to activate Group/Center and associate clients under group with out permissions.
- [MIFOSX-1021] - Not able to view particular charge details attached for savings account
- [MIFOSX-1027] - Potential issues with maker-Checker functionality
- [MIFOSX-1036] - Not able to generate Pentaho report added for client's Loan and saving transactions page
- [MIFOSX-1056] - Improper error message is displayed after clicking on "Repayment info" button while submitting the tranche loan application for a client with insufficient input
- [MIFOSX-1076] - In Modify Loan application if the Loan amount is modified, the % Charge on disbusement is not modifying accordingly.
- [MIFOSX-1077] - In Client loan page after submitting the Loan application if the %amount charge is edited then it is not getting calculated properly
- [MIFOSX-1053] - Not able to pay overdue savings charges through Schedular Job.
Community App
- [MIFOSX-962] - Upgrade to Twitter Bootstrap 3
- [MIFOSX-1048] - Gmail Like Loading Progress Bar during application load
- [MIFOSX-965] - Community app should "respond" to fill entire screen
- [MIFOSX-1064] - Remove Gray "frame" around page data so as to match with the background.
- [MIFOSX-1072] - Ability to view error log details of individual run in View history page of a particular Schedular Job page
- [MIFOSX-1057] - New Collection Sheet UI changes
- [MIFOSX-1022] - Improvements In savings account for a client
- [MIFOSX-1058] - Not able to create holiday because of issue with the checkbox while selecting the office
- [MIFOSX-1073] - Issue with respect to View a particular Charge details in Loan and savings accounts
- [MIFOSX-1042] - UI related issues with respect to Datatables
- [MIFOSX-1041] - Issue related to Collection sheets
- [MIFOSX-1090] - Added overdue penalties is not displaying in loan repayment schedule
- [MIFOSX-1095] - Not able to assign Moratorium for Interest in new loan application page for a client
- [MIFOSX-1144] - Not able make/edit/read datatable entries even though user have proper permissions
1.21.0.RELEASE
=============
This Feature release adds support for Automated Penalties for loans and externalizes the MySQL connection properties for a tenant along with other major fixes and improvements
Important: Those updating from an existing installation to 1.21.* release or higher should run the update https://github.com/openMF/mifosx/blob/develop/mifosng-db/migrations/list_db/V2__externalize-connection-properties.sql on `mifosplatform-tenants` schema
Platform & API
New Features & Improvements
- [MIFOSX-1025] - Implement Overdue Penalties with recurrence and percentage based approach
- [MIFOSX-949] - Externalizing the PoolConfiguration of data source per tenant
- [MIFOSX-994] - Allow all savings account's(remove constrain for overdraft) as client default account
- [MIFOSX-1015] - Need to Add Pentaho report which generates data for client saving transactions transaction and loan repayment schedule
- [MIFOSX-1010] - stretchy report converted into Pentaho reports
- [MIFOSX-986] - transferring of clients in same group but different loan officer
- [MIFOSX-1013] - Add loanId and clientId in makercheckers api return
- [MIFOSX-942] - Moving savings products and savings accounts api documentation out of beta
- [MIFOSX-993] - JUnit Integration Test Cases for Group Savings
- [MIFOSX-1003] - JUnit Integration Test Cases for Accounting with Savings
- [MIFOSX-1012] - JUnit Test Cases for Fund Transfer in Savings
- [MIFOSX-1026] - JUnit Integration Test Cases for Global Configurations
- [MIFOSX-941] - Api Documentation for modify loan application is missing
Bugs
- [MIFOSX-835] - For a Client (member of 2 Groups) taken JLG loan from 1 group, repayment amount is displaying in collection sheet of other Group
- [MIFOSX-880] - In new JLG Loan application interest on first repayment is not getting calculated as per Disbursement date
- [MIFOSX-909] - For the Loan under pending approval stage - modifications in the charges is not getting updated in "outstanding" column
- [MIFOSX-996] - Not able to modify Loan application through API
- [MIFOSX-1014] - approving maker checker for repayment and adjustments for work throws a 500 error
Community App
- [MIFOSX-1002] - Issues with Angular JS and Require JS load on the community app
- [MIFOSX-957] - Dashboard reports wont work when connected to MIfos X backend other than https://demo.openmf.org
- [MIFOSX-1018] - User with all permission not able to change password of his own
- [MIFOSX-956] - Ability to print Repayment Schedule in active loan
- [MIFOSX-1005] - Improvement with respect to Accounting pages
- [MIFOSX-1016] - Cleaning XBRL reports ui(inline styles)
- [MIFOSX-990] - Navigation page is not working as expected
- [MIFOSX-999] - Issues with User Generated Documents
- [MIFOSX-953] - Associating checkbox to jobs are not working as expected.
- [MIFOSX-972] - Log in screen freezing problem
1.20.1.RELEASE
=============
Bug Release
Bugs
- [MIFOSX-995] - Grace periods not working when actualDisbursementDate != expectedDisbursementDate
1.20.0.RELEASE
=============
Feature Release
Platform & API
New Features & Improvements
- [MIFOSX-216] - No. of days overdue before In Arrears Not in Mifos X
- [MIFOSX-992] - Password Expiry and Idle user Logout
- [MIFOSX-974] - Integration test cases for Savings functionality
Bugs
- [MIFOSX-814] - Not able to create user with the current API parameters
- [MIFOSX-877] - Retrieve Loan by external ID results in 500 error in API
- [MIFOSX-879] - Sorting and Ordering not working on Loan as per API Documentation
- [MIFOSX-930] - In modify loan application (Undo disbursal - Undo approval) not able to delete the charges added before.
- [MIFOSX-945] - Not able to adjust the minimum opening balance amount in transactions page of savings account results in "Null point exception"
- [MIFOSX-955] - Error in Aging Detail stretchy report
- [MIFOSX-948] - No links to User Generated Documents in the api docs (called templates)
Community App
- [MIFOSX-979] - show hide elements on user interface based on user permissions
- [MIFOSX-975] - Clearly represent Loans In Arrears in the Community app
- [MIFOSX-976] - Support editing values for global configurations
- [MIFOSX-985] - Implementing user permissions for scheduler job
- [MIFOSX-989] - Make easy to select particular entity in a table
- [MIFOSX-947] - Issue with checkboxes because of upgradation in Angular JS
- [MIFOSX-973] - Templates functionality is broken after Angular upgrade
- [MIFOSX-977] - Not able to view data in stretchy reports if duplicate values present in JSON array
- [MIFOSX-980] - issue with first repayment on the same day of disbursement
- [MIFOSX-981] - Not able to enter data into data tables for code values
- [MIFOSX-983] - Stretchy reports export csv including old results
- [MIFOSX-987] - Not able to add member under Group with the backdated.
- [MIFOSX-991] - Submit button is not working in currency configuration page
- [MIFOSX-907] - In Edit Datatable page "new name" is not working as expected
- [MIFOSX-909] - For the Loan under pending approval stage - modifications in the charges is not getting updated in "outstanding" column
- [MIFOSX-915] - Not able to submit the JLG loan application if "Interest charged from" field is attached
- [MIFOSX-919] - Charge on specified due date, added while submitting the loan application is not reflecting in preview repayments page
- [MIFOSX-952] - Not able to assign Moratorium for Interest in new loan application page for a client
1.19.0.RELEASE
=============
Feature Release
This feature release adds the ability to associate current accounts with clients along with other improvements and enhancements
Platform & API
New Features & Improvements
- [MIFOSX-931] - Add current account support (overdrafts) for savings
- [MIFOSX-932] - Basic Savings reports
- [MIFOSX-939] - Order of Saving transactions
Bugs
- [MIFOSX-884] - Charges removed in Modify loan application is not getting deleted after saving the application.
- [MIFOSX-911] - Not able to edit client without passing name details
- [MIFOSX-929] - User with no permission to activate the client is able to activate successfully while creating the client.
Community App
- [MIFOSX-933] - Update to latest version of Angular and fix all observed issues
- [MIFOSX-946] - Loan purpose is not captured for Group and JLG loans
- [MIFOSX-864] - Improvements with respect to Closed Loans/Closed Savings
- [MIFOSX-935] - Improvements to view particular transaction details in transaction page (Loan/savings)
- [MIFOSX-937] - Ability to display Loan status in Client loan page
1.18.0.RELEASE
=============
Feature Release
This feature release ships the first implementation of Tranche Loans functionality along with various bug fixes and minor improvements
Platform & API
New Features & Improvements
- [MIFOSX-92] - Tranche Loans
- [MIFOSX-869] - Correct spelling mistakes observed in MifosX schema
- [MIFOSX-902] - Generate Productive Collection sheet based on office, meeting date, loan officera search parameter
- [MIFOSX-872] - Capture Payment Type while creating a journal entry
- [MIFOSX-888] - Early Payment repayment strategy
- [MIFOSX-923] - Missing entity status in search resultset
Bugs
- [MIFOSX-847] - For a Client - 2nd loan(with same product) is not getting incremented as per Borrower Cycle.
- [MIFOSX-867] - If a loan is created with first repayment on date, upon approving if loan is disbursed on other than expected disb date, schedule is not updated
- [MIFOSX-870] - For Disbursed Loan - charge collected on disbursement is not reflecting in Loan summary page.(After running "Update Loan Summary" in schedular job)
- [MIFOSX-895] - Checkbox for "Terms vary based on loan cycle" only controls display and not the desired principal definition
- [MIFOSX-896] - Missing permission for "savingsaccountcharge" endpoint
- [MIFOSX-897] - Missing _CHECKER permission for CREATE_JOURNALENTRY
- [MIFOSX-900] - Deactivating a charge with assigned products causing integrity issues in product mapping
- [MIFOSX-901] - "BIT" datatype/columntype missing displaytype, throws "error.msg.invalid.lookup.type" error message
- [MIFOSX-904] - Loan disbursement checks cause corrupted schedule
- [MIFOSX-906] - Scheduler job exception for post interest for savings
- [MIFOSX-914] - Global configuration page is not working as exptected
- [MIFOSX-920] - Not able to submit the Tranche Loan application for the higher amounts (in Crores)
- [MIFOSX-921] - While submitting the Tranche Loan for a client Improper error message is displaying rather displaying for proper inputs
- [MIFOSX-922] - In Modify application page for Tranche Loans if the Installment amount is modified then Last repayment amount is more than defined.
1.17.1.RELEASE
=============
Bug Release
Bugs
- [MIFOSX-827] - Not able to disburse loan with the percentage charges applied while submitting the loan application.
- [MIFOSX-860] - NOt able to reject the loan application with status "Submitted and pending for approval"
- [MIFOSX-873] - Get clients by office id API is returing HTTP Status 500
- [MIFOSX-875] - Attach duplicate mobile number while creating Client results in Unknown Data Integrity Issue
- [MIFOSX-876] - Retrieve Loan by Loan account number returns all loan account in API
- [MIFOSX-878] - Not able to use created datatable for a client results in Forbidden error
- [MIFOSX-882] - API doccument related Issues
- [MIFOSX-883] - Additional fields added in Edit datatables (for client) page is not woking as expected
- [MIFOSX-912] - Client Loan amount is not getting rounded off even if "Currency in Multiples Of" is set as 100 in loan product.
1.17.0.RELEASE
=============
Feature Release
This feature release contains some API breaking changes around charges, loans and savings products (introducing mandatory short names) along with improvements around Collection Sheet, introducing the ability to activate/inactivate Staff and other Bug fixes
Platform & API
New Features & Improvements
- [MIFOSX-831] - Collectionsheet improvements to make data entry easy
- [MIFOSX-832] - Options to set short name for loan, charge and saving products
- [MIFOSX-845] - Option to activate or inactivate a staff
- [MIFOSX-849] - Update search API to include group external Id as a search parameter
- [MIFOSX-866] - Return Transaction Type of loan or savings transaction associated with a journal entry
Bugs
- [MIFOSX-720] - In modify loan application (Undo disbursal - Undo approval) if charge to be collected from savings is deleted then not able to save the application.
- [MIFOSX-819] - Not able to modify Loan application after undo disburse once one of the charge paid.
1.16.1.RELEASE
=============
Bug Release
Bugs
- [MIFOSX-802] - Loan life cycle is not considered in validations for loan operations
- [MIFOSX-812] - Journalentries Api is not returning currency while retrieving transactions
- [MIFOSX-825] - Timeline is not displaying while fetching the details of created centers
- [MIFOSX-830] - APIs are returning invalid commandId for all actions when maker-checker is enabled.
- [MIFOSX-834] - Reports-Loan products are not listing for currency ALL(Active Loans - Summary)
1.16.0.RELEASE
=============
Feature Release
This feature release adds support for undoing loan write-offs along with a couple other improvements
Platform & API
New Features & Improvements
- [MIFOSX-796] - Allow undo of write off transaction (disallow undo or change of any other transaction when loan is written off)
- [MIFOSX-824] - Add pagination to Audits endpoints
- [MIFOSX-826] - Add holiday status in response data
1.15.2.RELEASE
=============
Bug Release
Bugs
- [MIFOSX-816] - Future loan amounts should be with respect to Loan cycle (not to be confused with borrower cycle)
- [MIFOSX-818] - Not able to retrieve Global Configurations through API
- [MIFOSX-820] - Fix spelling mistakes in permissions for better Display on community app
- [MIFOSX-821] - Null pointer exception while disbursing the loan
- [MIFOSX-822] - Backdated transaction that results in transaction reversals does not create journal entries for new transactions
1.15.1.RELEASE
=============
Bug Release
Bugs
- [MIFOSX-801] - Clean up implementation of [MIFOSX-765]
- [MIFOSX-805] - Terms vary based on loan cycle is not getting updated in Edit Loan Product page.
- [MIFOSX-810] - Unhandled API error while creating multiple users with same name
- [MIFOSX-811] - Repayment schedule dates for Loan disbursement after undo disbursal is not proper
- [MIFOSX-744] - Implementation of mifosx-735 should be optional
1.15.0.RELEASE
=============
Feature Release
This feature release contains some API breaking changes around loan and savings products in relation to the accounting section of their respective APIs. Some small improvements are also bundled into this release.
Platform & API
New Features & Improvements
- [MIFOSX-569] - Calculate future loan amounts or installments based on previous loan cycle.
- [MIFOSX-744] - Implementation of mifosx-735 should be optional
- [MIFOSX-790] - Need ability to be able to link accounting journal entries with the additional payment details captured in m_payment_detail table
- [MIFOSX-792] - Improve penalties introducing a redemption periods for MFIs that dont input data same day.
- [MIFOSX-794] - Add roles list to /users endpoint
- [MIFOSX-795] - Clean up API around Loan/ Savings product creation for consistency and better usability
Bug
- [MIFOSX-798] - Read not working for holidays and API documentation not updated
- [MIFOSX-800] - Scheduler job is failed, if no accounting data is available.
1.14.0.RELEASE
=============
Feature Release
+18 -5
View File
@@ -10,9 +10,9 @@ The release artifact (.zip file) has the following structure:
+ mifosplatform-X.Y.Z.RELEASE ... parent folder which will have the release number on it
|
+ api-docs ... folder contains html based documentation on the platform API for this release
+ database ... folder contains database setup and upgrade scripts required for installation
+ database ... folder contains database setup and upgrade scripts along with sample data required for installation
+ pentahoReports ... folder contains any out-of-the-box reports provided through pentaho
+ apps ... folder contains apps like reference app that speak to the platform
+ apps ... folder contains apps like community app that speak to the platform
|
-- CHANGELOG.MD ... file documents changelog of project up to this release
-- CONTRIBUTORS.MD ... file provides details on contributors to project
@@ -110,9 +110,22 @@ The two ways to get up and running with mifos platform is:
#### 2.2.2 Upgrade existing database(s)
Those updating an existing MifosX installation to version 1.21.* or higher would need to upgrade the *mifosplatform-tenants* database with patch ```database/migrations/list_db/V2__externalize-connection-properties.sql```
```
mysql -uroot -pmysql mifosplatform-tenants < database/migrations/list_db/V2__externalize-connection-properties.sql
```
Any *tenant* databases will be upgraded automatically when the application starts if the *auto_update* field of the *tenants* database table is enabled(=1). This is the default setting.
Upgrading your database in this way is the recomended way as it will upgrade any *tenants* setup in the *mifosplatform-tenants* database but can be disabled by setting the *auto_update* field of the tenant to zero.
Upgrading your database in this way is the recommended way as it will upgrade any *tenants* setup in the *mifosplatform-tenants* database but can be disabled by setting the *auto_update* field of the tenant to zero.
#### 2.2.3 Load *mifostenant-default* schema with sample data (optional)
Every release ships with sample data (offices, users, customers, loan products, savings products and a chart of accounts). The same can be restored by running the following command
```
mysql -uroot -pmysql mifostenant-default < database/migrations/sample_data/load_sample_data.sql
```
### 2.3 Tomcat 7 Setup
@@ -220,11 +233,11 @@ The two ways to get up and running with mifos platform is:
- mifosng-provider.war
Drop the following from the release artifact into [TOMCAT_HOME]/webapps/ROOT folder:
- The entire ```apps/IndividualLendingGeneralJavaScript``` folder
- The entire ```apps/community-app``` folder.
- The entire api-docs folder
#### 2.3.7 Startup tomcat
Startup tomcat:
- Platform application should be available @ https://[server ip address]:8443/mifosng-provider/api/v1/offices?tenantIdentifier=default&pretty=true
- Reference application should be available @ https://[server ip address]:8443/IndividualLendingGeneralJavaScript/IndivLendHome.html?baseApiUrl=https://[server ip address]:8443/mifosng-provider/api/v1/
- Community application should be available @ https://[server ip address]:8443/community-app?baseApiUrl=https://[server ip address]:8443/mifosng-provider/api/v1/
- API docs should be available @ https://[server ip address]:8443/api-docs/apiLive.htm
+4 -4
View File
@@ -22,9 +22,8 @@ Status](https://openmf.ci.cloudbees.com/job/MIFOSX%20INTEGRATION%20TEST/badge/ic
Version
==========
The mifos-platform (project named 'Mifos X') has reached <b>public release version</b>.
That means there is a published and stable API. This API is documented in the api-docs under <b>Full API Matrix</b>.
The API for the mifos-platform (project named 'Mifos X')is documented in the api-docs under <b>Full API Matrix</b> and can be viewed <a target="_blank" href="https://demo.openmf.org/api-docs/apiLive.htm" title="API Documentation"> here
</a>
Latest stable release can always been viewed on master branch: <a target="_blank" href="https://github.com/openMF/mifosx/tree/master" title="Latest Release">Latest Release on Master</a>, <a target="_blank" href="https://github.com/openMF/mifosx/blob/master/CHANGELOG.md" title="Latest release change log">View change log</a>
@@ -42,7 +41,8 @@ Mifos Platform API
Online Demos
=============================
<a target="_blank" href="https://demo.openmf.org" title="Reference Client App">Reference Client App</a>
* <a target="_blank" href="https://demo.openmf.org" title="Reference Client App">Community App</a>
* ~~<a target="_blank" href="https://demo.openmf.org/old/" title="Community App">Reference Client App (Deprecated)</a>~~
Developers
==========
+10646 -745
View File
File diff suppressed because it is too large Load Diff
+16 -7
View File
@@ -43,16 +43,24 @@
padding-right:5px;
vertical-align:text-top;
}
.matrixHeading tr.alt
{
color:#000;
background-color: rgb(240, 240, 255);
}
.matrixHeading tr:not(:first-child):nth-child(even) {
color: #000;
background-color: rgb(240, 240, 255);
}
.matrixHeading tr:not(:first-child):nth-child(odd) {
color: #000;
background-color: rgba(255, 248, 218, 0.13);
}
.matrixHeading tr:first-child td table tr {
background-color: #6eb4db !important;
}
.matrixHeadingBG {
background-color: #6eb4db;
background-color: #6eb4db;
}
.matrixHeadingVerbs {
@@ -62,7 +70,8 @@
}
.matrixHeadingCommands {
color: rgb(240, 240, 255);
color: rgb(240, 240, 255) !important;
background-color: #6eb4db !important;
}
.mifosXHeading2 {
+6 -5
View File
@@ -1,16 +1,17 @@
Mifos Platform Apps
======
Some community created apps built on top of mifosplatform are stored in source control repository @ https://github.com/openMF/mifosx-community-apps
Community created apps built on top of mifosplatform are stored in source control repository @ https://github.com/openMF/
The new Community App (AngularJS-based)
The Community App (AngularJS-based)
===============
https://github.com/openMF/community-app
The original Reference App
The Default app shipped which is a core part of every community release.
The original Reference App (Now Deprecated)
===============
https://github.com/openMF/mifosx-community-apps/tree/master/IndividualLendingGeneralJavaScript
The reference app is a core part of community release. It is presently used to showcase platform API capabilities and is also used in production by MFIs.
The reference app was used to showcase platform API capabilities and is also used in production by MFIs.
BIN
View File
Binary file not shown.
@@ -73,6 +73,19 @@ CREATE TABLE `tenants` (
`schema_username` varchar(100) NOT NULL DEFAULT 'root',
`schema_password` varchar(100) NOT NULL DEFAULT 'mysql',
`auto_update` tinyint(1) NOT NULL DEFAULT '1',
`pool_initial_size` int(5) DEFAULT 5,
`pool_validation_interval` int(11) DEFAULT 30000,
`pool_remove_abandoned` tinyint(1) DEFAULT 1,
`pool_remove_abandoned_timeout` int(5) DEFAULT 60,
`pool_log_abandoned` tinyint(1) DEFAULT 1,
`pool_abandon_when_percentage_full` int(5) DEFAULT 50,
`pool_test_on_borrow` tinyint(1) DEFAULT 1,
`pool_max_active` int(5) DEFAULT 40,
`pool_min_idle` int(5) DEFAULT 20,
`pool_max_idle` int(5) DEFAULT 10,
`pool_suspect_timeout` int(5) DEFAULT 60,
`pool_time_between_eviction_runs_millis` int(11) DEFAULT 34000,
`pool_min_evictable_idle_time_millis` int(11) DEFAULT 60000,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -84,7 +97,7 @@ CREATE TABLE `tenants` (
LOCK TABLES `tenants` WRITE;
/*!40000 ALTER TABLE `tenants` DISABLE KEYS */;
INSERT INTO `tenants` VALUES
(1,'default','default','mifostenant-default','Asia/Kolkata',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1);
(1,'default','default','mifostenant-default','Asia/Kolkata',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1,5,30000,1,60,1,50,1,40,20,10,60,34000,60000);
/*!40000 ALTER TABLE `tenants` ENABLE KEYS */;
UNLOCK TABLES;
@@ -0,0 +1,19 @@
CREATE TABLE `m_product_loan_variations_borrower_cycle` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`loan_product_id` BIGINT(20) NOT NULL DEFAULT '0',
`borrower_cycle_number` INT(3) NOT NULL DEFAULT '0',
`value_condition` INT(1) NOT NULL DEFAULT '0',
`param_type` INT(1) NOT NULL DEFAULT '0',
`default_value` DECIMAL(19,6) NOT NULL DEFAULT '0.000000',
`max_value` DECIMAL(19,6) NULL DEFAULT NULL,
`min_value` DECIMAL(19,6) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `borrower_cycle_loan_product_FK` (`loan_product_id`),
CONSTRAINT `borrower_cycle_loan_product_FK` FOREIGN KEY (`loan_product_id`) REFERENCES `m_product_loan` (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;
ALTER TABLE `m_product_loan`
ADD COLUMN `use_borrower_cycle` TINYINT(1) NOT NULL DEFAULT '0' AFTER `include_in_borrower_cycle`;
@@ -0,0 +1,10 @@
ALTER TABLE `acc_gl_journal_entry`
ADD COLUMN `loan_transaction_id` BIGINT(20) NULL AFTER `transaction_id`,
ADD COLUMN `savings_transaction_id` BIGINT(20) NULL AFTER `loan_transaction_id`,
ADD CONSTRAINT `FK_acc_gl_journal_entry_m_loan_transaction` FOREIGN KEY (`loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`),
ADD CONSTRAINT `FK_acc_gl_journal_entry_m_savings_account_transaction` FOREIGN KEY (`savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`);
UPDATE acc_gl_journal_entry je SET je.savings_transaction_id=je.transaction_id,je.transaction_id=Concat('S',je.transaction_id) WHERE je.entity_type_enum=2;
UPDATE acc_gl_journal_entry je SET je.loan_transaction_id=je.transaction_id,je.transaction_id=Concat('L',je.transaction_id) WHERE je.entity_type_enum=1;
@@ -0,0 +1,6 @@
UPDATE m_client mc SET mc.submittedon_date=mc.activation_date where mc.submittedon_date is NULL;
UPDATE m_client mc SET mc.submittedon_date=now() where mc.submittedon_date is NULL;
UPDATE m_group mg SET mg.submittedon_date=mg.activation_date where mg.submittedon_date is NULL;
UPDATE m_group mg SET mg.submittedon_date=now() where mg.submittedon_date is NULL;
@@ -0,0 +1 @@
update m_permission set grouping="organisation" where grouping = "organistion";
@@ -0,0 +1,14 @@
ALTER TABLE `c_configuration`
ADD COLUMN `value` INT NULL AFTER `name`;
INSERT INTO `c_configuration` (
`id` ,
`name` ,
`value` ,
`enabled`
)
VALUES (
NULL , 'penalty-wait-period', '2', '1'
);
@@ -0,0 +1 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_loan', 'UNDOWRITEOFF_LOAN', 'LOAN', 'UNDOWRITEOFF', 0);
@@ -0,0 +1 @@
UPDATE stretchy_parameter SET `parameter_sql`='select p.id, p.`name`\r\nfrom m_product_loan p\r\nwhere (p.currency_code = \'${currencyId}\' or \'-1\'= \'${currencyId}\')\r\norder by 2' WHERE parameter_name='loanProductIdSelectAll';
@@ -0,0 +1 @@
ALTER TABLE `m_staff` ADD COLUMN `is_active` TINYINT(1) DEFAULT '0' AFTER `organisational_role_parent_staff_id`;
@@ -0,0 +1,18 @@
ALTER TABLE `m_product_loan`
ADD COLUMN `short_name` VARCHAR(4) NULL DEFAULT NULL AFTER `id`;
update m_product_loan set short_name=concat(LEFT(name,2), RIGHT(id,2)) where short_name is null;
ALTER TABLE `m_product_loan`
ALTER `short_name` DROP DEFAULT;
ALTER TABLE `m_product_loan`
CHANGE COLUMN `short_name` `short_name` VARCHAR(4) NOT NULL AFTER `id`;
ALTER TABLE `m_product_loan`
ADD UNIQUE INDEX `unq_short_name` (`short_name`);
ALTER TABLE `m_savings_product`
ADD COLUMN `short_name` VARCHAR(4) NULL DEFAULT NULL AFTER `name`;
update m_savings_product set short_name=concat(LEFT(name,2), RIGHT(id,2)) where short_name is null;
ALTER TABLE `m_savings_product`
ALTER `short_name` DROP DEFAULT;
ALTER TABLE `m_savings_product`
CHANGE COLUMN `short_name` `short_name` VARCHAR(4) NOT NULL AFTER `name`,
ADD UNIQUE INDEX `sp_unq_short_name` (`short_name`);
@@ -0,0 +1,3 @@
ALTER TABLE `m_staff`
CHANGE COLUMN `is_active` `is_active` TINYINT(1) NOT NULL DEFAULT '1' AFTER `organisational_role_parent_staff_id`;
UPDATE `m_staff` SET `is_active`=1;
@@ -0,0 +1,3 @@
ALTER TABLE `acc_gl_journal_entry`
ADD COLUMN `payment_details_id` BIGINT(20) NULL AFTER `organization_running_balance`,
ADD CONSTRAINT `FK_acc_gl_journal_entry_m_payment_detail` FOREIGN KEY (`payment_details_id`) REFERENCES `m_payment_detail` (`id`);
@@ -0,0 +1,2 @@
ALTER TABLE `m_loan_charge`
ADD COLUMN `is_active` TINYINT(1) NOT NULL DEFAULT '1' AFTER `max_cap`;
@@ -0,0 +1,3 @@
INSERT INTO `ref_loan_transaction_processing_strategy` ( `code`, `name`)
VALUES
( 'early-repayment-strategy', 'Early Repayment Strategy');
@@ -0,0 +1 @@
insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'READ_SAVINGSACCOUNTCHARGE', 'SAVINGSACCOUNTCHARGE', 'READ', 0);
@@ -0,0 +1 @@
insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'CREATE_JOURNALENTRY_CHECKER', 'JOURNALENTRY', 'CREATE', 0);
@@ -0,0 +1,4 @@
RENAME TABLE `x_table_cloumn_code_mappings` TO `x_table_column_code_mappings`;
ALTER TABLE `acc_gl_journal_entry`
CHANGE COLUMN `is_running_balance_caculated` `is_running_balance_calculated` TINYINT(4) NOT NULL DEFAULT '0' AFTER `lastmodified_date`;
@@ -0,0 +1,17 @@
INSERT INTO `c_configuration` (`id`, `name`, `value`, `enabled`) VALUES (NULL, 'force-password-reset-days', '0', '0');
ALTER TABLE `m_appuser` ADD `last_time_password_updated` DATE NOT NULL ,
ADD INDEX ( `last_time_password_updated` ) ;
UPDATE `m_appuser` SET `last_time_password_updated` = NOW() WHERE `m_appuser`.`last_time_password_updated` ='0000-00-00';
CREATE TABLE IF NOT EXISTS `m_appuser_previous_password` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) NOT NULL,
`password` varchar(255) NOT NULL,
`removal_date` date NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
ALTER TABLE m_appuser_previous_password
ADD FOREIGN KEY (user_id) REFERENCES m_appuser(id);
@@ -0,0 +1,38 @@
ALTER TABLE `m_product_loan`
ADD COLUMN `multi_disburse_loan` TINYINT(1) NOT NULL DEFAULT '0' AFTER `close_date`,
ADD COLUMN `max_tranche_count` INT(2) NULL DEFAULT NULL AFTER `multi_disburse_loan`,
ADD COLUMN `outstanding_loan_balance` DECIMAL(19,6) NULL DEFAULT NULL AFTER `max_tranche_count`;
CREATE TABLE `m_loan_disbursement_detail` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`loan_id` BIGINT(20) NOT NULL,
`expected_disburse_date` DATETIME NOT NULL,
`disbursedon_date` DATETIME NULL,
`principal` DECIMAL(19,6) NOT NULL,
`approved_principal` DECIMAL(19,6) NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `FK_loan_disbursement_detail_loan_id` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;
ALTER TABLE `m_loan`
ADD COLUMN `fixed_emi_amount` DECIMAL(19,6) NULL AFTER `loan_product_counter`,
ADD COLUMN `approved_principal` DECIMAL(19,6) NOT NULL AFTER `principal_amount`,
ADD COLUMN `max_outstanding_loan_balance` DECIMAL(19,6) NULL DEFAULT NULL AFTER `fixed_emi_amount`;
UPDATE m_loan ml SET ml.approved_principal = ml.principal_amount;
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_DISBURSEMENTDETAIL', 'DISBURSEMENTDETAIL', 'UPDATE', 0);
CREATE TABLE `m_loan_term_variations` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`loan_id` BIGINT(20) NOT NULL,
`term_type` SMALLINT(2) NOT NULL,
`applicable_from` DATE NOT NULL,
`term_value` DECIMAL(19,6) NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `FK_loan_id_m_loan_id` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;
@@ -0,0 +1,4 @@
ALTER TABLE `m_product_loan`
CHANGE COLUMN `multi_disburse_loan` `allow_multiple_disbursals` TINYINT(1) NOT NULL DEFAULT '0' AFTER `close_date`,
CHANGE COLUMN `max_tranche_count` `max_disbursals` INT(2) NULL DEFAULT NULL AFTER `allow_multiple_disbursals`,
CHANGE COLUMN `outstanding_loan_balance` `max_outstanding_loan_balance` DECIMAL(19,6) NULL DEFAULT NULL AFTER `max_disbursals`;
+14
View File
@@ -0,0 +1,14 @@
ALTER TABLE `m_savings_product`
ADD COLUMN `allow_overdraft` TINYINT(1) NOT NULL DEFAULT '0' AFTER `withdrawal_fee_for_transfer`,
ADD COLUMN `overdraft_limit` DECIMAL(19,6) NULL DEFAULT NULL AFTER `allow_overdraft`;
ALTER TABLE `m_savings_account`
ADD COLUMN `allow_overdraft` TINYINT(1) NOT NULL DEFAULT '0' AFTER `withdrawal_fee_for_transfer`,
ADD COLUMN `overdraft_limit` DECIMAL(19,6) NULL DEFAULT NULL AFTER `allow_overdraft`;
ALTER TABLE `m_savings_account_transaction`
ADD COLUMN `overdraft_amount_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `amount`;
ALTER TABLE `m_client`
ADD COLUMN `default_savings_product` BIGINT(20) NULL DEFAULT NULL AFTER `closedon_userid`,
ADD CONSTRAINT `FK_m_client_m_savings_product` FOREIGN KEY (`default_savings_product`) REFERENCES `m_savings_product` (`id`);
@@ -0,0 +1,4 @@
ALTER TABLE `m_savings_account_transaction`
ADD COLUMN `created_date` DATETIME NOT NULL AFTER `cumulative_balance_derived`;
update m_savings_account_transaction sat set sat.created_date=sat.transaction_date;
@@ -0,0 +1,32 @@
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Savings Transactions', 'Pentaho', NULL, 'Savings', NULL, NULL, 0, 1);
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Client Savings Summary', 'Pentaho', NULL, 'Savings', NULL, NULL, 0, 1);
INSERT INTO `stretchy_parameter` (`parameter_name`, `parameter_variable`, `parameter_label`, `parameter_displayType`, `parameter_FormatType`, `parameter_default`, `special`, `selectOne`, `selectAll`, `parameter_sql`, `parent_id`) VALUES ( 'selectAccount', 'accountNo', 'Enter Account No', 'text', 'string', 'n/a', NULL, NULL, NULL, NULL, NULL);
INSERT INTO `stretchy_parameter` (`parameter_name`, `parameter_variable`, `parameter_label`, `parameter_displayType`, `parameter_FormatType`, `parameter_default`, `special`, `selectOne`, `selectAll`, `parameter_sql`, `parent_id`) VALUES ('savingsProductIdSelectAll', 'savingsProductId', 'Product', 'select', 'number', '0', NULL, NULL, 'Y', 'select p.id, p.`name`\r\nfrom m_savings_product p\r\norder by 2', NULL);
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Savings Transactions'), (select id from stretchy_parameter where parameter_name='startDateSelect'), 'fromDate');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Savings Transactions'), (select id from stretchy_parameter where parameter_name='endDateSelect'), 'toDate');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Savings Transactions'), (select id from stretchy_parameter where parameter_name='selectAccount'), 'accountNo');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Savings Summary'), (select id from stretchy_parameter where parameter_name='startDateSelect'), 'fromDate');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Savings Summary'), (select id from stretchy_parameter where parameter_name='endDateSelect'), 'toDate');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Savings Summary'), (select id from stretchy_parameter where parameter_name='OfficeIdSelectOne'), 'selectOffice');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Savings Summary'), (select id from stretchy_parameter where parameter_name='savingsProductIdSelectAll'), 'selectProduct');
ALTER TABLE `r_enum_value`
ADD COLUMN `enum_type` TINYINT(1) NOT NULL AFTER `enum_value`;
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 1, 'deposit', 'deposit', 0);
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 2, 'withdrawal', 'withdrawal', 1);
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 3, 'Interest Posting', 'Interest Posting', 0);
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 4, 'Withdrawal Fee', 'Withdrawal Fee', 1);
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 5, 'Annual Fee', 'Annual Fee', 1);
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 6, 'Waive Charge', 'Waive Charge', 0);
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 7, 'Pay Charge', 'Pay Charge', 1);
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 12, 'Initiate Transfer', 'Initiate Transfer', 0);
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 13, 'Approve Transfer', 'Approve Transfer', 0);
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 14, 'Withdraw Transfer', 'Withdraw Transfer', 0);
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 15, 'Reject Transfer', 'Reject Transfer', 0);
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 16, 'Written-Off', 'Written-Off', 0);
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 17, 'Overdraft Interest', 'Overdraft Interest', 0);
@@ -0,0 +1,5 @@
ALTER TABLE `m_client`
ADD COLUMN `default_savings_account` BIGINT(20) NULL DEFAULT NULL AFTER `default_savings_product`,
ADD CONSTRAINT `FK_m_client_m_savings_account` FOREIGN KEY (`default_savings_account`) REFERENCES `m_savings_account` (`id`);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATESAVINGSACCOUNT_CLIENT', 'CLIENT', 'UPDATESAVINGSACCOUNT', 0);
@@ -0,0 +1,5 @@
ALTER TABLE `m_product_loan`
ADD COLUMN `grace_on_arrears_ageing` SMALLINT(5) NULL DEFAULT NULL AFTER `max_outstanding_loan_balance`;
ALTER TABLE `m_loan`
ADD COLUMN `grace_on_arrears_ageing` SMALLINT(5) NULL DEFAULT NULL AFTER `max_outstanding_loan_balance`;
@@ -0,0 +1,9 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'READ_ACCOUNTINGRULE', 'ACCOUNTINGRULE', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'READ_JOURNALENTRY', 'JOURNALENTRY', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'READ_GLACCOUNT', 'GLACCOUNT', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'READ_GLCLOSURE', 'GLCLOSURE', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'READ_HOLIDAY', 'HOLIDAY', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('jobs', 'READ_SCHEDULER', 'SCHEDULER', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'READ_PRODUCTMIX', 'PRODUCTMIX', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'READ_MEETING', 'MEETING', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('jobs', 'EXECUTEJOB_SCHEDULER', 'SCHEDULER', 'EXECUTEJOB', 0);
@@ -0,0 +1 @@
UPDATE `stretchy_report` SET `report_sql`='\r\nSELECT \r\nconcat(repeat("..", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as "Office/Branch",\r\nifnull(cur.display_symbol, ml.currency_code) as Currency, \r\nmc.account_no as "Client Account No.",\r\n mc.display_name AS "Client Name",\r\n ml.account_no AS "Account Number",\r\n ml.principal_amount AS "Loan Amount",\r\n ml.principal_disbursed_derived AS "Original Principal",\r\n ml.interest_charged_derived AS "Original Interest",\r\n ml.principal_repaid_derived AS "Principal Paid",\r\n ml.interest_repaid_derived AS "Interest Paid",\r\n laa.principal_overdue_derived AS "Principal Overdue",\r\n laa.interest_overdue_derived AS "Interest Overdue",\r\nDATEDIFF(CURDATE(), laa.overdue_since_date_derived) as "Days in Arrears",\r\n\r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<7, \'<1\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<8, \' 1\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<15, \'2\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<22, \' 3\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<29, \' 4\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<36, \' 5\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<43, \' 6\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<50, \' 7\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<57, \' 8\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<64, \' 9\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<71, \'10\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<78, \'11\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<85, \'12\', \'12+\')))))))))))) )AS "Weeks In Arrears Band",\r\n\r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<31, \'0 - 30\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<61, \'30 - 60\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<91, \'60 - 90\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<181, \'90 - 180\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<361, \'180 - 360\', \r\n \'> 360\'))))) AS "Days in Arrears Band"\r\n\r\n FROM m_office mo \r\n JOIN m_office ounder ON ounder.hierarchy like concat(mo.hierarchy, \'%\')\r\n AND ounder.hierarchy like CONCAT(\'${currentUserHierarchy}\', \'%\')\r\n INNER JOIN m_client mc ON mc.office_id=ounder.id\r\n INNER JOIN m_loan ml ON ml.client_id = mc.id\r\n INNER JOIN r_enum_value rev ON rev.enum_id=ml.loan_status_id AND rev.enum_name = \'loan_status_id\'\r\n INNER JOIN m_loan_arrears_aging laa ON laa.loan_id=ml.id\r\n left join m_currency cur on cur.code = ml.currency_code\r\n WHERE ml.loan_status_id=300\r\n AND mo.id=${officeId}\r\nORDER BY ounder.hierarchy, ifnull(cur.display_symbol, ml.currency_code), ml.account_no\r\n' WHERE `report_name`='Aging Detail';
@@ -0,0 +1,719 @@
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report)VALUES ("Active Loans - Details(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Active Loans - Summary(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Active Loans by Disbursal Period(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Active Loans in last installment Summary(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report)VALUES ("Active Loans in last installment(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Active Loans Passed Final Maturity Summary(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Active Loans Passed Final Maturity(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Aging Detail(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Aging Summary (Arrears in Months)(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Aging Summary (Arrears in Weeks)(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Client Listing(Pentaho)", 'Pentaho', 'Client', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Client Loans Listing(Pentaho)", 'Pentaho', 'Client', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Expected Payments By Date - Basic(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Funds Disbursed Between Dates Summary by Office(Pentaho)", 'Pentaho', 'Fund', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Funds Disbursed Between Dates Summary(Pentaho)", 'Pentaho', 'Fund', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Loans Awaiting Disbursal Summary by Month(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Loans Awaiting Disbursal Summary(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Loans Awaiting Disbursal(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Loans Pending Approval(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Obligation Met Loans Details(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Obligation Met Loans Summary(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Portfolio at Risk by Branch(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Portfolio at Risk(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Rescheduled Loans(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("TxnRunningBalances(Pentaho)", 'Pentaho', 'Transaction', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Written-Off Loans(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),'branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'loanOfficer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'currencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),'loanPurposeId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'loanOfficer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
'loanPurposeId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='parTypeSelect'),
'parType');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'loanOfficer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
'loanPurposeId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
'startDate');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
'endDate');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'Loan Officer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
'loanPurposeId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='parTypeSelect'),
'parType');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'Loan Officer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
'loanPurposeId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'Loan Officer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
'loanPurposeId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='parTypeSelect'),
'parType');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'Loan Officer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
'loanPurposeId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Aging Detail(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Aging Summary (Arrears in Months)(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Aging Summary (Arrears in Months)(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Aging Summary (Arrears in Weeks)(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Aging Summary (Arrears in Weeks)(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Listing(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'selectOffice');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'Loan Officer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
'loanPurposeId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Expected Payments By Date - Basic(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Expected Payments By Date - Basic(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'Loan Officer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Expected Payments By Date - Basic(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
'startDate');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Expected Payments By Date - Basic(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
'endDate');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary by Office(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary by Office(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary by Office(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary by Office(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
'startDate');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary by Office(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
'endDate');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
'startDate');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
'endDate');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'Loan Officer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
'loanPurposeId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'Loan Officer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
'loanPurposeId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'Loan Officer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
'loanPurposeId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'Loan Officer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
'loanPurposeId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'Loan Officer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
'loanPurposeId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
'startDate');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
'endDate');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='obligDateTypeSelect'),
'obligDateType');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'Loan Officer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
'loanPurposeId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
'Startdate');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
'Enddate');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='obligDateTypeSelect'),
'obligDateType');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'Loan Officer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
'loanPurposeId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='parTypeSelect'),
'parType');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'loanOfficer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
'fundId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
'loanPurposeId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='parTypeSelect'),
'parType');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Rescheduled Loans(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Rescheduled Loans(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Rescheduled Loans(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Rescheduled Loans(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
'startDate');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Rescheduled Loans(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
'endDate');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='TxnRunningBalances(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='TxnRunningBalances(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
'Loan Officer');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='TxnRunningBalances(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
'startDate');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='TxnRunningBalances(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
'endDate');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Written-Off Loans(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
'Branch');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Written-Off Loans(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
'CurrencyId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Written-Off Loans(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
'loanProductId');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Written-Off Loans(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
'startDate');
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Written-Off Loans(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
'endDate');
@@ -0,0 +1,9 @@
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Client Saving Transactions', 'Pentaho', NULL, 'Savings', NULL, NULL, 0, 0);
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Saving Transactions'), (select id from stretchy_parameter where parameter_name='startDateSelect'), 'startDate');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Saving Transactions'), (select id from stretchy_parameter where parameter_name='endDateSelect'), 'endDate');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Saving Transactions'), (select id from stretchy_parameter where parameter_name='selectAccount'), 'accountNo');
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Client Loan Account Schedule', 'Pentaho', NULL, 'Loans', NULL, NULL, 0, 0);
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Loan Account Schedule'), (select id from stretchy_parameter where parameter_name='startDateSelect'), 'startDate');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Loan Account Schedule'), (select id from stretchy_parameter where parameter_name='endDateSelect'), 'endDate');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Loan Account Schedule'), (select id from stretchy_parameter where parameter_name='selectAccount'), 'accountNo');
@@ -0,0 +1,18 @@
ALTER TABLE `m_charge`
ADD COLUMN `fee_frequency` SMALLINT(5) NULL DEFAULT NULL AFTER `max_cap`;
CREATE TABLE `m_loan_overdue_installment_charge` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`loan_charge_id` BIGINT(20) NOT NULL,
`loan_schedule_id` BIGINT(20) NOT NULL,
`frequency_number` INT(10) NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `FK_m_loan_overdue_installment_charge_m_loan_charge` FOREIGN KEY (`loan_charge_id`) REFERENCES `m_loan_charge` (`id`),
CONSTRAINT `FK_m_loan_overdue_installment_charge_m_loan_repayment_schedule` FOREIGN KEY (`loan_schedule_id`) REFERENCES `m_loan_repayment_schedule` (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;
INSERT INTO `c_configuration` (`name`, `value`, `enabled`) VALUES ('grace-on-penalty-posting', 0, 1);
INSERT INTO m_loan_overdue_installment_charge (`loan_charge_id`, `loan_schedule_id`, `frequency_number`) SELECT mlc.id ,ls.id ,1 from m_loan_charge as mlc inner join m_charge mc on mc.id = mlc.charge_id inner join m_loan_repayment_schedule ls on ls.loan_id = mlc.loan_id and ls.duedate = mlc.due_for_collection_as_of_date where mc.charge_time_enum = 9 and mlc.is_active = 1;
@@ -0,0 +1,17 @@
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('GroupNamesByStaff', 'Table', '', '', 'Select gr.id as id, gr.display_name as name from m_group gr where gr.level_id=1 and gr.staff_id = ${staffId}', '', 0, 1);
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('ClientTrendsByDay', 'Table', '', 'Client', 'SELECT COUNT(cl.id) AS count, \n cl.activation_date AS days\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (cl.activation_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 DAY) AND DATE(NOW()- INTERVAL 1 DAY))\nGROUP BY days', 'Retrieves the number of clients joined in last 12 days', 0, 1);
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('ClientTrendsByWeek', 'Table', '', 'Client', 'SELECT COUNT(cl.id) AS count, \n WEEK(cl.activation_date) AS Weeks\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (cl.activation_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 WEEK) AND DATE(NOW()))\nGROUP BY Weeks', '', 0, 1);
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('ClientTrendsByMonth', 'Table', '', 'Client', 'SELECT COUNT(cl.id) AS count, \n MONTHNAME(cl.activation_date) AS Months\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (cl.activation_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 MONTH) AND DATE(NOW()))\nGROUP BY Months', '', 0, 1);
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('LoanTrendsByDay', 'Table', '', 'Loan', 'SELECT COUNT(ln.id) AS lcount, \n ln.disbursedon_date AS days\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\n LEFT JOIN m_loan ln on cl.id = ln.client_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (ln.disbursedon_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 DAY) AND DATE(NOW()- INTERVAL 1 DAY))\nGROUP BY days', 'Retrieves Number of loans disbursed for last 12 days', 0, 1);
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('LoanTrendsByWeek', 'Table', '', 'Loan', 'SELECT COUNT(ln.id) AS lcount, \n WEEK(ln.disbursedon_date) AS Weeks\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\n LEFT JOIN m_loan ln on cl.id = ln.client_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (ln.disbursedon_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 WEEK) AND DATE(NOW()))\nGROUP BY Weeks', '', 0, 1);
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('LoanTrendsByMonth', 'Table', '', 'Loan', 'SELECT COUNT(ln.id) AS lcount, \n MONTHNAME(ln.disbursedon_date) AS Months\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\n LEFT JOIN m_loan ln on cl.id = ln.client_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (ln.disbursedon_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 MONTH) AND DATE(NOW()))\nGROUP BY Months', '', 0, 1);
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Demand_Vs_Collection', 'Table', '', 'Loan', 'select amount.AmountDue-amount.AmountPaid as AmountDue, amount.AmountPaid as AmountPaid from\n(SELECT \n(IFNULL(SUM(ls.principal_amount),0) - IFNULL(SUM(ls.principal_writtenoff_derived),0)\n + IFNULL(SUM(ls.interest_amount),0) - IFNULL(SUM(ls.interest_writtenoff_derived),0) \n - IFNULL(SUM(ls.interest_waived_derived),0)\n + IFNULL(SUM(ls.fee_charges_amount),0) - IFNULL(SUM(ls.fee_charges_writtenoff_derived),0) \n - IFNULL(SUM(ls.fee_charges_waived_derived),0)\n + IFNULL(SUM(ls.penalty_charges_amount),0) - IFNULL(SUM(ls.penalty_charges_writtenoff_derived),0) \n - IFNULL(SUM(ls.penalty_charges_waived_derived),0)\n) AS AmountDue, \n\n(IFNULL(SUM(ls.principal_completed_derived),0) - IFNULL(SUM(ls.principal_writtenoff_derived),0) + IFNULL(SUM(ls.interest_completed_derived),0) - IFNULL(SUM(ls.interest_writtenoff_derived),0) \n - IFNULL(SUM(ls.interest_waived_derived),0)\n + IFNULL(SUM(ls.fee_charges_completed_derived),0) - IFNULL(SUM(ls.fee_charges_writtenoff_derived),0) \n - IFNULL(SUM(ls.fee_charges_waived_derived),0)\n + IFNULL(SUM(ls.penalty_charges_completed_derived),0) - IFNULL(SUM(ls.penalty_charges_writtenoff_derived),0) \n - IFNULL(SUM(ls.penalty_charges_waived_derived),0)\n) AS AmountPaid\nFROM m_office of\nLEFT JOIN m_client cl ON of.id = cl.office_id\nLEFT JOIN m_loan ln ON cl.id = ln.client_id\nLEFT JOIN m_loan_repayment_schedule ls ON ln.id = ls.loan_id\nWHERE ls.duedate = DATE(NOW()) AND \n (of.hierarchy LIKE CONCAT((\nSELECT ino.hierarchy\nFROM m_office ino\nWHERE ino.id = ${officeId}),"%"))) as amount', 'Demand Vs Collection', 0, 1);
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Disbursal_Vs_Awaitingdisbursal', 'Table', '', 'Loan', 'select awaitinddisbursal.amount-disbursedAmount.amount as amountToBeDisburse, disbursedAmount.amount as disbursedAmount from \n(\nSELECT COUNT(ln.id) AS noOfLoans, \n IFNULL(SUM(ln.principal_amount),0) AS amount\nFROM \nm_office of\nLEFT JOIN m_client cl ON cl.office_id = of.id\nLEFT JOIN m_loan ln ON cl.id = ln.client_id\nWHERE \nln.expected_disbursedon_date = DATE(NOW()) AND \n(ln.loan_status_id=200 OR ln.loan_status_id=300) AND\n of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" )\n) awaitinddisbursal,\n(\nSELECT COUNT(ltrxn.id) as count, \n IFNULL(SUM(ltrxn.amount),0) as amount \nFROM \nm_office of\nLEFT JOIN m_client cl ON cl.office_id = of.id\nLEFT JOIN m_loan ln ON cl.id = ln.client_id\nLEFT JOIN m_loan_transaction ltrxn ON ln.id = ltrxn.loan_id\nWHERE \nltrxn.transaction_date = DATE(NOW()) AND \nltrxn.transaction_type_enum=1 AND\n of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n) disbursedAmount', 'Disbursal_Vs_Awaitingdisbursal', 0, 1);
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'ClientTrendsByDay'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), '');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'ClientTrendsByWeek'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), '');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'ClientTrendsByMonth'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), '');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'LoanTrendsByDay'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), '');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'LoanTrendsByWeek'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), '');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'LoanTrendsByMonth'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), '');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'Demand_Vs_Collection'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), '');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'Disbursal_Vs_Awaitingdisbursal'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), '');
@@ -0,0 +1,2 @@
ALTER TABLE `m_portfolio_command_source`
ADD COLUMN `transaction_id` VARCHAR(100) NULL DEFAULT NULL AFTER `product_id`;
@@ -0,0 +1,126 @@
CREATE TABLE `m_account_transfer_details` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`from_office_id` BIGINT(20) NOT NULL,
`to_office_id` BIGINT(20) NOT NULL,
`from_client_id` BIGINT(20) NULL DEFAULT NULL,
`to_client_id` BIGINT(20) NULL DEFAULT NULL,
`from_savings_account_id` BIGINT(20) NULL DEFAULT NULL,
`to_savings_account_id` BIGINT(20) NULL DEFAULT NULL,
`from_loan_account_id` BIGINT(20) NULL DEFAULT NULL,
`to_loan_account_id` BIGINT(20) NULL DEFAULT NULL,
`transfer_type` SMALLINT(2) NULL DEFAULT NULL,
`from_savings_transaction_id` BIGINT(20) NULL DEFAULT NULL,
`from_loan_transaction_id` BIGINT(20) NULL DEFAULT NULL,
`to_savings_transaction_id` BIGINT(20) NULL DEFAULT NULL,
`to_loan_transaction_id` BIGINT(20) NULL DEFAULT NULL,
`is_reversed` TINYINT(1) NOT NULL,
`transaction_date` DATE NOT NULL,
`currency_code` VARCHAR(3) NOT NULL,
`currency_digits` SMALLINT(5) NOT NULL,
`currency_multiplesof` SMALLINT(5) NULL DEFAULT NULL,
`amount` DECIMAL(19,6) NOT NULL,
`description` VARCHAR(200) NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_account_transfer_details_from_office` (`from_office_id`),
INDEX `FK_m_account_transfer_details_to_office` (`to_office_id`),
INDEX `FK_m_account_transfer_details_from_client` (`from_client_id`),
INDEX `FK_m_account_transfer_details_to_client` (`to_client_id`),
INDEX `FK_m_account_transfer_details_from_savings_account` (`from_savings_account_id`),
INDEX `FK_m_account_transfer_details_to_savings_account` (`to_savings_account_id`),
INDEX `FK_m_account_transfer_details_from_loan_account` (`from_loan_account_id`),
INDEX `FK_m_account_transfer_details_to_loan_account` (`to_loan_account_id`),
CONSTRAINT `FK_m_account_transfer_details_from_client` FOREIGN KEY (`from_client_id`) REFERENCES `m_client` (`id`),
CONSTRAINT `FK_m_account_transfer_details_from_loan_account` FOREIGN KEY (`from_loan_account_id`) REFERENCES `m_loan` (`id`),
CONSTRAINT `FK_m_account_transfer_details_from_office` FOREIGN KEY (`from_office_id`) REFERENCES `m_office` (`id`),
CONSTRAINT `FK_m_account_transfer_details_from_savings_account` FOREIGN KEY (`from_savings_account_id`) REFERENCES `m_savings_account` (`id`),
CONSTRAINT `FK_m_account_transfer_details_to_client` FOREIGN KEY (`to_client_id`) REFERENCES `m_client` (`id`),
CONSTRAINT `FK_m_account_transfer_details_to_loan_account` FOREIGN KEY (`to_loan_account_id`) REFERENCES `m_loan` (`id`),
CONSTRAINT `FK_m_account_transfer_details_to_office` FOREIGN KEY (`to_office_id`) REFERENCES `m_office` (`id`),
CONSTRAINT `FK_m_account_transfer_details_to_savings_account` FOREIGN KEY (`to_savings_account_id`) REFERENCES `m_savings_account` (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;
CREATE TABLE `m_account_transfer_standing_instructions` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(250) NOT NULL,
`account_transfer_details_id` BIGINT(20) NOT NULL,
`priority` TINYINT(2) NOT NULL,
`status` TINYINT(2) NOT NULL,
`instruction_type` TINYINT(2) NOT NULL,
`amount` DECIMAL(19,6) NULL DEFAULT NULL,
`valid_from` DATE NOT NULL,
`valid_till` DATE NULL DEFAULT NULL,
`recurrence_type` TINYINT(1) NOT NULL,
`recurrence_frequency` SMALLINT(5) NULL DEFAULT NULL,
`recurrence_interval` SMALLINT(5) NULL DEFAULT NULL,
`recurrence_on_day` SMALLINT(2) NULL DEFAULT NULL,
`recurrence_on_month` SMALLINT(2) NULL DEFAULT NULL,
`last_run_date` DATE NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `name` (`name`),
INDEX `FK_m_standing_instructions_account_transfer_details` (`account_transfer_details_id`),
CONSTRAINT `FK_m_standing_instructions_account_transfer_details` FOREIGN KEY (`account_transfer_details_id`) REFERENCES `m_account_transfer_details` (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;
CREATE TABLE `m_account_transfer_transaction` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`account_transfer_details_id` BIGINT(20) NOT NULL,
`from_savings_transaction_id` BIGINT(20) NULL DEFAULT NULL,
`from_loan_transaction_id` BIGINT(20) NULL DEFAULT NULL,
`to_savings_transaction_id` BIGINT(20) NULL DEFAULT NULL,
`to_loan_transaction_id` BIGINT(20) NULL DEFAULT NULL,
`is_reversed` TINYINT(1) NOT NULL,
`transaction_date` DATE NOT NULL,
`currency_code` VARCHAR(3) NOT NULL,
`currency_digits` SMALLINT(5) NOT NULL,
`currency_multiplesof` SMALLINT(5) NULL DEFAULT NULL,
`amount` DECIMAL(19,6) NOT NULL,
`description` VARCHAR(200) NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_account_transfer_transaction_from_m_savings_transaction` (`from_savings_transaction_id`),
INDEX `FK_m_account_transfer_transaction_to_m_savings_transaction` (`to_savings_transaction_id`),
INDEX `FK_m_account_transfer_transaction_to_m_loan_transaction` (`to_loan_transaction_id`),
INDEX `FK_m_account_transfer_transaction_from_m_loan_transaction` (`from_loan_transaction_id`),
INDEX `FK_m_account_transfer_transaction_account_detail` (`account_transfer_details_id`),
CONSTRAINT `FK_m_account_transfer_transaction_account_detail` FOREIGN KEY (`account_transfer_details_id`) REFERENCES `m_account_transfer_details` (`id`),
CONSTRAINT `FK_m_account_transfer_transaction_from_m_loan_transaction` FOREIGN KEY (`from_loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`),
CONSTRAINT `FK_m_account_transfer_transaction_from_m_savings_transaction` FOREIGN KEY (`from_savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`),
CONSTRAINT `FK_m_account_transfer_transaction_to_m_loan_transaction` FOREIGN KEY (`to_loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`),
CONSTRAINT `FK_m_account_transfer_transaction_to_m_savings_transaction` FOREIGN KEY (`to_savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;
INSERT INTO `m_account_transfer_details` (`from_office_id`, `to_office_id`, `from_client_id`, `to_client_id`, `from_savings_account_id`, `to_savings_account_id`, `from_loan_account_id`, `to_loan_account_id`, `from_savings_transaction_id`, `from_loan_transaction_id`, `to_savings_transaction_id`, `to_loan_transaction_id`, `is_reversed`, `transaction_date`, `currency_code`, `currency_digits`, `currency_multiplesof`, `amount`, `description`) select at.from_office_id,at.to_office_id,at.from_client_id,at.to_client_id,at.from_savings_account_id,at.to_savings_account_id,at.from_loan_account_id,at.to_loan_account_id,at.from_savings_transaction_id,at.from_loan_transaction_id,at.to_savings_transaction_id,at.to_loan_transaction_id,at.is_reversed,at.transaction_date,at.currency_code,at.currency_digits,at.currency_multiplesof,at.amount,at.description from m_savings_account_transfer at;
INSERT INTO `m_account_transfer_transaction` (`account_transfer_details_id`, `from_savings_transaction_id`, `from_loan_transaction_id`, `to_savings_transaction_id`, `to_loan_transaction_id`, `is_reversed`, `transaction_date`, `currency_code`, `currency_digits`, `currency_multiplesof`, `amount`, `description`) select ad.id,ad.from_savings_transaction_id,ad.from_loan_transaction_id,ad.to_savings_transaction_id,ad.to_loan_transaction_id,ad.is_reversed,ad.transaction_date,ad.currency_code,ad.currency_digits,ad.currency_multiplesof,ad.amount,ad.description from m_account_transfer_details ad;
ALTER TABLE `m_account_transfer_details`
DROP COLUMN `from_savings_transaction_id`,
DROP COLUMN `from_loan_transaction_id`,
DROP COLUMN `to_savings_transaction_id`,
DROP COLUMN `to_loan_transaction_id`,
DROP COLUMN `is_reversed`,
DROP COLUMN `transaction_date`,
DROP COLUMN `currency_code`,
DROP COLUMN `currency_digits`,
DROP COLUMN `currency_multiplesof`,
DROP COLUMN `amount`,
DROP COLUMN `description`;
DROP TABLE `m_savings_account_transfer`;
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('account_transfer', 'READ_STANDINGINSTRUCTION ', 'STANDINGINSTRUCTION ', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('account_transfer', 'CREATE_STANDINGINSTRUCTION ', 'STANDINGINSTRUCTION ', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('account_transfer', 'UPDATE_STANDINGINSTRUCTION ', 'STANDINGINSTRUCTION ', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('account_transfer', 'DELETE_STANDINGINSTRUCTION ', 'STANDINGINSTRUCTION ', 'DELETE', 0);
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Execute Standing Instruction', 'Execute Standing Instruction', '0 0 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0);
@@ -0,0 +1,6 @@
ALTER TABLE `m_loan_repayment_schedule`
ADD COLUMN `accrual_interest_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `interest_waived_derived`,
ADD COLUMN `accrual_fee_charges_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `fee_charges_waived_derived`,
ADD COLUMN `accrual_penalty_charges_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `penalty_charges_waived_derived`;
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Add Accrual Transactions', 'Add Accrual Transactions', '0 1 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0);
@@ -0,0 +1 @@
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Apply penalty to overdue loans', 'Apply penalty to overdue loans', '0 0 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0);
@@ -0,0 +1,7 @@
ALTER TABLE `m_product_loan`
ADD COLUMN `overdue_days_for_npa` SMALLINT(5) NULL DEFAULT NULL AFTER `grace_on_arrears_ageing`;
ALTER TABLE `m_loan`
ADD COLUMN `is_npa` TINYINT(1) NOT NULL DEFAULT '0' AFTER `grace_on_arrears_ageing`;
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`) VALUES ('Update Non Performing Assets', 'Update Non Performing Assets', '0 0 0 1/1 * ? *', now());
@@ -0,0 +1,237 @@
CREATE TABLE IF NOT EXISTS `m_interest_rate_chart` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) DEFAULT NULL,
`description` varchar(200) DEFAULT NULL,
`from_date` date NOT NULL,
`end_date` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `m_interest_rate_slab` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`interest_rate_chart_id` bigint(20) NOT NULL,
`description` varchar(200) DEFAULT NULL,
`period_type_enum` smallint(5) NOT NULL DEFAULT '1',
`from_period` int(11) NOT NULL DEFAULT '0',
`to_period` int(11) DEFAULT NULL,
`amount_range_from` decimal(19,6) DEFAULT NULL,
`amount_range_to` decimal(19,6) DEFAULT NULL,
`annual_interest_rate` decimal(19,6) NOT NULL,
`currency_code` varchar(3) NOT NULL,
PRIMARY KEY (`id`),
KEY `FKIRS00000000000001` (`interest_rate_chart_id`),
CONSTRAINT `FKIRS00000000000001` FOREIGN KEY (`interest_rate_chart_id`) REFERENCES `m_interest_rate_chart` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `m_deposit_product_interest_rate_chart` (
`deposit_product_id` bigint(20) NOT NULL,
`interest_rate_chart_id` bigint(20) NOT NULL,
UNIQUE KEY `deposit_product_id_interest_rate_chart_id` (`deposit_product_id`,`interest_rate_chart_id`),
KEY `FKDPIRC00000000000002` (`interest_rate_chart_id`),
CONSTRAINT `FKDPIRC00000000000001` FOREIGN KEY (`deposit_product_id`) REFERENCES `m_savings_product` (`id`),
CONSTRAINT `FKDPIRC00000000000002` FOREIGN KEY (`interest_rate_chart_id`) REFERENCES `m_interest_rate_chart` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `m_deposit_product_term_and_preclosure` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`savings_product_id` bigint(20) NOT NULL DEFAULT '0',
`min_deposit_term` int(11) DEFAULT NULL,
`max_deposit_term` int(11) DEFAULT NULL,
`min_deposit_term_type_enum` smallint(5) DEFAULT NULL,
`max_deposit_term_type_enum` smallint(5) DEFAULT NULL,
`in_multiples_of_deposit_term` int(11) DEFAULT NULL,
`in_multiples_of_deposit_term_type_enum` smallint(5) DEFAULT NULL,
`interest_free_period_applicable` smallint(5) DEFAULT NULL,
`interest_free_from_period` int(11) DEFAULT NULL,
`interest_free_to_period` int(11) DEFAULT NULL,
`interest_free_period_frequency_enum` smallint(5) DEFAULT NULL,
`pre_closure_penal_applicable` smallint(5) DEFAULT NULL,
`pre_closure_penal_interest` decimal(19,6) DEFAULT NULL,
`pre_closure_penal_interest_on_enum` smallint(5) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FKDPTP00000000000001` (`savings_product_id`),
CONSTRAINT `FKDPTP00000000000001` FOREIGN KEY (`savings_product_id`) REFERENCES `m_savings_product` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `m_deposit_product_recurring_detail` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`savings_product_id` bigint(20) NOT NULL DEFAULT '0',
`recurring_deposit_type_enum` smallint(5) DEFAULT NULL,
`recurring_deposit_frequency` int(11) DEFAULT NULL,
`recurring_deposit_frequency_type_enum` smallint(5) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FKDPRD00000000000001` (`savings_product_id`),
CONSTRAINT `FKDPRD00000000000001` FOREIGN KEY (`savings_product_id`) REFERENCES `m_savings_product` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `m_savings_account_interest_rate_chart` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`savings_account_id` bigint(20) NOT NULL,
`name` varchar(100) DEFAULT NULL,
`description` varchar(200) DEFAULT NULL,
`from_date` date NOT NULL,
`end_date` date DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FKSAIRC00000000000001` (`savings_account_id`),
CONSTRAINT `FKSAIRC00000000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `m_savings_account_interest_rate_slab` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`savings_account_interest_rate_chart_id` bigint(20) NOT NULL,
`description` varchar(200) DEFAULT NULL,
`period_type_enum` smallint(5) NOT NULL DEFAULT '1',
`from_period` int(11) NOT NULL DEFAULT '0',
`to_period` int(11) DEFAULT NULL,
`amount_range_from` decimal(19,6) DEFAULT NULL,
`amount_range_to` decimal(19,6) DEFAULT NULL,
`annual_interest_rate` decimal(19,6) NOT NULL,
`currency_code` varchar(3) NOT NULL,
PRIMARY KEY (`id`),
KEY `FKSAIRS00000000000001` (`savings_account_interest_rate_chart_id`),
CONSTRAINT `FKSAIRS00000000000001` FOREIGN KEY (`savings_account_interest_rate_chart_id`) REFERENCES `m_savings_account_interest_rate_chart` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `m_deposit_account_recurring_detail` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`savings_account_id` bigint(20) NOT NULL DEFAULT '0',
`recurring_deposit_amount` decimal(19,6) DEFAULT NULL,
`recurring_deposit_type_enum` smallint(5) DEFAULT NULL,
`recurring_deposit_frequency` int(11) DEFAULT NULL,
`recurring_deposit_frequency_type_enum` smallint(5) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FKDARD00000000000001` (`savings_account_id`),
CONSTRAINT `FKDARD00000000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `m_deposit_account_term_and_preclosure` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`savings_account_id` bigint(20) NOT NULL DEFAULT '0',
`min_deposit_term` int(11) DEFAULT NULL,
`max_deposit_term` int(11) DEFAULT NULL,
`min_deposit_term_type_enum` smallint(5) DEFAULT NULL,
`max_deposit_term_type_enum` smallint(5) DEFAULT NULL,
`in_multiples_of_deposit_term` int(11) DEFAULT NULL,
`in_multiples_of_deposit_term_type_enum` smallint(5) DEFAULT NULL,
`interest_free_period_applicable` smallint(5) DEFAULT NULL,
`interest_free_from_period` int(11) DEFAULT NULL,
`interest_free_to_period` int(11) DEFAULT NULL,
`interest_free_period_frequency_enum` smallint(5) DEFAULT NULL,
`pre_closure_penal_applicable` smallint(5) DEFAULT NULL,
`pre_closure_penal_interest` decimal(19,6) DEFAULT NULL,
`pre_closure_penal_interest_on_enum` smallint(5) DEFAULT NULL,
`deposit_period` int(11) DEFAULT NULL,
`deposit_period_frequency_enum` smallint(5) DEFAULT NULL,
`deposit_amount` decimal(19,6) DEFAULT NULL,
`maturity_amount` decimal(19,6) DEFAULT NULL,
`maturity_date` date DEFAULT NULL,
`on_account_closure_enum` smallint(5) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FKDATP00000000000001` (`savings_account_id`),
CONSTRAINT `FKDATP00000000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `m_savings_product`
ADD COLUMN `deposit_type_enum` SMALLINT(5) NOT NULL DEFAULT '100' AFTER `description`;
ALTER TABLE `m_savings_account`
ADD COLUMN `deposit_type_enum` SMALLINT(5) NOT NULL DEFAULT '100' AFTER `account_type_enum`;
ALTER TABLE `m_client`
ADD COLUMN `gender_cv_id` INT(11) NULL DEFAULT NULL AFTER `mobile_no`,
ADD COLUMN `date_of_birth` DATE NULL DEFAULT NULL AFTER `gender_cv_id`;
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_INTERESTRATECHART', 'INTERESTRATECHART', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_INTERESTRATECHART_CHECKER', 'INTERESTRATECHART', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_INTERESTRATECHART', 'INTERESTRATECHART', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_INTERESTRATECHART', 'INTERESTRATECHART', 'DELETE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_INTERESTRATECHART_CHECKER', 'INTERESTRATECHART', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_INTERESTRATECHART_CHECKER', 'INTERESTRATECHART', 'DELETE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_CHARTSLAB', 'CHARTSLAB', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_CHARTSLAB_CHECKER', 'CHARTSLAB', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_CHARTSLAB', 'CHARTSLAB', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_CHARTSLAB', 'CHARTSLAB', 'DELETE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_CHARTSLAB_CHECKER', 'CHARTSLAB', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_CHARTSLAB_CHECKER', 'CHARTSLAB', 'DELETE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_FIXEDDEPOSITPRODUCT', 'FIXEDDEPOSITPRODUCT', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_FIXEDDEPOSITPRODUCT_CHECKER', 'FIXEDDEPOSITPRODUCT', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_FIXEDDEPOSITPRODUCT', 'FIXEDDEPOSITPRODUCT', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_FIXEDDEPOSITPRODUCT', 'FIXEDDEPOSITPRODUCT', 'DELETE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_FIXEDDEPOSITPRODUCT_CHECKER', 'FIXEDDEPOSITPRODUCT', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_FIXEDDEPOSITPRODUCT_CHECKER', 'FIXEDDEPOSITPRODUCT', 'DELETE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_RECURRINGDEPOSITPRODUCT', 'RECURRINGDEPOSITPRODUCT', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_RECURRINGDEPOSITPRODUCT_CHECKER', 'RECURRINGDEPOSITPRODUCT', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_RECURRINGDEPOSITPRODUCT', 'RECURRINGDEPOSITPRODUCT', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_RECURRINGDEPOSITPRODUCT', 'RECURRINGDEPOSITPRODUCT', 'DELETE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_RECURRINGDEPOSITPRODUCT_CHECKER', 'RECURRINGDEPOSITPRODUCT', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_RECURRINGDEPOSITPRODUCT_CHECKER', 'RECURRINGDEPOSITPRODUCT', 'DELETE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'READ_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'DELETE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'DELETE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'DEPOSIT_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'DEPOSIT', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'DEPOSIT_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'DEPOSIT', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAWAL_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'WITHDRAWAL', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAWAL_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'WITHDRAWAL', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ACTIVATE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'ACTIVATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ACTIVATE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'ACTIVATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CALCULATEINTEREST_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'CALCULATEINTEREST', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CALCULATEINTEREST_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'CALCULATEINTEREST', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'POSTINTEREST_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'POSTINTEREST', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'POSTINTEREST_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'POSTINTEREST', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'APPROVE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'REJECT_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'REJECT', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAW_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'WITHDRAW', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVALUNDO_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'APPROVALUNDO', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CLOSE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'CLOSE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'APPROVE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'REJECT_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'REJECT', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAW_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'WITHDRAW', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVALUNDO_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'APPROVALUNDO', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CLOSE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'CLOSE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'UNDOTRANSACTION_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'UNDOTRANSACTION', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'UNDOTRANSACTION_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'UNDOTRANSACTION', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ADJUSTTRANSACTION_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'ADJUSTTRANSACTION', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'READ_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'DELETE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'DELETE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'DEPOSIT_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'DEPOSIT', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'DEPOSIT_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'DEPOSIT', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAWAL_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'WITHDRAWAL', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAWAL_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'WITHDRAWAL', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ACTIVATE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'ACTIVATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ACTIVATE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'ACTIVATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CALCULATEINTEREST_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'CALCULATEINTEREST', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CALCULATEINTEREST_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'CALCULATEINTEREST', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'POSTINTEREST_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'POSTINTEREST', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'POSTINTEREST_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'POSTINTEREST', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'APPROVE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'REJECT_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'REJECT', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAW_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'WITHDRAW', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVALUNDO_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'APPROVALUNDO', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CLOSE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'CLOSE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'APPROVE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'REJECT_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'REJECT', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAW_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'WITHDRAW', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVALUNDO_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'APPROVALUNDO', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CLOSE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'CLOSE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'UNDOTRANSACTION_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'UNDOTRANSACTION', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'UNDOTRANSACTION_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'UNDOTRANSACTION', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ADJUSTTRANSACTION_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'ADJUSTTRANSACTION', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_savings', 'PREMATURECLOSE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'PREMATURECLOSE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`) VALUES ('transaction_savings', 'PREMATURECLOSE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'PREMATURECLOSE');
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_savings', 'PREMATURECLOSE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'PREMATURECLOSE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`) VALUES ('transaction_savings', 'PREMATURECLOSE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'PREMATURECLOSE');
@@ -0,0 +1 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_loan', 'DISBURSETOSAVINGS_LOAN', 'LOAN', 'DISBURSETOSAVINGS', 0);
@@ -0,0 +1,7 @@
ALTER TABLE `m_deposit_product_term_and_preclosure`
ADD COLUMN `min_deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL,
ADD COLUMN `max_deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL,
ADD COLUMN `deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL;
ALTER TABLE m_deposit_account_term_and_preclosure
ADD COLUMN `expected_firstdepositon_date` DATE NULL DEFAULT NULL;
@@ -0,0 +1,28 @@
INSERT INTO `m_permission` (
`id` ,
`grouping` ,
`code` ,
`entity_name` ,
`action_name` ,
`can_maker_checker`
)
VALUES (
NULL , 'transaction_loan', 'RECOVERYPAYMENT_LOAN', 'LOAN', 'RECOVERYPAYMENT', '0'
);
Alter table m_loan
add column total_recovered_derived Decimal(19,6);
INSERT INTO `acc_gl_account` (`name`, `hierarchy`, `gl_code`,`account_usage`, `classification_enum`,`description`)
select 'Loan Recovery (Temp)', '.', '220002-Temp', 1, 4,'Temporary account to track income from Loan recovery'
FROM m_product_loan WHERE accounting_type != 1
limit 1;
INSERT INTO `acc_product_mapping` (`gl_account_id`,`product_id`,`product_type`,`financial_account_type`)
select (select max(id) from acc_gl_account where classification_enum=4 and account_usage=1 LIMIT 1), mapping.product_id, mapping.product_type, 12
from acc_product_mapping mapping
where mapping.financial_account_type = 4 and mapping.product_type=1
group by mapping.product_id;
@@ -0,0 +1,9 @@
ALTER TABLE `job_run_history`
CHANGE COLUMN `error_message` `error_message` TEXT NULL DEFAULT NULL AFTER `status`;
ALTER TABLE `m_deposit_account_term_and_preclosure`
ADD COLUMN `transfer_interest_to_linked_account` TINYINT(1) NOT NULL DEFAULT '0' AFTER `expected_firstdepositon_date`;
UPDATE `job` SET `scheduler_group`=1 WHERE `name`='Post Interest For Savings';
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Transfer Interest To Savings', 'Transfer Interest To Savings', '0 2 0 1/1 * ? *', now(), 4, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 1, 0);
@@ -0,0 +1 @@
UPDATE stretchy_report SET core_report=1, use_report=0 WHERE report_name in ('ClientTrendsByDay','ClientTrendsByWeek','ClientTrendsByMonth','LoanTrendsByDay','LoanTrendsByWeek','LoanTrendsByMonth','Demand_Vs_Collection','Disbursal_Vs_Awaitingdisbursal');
@@ -0,0 +1 @@
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Update Deposit Accounts Maturity details', 'Update Deposit Accounts Maturity details', '0 0 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0);
@@ -0,0 +1,71 @@
INSERT INTO `c_configuration` (`name`, `value`, `enabled`) VALUES ('age_limit_for_senior_citizen', 65, 1);
INSERT INTO `c_configuration` (`name`, `value`, `enabled`) VALUES ('age_limit_for_children', 15, 1);
ALTER TABLE `m_interest_rate_slab`
ADD COLUMN `interest_rate_for_female` DECIMAL(19,6) NULL AFTER `annual_interest_rate`,
ADD COLUMN `interest_rate_for_children` DECIMAL(19,6) NULL AFTER `interest_rate_for_female`,
ADD COLUMN `interest_rate_for_senior_citizen` DECIMAL(19,6) NULL AFTER `interest_rate_for_children`;
ALTER TABLE `m_savings_account_interest_rate_slab`
ADD COLUMN `interest_rate_for_female` DECIMAL(19,6) NULL AFTER `annual_interest_rate`,
ADD COLUMN `interest_rate_for_children` DECIMAL(19,6) NULL AFTER `interest_rate_for_female`,
ADD COLUMN `interest_rate_for_senior_citizen` DECIMAL(19,6) NULL AFTER `interest_rate_for_children`;
ALTER TABLE `m_deposit_account_recurring_detail`
CHANGE COLUMN `recurring_deposit_amount` `mandatory_recommended_deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL,
ADD COLUMN `is_mandatory` TINYINT NOT NULL DEFAULT '0',
ADD COLUMN `allow_withdrawal` TINYINT NOT NULL DEFAULT '0',
ADD COLUMN `adjust_advance_towards_future_payments` TINYINT NOT NULL DEFAULT '1',
ADD COLUMN `is_calendar_inherited` TINYINT NOT NULL DEFAULT '0',
ADD COLUMN `total_overdue_amount` DECIMAL(19,6) NULL DEFAULT NULL,
ADD COLUMN `no_of_overdue_installments` INT(11) NULL DEFAULT NULL,
DROP COLUMN `recurring_deposit_type_enum`,
DROP COLUMN `recurring_deposit_frequency`,
DROP COLUMN `recurring_deposit_frequency_type_enum`;
ALTER TABLE `m_deposit_product_term_and_preclosure`
DROP COLUMN `interest_free_period_applicable`,
DROP COLUMN `interest_free_from_period`,
DROP COLUMN `interest_free_to_period`,
DROP COLUMN `interest_free_period_frequency_enum`;
ALTER TABLE `m_deposit_product_recurring_detail`
ADD COLUMN `is_mandatory` TINYINT(1) NOT NULL DEFAULT '1',
ADD COLUMN `allow_withdrawal` TINYINT(1) NOT NULL DEFAULT '0',
ADD COLUMN `adjust_advance_towards_future_payments` TINYINT(1) NOT NULL DEFAULT '1',
DROP COLUMN `recurring_deposit_type_enum`,
DROP COLUMN `recurring_deposit_frequency`,
DROP COLUMN `recurring_deposit_frequency_type_enum`;
ALTER TABLE `m_deposit_account_term_and_preclosure`
DROP COLUMN `interest_free_period_applicable`,
DROP COLUMN `interest_free_from_period`,
DROP COLUMN `interest_free_to_period`,
DROP COLUMN `interest_free_period_frequency_enum`;
CREATE TABLE `m_mandatory_savings_schedule` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`savings_account_id` BIGINT(20) NOT NULL,
`fromdate` DATE NULL DEFAULT NULL,
`duedate` DATE NOT NULL,
`installment` SMALLINT(5) NOT NULL,
`deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL,
`deposit_amount_completed_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`total_paid_in_advance_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`total_paid_late_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`completed_derived` BIT(1) NOT NULL,
`obligations_met_on_date` DATE NULL DEFAULT NULL,
`createdby_id` BIGINT(20) NULL DEFAULT NULL,
`created_date` DATETIME NULL DEFAULT NULL,
`lastmodified_date` DATETIME NULL DEFAULT NULL,
`lastmodifiedby_id` BIGINT(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `FKMSS0000000001` (`savings_account_id`),
CONSTRAINT `FKMSS0000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`)
);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'READ_RECURRINGDEPOSITPRODUCT', 'RECURRINGDEPOSITPRODUCT', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'READ_FIXEDDEPOSITPRODUCT', 'FIXEDDEPOSITPRODUCT', 'READ', 0);
@@ -0,0 +1,21 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'READ_OFFICEGLACCOUNT', 'OFFICEGLACCOUNT', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'CREATE_OFFICEGLACCOUNT', 'OFFICEGLACCOUNT', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'DELETE_OFFICEGLACCOUNT', 'OFFICEGLACCOUNT', 'DELETE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'UPDATE_OFFICEGLACCOUNT', 'OFFICEGLACCOUNT', 'UPDATE', 0);
CREATE TABLE `acc_gl_office_mapping` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`gl_account_id` BIGINT(20) NOT NULL DEFAULT '0',
`office_id` BIGINT(20) NOT NULL,
`financial_account_type` SMALLINT(5) NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_office_mapping_acc_gl_account` (`gl_account_id`),
INDEX `FK_office_mapping_office` (`office_id`),
CONSTRAINT `FK_office_mapping_acc_gl_account` FOREIGN KEY (`gl_account_id`) REFERENCES `acc_gl_account` (`id`),
CONSTRAINT `FK_office_mapping_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;
+103
View File
@@ -0,0 +1,103 @@
ALTER TABLE `m_code_value`
ADD COLUMN `code_score` INT(11) NULL AFTER `order_position`;
CREATE TABLE IF NOT EXISTS `ppi_scores` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`score_from` int(11) NOT NULL,
`score_to` int(11) NOT NULL,
PRIMARY KEY (`id`)
) COLLATE='utf8_general_ci'
ENGINE=InnoDB;
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(0, 4);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(5, 9);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(10, 14);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(15, 19);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(20, 24);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(25,29 );
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(30, 34);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(35, 39);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(40, 44);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(45, 49);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(50, 54);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(55, 59);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(60,64);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(65, 69);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(70, 74);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(75, 79);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(80,84);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(85, 89);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(90, 94);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(95, 100);
CREATE TABLE IF NOT EXISTS `ppi_likelihoods` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`code` varchar(100) NOT NULL,
`name` varchar(250) NOT NULL,
PRIMARY KEY (`id`)
) COLLATE='utf8_general_ci'
ENGINE=InnoDB ;
CREATE TABLE IF NOT EXISTS `ppi_likelihoods_ppi` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`likelihood_id` bigint(20) NOT NULL,
`ppi_name` varchar(250) NOT NULL,
`enabled` int(11) NOT NULL DEFAULT '100',
PRIMARY KEY (`id`)
) COLLATE='utf8_general_ci'
ENGINE=InnoDB;
/**PPI permission**/
INSERT INTO `m_permission` (`id`, `grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES (NULL, 'datatable', 'UPDATE_LIKELIHOOD', 'likelihood', 'UPDATE', '0');
INSERT INTO `m_permission` (`id`, `grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES (NULL, 'survey', 'REGISTER_SURVEY', 'survey', 'CREATE', '0');
/**Registered table category**/
ALTER TABLE `x_registered_table` ADD `category` INT NOT NULL DEFAULT 100;
@@ -0,0 +1,5 @@
/**Remove all existing apply interest transaction Types**/
update m_loan_transaction set interest_portion_derived=amount where transaction_type_enum=11;
update m_loan_transaction set transaction_type_enum=10 where transaction_type_enum=11;
@@ -0,0 +1,49 @@
ALTER TABLE `m_client`
ADD COLUMN `client_type_cv_id` INT(11) NULL DEFAULT NULL AFTER `default_savings_account`,
ADD COLUMN `client_classification_cv_id` INT(11) NULL DEFAULT NULL AFTER `client_type_cv_id`,
ADD CONSTRAINT `FK_m_client_type_m_code_value` FOREIGN KEY (`client_type_cv_id`) REFERENCES `m_code_value` (`id`),
ADD CONSTRAINT `FK_m_client_classification_m_code_value` FOREIGN KEY (`client_classification_cv_id`) REFERENCES `m_code_value` (`id`),
ADD CONSTRAINT `FK1_m_client_gender_m_code_value` FOREIGN KEY (`gender_cv_id`) REFERENCES `m_code_value` (`id`);
INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('ClientType', 1);
INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('ClientClassification', 1);
CREATE TABLE `m_interest_incentives` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`interest_rate_slab_id` BIGINT(20) NOT NULL,
`entiry_type` SMALLINT(2) NOT NULL,
`attribute_name` SMALLINT(2) NOT NULL,
`condition_type` SMALLINT(2) NOT NULL,
`attribute_value` VARCHAR(50) NOT NULL,
`incentive_type` SMALLINT(2) NOT NULL,
`amount` DECIMAL(19,6) NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_interest_incentives_m_interest_rate_slab` (`interest_rate_slab_id`),
CONSTRAINT `FK_m_interest_incentives_m_interest_rate_slab` FOREIGN KEY (`interest_rate_slab_id`) REFERENCES `m_interest_rate_slab` (`id`)
);
CREATE TABLE `m_savings_interest_incentives` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`deposit_account_interest_rate_slab_id` BIGINT(20) NOT NULL,
`entiry_type` SMALLINT(2) NOT NULL,
`attribute_name` SMALLINT(2) NOT NULL,
`condition_type` SMALLINT(2) NOT NULL,
`attribute_value` VARCHAR(50) NOT NULL,
`incentive_type` SMALLINT(2) NOT NULL,
`amount` DECIMAL(19,6) NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_savings_interest_incentives_m_savings_interest_rate_slab` (`deposit_account_interest_rate_slab_id`),
CONSTRAINT `FK_m_savings_interest_incentives_m_savings_interest_rate_slab` FOREIGN KEY (`deposit_account_interest_rate_slab_id`) REFERENCES `m_savings_account_interest_rate_slab` (`id`)
);
ALTER TABLE `m_interest_rate_slab`
DROP COLUMN `interest_rate_for_female`,
DROP COLUMN `interest_rate_for_children`,
DROP COLUMN `interest_rate_for_senior_citizen`;
ALTER TABLE `m_savings_account_interest_rate_slab`
DROP COLUMN `interest_rate_for_female`,
DROP COLUMN `interest_rate_for_children`,
DROP COLUMN `interest_rate_for_senior_citizen`;
@@ -0,0 +1,14 @@
ALTER TABLE `tenants`
ADD COLUMN `pool_initial_size` int(5) DEFAULT 5 AFTER `auto_update`,
ADD COLUMN `pool_validation_interval` int(11) DEFAULT 30000,
ADD COLUMN `pool_remove_abandoned` tinyint(1) DEFAULT 1,
ADD COLUMN `pool_remove_abandoned_timeout` int(5) DEFAULT 60,
ADD COLUMN `pool_log_abandoned` tinyint(1) DEFAULT 1,
ADD COLUMN `pool_abandon_when_percentage_full` int(5) DEFAULT 50,
ADD COLUMN `pool_test_on_borrow` tinyint(1) DEFAULT 1,
ADD COLUMN `pool_max_active` int(5) DEFAULT 40,
ADD COLUMN `pool_min_idle` int(5) DEFAULT 20,
ADD COLUMN `pool_max_idle` int(5) DEFAULT 10,
ADD COLUMN `pool_suspect_timeout` int(5) DEFAULT 60,
ADD COLUMN `pool_time_between_eviction_runs_millis` int(11) DEFAULT 34000,
ADD COLUMN `pool_min_evictable_idle_time_millis` int(11) DEFAULT 60000;
File diff suppressed because one or more lines are too long
+6 -4
View File
@@ -28,7 +28,7 @@ sourceCompatibility = JavaVersion.VERSION_1_6
/* define binary compatiblity version */
targetCompatibility = JavaVersion.VERSION_1_6
project.ext.springVersion = '3.2.4.RELEASE'
project.ext.springVersion = '3.2.5.RELEASE'
project.ext.springSecurityVersion = '3.1.4.RELEASE'
project.ext.hibernateCoreVersion = '4.1.9.Final'
project.ext.jerseyVersion = '1.17'
@@ -55,7 +55,7 @@ configurations {
}
dependencies {
def tomcatVersion = '7.0.42'
def tomcatVersion = '7.0.47'
tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
"org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}"
tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") {
@@ -105,8 +105,8 @@ dependencies {
[group: 'ch.qos.logback', name: 'logback-core', version: '1.0.13'],
[group: 'ch.qos.logback', name: 'logback-classic', version: '1.0.13'],
[group: 'mysql', name: 'mysql-connector-java', version: '5.1.26'],
[group: 'org.apache.tomcat', name: 'tomcat-jdbc', version: '7.0.42'],
[group: 'mysql', name: 'mysql-connector-java', version: '5.1.27'],
[group: 'org.apache.tomcat', name: 'tomcat-jdbc', version: '7.0.47'],
[group: 'pentaho-reporting-engine', name: 'pentaho-reporting-engine-classic-core', version: '3.9.1.1'],
[group: 'pentaho-reporting-engine', name: 'pentaho-reporting-engine-classic-extensions', version: '3.9.1-GA'],
@@ -230,6 +230,8 @@ tomcatRunWar {
sourceSets {
integrationTest {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
}
}
+3 -1
View File
@@ -1,2 +1,4 @@
releaseVersion=1.14.0.RELEASE
releaseVersion=1.22.0.RELEASE
@@ -0,0 +1,482 @@
package org.mifosplatform.integrationtests;
import static org.junit.Assert.assertEquals;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.ClientHelper;
import org.mifosplatform.integrationtests.common.CommonConstants;
import org.mifosplatform.integrationtests.common.OfficeHelper;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.accounting.Account;
import org.mifosplatform.integrationtests.common.accounting.AccountHelper;
import org.mifosplatform.integrationtests.common.accounting.JournalEntry;
import org.mifosplatform.integrationtests.common.accounting.JournalEntryHelper;
import org.mifosplatform.integrationtests.common.accounting.OfficeAccountMappingHelper;
import org.mifosplatform.integrationtests.common.charges.ChargesHelper;
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanStatusChecker;
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
import org.mifosplatform.integrationtests.common.savings.AccountTransferHelper;
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
import org.mifosplatform.integrationtests.common.savings.SavingsStatusChecker;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
/**
* JUnit Test Cases for Account Transfer for.
*/
@SuppressWarnings({ "rawtypes", "unused" })
public class AccountTransferTest {
public static final String MINIMUM_OPENING_BALANCE = "30000.0";
public static final String ACCOUNT_TYPE_INDIVIDUAL = "INDIVIDUAL";
public static final String ACCOUNT_TRANSFER_AMOUNT = "15000.0";
public static final String ACCOUNT_TRANSFER_AMOUNT_ADJUST = "3000.0";
public static final String FROM_LOAN_ACCOUNT_TYPE = "1";
public static final String FROM_SAVINGS_ACCOUNT_TYPE = "2";
public static final String TO_LOAN_ACCOUNT_TYPE = "1";
public static final String TO_SAVINGS_ACCOUNT_TYPE = "2";
public static final String LOAN_APPROVAL_DATE = "01 March 2013";
public static final String LOAN_APPROVAL_DATE_PLUS_ONE = "02 March 2013";
public static final String LOAN_DISBURSAL_DATE = "01 March 2013";
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
private SavingsAccountHelper savingsAccountHelper;
private AccountTransferHelper accountTransferHelper;
private LoanTransactionHelper loanTransactionHelper;
private AccountHelper accountHelper;
private JournalEntryHelper journalEntryHelper;
Float TRANSFER_AMOUNT = new Float(ACCOUNT_TRANSFER_AMOUNT);
Float TRANSFER_AMOUNT_ADJUST = new Float(ACCOUNT_TRANSFER_AMOUNT_ADJUST);
@Before
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
}
@Test
public void testFromSavingsToSavingsAccountTransfer() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.accountTransferHelper = new AccountTransferHelper(this.requestSpec, this.responseSpec);
final Account assetAccount = this.accountHelper.createAssetAccount();
final Account incomeAccount = this.accountHelper.createIncomeAccount();
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
OfficeHelper officeHelper = new OfficeHelper(this.requestSpec, this.responseSpec);
Integer toOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(toOfficeId);
// Creating Savings Account to which fund to be Transferred
final Integer toClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(toOfficeId));
Assert.assertNotNull(toClientID);
Account toTransferAccount = accountHelper.createLiabilityAccount();
Assert.assertNotNull(toTransferAccount);
OfficeAccountMappingHelper accountMappingHelper = new OfficeAccountMappingHelper(this.requestSpec,
new ResponseSpecBuilder().build());
Integer toTransferAccountMappingId = (Integer) accountMappingHelper.createOfficeAccountMapping(toOfficeId,
toTransferAccount.getAccountID(), CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(toTransferAccountMappingId);
final Integer toSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, assetAccount,
incomeAccount, expenseAccount, liabilityAccount);
Assert.assertNotNull(toSavingsProductID);
final Integer toSavingsID = this.savingsAccountHelper.applyForSavingsApplication(toClientID, toSavingsProductID,
ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(toSavingsProductID);
HashMap toSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, toSavingsID);
SavingsStatusChecker.verifySavingsIsPending(toSavingsStatusHashMap);
toSavingsStatusHashMap = this.savingsAccountHelper.approveSavings(toSavingsID);
SavingsStatusChecker.verifySavingsIsApproved(toSavingsStatusHashMap);
toSavingsStatusHashMap = this.savingsAccountHelper.activateSavings(toSavingsID);
SavingsStatusChecker.verifySavingsIsActive(toSavingsStatusHashMap);
final HashMap toSavingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(toSavingsID);
Integer fromOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(fromOfficeId);
// Creating Savings Account from which the Fund has to be Transferred
final Integer fromClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(fromOfficeId));
Assert.assertNotNull(fromClientID);
Account fromTransferAccount = accountHelper.createLiabilityAccount();
Assert.assertNotNull(fromTransferAccount);
Integer fromTransferAccountMappingId = (Integer) accountMappingHelper.createOfficeAccountMapping(fromOfficeId,
fromTransferAccount.getAccountID(), CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(fromTransferAccountMappingId);
final Integer fromSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
assetAccount, incomeAccount, expenseAccount, liabilityAccount);
Assert.assertNotNull(fromSavingsProductID);
final Integer fromSavingsID = this.savingsAccountHelper.applyForSavingsApplication(fromClientID, fromSavingsProductID,
ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(fromSavingsID);
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsID);
SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap);
fromSavingsStatusHashMap = this.savingsAccountHelper.approveSavings(fromSavingsID);
SavingsStatusChecker.verifySavingsIsApproved(fromSavingsStatusHashMap);
fromSavingsStatusHashMap = this.savingsAccountHelper.activateSavings(fromSavingsID);
SavingsStatusChecker.verifySavingsIsActive(fromSavingsStatusHashMap);
final HashMap fromSavingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(fromSavingsID);
Float fromSavingsBalance = new Float(MINIMUM_OPENING_BALANCE);
Float toSavingsBalance = new Float(MINIMUM_OPENING_BALANCE);
this.accountTransferHelper.accountTransfer(fromClientID, fromSavingsID, fromClientID, toSavingsID, FROM_SAVINGS_ACCOUNT_TYPE,
TO_SAVINGS_ACCOUNT_TYPE, ACCOUNT_TRANSFER_AMOUNT);
fromSavingsBalance -= new Float(ACCOUNT_TRANSFER_AMOUNT);
toSavingsBalance += new Float(ACCOUNT_TRANSFER_AMOUNT);
HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsID);
assertEquals("Verifying From Savings Account Balance after Account Transfer", fromSavingsBalance,
fromSavingsSummaryAfter.get("accountBalance"));
HashMap toSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(toSavingsID);
assertEquals("Verifying To Savings Account Balance after Account Transfer", toSavingsBalance,
toSavingsSummaryAfter.get("accountBalance"));
final JournalEntry[] office1LiabilityEntries = { new JournalEntry(new Float(ACCOUNT_TRANSFER_AMOUNT),
JournalEntry.TransactionType.CREDIT) };
final JournalEntry[] office2LiabilityEntries = { new JournalEntry(new Float(ACCOUNT_TRANSFER_AMOUNT),
JournalEntry.TransactionType.DEBIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(fromTransferAccount, AccountTransferHelper.ACCOUNT_TRANSFER_DATE,
office1LiabilityEntries);
this.journalEntryHelper.checkJournalEntryForAssetAccount(toTransferAccount, AccountTransferHelper.ACCOUNT_TRANSFER_DATE,
office2LiabilityEntries);
}
@Test
public void testFromSavingsToLoanAccountTransfer() {
final Account assetAccount = this.accountHelper.createAssetAccount();
final Account incomeAccount = this.accountHelper.createIncomeAccount();
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
final Account loanAssetAccount = this.accountHelper.createAssetAccount();
final Account loanIncomeAccount = this.accountHelper.createIncomeAccount();
final Account loanExpenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
this.accountTransferHelper = new AccountTransferHelper(this.requestSpec, this.responseSpec);
OfficeHelper officeHelper = new OfficeHelper(this.requestSpec, this.responseSpec);
Integer toOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(toOfficeId);
// Creating Loan Account to which fund to be Transferred
final Integer toClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(toOfficeId));
Assert.assertNotNull(toClientID);
Account toTransferAccount = accountHelper.createLiabilityAccount();
Assert.assertNotNull(toTransferAccount);
OfficeAccountMappingHelper accountMappingHelper = new OfficeAccountMappingHelper(this.requestSpec,
new ResponseSpecBuilder().build());
Integer toTransferAccountMappingId = (Integer) accountMappingHelper.createOfficeAccountMapping(toOfficeId,
toTransferAccount.getAccountID(), CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(toTransferAccountMappingId);
final Integer toLoanProductID = createLoanProduct(loanAssetAccount, loanIncomeAccount, loanExpenseAccount, overpaymentAccount);
Assert.assertNotNull(toLoanProductID);
final Integer toLoanID = applyForLoanApplication(toClientID, toLoanProductID);
Assert.assertNotNull(toLoanID);
HashMap toLoanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, toLoanID);
LoanStatusChecker.verifyLoanIsPending(toLoanStatusHashMap);
toLoanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_APPROVAL_DATE, toLoanID);
LoanStatusChecker.verifyLoanIsApproved(toLoanStatusHashMap);
toLoanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSAL_DATE, toLoanID);
LoanStatusChecker.verifyLoanIsActive(toLoanStatusHashMap);
Integer fromOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(fromOfficeId);
// Creating Savings Account from which the Fund has to be Transferred
final Integer fromClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(fromOfficeId));
Assert.assertNotNull(fromClientID);
Account fromTransferAccount = accountHelper.createLiabilityAccount();
Assert.assertNotNull(fromTransferAccount);
Integer fromTransferAccountMappingId = (Integer) accountMappingHelper.createOfficeAccountMapping(fromOfficeId,
fromTransferAccount.getAccountID(), CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(fromTransferAccountMappingId);
final Integer fromSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
assetAccount, incomeAccount, expenseAccount, liabilityAccount);
Assert.assertNotNull(fromSavingsProductID);
final Integer fromSavingsID = this.savingsAccountHelper.applyForSavingsApplication(fromClientID, fromSavingsProductID,
ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(fromSavingsID);
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsID);
SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap);
fromSavingsStatusHashMap = this.savingsAccountHelper.approveSavings(fromSavingsID);
SavingsStatusChecker.verifySavingsIsApproved(fromSavingsStatusHashMap);
fromSavingsStatusHashMap = this.savingsAccountHelper.activateSavings(fromSavingsID);
SavingsStatusChecker.verifySavingsIsActive(fromSavingsStatusHashMap);
final HashMap fromSavingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(fromSavingsID);
Float fromSavingsBalance = new Float(MINIMUM_OPENING_BALANCE);
this.accountTransferHelper.accountTransfer(fromClientID, fromSavingsID, toClientID, toLoanID, FROM_SAVINGS_ACCOUNT_TYPE,
TO_LOAN_ACCOUNT_TYPE, ACCOUNT_TRANSFER_AMOUNT_ADJUST);
fromSavingsBalance -= TRANSFER_AMOUNT_ADJUST;
HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsID);
assertEquals("Verifying From Savings Account Balance after Account Transfer", fromSavingsBalance,
fromSavingsSummaryAfter.get("accountBalance"));
HashMap toLoanSummaryAfter = this.loanTransactionHelper.getLoanSummary(requestSpec, responseSpec, toLoanID);
assertEquals("Verifying To Loan Repayment Amount after Account Transfer", TRANSFER_AMOUNT_ADJUST,
toLoanSummaryAfter.get("totalRepayment"));
final JournalEntry[] office1LiabilityEntries = { new JournalEntry(new Float(ACCOUNT_TRANSFER_AMOUNT_ADJUST),
JournalEntry.TransactionType.CREDIT) };
final JournalEntry[] office2LiabilityEntries = { new JournalEntry(new Float(ACCOUNT_TRANSFER_AMOUNT_ADJUST),
JournalEntry.TransactionType.DEBIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(fromTransferAccount, AccountTransferHelper.ACCOUNT_TRANSFER_DATE,
office1LiabilityEntries);
this.journalEntryHelper.checkJournalEntryForAssetAccount(toTransferAccount, AccountTransferHelper.ACCOUNT_TRANSFER_DATE,
office2LiabilityEntries);
}
@Test
public void testFromLoanToSavingsAccountTransfer() {
final Account assetAccount = this.accountHelper.createAssetAccount();
final Account incomeAccount = this.accountHelper.createIncomeAccount();
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
final Account loanAssetAccount = this.accountHelper.createAssetAccount();
final Account loanIncomeAccount = this.accountHelper.createIncomeAccount();
final Account loanExpenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
this.accountTransferHelper = new AccountTransferHelper(this.requestSpec, this.responseSpec);
OfficeHelper officeHelper = new OfficeHelper(this.requestSpec, this.responseSpec);
Integer toOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(toOfficeId);
// Creating Loan Account to which fund to be Transferred
final Integer toClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(toOfficeId));
Assert.assertNotNull(toClientID);
Account toTransferAccount = accountHelper.createLiabilityAccount();
Assert.assertNotNull(toTransferAccount);
OfficeAccountMappingHelper accountMappingHelper = new OfficeAccountMappingHelper(this.requestSpec,
new ResponseSpecBuilder().build());
Integer toTransferAccountMappingId = (Integer) accountMappingHelper.createOfficeAccountMapping(toOfficeId,
toTransferAccount.getAccountID(), CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(toTransferAccountMappingId);
final Integer toSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, assetAccount,
incomeAccount, expenseAccount, liabilityAccount);
Assert.assertNotNull(toSavingsProductID);
final Integer toSavingsID = this.savingsAccountHelper.applyForSavingsApplication(toClientID, toSavingsProductID,
ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(toSavingsID);
HashMap toSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, toSavingsID);
SavingsStatusChecker.verifySavingsIsPending(toSavingsStatusHashMap);
toSavingsStatusHashMap = this.savingsAccountHelper.approveSavings(toSavingsID);
SavingsStatusChecker.verifySavingsIsApproved(toSavingsStatusHashMap);
toSavingsStatusHashMap = this.savingsAccountHelper.activateSavings(toSavingsID);
SavingsStatusChecker.verifySavingsIsActive(toSavingsStatusHashMap);
Integer fromOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(fromOfficeId);
// Creating Savings Account from which the Fund has to be Transferred
final Integer fromClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(fromOfficeId));
Assert.assertNotNull(fromClientID);
Account fromTransferAccount = accountHelper.createLiabilityAccount();
Assert.assertNotNull(fromTransferAccount);
Integer fromTransferAccountMappingId = (Integer) accountMappingHelper.createOfficeAccountMapping(fromOfficeId,
fromTransferAccount.getAccountID(), CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(fromTransferAccountMappingId);
final Integer loanProductID = createLoanProduct(loanAssetAccount, loanIncomeAccount, loanExpenseAccount, overpaymentAccount);
Assert.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(fromClientID, loanProductID);
Assert.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_APPROVAL_DATE, loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSAL_DATE, loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
final Integer fromSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
assetAccount, incomeAccount, expenseAccount, liabilityAccount);
Assert.assertNotNull(fromSavingsProductID);
final Integer fromSavingsID = this.savingsAccountHelper.applyForSavingsApplication(fromClientID, fromSavingsProductID,
ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(fromSavingsID);
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsID);
SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap);
fromSavingsStatusHashMap = this.savingsAccountHelper.approveSavings(fromSavingsID);
SavingsStatusChecker.verifySavingsIsApproved(fromSavingsStatusHashMap);
fromSavingsStatusHashMap = this.savingsAccountHelper.activateSavings(fromSavingsID);
SavingsStatusChecker.verifySavingsIsActive(fromSavingsStatusHashMap);
final HashMap toSavingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(toSavingsID);
Float fromSavingsBalance = new Float(MINIMUM_OPENING_BALANCE);
this.accountTransferHelper.accountTransfer(fromClientID, fromSavingsID, fromClientID, loanID, FROM_SAVINGS_ACCOUNT_TYPE,
TO_LOAN_ACCOUNT_TYPE, ACCOUNT_TRANSFER_AMOUNT);
fromSavingsBalance -= TRANSFER_AMOUNT;
HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsID);
// Verifying fromSavings Account Balance after Account Transfer
assertEquals("Verifying From Savings Account Balance after Account Transfer", fromSavingsBalance,
fromSavingsSummaryAfter.get("accountBalance"));
Float toSavingsBalance = new Float(MINIMUM_OPENING_BALANCE);
this.accountTransferHelper.accountTransfer(fromClientID, loanID, toClientID, toSavingsID, FROM_LOAN_ACCOUNT_TYPE,
TO_SAVINGS_ACCOUNT_TYPE, ACCOUNT_TRANSFER_AMOUNT_ADJUST);
toSavingsBalance += TRANSFER_AMOUNT_ADJUST;
HashMap toSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(toSavingsID);
// Verifying toSavings Account Balance after Account Transfer
assertEquals("Verifying From Savings Account Balance after Account Transfer", toSavingsBalance,
toSavingsSummaryAfter.get("accountBalance"));
final JournalEntry[] office1LiabilityEntries = { new JournalEntry(new Float(ACCOUNT_TRANSFER_AMOUNT_ADJUST),
JournalEntry.TransactionType.CREDIT) };
final JournalEntry[] office2LiabilityEntries = { new JournalEntry(new Float(ACCOUNT_TRANSFER_AMOUNT_ADJUST),
JournalEntry.TransactionType.DEBIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(fromTransferAccount, AccountTransferHelper.ACCOUNT_TRANSFER_DATE,
office1LiabilityEntries);
this.journalEntryHelper.checkJournalEntryForAssetAccount(toTransferAccount, AccountTransferHelper.ACCOUNT_TRANSFER_DATE,
office2LiabilityEntries);
}
private Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String minOpenningBalance, final Account... accounts) {
System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------");
SavingsProductHelper savingsProductHelper = new SavingsProductHelper();
final String savingsProductJSON = savingsProductHelper //
.withInterestCompoundingPeriodTypeAsDaily() //
.withInterestPostingPeriodTypeAsMonthly() //
.withInterestCalculationPeriodTypeAsDailyBalance() //
.withMinimumOpenningBalance(minOpenningBalance).withAccountingRuleAsCashBased(accounts).build();
return SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
}
private Integer createLoanProduct(final Account... accounts) {
System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
final String loanProductJSON = new LoanProductTestBuilder() //
.withPrincipal("8,000.00") //
.withNumberOfRepayments("4") //
.withRepaymentAfterEvery("1") //
.withRepaymentTypeAsMonth() //
.withinterestRatePerPeriod("1") //
.withInterestRateFrequencyTypeAsMonths() //
.withAmortizationTypeAsEqualInstallments() //
.withInterestTypeAsDecliningBalance() //
.withAccountingRuleAsCashBased(accounts)//
.build(null);
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
}
private Integer applyForLoanApplication(final Integer clientID, final Integer loanProductID) {
System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
final String loanApplicationJSON = new LoanApplicationTestBuilder() //
.withPrincipal("8,000.00") //
.withLoanTermFrequency("4") //
.withLoanTermFrequencyAsMonths() //
.withNumberOfRepayments("4") //
.withRepaymentEveryAfter("1") //
.withRepaymentFrequencyTypeAsMonths() //
.withInterestRatePerPeriod("2") //
.withAmortizationTypeAsEqualInstallments() //
.withInterestTypeAsDecliningBalance() //
.withInterestCalculationPeriodTypeSameAsRepaymentPeriod() //
.withExpectedDisbursementDate("10 January 2013") //
.withSubmittedOnDate("10 January 2013") //
.build(clientID.toString(), loanProductID.toString(), null);
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
}
}
@@ -1,19 +1,40 @@
package org.mifosplatform.integrationtests;
import static org.junit.Assert.assertEquals;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import org.joda.time.LocalDate;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.ClientHelper;
import org.mifosplatform.integrationtests.common.CommonConstants;
import org.mifosplatform.integrationtests.common.SchedulerJobHelper;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.accounting.Account;
import org.mifosplatform.integrationtests.common.accounting.AccountHelper;
import org.mifosplatform.integrationtests.common.accounting.JournalEntry;
import org.mifosplatform.integrationtests.common.accounting.JournalEntryHelper;
import org.mifosplatform.integrationtests.common.charges.ChargesHelper;
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositAccountHelper;
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositAccountStatusChecker;
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositProductHelper;
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanStatusChecker;
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
import org.mifosplatform.integrationtests.common.recurringdeposit.RecurringDepositAccountHelper;
import org.mifosplatform.integrationtests.common.recurringdeposit.RecurringDepositAccountStatusChecker;
import org.mifosplatform.integrationtests.common.recurringdeposit.RecurringDepositProductHelper;
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
import org.mifosplatform.integrationtests.common.savings.SavingsStatusChecker;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -21,11 +42,11 @@ import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings("rawtypes")
@SuppressWarnings({ "unused", "rawtypes", "unchecked", "static-access" })
public class AccountingScenarioIntegrationTest {
private RequestSpecification requestSpec;
private ResponseSpecification responseSpec;
private static RequestSpecification requestSpec;
private static ResponseSpecification responseSpec;
private final String DATE_OF_JOINING = "01 January 2011";
@@ -35,8 +56,19 @@ public class AccountingScenarioIntegrationTest {
private final String LP_INTEREST_RATE = "1";
private final String EXPECTED_DISBURSAL_DATE = "04 March 2011";
private final String LOAN_APPLICATION_SUBMISSION_DATE = "3 March 2011";
private final String TRANSACTION_DATE = "01 March 2013";
private final String LOAN_TERM_FREQUENCY = "10";
private final String INDIVIDUAL_LOAN = "individual";
public static final String ACCOUNT_TYPE_INDIVIDUAL = "INDIVIDUAL";
public static final String MINIMUM_OPENING_BALANCE = "1000.0";
public static final String DEPOSIT_AMOUNT = "7000";
public static final String WITHDRAWAL_AMOUNT = "3000";
public static final String WITHDRAWAL_AMOUNT_ADJUSTED = "2000";
Float SP_BALANCE = new Float(MINIMUM_OPENING_BALANCE);
Float SP_DEPOSIT_AMOUNT = new Float(DEPOSIT_AMOUNT);
Float SP_WITHDRAWAL_AMOUNT = new Float(WITHDRAWAL_AMOUNT);
Float SP_WITHDRAWAL_AMOUNT_ADJUSTED = new Float(WITHDRAWAL_AMOUNT_ADJUSTED);
private final String REPAYMENT_DATE[] = { "", "04 May 2011", "04 July 2011", "04 September 2011", "04 November 2011", "04 January 2012" };
private final Float REPAYMENT_AMOUNT[] = { .0f, 2200.0f, 3000.0f, 900.0f, 2000.0f, 2500.0f };
@@ -45,6 +77,12 @@ public class AccountingScenarioIntegrationTest {
private LoanTransactionHelper loanTransactionHelper;
private AccountHelper accountHelper;
private JournalEntryHelper journalEntryHelper;
private SavingsAccountHelper savingsAccountHelper;
private FixedDepositProductHelper fixedDepositProductHelper;
private FixedDepositAccountHelper fixedDepositAccountHelper;
private RecurringDepositProductHelper recurringDepositProductHelper;
private RecurringDepositAccountHelper recurringDepositAccountHelper;
private SchedulerJobHelper schedulerJobHelper;
@Before
public void setup() {
@@ -56,16 +94,18 @@ public class AccountingScenarioIntegrationTest {
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
}
@Test
public void checkAccountingFlow() {
public void checkUpfrontAccrualAccountingFlow() {
final Account assetAccount = this.accountHelper.createAssetAccount();
final Account incomeAccount = this.accountHelper.createIncomeAccount();
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
final Integer loanProductID = createLoanProduct(assetAccount, incomeAccount, expenseAccount, overpaymentAccount);
final Integer loanProductID = createLoanProductWithUpfrontAccrualAccountingEnabled(assetAccount, incomeAccount, expenseAccount,
overpaymentAccount);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
final Integer loanID = applyForLoanApplication(clientID, loanProductID);
@@ -160,12 +200,13 @@ public class AccountingScenarioIntegrationTest {
System.out.println("Repayment 5 Done ......");
}
private Integer createLoanProduct(final Account... accounts) {
private Integer createLoanProductWithUpfrontAccrualAccountingEnabled(final Account... accounts) {
System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
final String loanProductJSON = new LoanProductTestBuilder().withPrincipal(this.LP_PRINCIPAL.toString()).withRepaymentTypeAsMonth()
.withRepaymentAfterEvery(this.LP_REPAYMENT_PERIOD).withNumberOfRepayments(this.LP_REPAYMENTS).withRepaymentTypeAsMonth()
.withinterestRatePerPeriod(this.LP_INTEREST_RATE).withInterestRateFrequencyTypeAsMonths()
.withAmortizationTypeAsEqualPrincipalPayment().withInterestTypeAsFlat().withAccountingRuleAsAccrualBased(accounts).build();
.withAmortizationTypeAsEqualPrincipalPayment().withInterestTypeAsFlat().withAccountingRuleUpfrontAccrual(accounts)
.build(null);
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
}
@@ -177,7 +218,553 @@ public class AccountingScenarioIntegrationTest {
.withInterestRatePerPeriod(this.LP_INTEREST_RATE).withInterestTypeAsFlatBalance()
.withAmortizationTypeAsEqualPrincipalPayments().withInterestCalculationPeriodTypeSameAsRepaymentPeriod()
.withExpectedDisbursementDate(this.EXPECTED_DISBURSAL_DATE).withSubmittedOnDate(this.LOAN_APPLICATION_SUBMISSION_DATE)
.withLoanType(this.INDIVIDUAL_LOAN).build(clientID.toString(), loanProductID.toString());
.withLoanType(this.INDIVIDUAL_LOAN).build(clientID.toString(), loanProductID.toString(), null);
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
}
@Test
public void checkAccountingWithSavingsFlow() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
final Account assetAccount = this.accountHelper.createAssetAccount();
final Account incomeAccount = this.accountHelper.createIncomeAccount();
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
final Integer savingsProductID = createSavingsProduct(MINIMUM_OPENING_BALANCE, assetAccount, incomeAccount, expenseAccount,
liabilityAccount);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
final Integer savingsID = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsID);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsID);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsID);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
// Checking initial Account entries.
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(this.SP_BALANCE, JournalEntry.TransactionType.DEBIT) };
final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(this.SP_BALANCE, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.TRANSACTION_DATE, assetAccountInitialEntry);
this.journalEntryHelper
.checkJournalEntryForLiabilityAccount(liabilityAccount, this.TRANSACTION_DATE, liablilityAccountInitialEntry);
// First Transaction-Deposit
this.savingsAccountHelper.depositToSavingsAccount(savingsID, DEPOSIT_AMOUNT, SavingsAccountHelper.TRANSACTION_DATE,
CommonConstants.RESPONSE_RESOURCE_ID);
Float balance = SP_BALANCE + SP_DEPOSIT_AMOUNT;
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsID);
assertEquals("Verifying Balance after Deposit", balance, summary.get("accountBalance"));
System.out.println("----------------------Verifying Journal Entry after the Transaction Deposit----------------------------");
final JournalEntry[] assetAccountFirstTransactionEntry = { new JournalEntry(this.SP_DEPOSIT_AMOUNT,
JournalEntry.TransactionType.DEBIT) };
final JournalEntry[] liabililityAccountFirstTransactionEntry = { new JournalEntry(this.SP_DEPOSIT_AMOUNT,
JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.TRANSACTION_DATE, assetAccountFirstTransactionEntry);
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, this.TRANSACTION_DATE,
liabililityAccountFirstTransactionEntry);
// Second Transaction-Withdrawal
this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsID, WITHDRAWAL_AMOUNT, SavingsAccountHelper.TRANSACTION_DATE,
CommonConstants.RESPONSE_RESOURCE_ID);
balance -= SP_WITHDRAWAL_AMOUNT;
summary = this.savingsAccountHelper.getSavingsSummary(savingsID);
assertEquals("Verifying Balance after Withdrawal", balance, summary.get("accountBalance"));
System.out.println("-------------------Verifying Journal Entry after the Transaction Withdrawal----------------------");
final JournalEntry[] assetAccountSecondTransactionEntry = { new JournalEntry(this.SP_WITHDRAWAL_AMOUNT,
JournalEntry.TransactionType.CREDIT) };
final JournalEntry[] liabililityAccountSecondTransactionEntry = { new JournalEntry(this.SP_WITHDRAWAL_AMOUNT,
JournalEntry.TransactionType.DEBIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.TRANSACTION_DATE, assetAccountSecondTransactionEntry);
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, this.TRANSACTION_DATE,
liabililityAccountSecondTransactionEntry);
// Third Transaction-Add Charges for Withdrawal Fee
final Integer withdrawalChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsWithdrawalFeeJSON());
Assert.assertNotNull(withdrawalChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsID, withdrawalChargeId);
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsID);
Assert.assertEquals(1, chargesPendingState.size());
HashMap savingsChargeForPay = chargesPendingState.get(0);
HashMap paidCharge = this.savingsAccountHelper.getSavingsCharge(savingsID, (Integer) savingsChargeForPay.get("id"));
Float chargeAmount = (Float) paidCharge.get("amount");
// Withdrawal after adding Charge of type Withdrawal Fee
this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsID, WITHDRAWAL_AMOUNT_ADJUSTED,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
summary = this.savingsAccountHelper.getSavingsSummary(savingsID);
balance = balance - SP_WITHDRAWAL_AMOUNT_ADJUSTED - chargeAmount;
final JournalEntry[] liabililityAccountThirdTransactionEntry = {
new JournalEntry(chargeAmount, JournalEntry.TransactionType.DEBIT),
new JournalEntry(this.SP_WITHDRAWAL_AMOUNT_ADJUSTED, JournalEntry.TransactionType.DEBIT) };
final JournalEntry[] assetAccountThirdTransactionEntry = { new JournalEntry(this.SP_WITHDRAWAL_AMOUNT_ADJUSTED,
JournalEntry.TransactionType.CREDIT) };
final JournalEntry[] incomeAccountThirdTransactionEntry = { new JournalEntry(chargeAmount, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.TRANSACTION_DATE, assetAccountThirdTransactionEntry);
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, this.TRANSACTION_DATE,
liabililityAccountThirdTransactionEntry);
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, this.TRANSACTION_DATE, incomeAccountThirdTransactionEntry);
// Verifying Balance after applying Charge for Withdrawal Fee
assertEquals("Verifying Balance", balance, summary.get("accountBalance"));
}
@Test
public void testFixedDepositAccountingFlow() {
this.fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.fixedDepositAccountHelper = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec);
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
DateFormat currentDateFormat = new SimpleDateFormat("dd");
Calendar todaysDate = Calendar.getInstance();
todaysDate.add(Calendar.MONTH, -3);
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
todaysDate.add(Calendar.YEAR, 10);
final String VALID_TO = dateFormat.format(todaysDate.getTime());
todaysDate = Calendar.getInstance();
todaysDate.add(Calendar.MONTH, -1);
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
final Account assetAccount = this.accountHelper.createAssetAccount();
final Account incomeAccount = this.accountHelper.createIncomeAccount();
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, assetAccount, incomeAccount, expenseAccount,
liabilityAccount);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, FixedDepositTest.WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
FixedDepositAccountStatusChecker.verifyFixedDepositIsPending(fixedDepositAccountStatusHashMap);
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
HashMap accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float depositAmount = (Float) accountSummary.get("totalDeposits");
// Checking initial Journal entries after Activation.
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) };
final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, ACTIVATION_DATE, assetAccountInitialEntry);
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, ACTIVATION_DATE, liablilityAccountInitialEntry);
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(transactionIdForPostInterest);
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
// Checking initial Journal entries after Interest Posting.
final JournalEntry[] expenseAccountEntry = { new JournalEntry(totalInterestPosted, JournalEntry.TransactionType.DEBIT) };
final JournalEntry[] liablilityAccountEntry = { new JournalEntry(totalInterestPosted, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(expenseAccount, INTEREST_POSTED_DATE, expenseAccountEntry);
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, INTEREST_POSTED_DATE, liablilityAccountEntry);
}
@Test
public void testRecurringDepositAccountingFlow() {
this.recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
this.recurringDepositAccountHelper = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec);
final Account assetAccount = this.accountHelper.createAssetAccount();
final Account incomeAccount = this.accountHelper.createIncomeAccount();
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
DateFormat currentDateFormat = new SimpleDateFormat("dd");
Calendar todaysDate = Calendar.getInstance();
todaysDate.add(Calendar.MONTH, -3);
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
todaysDate.add(Calendar.YEAR, 10);
final String VALID_TO = dateFormat.format(todaysDate.getTime());
todaysDate = Calendar.getInstance();
todaysDate.add(Calendar.MONTH, -1);
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
final String EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(todaysDate.getTime());
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Integer recurringDepositProductId = createRecurringDepositProduct(VALID_FROM, VALID_TO, assetAccount, liabilityAccount, incomeAccount, expenseAccount);
Assert.assertNotNull(recurringDepositProductId);
Integer recurringDepositAccountId = applyForRecurringDepositApplication(clientId.toString(), recurringDepositProductId.toString(),
VALID_FROM, VALID_TO, SUBMITTED_ON_DATE, RecurringDepositTest.WHOLE_TERM, EXPECTED_FIRST_DEPOSIT_ON_DATE);
Assert.assertNotNull(recurringDepositAccountId);
HashMap recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker.getStatusOfRecurringDepositAccount(
this.requestSpec, this.responseSpec, recurringDepositAccountId.toString());
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsPending(recurringDepositAccountStatusHashMap);
recurringDepositAccountStatusHashMap = this.recurringDepositAccountHelper.approveRecurringDeposit(recurringDepositAccountId,
APPROVED_ON_DATE);
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsApproved(recurringDepositAccountStatusHashMap);
recurringDepositAccountStatusHashMap = this.recurringDepositAccountHelper.activateRecurringDeposit(recurringDepositAccountId,
ACTIVATION_DATE);
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId);
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId, depositAmount, EXPECTED_FIRST_DEPOSIT_ON_DATE);
Assert.assertNotNull(depositTransactionId);
// Checking initial Journal entries after Activation.
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) };
final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, EXPECTED_FIRST_DEPOSIT_ON_DATE, assetAccountInitialEntry);
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, EXPECTED_FIRST_DEPOSIT_ON_DATE, liablilityAccountInitialEntry);
Integer interestPostingTransactionId = this.recurringDepositAccountHelper
.postInterestForRecurringDeposit(recurringDepositAccountId);
Assert.assertNotNull(interestPostingTransactionId);
HashMap accountSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
// Checking initial Journal entries after Interest Posting.
final JournalEntry[] expenseAccountEntry = { new JournalEntry(totalInterestPosted, JournalEntry.TransactionType.DEBIT) };
final JournalEntry[] liablilityAccountEntry = { new JournalEntry(totalInterestPosted, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(expenseAccount, INTEREST_POSTED_DATE, expenseAccountEntry);
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, INTEREST_POSTED_DATE, liablilityAccountEntry);
}
public static Integer createSavingsProduct(final String minOpenningBalance, final Account... accounts) {
System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------");
final String savingsProductJSON = new SavingsProductHelper().withInterestCompoundingPeriodTypeAsDaily() //
.withInterestPostingPeriodTypeAsQuarterly() //
.withInterestCalculationPeriodTypeAsDailyBalance() //
.withMinimumOpenningBalance(minOpenningBalance).withAccountingRuleAsCashBased(accounts).build();
return SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
}
private Integer createFixedDepositProduct(final String validFrom, final String validTo, Account... accounts) {
System.out.println("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------");
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
final String fixedDepositProductJSON = fixedDepositProductHelper //
.withAccountingRuleAsCashBased(accounts).build(validFrom, validTo);
return FixedDepositProductHelper.createFixedDepositProduct(fixedDepositProductJSON, requestSpec, responseSpec);
}
private Integer applyForFixedDepositApplication(final String clientID, final String productID, final String validFrom,
final String validTo, final String submittedOnDate, final String penalInterestType) {
System.out.println("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------");
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) //
.withSubmittedOnDate(submittedOnDate).build(clientID, productID, validFrom, validTo, penalInterestType);
return this.fixedDepositAccountHelper
.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
}
private Integer createRecurringDepositProduct(final String validFrom, final String validTo, Account... accounts) {
System.out.println("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------");
RecurringDepositProductHelper recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
final String recurringDepositProductJSON = recurringDepositProductHelper //
.withAccountingRuleAsCashBased(accounts)
.build(validFrom, validTo);
return RecurringDepositProductHelper.createRecurringDepositProduct(recurringDepositProductJSON, requestSpec, responseSpec);
}
private Integer applyForRecurringDepositApplication(final String clientID, final String productID, final String validFrom,
final String validTo, final String submittedOnDate, final String penalInterestType, final String expectedFirstDepositOnDate) {
System.out.println("--------------------------------APPLYING FOR RECURRING DEPOSIT ACCOUNT --------------------------------");
final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec)
//
.withSubmittedOnDate(submittedOnDate).withExpectedFirstDepositOnDate(expectedFirstDepositOnDate)
.build(clientID, productID, validFrom, validTo, penalInterestType);
return this.recurringDepositAccountHelper.applyRecurringDepositApplication(recurringDepositApplicationJSON, this.requestSpec,
this.responseSpec);
}
@Test
public void checkPeriodicAccrualAccountingFlow() {
final Account assetAccount = this.accountHelper.createAssetAccount();
final Account incomeAccount = this.accountHelper.createIncomeAccount();
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
final Integer loanProductID = createLoanProductWithPeriodicAccrualAccountingEnabled(assetAccount, incomeAccount, expenseAccount,
overpaymentAccount);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
final Integer loanID = applyForLoanApplication(clientID, loanProductID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.approveLoan(this.EXPECTED_DISBURSAL_DATE, loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(this.EXPECTED_DISBURSAL_DATE, loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
// CHECK ACCOUNT ENTRIES
System.out.println("Entries ......");
final float PRINCIPAL_VALUE_FOR_EACH_PERIOD = 2000.0f;
final float TOTAL_INTEREST = 1000.0f;
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(this.LP_PRINCIPAL, JournalEntry.TransactionType.CREDIT),
new JournalEntry(this.LP_PRINCIPAL, JournalEntry.TransactionType.DEBIT), };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.EXPECTED_DISBURSAL_DATE, assetAccountInitialEntry);
final String jobName = "Add Accrual Transactions";
try {
this.schedulerJobHelper.excuteJob(jobName);
} catch (InterruptedException e) {
e.printStackTrace();
}
// MAKE 1
System.out.println("Repayment 1 ......");
final float FIRST_INTEREST = 200.0f;
final float FIRST_PRINCIPAL = 2000.0f;
final float FEE_PORTION = 0.0f;
final float PENALTY_PORTION = 0.0f;
this.loanTransactionHelper.checkAccrualTransactionForRepayment(getDateAsLocalDate(this.REPAYMENT_DATE[1]), FIRST_INTEREST, FEE_PORTION, PENALTY_PORTION, loanID);
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[1], this.REPAYMENT_AMOUNT[1], loanID);
float expected_value = this.LP_PRINCIPAL - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(1, expected_value, loanID);
final JournalEntry[] assetAccountFirstEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[1], JournalEntry.TransactionType.DEBIT),
new JournalEntry(FIRST_INTEREST, JournalEntry.TransactionType.CREDIT),
new JournalEntry(FIRST_PRINCIPAL, JournalEntry.TransactionType.CREDIT), };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[1], assetAccountFirstEntry);
System.out.println("Repayment 1 Done......");
// REPAYMENT 2
System.out.println("Repayment 2 ......");
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[2], this.REPAYMENT_AMOUNT[2], loanID);
final float SECOND_AND_THIRD_INTEREST = 400.0f;
final float SECOND_PRINCIPAL = this.REPAYMENT_AMOUNT[2] - SECOND_AND_THIRD_INTEREST;
expected_value = expected_value - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
this.loanTransactionHelper.checkAccrualTransactionForRepayment(getDateAsLocalDate(this.REPAYMENT_DATE[2]), FIRST_INTEREST, FEE_PORTION, PENALTY_PORTION, loanID);
this.loanTransactionHelper.checkAccrualTransactionForRepayment(getDateAsLocalDate(this.REPAYMENT_DATE[3]), FIRST_INTEREST, FEE_PORTION, PENALTY_PORTION, loanID);
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(2, expected_value, loanID);
final JournalEntry[] assetAccountSecondEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[2], JournalEntry.TransactionType.DEBIT),
new JournalEntry(SECOND_AND_THIRD_INTEREST, JournalEntry.TransactionType.CREDIT),
new JournalEntry(SECOND_PRINCIPAL, JournalEntry.TransactionType.CREDIT), };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[2], assetAccountSecondEntry);
System.out.println("Repayment 2 Done ......");
// WAIVE INTEREST
System.out.println("Waive Interest ......");
this.loanTransactionHelper.checkAccrualTransactionForRepayment(getDateAsLocalDate(this.REPAYMENT_DATE[4]), FIRST_INTEREST, FEE_PORTION, PENALTY_PORTION, loanID);
this.loanTransactionHelper.checkAccrualTransactionForRepayment(getDateAsLocalDate(this.REPAYMENT_DATE[5]), FIRST_INTEREST, FEE_PORTION, PENALTY_PORTION, loanID);
this.loanTransactionHelper.waiveInterest(this.REPAYMENT_DATE[4], this.AMOUNT_TO_BE_WAIVE.toString(), loanID);
final JournalEntry waivedEntry = new JournalEntry(this.AMOUNT_TO_BE_WAIVE, JournalEntry.TransactionType.CREDIT);
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[4], waivedEntry);
final JournalEntry expenseJournalEntry = new JournalEntry(this.AMOUNT_TO_BE_WAIVE, JournalEntry.TransactionType.DEBIT);
this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, this.REPAYMENT_DATE[4], expenseJournalEntry);
System.out.println("Waive Interest Done......");
// REPAYMENT 3
System.out.println("Repayment 3 ......");
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[3], this.REPAYMENT_AMOUNT[3], loanID);
expected_value = expected_value - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
final JournalEntry[] assetAccountThirdEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[3], JournalEntry.TransactionType.DEBIT),
new JournalEntry(this.REPAYMENT_AMOUNT[3], JournalEntry.TransactionType.CREDIT) };
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(3, expected_value, loanID);
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[3], assetAccountThirdEntry);
System.out.println("Repayment 3 Done ......");
// REPAYMENT 4
System.out.println("Repayment 4 ......");
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[4], this.REPAYMENT_AMOUNT[4], loanID);
expected_value = expected_value - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(4, expected_value, loanID);
final JournalEntry[] assetAccountFourthEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[4], JournalEntry.TransactionType.DEBIT),
new JournalEntry(this.REPAYMENT_AMOUNT[4], JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[4], assetAccountFourthEntry);
System.out.println("Repayment 4 Done ......");
// Repayment 5
System.out.println("Repayment 5 ......");
final JournalEntry[] assetAccountFifthEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[5], JournalEntry.TransactionType.DEBIT),
new JournalEntry(this.REPAYMENT_AMOUNT[5], JournalEntry.TransactionType.CREDIT) };
expected_value = expected_value - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[5], this.REPAYMENT_AMOUNT[5], loanID);
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(5, expected_value, loanID);
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[5], assetAccountFifthEntry);
System.out.println("Repayment 5 Done ......");
}
private Integer createLoanProductWithPeriodicAccrualAccountingEnabled(final Account... accounts) {
System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
final String loanProductJSON = new LoanProductTestBuilder().withPrincipal(this.LP_PRINCIPAL.toString()).withRepaymentTypeAsMonth()
.withRepaymentAfterEvery(this.LP_REPAYMENT_PERIOD).withNumberOfRepayments(this.LP_REPAYMENTS).withRepaymentTypeAsMonth()
.withinterestRatePerPeriod(this.LP_INTEREST_RATE).withInterestRateFrequencyTypeAsMonths()
.withAmortizationTypeAsEqualPrincipalPayment().withInterestTypeAsFlat().withAccountingRulePeriodicAccrual(accounts)
.build(null);
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
}
@Test
public void checkCashBasedAccountingFlow() {
final Account assetAccount = this.accountHelper.createAssetAccount();
final Account incomeAccount = this.accountHelper.createIncomeAccount();
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
final Integer loanProductID = createLoanProductWithCashBasedAccountingEnabled(assetAccount, incomeAccount, expenseAccount,
overpaymentAccount);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
final Integer loanID = applyForLoanApplication(clientID, loanProductID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.approveLoan(this.EXPECTED_DISBURSAL_DATE, loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(this.EXPECTED_DISBURSAL_DATE, loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
// CHECK ACCOUNT ENTRIES
System.out.println("Entries ......");
final float PRINCIPAL_VALUE_FOR_EACH_PERIOD = 2000.0f;
final float TOTAL_INTEREST = 1000.0f;
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(this.LP_PRINCIPAL, JournalEntry.TransactionType.CREDIT),
new JournalEntry(this.LP_PRINCIPAL, JournalEntry.TransactionType.DEBIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.EXPECTED_DISBURSAL_DATE, assetAccountInitialEntry);
// MAKE 1
System.out.println("Repayment 1 ......");
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[1], this.REPAYMENT_AMOUNT[1], loanID);
final float FIRST_INTEREST = 200.0f;
final float FIRST_PRINCIPAL = 2000.0f;
float expected_value = this.LP_PRINCIPAL - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(1, expected_value, loanID);
final JournalEntry[] assetAccountFirstEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[1], JournalEntry.TransactionType.DEBIT),
new JournalEntry(FIRST_PRINCIPAL, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[1], assetAccountFirstEntry);
System.out.println("CHECKING INCOME: ******************************************");
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, this.REPAYMENT_DATE[1], new JournalEntry(FIRST_INTEREST,
JournalEntry.TransactionType.CREDIT));
System.out.println("Repayment 1 Done......");
// REPAYMENT 2
System.out.println("Repayment 2 ......");
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[2], this.REPAYMENT_AMOUNT[2], loanID);
final float SECOND_AND_THIRD_INTEREST = 400.0f;
final float SECOND_PRINCIPAL = this.REPAYMENT_AMOUNT[2] - SECOND_AND_THIRD_INTEREST;
expected_value = expected_value - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(2, expected_value, loanID);
final JournalEntry[] assetAccountSecondEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[2], JournalEntry.TransactionType.DEBIT),
new JournalEntry(SECOND_PRINCIPAL, JournalEntry.TransactionType.CREDIT), };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[2], assetAccountSecondEntry);
System.out.println("CHECKING INCOME: ******************************************");
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, this.REPAYMENT_DATE[2], new JournalEntry(
SECOND_AND_THIRD_INTEREST, JournalEntry.TransactionType.CREDIT));
System.out.println("Repayment 2 Done ......");
// WAIVE INTEREST
System.out.println("Waive Interest ......");
Integer transactionId = this.loanTransactionHelper.waiveInterestAndReturnTransactionId(this.REPAYMENT_DATE[4], this.AMOUNT_TO_BE_WAIVE.toString(), loanID);
// waive of fees and interest are not considered in cash based accounting,
this.journalEntryHelper.ensureNoAccountingTransactionsWithTransactionId("L"+transactionId);
// REPAYMENT 3
System.out.println("Repayment 3 ......");
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[3], this.REPAYMENT_AMOUNT[3], loanID);
expected_value = expected_value - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
final JournalEntry[] assetAccountThirdEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[3], JournalEntry.TransactionType.DEBIT),
new JournalEntry(this.REPAYMENT_AMOUNT[3], JournalEntry.TransactionType.CREDIT) };
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(3, expected_value, loanID);
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[3], assetAccountThirdEntry);
System.out.println("Repayment 3 Done ......");
// REPAYMENT 4
System.out.println("Repayment 4 ......");
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[4], this.REPAYMENT_AMOUNT[4], loanID);
expected_value = expected_value - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(4, expected_value, loanID);
final JournalEntry[] assetAccountFourthEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[4], JournalEntry.TransactionType.DEBIT),
new JournalEntry(this.REPAYMENT_AMOUNT[4], JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[4], assetAccountFourthEntry);
System.out.println("Repayment 4 Done ......");
// Repayment 5
System.out.println("Repayment 5 ......");
final JournalEntry[] assetAccountFifthEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[5], JournalEntry.TransactionType.DEBIT),
new JournalEntry(this.REPAYMENT_AMOUNT[5], JournalEntry.TransactionType.CREDIT) };
expected_value = expected_value - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[5], this.REPAYMENT_AMOUNT[5], loanID);
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(5, expected_value, loanID);
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[5], assetAccountFifthEntry);
System.out.println("Repayment 5 Done ......");
}
private Integer createLoanProductWithCashBasedAccountingEnabled(final Account... accounts) {
System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
final String loanProductJSON = new LoanProductTestBuilder().withPrincipal(this.LP_PRINCIPAL.toString()).withRepaymentTypeAsMonth()
.withRepaymentAfterEvery(this.LP_REPAYMENT_PERIOD).withNumberOfRepayments(this.LP_REPAYMENTS).withRepaymentTypeAsMonth()
.withinterestRatePerPeriod(this.LP_INTEREST_RATE).withInterestRateFrequencyTypeAsMonths()
.withAmortizationTypeAsEqualPrincipalPayment().withInterestTypeAsFlat().withAccountingRuleAsCashBased(accounts)
.build(null);
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
}
private LocalDate getDateAsLocalDate(String dateAsString) {
LocalDate date = null;
try {
DateFormat df = new SimpleDateFormat("dd MMMM yyyy");
date = new LocalDate(df.parse(dateAsString));
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
}
@@ -0,0 +1,308 @@
package org.mifosplatform.integrationtests;
import java.util.ArrayList;
import java.util.HashMap;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.charges.ChargesHelper;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings({ "rawtypes" })
public class ChargesTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
}
@Test
public void testChargesForLoans() {
// Retrieving all Charges
ArrayList<HashMap> allChargesData = ChargesHelper.getCharges(this.requestSpec, this.responseSpec);
Assert.assertNotNull(allChargesData);
// Testing Creation, Updation and Deletion of Disbursement Charge
final Integer disbursementChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanDisbursementJSON());
Assert.assertNotNull(disbursementChargeId);
// Updating Charge Amount
HashMap changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, disbursementChargeId,
ChargesHelper.getModifyChargeJSON());
HashMap chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, disbursementChargeId,
ChargesHelper.getModifyChargeAsPecentageAmountJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId);
HashMap chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargePaymentMode");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargePaymentMode"));
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, disbursementChargeId,
ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, disbursementChargeId,
ChargesHelper.getModifyChargeAsPercentageInterestJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
Integer chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, disbursementChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", disbursementChargeId, chargeIdAfterDeletion);
// Testing Creation, Updation and Deletion of Specified due date Charge
final Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanSpecifiedDueDateJSON());
Assert.assertNotNull(specifiedDueDateChargeId);
// Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
ChargesHelper.getModifyChargeAsPecentageAmountJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargePaymentMode");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargePaymentMode"));
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
ChargesHelper.getModifyChargeAsPercentageInterestJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, specifiedDueDateChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", specifiedDueDateChargeId, chargeIdAfterDeletion);
// Testing Creation, Updation and Deletion of Installment Fee Charge
final Integer installmentFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanInstallmentFeeJSON());
// Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, installmentFeeChargeId,
ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, installmentFeeChargeId,
ChargesHelper.getModifyChargeAsPecentageAmountJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargePaymentMode");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargePaymentMode"));
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, installmentFeeChargeId,
ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, installmentFeeChargeId,
ChargesHelper.getModifyChargeAsPercentageInterestJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, installmentFeeChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", installmentFeeChargeId, chargeIdAfterDeletion);
// Testing Creation, Updation and Deletion of Overdue Installment Fee
// Charge
final Integer overdueFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanOverdueFeeJSON());
Assert.assertNotNull(overdueFeeChargeId);
// Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId, ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId,
ChargesHelper.getModifyChargeAsPecentageAmountJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargePaymentMode");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargePaymentMode"));
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId,
ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId,
ChargesHelper.getModifyChargeAsPercentageInterestJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId,
ChargesHelper.getModifyChargeFeeFrequencyAsYearsJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("feeFrequency");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("feeFrequency"));
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, overdueFeeChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", overdueFeeChargeId, chargeIdAfterDeletion);
}
@Test
public void testChargesForSavings() {
// Testing Creation, Updation and Deletion of Specified due date Charge
final Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsSpecifiedDueDateJSON());
Assert.assertNotNull(specifiedDueDateChargeId);
// Updating Charge Amount
HashMap changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
ChargesHelper.getModifyChargeJSON());
HashMap chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
Integer chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, specifiedDueDateChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", specifiedDueDateChargeId, chargeIdAfterDeletion);
// Testing Creation, Updation and Deletion of Savings Activation Charge
final Integer savingsActivationChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsActivationFeeJSON());
Assert.assertNotNull(savingsActivationChargeId);
// Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, savingsActivationChargeId,
ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, savingsActivationChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, savingsActivationChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", savingsActivationChargeId, chargeIdAfterDeletion);
// Testing Creation, Updation and Deletion of Charge for Withdrawal Fee
final Integer withdrawalFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsWithdrawalFeeJSON());
Assert.assertNotNull(withdrawalFeeChargeId);
// Updating Charge-Calculation-Type to Withdrawal-Fee
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, withdrawalFeeChargeId,
ChargesHelper.getModifyWithdrawalFeeSavingsChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, withdrawalFeeChargeId);
HashMap chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, withdrawalFeeChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", withdrawalFeeChargeId, chargeIdAfterDeletion);
// Testing Creation, Updation and Deletion of Charge for Annual Fee
final Integer annualFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsAnnualFeeJSON());
Assert.assertNotNull(annualFeeChargeId);
// Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, annualFeeChargeId, ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, annualFeeChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, annualFeeChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", annualFeeChargeId, chargeIdAfterDeletion);
// Testing Creation, Updation and Deletion of Charge for Monthly Fee
final Integer monthlyFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsMonthlyFeeJSON());
Assert.assertNotNull(monthlyFeeChargeId);
// Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, monthlyFeeChargeId, ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, monthlyFeeChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, monthlyFeeChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", monthlyFeeChargeId, chargeIdAfterDeletion);
// Testing Creation, Updation and Deletion of Charge for Overdraft Fee
final Integer overdraftFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsOverdraftFeeJSON());
Assert.assertNotNull(overdraftFeeChargeId);
// Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdraftFeeChargeId,
ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdraftFeeChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, overdraftFeeChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", overdraftFeeChargeId, chargeIdAfterDeletion);
}
}
@@ -0,0 +1,418 @@
package org.mifosplatform.integrationtests;
import static org.junit.Assert.assertEquals;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.ClientHelper;
import org.mifosplatform.integrationtests.common.CommonConstants;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.charges.ChargesHelper;
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
import org.mifosplatform.integrationtests.common.savings.SavingsStatusChecker;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
/**
* Client Savings Integration Test for checking Savings Application.
*/
@SuppressWarnings({ "rawtypes", "unused" })
public class ClientSavingsIntegrationTest {
public static final String DEPOSIT_AMOUNT = "2000";
public static final String WITHDRAW_AMOUNT = "1000";
public static final String WITHDRAW_AMOUNT_ADJUSTED = "500";
public static final String MINIMUM_OPENING_BALANCE = "1000.0";
public static final String ACCOUNT_TYPE_INDIVIDUAL = "INDIVIDUAL";
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
private SavingsAccountHelper savingsAccountHelper;
@Before
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
}
@Test
public void testSavingsAccount() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
HashMap modifications = this.savingsAccountHelper.updateSavingsAccount(clientID, savingsProductID, savingsId,
ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertTrue(modifications.containsKey("submittedOnDate"));
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
final HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
this.savingsAccountHelper.calculateInterestForSavings(savingsId);
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
assertEquals(summaryBefore, summary);
this.savingsAccountHelper.postInterestForSavings(savingsId);
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
Assert.assertFalse(summaryBefore.equals(summary));
final Object savingsInterest = this.savingsAccountHelper.getSavingsInterest(savingsId);
// verifySavingsInterest(savingsInterest);
}
@Test
public void testSavingsAccount_CLOSE_APPLICATION() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, null);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.closeSavingsAccount(savingsId);
SavingsStatusChecker.verifySavingsAccountIsClosed(savingsStatusHashMap);
}
@SuppressWarnings("unchecked")
@Test
public void testSavingsAccount_DELETE_APPLICATION() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
SavingsAccountHelper savingsAccountHelperValidationError = new SavingsAccountHelper(this.requestSpec,
new ResponseSpecBuilder().build());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, null);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
List<HashMap> error1 = (List<HashMap>) savingsAccountHelperValidationError.deleteSavingsApplication(savingsId,
CommonConstants.RESPONSE_ERROR);
assertEquals("validation.msg.savingsaccount.delete.not.in.submittedandpendingapproval.state",
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
savingsStatusHashMap = this.savingsAccountHelper.undoApproval(savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
this.savingsAccountHelper.deleteSavingsApplication(savingsId, CommonConstants.RESPONSE_RESOURCE_ID);
List<HashMap> error = savingsAccountHelperValidationError.getSavingsCollectionAttribute(savingsId, CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.saving.account.id.invalid", error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
}
@SuppressWarnings("unchecked")
@Test
public void testSavingsAccount_REJECT_APPLICATION() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
SavingsAccountHelper savingsAccountHelperValidationError = new SavingsAccountHelper(this.requestSpec,
new ResponseSpecBuilder().build());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
List<HashMap> error1 = savingsAccountHelperValidationError.rejectApplicationWithErrorCode(savingsId,
SavingsAccountHelper.CREATED_DATE_PLUS_ONE);
assertEquals("validation.msg.savingsaccount.reject.not.in.submittedandpendingapproval.state",
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
savingsStatusHashMap = this.savingsAccountHelper.undoApproval(savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
error1 = savingsAccountHelperValidationError.rejectApplicationWithErrorCode(savingsId, SavingsAccountHelper.getFutureDate());
assertEquals("validation.msg.savingsaccount.reject.cannot.be.a.future.date",
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
error1 = savingsAccountHelperValidationError.rejectApplicationWithErrorCode(savingsId, SavingsAccountHelper.CREATED_DATE_MINUS_ONE);
assertEquals("validation.msg.savingsaccount.reject.cannot.be.before.submittal.date",
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
savingsStatusHashMap = this.savingsAccountHelper.rejectApplication(savingsId);
SavingsStatusChecker.verifySavingsIsRejected(savingsStatusHashMap);
}
@Test
public void testSavingsAccount_WITHDRAW_APPLICATION() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.withdrawApplication(savingsId);
SavingsStatusChecker.verifySavingsIsWithdrawn(savingsStatusHashMap);
}
@SuppressWarnings("unchecked")
@Test
public void testSavingsAccountTransactions() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
SavingsAccountHelper savingsAccountHelperValidationError = new SavingsAccountHelper(this.requestSpec,
new ResponseSpecBuilder().build());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
List<HashMap> error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "100",
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.savingsaccount.transaction.account.is.not.active",
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
error = (List) savingsAccountHelperValidationError.depositToSavingsAccount(savingsId, "100", SavingsAccountHelper.TRANSACTION_DATE,
CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.savingsaccount.transaction.account.is.not.active",
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
Float balance = new Float(MINIMUM_OPENING_BALANCE);
assertEquals("Verifying opening Balance", balance, summary.get("accountBalance"));
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
balance += new Float(DEPOSIT_AMOUNT);
assertEquals("Verifying Deposit Amount", new Float(DEPOSIT_AMOUNT), depositTransaction.get("amount"));
assertEquals("Verifying Balance after Deposit", balance, depositTransaction.get("runningBalance"));
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
balance -= new Float(WITHDRAW_AMOUNT);
assertEquals("Verifying Withdrawal Amount", new Float(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"));
assertEquals("Verifying Balance after Withdrawal", balance, withdrawTransaction.get("runningBalance"));
Integer newWithdrawTransactionId = this.savingsAccountHelper.updateSavingsAccountTransaction(savingsId, withdrawTransactionId,
WITHDRAW_AMOUNT_ADJUSTED);
HashMap newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, newWithdrawTransactionId);
balance = balance + new Float(WITHDRAW_AMOUNT) - new Float(WITHDRAW_AMOUNT_ADJUSTED);
assertEquals("Verifying adjusted Amount", new Float(WITHDRAW_AMOUNT_ADJUSTED), newWithdrawTransaction.get("amount"));
assertEquals("Verifying Balance after adjust", balance, newWithdrawTransaction.get("runningBalance"));
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
assertEquals("Verifying Adjusted Balance", balance, summary.get("accountBalance"));
withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
Assert.assertTrue((Boolean) withdrawTransaction.get("reversed"));
this.savingsAccountHelper.undoSavingsAccountTransaction(savingsId, newWithdrawTransactionId);
newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
Assert.assertTrue((Boolean) newWithdrawTransaction.get("reversed"));
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
balance += new Float(WITHDRAW_AMOUNT_ADJUSTED);
assertEquals("Verifying Balance After Undo Transaction", balance, summary.get("accountBalance"));
error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "5000",
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.savingsaccount.transaction.insufficient.account.balance",
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "5000",
SavingsAccountHelper.getFutureDate(), CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.savingsaccount.transaction.in.the.future", error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
error = (List) savingsAccountHelperValidationError.depositToSavingsAccount(savingsId, "5000", SavingsAccountHelper.getFutureDate(),
CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.savingsaccount.transaction.in.the.future", error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "5000",
SavingsAccountHelper.CREATED_DATE_MINUS_ONE, CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.savingsaccount.transaction.before.activation.date",
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
error = (List) savingsAccountHelperValidationError.depositToSavingsAccount(savingsId, "5000",
SavingsAccountHelper.CREATED_DATE_MINUS_ONE, CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.savingsaccount.transaction.before.activation.date",
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
}
@SuppressWarnings("unchecked")
@Test
public void testSavingsAccountCharges() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
final Integer withdrawalChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsWithdrawalFeeJSON());
Assert.assertNotNull(withdrawalChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, withdrawalChargeId);
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(1, chargesPendingState.size());
Integer savingsChargeId = (Integer) chargesPendingState.get(0).get("id");
HashMap chargeChanges = this.savingsAccountHelper.updateCharges(savingsChargeId, savingsId);
Assert.assertTrue(chargeChanges.containsKey("amount"));
Integer deletedChargeId = this.savingsAccountHelper.deleteCharge(savingsChargeId, savingsId);
assertEquals(savingsChargeId, deletedChargeId);
chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertTrue(chargesPendingState == null || chargesPendingState.size() == 0);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
final Integer chargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, ChargesHelper.getSavingsAnnualFeeJSON());
Assert.assertNotNull(chargeId);
ArrayList<HashMap> charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertTrue(charges == null || charges.size() == 0);
this.savingsAccountHelper.addChargesForSavings(savingsId, chargeId);
charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(1, charges.size());
HashMap savingsChargeForPay = charges.get(0);
SimpleDateFormat sdf = new SimpleDateFormat(CommonConstants.dateFormat);
Calendar cal = Calendar.getInstance();
List dates = (List) savingsChargeForPay.get("dueDate");
cal.set(Calendar.YEAR, (Integer) dates.get(0));
cal.set(Calendar.MONTH, (Integer) dates.get(1) - 1);
cal.set(Calendar.DAY_OF_MONTH, (Integer) dates.get(2));
this.savingsAccountHelper.payCharge((Integer) savingsChargeForPay.get("id"), savingsId,
((Float) savingsChargeForPay.get("amount")).toString(), sdf.format(cal.getTime()));
HashMap paidCharge = this.savingsAccountHelper.getSavingsCharge(savingsId, (Integer) savingsChargeForPay.get("id"));
assertEquals(savingsChargeForPay.get("amount"), paidCharge.get("amountPaid"));
final Integer monthlyFeechargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsMonthlyFeeJSON());
Assert.assertNotNull(monthlyFeechargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, monthlyFeechargeId);
charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(2, charges.size());
HashMap savingsChargeForWaive = charges.get(1);
this.savingsAccountHelper.waiveCharge((Integer) savingsChargeForWaive.get("id"), savingsId);
HashMap waiveCharge = this.savingsAccountHelper.getSavingsCharge(savingsId, (Integer) savingsChargeForWaive.get("id"));
assertEquals(savingsChargeForWaive.get("amount"), waiveCharge.get("amountWaived"));
}
private Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String minOpenningBalance) {
System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------");
SavingsProductHelper savingsProductHelper = new SavingsProductHelper();
final String savingsProductJSON = savingsProductHelper //
.withInterestCompoundingPeriodTypeAsDaily() //
.withInterestPostingPeriodTypeAsMonthly() //
.withInterestCalculationPeriodTypeAsDailyBalance() //
.withMinimumOpenningBalance(minOpenningBalance).build();
return SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
}
/*
* private void verifySavingsInterest(final Object savingsInterest) {
* System.out.println(
* "--------------------VERIFYING THE BALANCE, INTEREST --------------------------"
* );
*
* assertEquals("Verifying Interest Calculation", new Float("238.3399"),
* savingsInterest); }
*/
}
@@ -0,0 +1,119 @@
package org.mifosplatform.integrationtests;
import java.util.ArrayList;
import java.util.HashMap;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.GlobalConfigurationHelper;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings({ "rawtypes", "unchecked", "static-access" })
public class GlobalConfigurationTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
private GlobalConfigurationHelper globalConfigurationHelper;
@Before
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
}
@Test
public void testGlobalConfigurations() {
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
// Retrieving All Global Configuration details
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec,
this.responseSpec);
Assert.assertNotNull(globalConfig);
String configName = "penalty-wait-period";
for (Integer configIndex = 0; configIndex < (globalConfig.size() - 1); configIndex++) {
if (globalConfig.get(configIndex).get("name").equals(configName)) {
Integer configId = (Integer) globalConfig.get(configIndex).get("id");
Assert.assertNotNull(configId);
HashMap configDataBefore = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
configId.toString());
Assert.assertNotNull(configDataBefore);
Integer value = (Integer) configDataBefore.get("value") + 1;
// Updating Value for penalty-wait-period Global Configuration
configId = this.globalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec,
configId.toString(), value.toString());
Assert.assertNotNull(configId);
HashMap configDataAfter = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
configId.toString());
// Verifying Value for penalty-wait-period after Updation
Assert.assertEquals("Verifying Global Config Value after Updation", value, configDataAfter.get("value"));
// Updating Enabled Flag for penalty-wait-period Global
// Configuration
Boolean enabled = (Boolean) globalConfig.get(configIndex).get("enabled");
if (enabled == true) {
enabled = false;
} else {
enabled = true;
}
configId = this.globalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec,
configId.toString(), enabled);
configDataAfter = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
configId.toString());
// Verifying Enabled Flag for penalty-wait-period after Updation
Assert.assertEquals("Verifying Enabled Flag Global Config after Updation", enabled, configDataAfter.get("enabled"));
break;
}
}
}
@Test
public void testGlobalConfigurationIsCacheEnabled() {
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
// Retrieving Is Cache Enabled Global Configuration details
ArrayList<HashMap> isCacheGlobalConfig = this.globalConfigurationHelper.getGlobalConfigurationIsCacheEnabled(this.requestSpec,
this.responseSpec);
Assert.assertNotNull(isCacheGlobalConfig);
for (Integer cacheType = 0; cacheType <= ((isCacheGlobalConfig.size()) - 1); cacheType++) {
// Retrieving Is Cache Enabled Global Configuration details
isCacheGlobalConfig = this.globalConfigurationHelper.getGlobalConfigurationIsCacheEnabled(this.requestSpec, this.responseSpec);
Assert.assertNotNull(isCacheGlobalConfig);
HashMap cacheTypeAsHashMap = (HashMap) isCacheGlobalConfig.get(cacheType).get("cacheType");
Integer cacheTypeId = (Integer) cacheTypeAsHashMap.get("id");
String cacheTypeValue = (String) cacheTypeAsHashMap.get("value");
Boolean enabled = (Boolean) isCacheGlobalConfig.get(cacheType).get("enabled");
if (cacheTypeValue.compareTo("No cache") == 0 && enabled == true) {
cacheTypeId += 1;
} else if (cacheTypeValue.compareTo("Single node") == 0 && enabled == true) {
cacheTypeId -= 1;
}
HashMap changes = this.globalConfigurationHelper.updateIsCacheEnabledForGlobalConfiguration(this.requestSpec,
this.responseSpec, cacheTypeId.toString());
Assert.assertEquals("Verifying Is Cache Enabled Global Config after Updation", cacheTypeId, changes.get("cacheType"));
}
}
}
@@ -66,7 +66,7 @@ public class GroupLoanIntegrationTest {
.withInterestRateFrequencyTypeAsMonths() //
.withAmortizationTypeAsEqualInstallments() //
.withInterestTypeAsDecliningBalance() //
.build();
.build(null);
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
}
@@ -85,7 +85,7 @@ public class GroupLoanIntegrationTest {
.withInterestCalculationPeriodTypeSameAsRepaymentPeriod() //
.withExpectedDisbursementDate("20 September 2011") //
.withSubmittedOnDate("20 September 2011") //
.withLoanType("group").build(groupID.toString(), loanProductID.toString());
.withLoanType("group").build(groupID.toString(), loanProductID.toString(), null);
System.out.println(loanApplicationJSON);
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
}
@@ -0,0 +1,447 @@
package org.mifosplatform.integrationtests;
import static org.junit.Assert.assertEquals;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.ClientHelper;
import org.mifosplatform.integrationtests.common.CommonConstants;
import org.mifosplatform.integrationtests.common.GroupHelper;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.charges.ChargesHelper;
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
import org.mifosplatform.integrationtests.common.savings.SavingsStatusChecker;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
/**
* Group Savings Integration Test for checking Savings Application.
*/
@SuppressWarnings({ "rawtypes", "unused" })
public class GroupSavingsIntegrationTest {
public static final String DEPOSIT_AMOUNT = "2000";
public static final String WITHDRAW_AMOUNT = "1000";
public static final String WITHDRAW_AMOUNT_ADJUSTED = "500";
public static final String MINIMUM_OPENING_BALANCE = "1000.0";
public static final String ACCOUNT_TYPE_GROUP = "GROUP";
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
private SavingsAccountHelper savingsAccountHelper;
@Before
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
}
@Test
public void testSavingsAccount() {
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
Assert.assertNotNull(savingsId);
HashMap modifications = this.savingsAccountHelper.updateSavingsAccount(groupID, savingsProductID, savingsId, ACCOUNT_TYPE_GROUP);
Assert.assertTrue(modifications.containsKey("submittedOnDate"));
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
final HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
this.savingsAccountHelper.calculateInterestForSavings(savingsId);
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
assertEquals(summaryBefore, summary);
this.savingsAccountHelper.postInterestForSavings(savingsId);
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
Assert.assertFalse(summaryBefore.equals(summary));
final Object savingsInterest = this.savingsAccountHelper.getSavingsInterest(savingsId);
}
@Test
public void testSavingsAccount_CLOSE_APPLICATION() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, null);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
Assert.assertNotNull(savingsId);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.closeSavingsAccount(savingsId);
SavingsStatusChecker.verifySavingsAccountIsClosed(savingsStatusHashMap);
}
@SuppressWarnings("unchecked")
@Test
public void testSavingsAccount_DELETE_APPLICATION() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
SavingsAccountHelper savingsAccountHelperValidationError = new SavingsAccountHelper(this.requestSpec,
new ResponseSpecBuilder().build());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, null);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
Assert.assertNotNull(savingsId);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
List<HashMap> error1 = (List<HashMap>) savingsAccountHelperValidationError.deleteSavingsApplication(savingsId,
CommonConstants.RESPONSE_ERROR);
assertEquals("validation.msg.savingsaccount.delete.not.in.submittedandpendingapproval.state",
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
savingsStatusHashMap = this.savingsAccountHelper.undoApproval(savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
this.savingsAccountHelper.deleteSavingsApplication(savingsId, CommonConstants.RESPONSE_RESOURCE_ID);
List<HashMap> error = savingsAccountHelperValidationError.getSavingsCollectionAttribute(savingsId, CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.saving.account.id.invalid", error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
}
@SuppressWarnings("unchecked")
@Test
public void testSavingsAccount_REJECT_APPLICATION() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
SavingsAccountHelper savingsAccountHelperValidationError = new SavingsAccountHelper(this.requestSpec,
new ResponseSpecBuilder().build());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
Assert.assertNotNull(savingsId);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
List<HashMap> error1 = savingsAccountHelperValidationError.rejectApplicationWithErrorCode(savingsId,
SavingsAccountHelper.CREATED_DATE_PLUS_ONE);
assertEquals("validation.msg.savingsaccount.reject.not.in.submittedandpendingapproval.state",
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
savingsStatusHashMap = this.savingsAccountHelper.undoApproval(savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
error1 = savingsAccountHelperValidationError.rejectApplicationWithErrorCode(savingsId, SavingsAccountHelper.getFutureDate());
assertEquals("validation.msg.savingsaccount.reject.cannot.be.a.future.date",
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
error1 = savingsAccountHelperValidationError.rejectApplicationWithErrorCode(savingsId, SavingsAccountHelper.CREATED_DATE_MINUS_ONE);
assertEquals("validation.msg.savingsaccount.reject.cannot.be.before.submittal.date",
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
savingsStatusHashMap = this.savingsAccountHelper.rejectApplication(savingsId);
SavingsStatusChecker.verifySavingsIsRejected(savingsStatusHashMap);
}
@Test
public void testSavingsAccount_WITHDRAW_APPLICATION() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
Assert.assertNotNull(savingsId);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.withdrawApplication(savingsId);
SavingsStatusChecker.verifySavingsIsWithdrawn(savingsStatusHashMap);
}
@SuppressWarnings("unchecked")
@Test
public void testSavingsAccountTransactions() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
SavingsAccountHelper savingsAccountHelperValidationError = new SavingsAccountHelper(this.requestSpec,
new ResponseSpecBuilder().build());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
Assert.assertNotNull(savingsId);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
List<HashMap> error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "100",
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.savingsaccount.transaction.account.is.not.active",
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
error = (List) savingsAccountHelperValidationError.depositToSavingsAccount(savingsId, "100", SavingsAccountHelper.TRANSACTION_DATE,
CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.savingsaccount.transaction.account.is.not.active",
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
Float balance = new Float(MINIMUM_OPENING_BALANCE);
assertEquals("Verifying opening Balance", balance, summary.get("accountBalance"));
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
balance += new Float(DEPOSIT_AMOUNT);
assertEquals("Verifying Deposit Amount", new Float(DEPOSIT_AMOUNT), depositTransaction.get("amount"));
assertEquals("Verifying Balance after Deposit", balance, depositTransaction.get("runningBalance"));
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
balance -= new Float(WITHDRAW_AMOUNT);
assertEquals("Verifying Withdrawal Amount", new Float(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"));
assertEquals("Verifying Balance after Withdrawal", balance, withdrawTransaction.get("runningBalance"));
Integer newWithdrawTransactionId = this.savingsAccountHelper.updateSavingsAccountTransaction(savingsId, withdrawTransactionId,
WITHDRAW_AMOUNT_ADJUSTED);
HashMap newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, newWithdrawTransactionId);
balance = balance + new Float(WITHDRAW_AMOUNT) - new Float(WITHDRAW_AMOUNT_ADJUSTED);
assertEquals("Verifying adjusted Amount", new Float(WITHDRAW_AMOUNT_ADJUSTED), newWithdrawTransaction.get("amount"));
assertEquals("Verifying Balance after adjust", balance, newWithdrawTransaction.get("runningBalance"));
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
assertEquals("Verifying Adjusted Balance", balance, summary.get("accountBalance"));
withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
Assert.assertTrue((Boolean) withdrawTransaction.get("reversed"));
this.savingsAccountHelper.undoSavingsAccountTransaction(savingsId, newWithdrawTransactionId);
newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
Assert.assertTrue((Boolean) newWithdrawTransaction.get("reversed"));
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
balance += new Float(WITHDRAW_AMOUNT_ADJUSTED);
assertEquals("Verifying Balance After Undo Transaction", balance, summary.get("accountBalance"));
error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "5000",
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.savingsaccount.transaction.insufficient.account.balance",
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "5000",
SavingsAccountHelper.getFutureDate(), CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.savingsaccount.transaction.in.the.future", error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
error = (List) savingsAccountHelperValidationError.depositToSavingsAccount(savingsId, "5000", SavingsAccountHelper.getFutureDate(),
CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.savingsaccount.transaction.in.the.future", error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "5000",
SavingsAccountHelper.CREATED_DATE_MINUS_ONE, CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.savingsaccount.transaction.before.activation.date",
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
error = (List) savingsAccountHelperValidationError.depositToSavingsAccount(savingsId, "5000",
SavingsAccountHelper.CREATED_DATE_MINUS_ONE, CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.savingsaccount.transaction.before.activation.date",
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
}
@SuppressWarnings("unchecked")
@Test
public void testSavingsAccountCharges() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
Assert.assertNotNull(savingsId);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
final Integer withdrawalChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsWithdrawalFeeJSON());
Assert.assertNotNull(withdrawalChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, withdrawalChargeId);
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(1, chargesPendingState.size());
Integer savingsChargeId = (Integer) chargesPendingState.get(0).get("id");
HashMap chargeChanges = this.savingsAccountHelper.updateCharges(savingsChargeId, savingsId);
Assert.assertTrue(chargeChanges.containsKey("amount"));
Integer deletedChargeId = this.savingsAccountHelper.deleteCharge(savingsChargeId, savingsId);
assertEquals(savingsChargeId, deletedChargeId);
chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertTrue(chargesPendingState == null || chargesPendingState.size() == 0);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
final Integer chargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, ChargesHelper.getSavingsAnnualFeeJSON());
Assert.assertNotNull(chargeId);
ArrayList<HashMap> charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertTrue(charges == null || charges.size() == 0);
this.savingsAccountHelper.addChargesForSavings(savingsId, chargeId);
charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(1, charges.size());
HashMap savingsChargeForPay = charges.get(0);
SimpleDateFormat sdf = new SimpleDateFormat(CommonConstants.dateFormat);
Calendar cal = Calendar.getInstance();
List dates = (List) savingsChargeForPay.get("dueDate");
cal.set(Calendar.YEAR, (Integer) dates.get(0));
cal.set(Calendar.MONTH, (Integer) dates.get(1) - 1);
cal.set(Calendar.DAY_OF_MONTH, (Integer) dates.get(2));
this.savingsAccountHelper.payCharge((Integer) savingsChargeForPay.get("id"), savingsId,
((Float) savingsChargeForPay.get("amount")).toString(), sdf.format(cal.getTime()));
HashMap paidCharge = this.savingsAccountHelper.getSavingsCharge(savingsId, (Integer) savingsChargeForPay.get("id"));
assertEquals(savingsChargeForPay.get("amount"), paidCharge.get("amountPaid"));
final Integer monthlyFeechargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsMonthlyFeeJSON());
Assert.assertNotNull(monthlyFeechargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, monthlyFeechargeId);
charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(2, charges.size());
HashMap savingsChargeForWaive = charges.get(1);
this.savingsAccountHelper.waiveCharge((Integer) savingsChargeForWaive.get("id"), savingsId);
HashMap waiveCharge = this.savingsAccountHelper.getSavingsCharge(savingsId, (Integer) savingsChargeForWaive.get("id"));
assertEquals(savingsChargeForWaive.get("amount"), waiveCharge.get("amountWaived"));
}
public static Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String minOpenningBalance) {
System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------");
SavingsProductHelper savingsProductHelper = new SavingsProductHelper();
final String savingsProductJSON = savingsProductHelper //
.withInterestCompoundingPeriodTypeAsDaily() //
.withInterestPostingPeriodTypeAsMonthly() //
.withInterestCalculationPeriodTypeAsDailyBalance() //
.withMinimumOpenningBalance(minOpenningBalance).build();
return SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
}
}
@@ -48,8 +48,9 @@ public class GroupTest {
groupID = GroupHelper.updateGroup(this.requestSpec, this.responseSpec, updatedGroupName, groupID.toString());
GroupHelper.verifyGroupDetails(this.requestSpec, this.responseSpec, groupID, "name", updatedGroupName);
groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec);
GroupHelper.deleteGroup(this.requestSpec, this.responseSpec, groupID.toString());
GroupHelper.verifyGroupDeleted(this.requestSpec, this.responseSpec, groupID);
// NOTE: removed as consistently provides false positive result on cloudbees server.
// groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec);
// GroupHelper.deleteGroup(this.requestSpec, this.responseSpec, groupID.toString());
// GroupHelper.verifyGroupDeleted(this.requestSpec, this.responseSpec, groupID);
}
}
@@ -116,7 +116,7 @@ public class LoanWithWaiveInterestAndWriteOffIntegrationTest {
final String loanProductJSON = new LoanProductTestBuilder().withPrincipal(this.LP_PRINCIPAL).withRepaymentTypeAsMonth()
.withRepaymentAfterEvery(this.LP_REPAYMENT_PERIOD).withNumberOfRepayments(this.LP_REPAYMENTS).withRepaymentTypeAsMonth()
.withinterestRatePerPeriod(this.LP_INTEREST_RATE).withInterestRateFrequencyTypeAsMonths()
.withAmortizationTypeAsEqualPrincipalPayment().withInterestTypeAsFlat().build();
.withAmortizationTypeAsEqualPrincipalPayment().withInterestTypeAsFlat().build(null);
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
}
@@ -129,7 +129,7 @@ public class LoanWithWaiveInterestAndWriteOffIntegrationTest {
.withRepaymentFrequencyTypeAsMonths().withInterestRatePerPeriod(this.RATE_OF_INTEREST_PER_PERIOD)
.withInterestTypeAsFlatBalance().withAmortizationTypeAsEqualInstallments()
.withInterestCalculationPeriodTypeSameAsRepaymentPeriod().withExpectedDisbursementDate(this.EXPECTED_DISBURSAL_DATE)
.withSubmittedOnDate(this.LOAN_APPLICATION_SUBMISSION_DATE).build(clientID.toString(), loanProductID.toString());
.withSubmittedOnDate(this.LOAN_APPLICATION_SUBMISSION_DATE).build(clientID.toString(), loanProductID.toString(), null);
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
}
}
@@ -37,7 +37,7 @@ public class LoanWithdrawnByApplicantIntegrationTest {
@Test
public void loanWithdrawnByApplicant() {
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2012");
final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder().build());
final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder().build(null));
final Integer loanID = applyForLoanApplication(clientID, loanProductID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
@@ -53,7 +53,7 @@ public class LoanWithdrawnByApplicantIntegrationTest {
final String loanApplication = new LoanApplicationTestBuilder().withPrincipal("5000").withLoanTermFrequency("5")
.withLoanTermFrequencyAsMonths().withNumberOfRepayments("5").withRepaymentEveryAfter("1")
.withRepaymentFrequencyTypeAsMonths().withInterestRatePerPeriod("2").withExpectedDisbursementDate("04 April 2012")
.withSubmittedOnDate("02 April 2012").build(clientID.toString(), loanProductID.toString());
.withSubmittedOnDate("02 April 2012").build(clientID.toString(), loanProductID.toString(), null);
return this.loanTransactionHelper.getLoanId(loanApplication);
}
}
@@ -0,0 +1,93 @@
package org.mifosplatform.integrationtests;
import static org.junit.Assert.assertEquals;
import java.util.HashMap;
import java.util.List;
import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.CommonConstants;
import org.mifosplatform.integrationtests.common.OfficeHelper;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.accounting.Account;
import org.mifosplatform.integrationtests.common.accounting.AccountHelper;
import org.mifosplatform.integrationtests.common.accounting.OfficeAccountMappingHelper;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings("rawtypes")
public class OfficeAccountingMappingsTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
}
@SuppressWarnings("unchecked")
@Test
public void testOfficeAccountingMappings() {
OfficeHelper officeHelper = new OfficeHelper(this.requestSpec, this.responseSpec);
Integer officeId = officeHelper.createOffice("01 January 2014");
Assert.assertNotNull(officeId);
Integer officeId2 = officeHelper.createOffice("01 January 2014");
Assert.assertNotNull(officeId2);
AccountHelper accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
Account transferAccount = accountHelper.createLiabilityAccount();
Assert.assertNotNull(transferAccount);
OfficeAccountMappingHelper accountMappingHelper = new OfficeAccountMappingHelper(this.requestSpec,
new ResponseSpecBuilder().build());
Integer transferAccountMappingId = (Integer) accountMappingHelper.createOfficeAccountMapping(officeId,
transferAccount.getAccountID(), CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(transferAccountMappingId);
HashMap mappingDetails = accountMappingHelper.getOfficeAccountMapping(transferAccountMappingId);
Assert.assertEquals(officeId, ((HashMap) mappingDetails.get("officeData")).get("id"));
Assert.assertEquals(transferAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
Account transferAccount2 = accountHelper.createLiabilityAccount();
Assert.assertNotNull(transferAccount2);
HashMap changes = (HashMap) accountMappingHelper.updateOfficeAccountMapping(transferAccountMappingId, officeId,
transferAccount2.getAccountID(), CommonConstants.RESPONSE_CHANGES);
Assert.assertEquals(transferAccount2.getAccountID(), changes.get("liabilityTransferInSuspenseAccountId"));
mappingDetails = accountMappingHelper.getOfficeAccountMapping(transferAccountMappingId);
Assert.assertEquals(officeId, ((HashMap) mappingDetails.get("officeData")).get("id"));
Assert.assertEquals(transferAccount2.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
List<HashMap> error1 = (List<HashMap>) accountMappingHelper.updateOfficeAccountMapping(transferAccountMappingId, officeId2,
transferAccount2.getAccountID(), CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.officeToAccountMapping.update.of.officeId.is.not.supported",
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
List<HashMap> error2 = (List<HashMap>) accountMappingHelper.createOfficeAccountMapping(officeId, transferAccount.getAccountID(),
CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.officeToAccountMapping.exists.for.office", error2.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
Account fundAccount = accountHelper.createAssetAccount();
Assert.assertNotNull(fundAccount);
List<HashMap> error3 = (List<HashMap>) accountMappingHelper.createOfficeAccountMapping(officeId2, fundAccount.getAccountID(),
CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.liabilityTransferInSuspenseAccountId.invalid.account.type", error3.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
}
}
@@ -0,0 +1,105 @@
package org.mifosplatform.integrationtests;
import java.util.ArrayList;
import java.util.HashMap;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.SchedulerJobHelper;
import org.mifosplatform.integrationtests.common.Utils;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings({ "rawtypes", "unchecked", "static-access" })
public class SchedulerJobsTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
private ResponseSpecification responseSpecForSchedulerJob;
private SchedulerJobHelper schedulerJobHelper;
@Before
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
this.requestSpec.header("X-Mifos-Platform-TenantId", "default");
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
this.responseSpecForSchedulerJob = new ResponseSpecBuilder().expectStatusCode(202).build();
}
@Test
public void testSchedulerJobs() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
// Retrieving Status of Scheduler
HashMap schedulerStatus = this.schedulerJobHelper.getSchedulerStatus(this.requestSpec, this.responseSpec);
Boolean status = (Boolean) schedulerStatus.get("active");
if (status == true) {
this.schedulerJobHelper.updateSchedulerStatus(this.requestSpec, this.responseSpecForSchedulerJob, "stop");
schedulerStatus = this.schedulerJobHelper.getSchedulerStatus(this.requestSpec, this.responseSpec);
// Verifying Status of the Scheduler after updation
Assert.assertEquals("Verifying Scheduler Job Status", false, schedulerStatus.get("active"));
} else {
this.schedulerJobHelper.updateSchedulerStatus(this.requestSpec, this.responseSpecForSchedulerJob, "start");
schedulerStatus = this.schedulerJobHelper.getSchedulerStatus(this.requestSpec, this.responseSpec);
// Verifying Status of the Scheduler after updation
Assert.assertEquals("Verifying Scheduler Job Status", true, schedulerStatus.get("active"));
}
// Retrieving All Scheduler Jobs
ArrayList<HashMap> allSchedulerJobsData = this.schedulerJobHelper.getAllSchedulerJobs(this.requestSpec, this.responseSpec);
Assert.assertNotNull(allSchedulerJobsData);
for (Integer jobIndex = 0; jobIndex < allSchedulerJobsData.size(); jobIndex++) {
Integer jobId = (Integer) allSchedulerJobsData.get(jobIndex).get("jobId");
// Retrieving Scheduler Job by ID
HashMap schedulerJob = this.schedulerJobHelper.getSchedulerJobById(this.requestSpec, this.responseSpec, jobId.toString());
Assert.assertNotNull(schedulerJob);
Boolean active = (Boolean) schedulerJob.get("active");
if (active == true) {
active = false;
} else {
active = true;
}
// Updating Scheduler Job
HashMap changes = this.schedulerJobHelper.updateSchedulerJob(this.requestSpec, this.responseSpec, jobId.toString(),
active.toString());
// Verifying Scheduler Job updation
Assert.assertEquals("Verifying Scheduler Job Updation", active, changes.get("active"));
// Executing Scheduler Job
this.schedulerJobHelper.runSchedulerJob(this.requestSpec, jobId.toString());
// Retrieving Scheduler Job by ID
schedulerJob = this.schedulerJobHelper.getSchedulerJobById(this.requestSpec, this.responseSpec, jobId.toString());
Assert.assertNotNull(schedulerJob);
// Waiting for Job to complete
while ((Boolean) schedulerJob.get("currentlyRunning") == true) {
Thread.sleep(15000);
schedulerJob = this.schedulerJobHelper.getSchedulerJobById(this.requestSpec, this.responseSpec, jobId.toString());
Assert.assertNotNull(schedulerJob);
System.out.println("Job is Still Running");
}
ArrayList<HashMap> jobHistoryData = this.schedulerJobHelper.getSchedulerJobHistory(this.requestSpec, this.responseSpec,
jobId.toString());
// Verifying the Status of the Recently executed Scheduler Job
Assert.assertEquals("Verifying Last Scheduler Job Status", "success",
jobHistoryData.get(jobHistoryData.size() - 1).get("status"));
}
}
}
@@ -0,0 +1,878 @@
package org.mifosplatform.integrationtests;
import static org.junit.Assert.assertEquals;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.ClientHelper;
import org.mifosplatform.integrationtests.common.GlobalConfigurationHelper;
import org.mifosplatform.integrationtests.common.HolidayHelper;
import org.mifosplatform.integrationtests.common.SchedulerJobHelper;
import org.mifosplatform.integrationtests.common.StandingInstructionsHelper;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.accounting.Account;
import org.mifosplatform.integrationtests.common.accounting.AccountHelper;
import org.mifosplatform.integrationtests.common.accounting.JournalEntry;
import org.mifosplatform.integrationtests.common.accounting.JournalEntryHelper;
import org.mifosplatform.integrationtests.common.charges.ChargesHelper;
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositAccountHelper;
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositAccountStatusChecker;
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositProductHelper;
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanStatusChecker;
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
import org.mifosplatform.integrationtests.common.savings.SavingsStatusChecker;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings({ "unused", "unchecked", "rawtypes", "static-access", "cast" })
public class SchedulerJobsTestResults {
private static final String FROM_ACCOUNT_TYPE_LOAN = "1";
private static final String FROM_ACCOUNT_TYPE_SAVINGS = "2";
private static final String TO_ACCOUNT_TYPE_LOAN = "1";
private static final String TO_ACCOUNT_TYPE_SAVINGS = "2";
private final String DATE_OF_JOINING = "01 January 2011";
private final String TRANSACTION_DATE = "01 March 2013";
public static final String ACCOUNT_TYPE_INDIVIDUAL = "INDIVIDUAL";
public static final String MINIMUM_OPENING_BALANCE = "1000";
Float SP_BALANCE = new Float(MINIMUM_OPENING_BALANCE);
private static ResponseSpecification responseSpec;
private static RequestSpecification requestSpec;
private ResponseSpecification responseSpecForSchedulerJob;
private SchedulerJobHelper schedulerJobHelper;
private SavingsAccountHelper savingsAccountHelper;
private LoanTransactionHelper loanTransactionHelper;
private HolidayHelper holidayHelper;
private GlobalConfigurationHelper globalConfigurationHelper;
private AccountHelper accountHelper;
private JournalEntryHelper journalEntryHelper;
private StandingInstructionsHelper standingInstructionsHelper;
@Before
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
this.requestSpec.header("X-Mifos-Platform-TenantId", "default");
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
this.responseSpecForSchedulerJob = new ResponseSpecBuilder().expectStatusCode(202).build();
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
}
@Test
public void testApplyAnnualFeeForSavingsJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID,
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
final Integer annualFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsAnnualFeeJSON());
Assert.assertNotNull(annualFeeChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, annualFeeChargeId);
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(1, chargesPendingState.size());
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
String JobName = "Apply Annual Fee For Savings";
this.schedulerJobHelper.excuteJob(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"));
}
@Test
public void testInterestPostingForSavingsJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID,
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
final HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
String JobName = "Post Interest For Savings";
this.schedulerJobHelper.excuteJob(JobName);
final HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
Assert.assertNotSame("Verifying the Balance after running Post Interest for Savings Job", summaryBefore.get("accountBalance"),
summaryAfter.get("accountBalance"));
}
@Test
public void testTransferFeeForLoansFromSavingsJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID,
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), savingsId.toString());
Assert.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanSpecifiedDueDateWithAccountTransferJSON());
Assert.assertNotNull(specifiedDueDateChargeId);
this.loanTransactionHelper.addChargesForLoan(loanID,
LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(specifiedDueDateChargeId.toString()));
ArrayList<HashMap> chargesPendingState = this.loanTransactionHelper.getLoanCharges(loanID);
Assert.assertEquals(1, chargesPendingState.size());
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(AccountTransferTest.LOAN_DISBURSAL_DATE, loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
final HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
String JobName = "Transfer Fee For Loans From Savings";
this.schedulerJobHelper.excuteJob(JobName);
final HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
Float chargeAmount = (Float) chargeData.get("amount");
final Float balance = (Float) summaryBefore.get("accountBalance") - chargeAmount;
Assert.assertEquals("Verifying the Balance after running Transfer Fee for Loans from Savings", balance,
(Float) summaryAfter.get("accountBalance"));
}
@Test
public void testApplyHolidaysToLoansJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
this.holidayHelper = new HolidayHelper(this.requestSpec, this.responseSpec);
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Integer holidayId = this.holidayHelper.createHolidays(this.requestSpec, this.responseSpec);
Assert.assertNotNull(holidayId);
final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(AccountTransferTest.LOAN_DISBURSAL_DATE, loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
// Retrieving All Global Configuration details
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec,
this.responseSpec);
Assert.assertNotNull(globalConfig);
// Updating Value for reschedule-repayments-on-holidays Global
// Configuration
Integer configId = (Integer) globalConfig.get(3).get("id");
Assert.assertNotNull(configId);
HashMap configData = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
configId.toString());
Assert.assertNotNull(configData);
Boolean enabled = (Boolean) globalConfig.get(3).get("enabled");
if (enabled == false) {
enabled = true;
configId = this.globalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec,
configId.toString(), enabled);
}
final ArrayList<HashMap> repaymentScheduleDataBeforeJob = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
this.responseSpec, loanID);
holidayId = this.holidayHelper.activateHolidays(this.requestSpec, this.responseSpec, holidayId.toString());
Assert.assertNotNull(holidayId);
String JobName = "Apply Holidays To Loans";
this.schedulerJobHelper.excuteJob(JobName);
final ArrayList<HashMap> repaymentScheduleDataAfterJob = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
this.responseSpec, loanID);
HashMap holidayData = this.holidayHelper.getHolidayById(this.requestSpec, this.responseSpec, holidayId.toString());
ArrayList<Integer> repaymentsRescheduledDate = (ArrayList<Integer>) holidayData.get("repaymentsRescheduledTo");
ArrayList<Integer> rescheduleDateAfter = (ArrayList<Integer>) repaymentScheduleDataAfterJob.get(2).get("fromDate");
Assert.assertEquals("Verifying Repayment Rescheduled Date after Running Apply Holidays to Loans Scheduler Job",
repaymentsRescheduledDate, repaymentsRescheduledDate);
}
@Test
public void testApplyDueFeeChargesForSavingsJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID,
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
final Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsSpecifiedDueDateJSON());
Assert.assertNotNull(specifiedDueDateChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, specifiedDueDateChargeId);
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(1, chargesPendingState.size());
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
String JobName = "Pay Due Savings Charges";
this.schedulerJobHelper.excuteJob(JobName);
HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
Float chargeAmount = (Float) chargeData.get("amount");
final Float balance = (Float) summaryBefore.get("accountBalance") - chargeAmount;
Assert.assertEquals("Verifying the Balance after running Pay due Savings Charges", balance,
(Float) summaryAfter.get("accountBalance"));
}
@Test
public void testUpdateAccountingRunningBalancesJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
final Account assetAccount = this.accountHelper.createAssetAccount();
final Account incomeAccount = this.accountHelper.createIncomeAccount();
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
final Integer accountID = assetAccount.getAccountID();
final Integer savingsProductID = createSavingsProduct(MINIMUM_OPENING_BALANCE, assetAccount, incomeAccount, expenseAccount,
liabilityAccount);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
final Integer savingsID = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsID);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsID);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsID);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
// Checking initial Account entries.
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(this.SP_BALANCE, JournalEntry.TransactionType.DEBIT) };
final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(this.SP_BALANCE, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.TRANSACTION_DATE, assetAccountInitialEntry);
this.journalEntryHelper
.checkJournalEntryForLiabilityAccount(liabilityAccount, this.TRANSACTION_DATE, liablilityAccountInitialEntry);
String JobName = "Update Accounting Running Balances";
this.schedulerJobHelper.excuteJob(JobName);
final HashMap runningBalanceAfter = this.accountHelper.getAccountingWithRunningBalanceById(accountID.toString());
final Integer INT_BALANCE = new Integer(MINIMUM_OPENING_BALANCE);
Assert.assertEquals("Verifying Account Running Balance after running Update Accounting Running Balances Scheduler Job",
INT_BALANCE, runningBalanceAfter.get("organizationRunningBalance"));
}
@Test
public void testUpdateLoanArrearsAgingJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(AccountTransferTest.LOAN_DISBURSAL_DATE, loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
String JobName = "Update Loan Arrears Ageing";
this.schedulerJobHelper.excuteJob(JobName);
HashMap loanSummaryData = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
Float totalLoanArrearsAging = (Float) loanSummaryData.get("principalOverdue") + (Float) loanSummaryData.get("interestOverdue");
Assert.assertEquals("Verifying Arrears Aging after Running Update Loan Arrears Aging Scheduler Job", totalLoanArrearsAging,
loanSummaryData.get("totalOverdue"));
}
@Test
public void testUpdateLoanPaidInAdvanceJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
Calendar todayDate = Calendar.getInstance();
final String currentDate = dateFormat.format(todayDate.getTime());
todayDate.add(Calendar.MONTH, -1);
final String LOAN_DISBURSEMENT_DATE = dateFormat.format(todayDate.getTime());
todayDate = Calendar.getInstance();
todayDate.add(Calendar.DATE, -5);
final String LOAN_FIRST_REPAYMENT_DATE = dateFormat.format(todayDate.getTime());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSEMENT_DATE, loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
ArrayList<HashMap> loanScheduleBefore = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec,
loanID);
Float totalDueForCurrentPeriod = (Float) loanScheduleBefore.get(1).get("totalDueForPeriod");
this.loanTransactionHelper.makeRepayment(LOAN_FIRST_REPAYMENT_DATE, totalDueForCurrentPeriod, loanID);
HashMap loanSummary = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
String JobName = "Update Loan Paid In Advance";
this.schedulerJobHelper.excuteJob(JobName);
// Retrieving Loan Repayment Schedule after the successful
// completion of
// Update Loan Paid in Advance Scheduler Job
ArrayList<HashMap> loanScheduleAfter = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec,
loanID);
loanSummary = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
Float totalPaidInAdvance = (Float) loanScheduleAfter.get(1).get("totalPaidInAdvanceForPeriod");
Assert.assertEquals("Verifying Loan Repayment in Advance after Running Update Loan Paid in Advance Scheduler Job",
totalDueForCurrentPeriod, totalPaidInAdvance);
}
@Test
public void testUpdateLoanSummaryJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
Calendar todaysDate = Calendar.getInstance();
final String currentDate = dateFormat.format(todaysDate.getTime());
todaysDate.add(Calendar.MONTH, -1);
final String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime());
todaysDate = Calendar.getInstance();
todaysDate.add(Calendar.DATE, -5);
final String LOAN_FIRST_REPAYMENT_DATE = dateFormat.format(todaysDate.getTime());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID);
Integer disburseChargeId = ChargesHelper
.createCharges(this.requestSpec, this.responseSpec, ChargesHelper.getLoanDisbursementJSON());
Assert.assertNotNull(disburseChargeId);
this.loanTransactionHelper.addChargesForLoan(loanID,
LoanTransactionHelper.getDisbursementChargesForLoanAsJSON(disburseChargeId.toString()));
ArrayList<HashMap> chargesPendingState = this.loanTransactionHelper.getLoanCharges(loanID);
Assert.assertEquals(1, chargesPendingState.size());
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSEMENT_DATE, loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
HashMap loanSummaryBefore = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
String JobName = "Update loan Summary";
this.schedulerJobHelper.excuteJob(JobName);
Float expectedSummaryAfterJob = (Float) loanSummaryBefore.get("totalExpectedRepayment")
- (Float) loanSummaryBefore.get("feeChargesPaid");
HashMap loanSummaryAfter = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
Assert.assertEquals("Verifying Loan Summary after Running Update Loan Summary Scheduler Job", expectedSummaryAfterJob,
(Float) loanSummaryAfter.get("totalExpectedRepayment"));
}
@Test
public void testExecuteStandingInstructionsJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.standingInstructionsHelper = new StandingInstructionsHelper(this.requestSpec, this.responseSpec);
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
DateFormat monthDayFormat = new SimpleDateFormat("dd MMMM");
Calendar todaysDate = Calendar.getInstance();
todaysDate.add(Calendar.MONTH, -1);
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
todaysDate.add(Calendar.YEAR, 1);
final String VALID_TO = dateFormat.format(todaysDate.getTime());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
final Integer fromSavingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID,
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsId);
SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap);
fromSavingsStatusHashMap = this.savingsAccountHelper.approveSavings(fromSavingsId);
SavingsStatusChecker.verifySavingsIsApproved(fromSavingsStatusHashMap);
fromSavingsStatusHashMap = this.savingsAccountHelper.activateSavings(fromSavingsId);
SavingsStatusChecker.verifySavingsIsActive(fromSavingsStatusHashMap);
final Integer toSavingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID,
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
HashMap toSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, toSavingsId);
SavingsStatusChecker.verifySavingsIsPending(toSavingsStatusHashMap);
toSavingsStatusHashMap = this.savingsAccountHelper.approveSavings(toSavingsId);
SavingsStatusChecker.verifySavingsIsApproved(toSavingsStatusHashMap);
toSavingsStatusHashMap = this.savingsAccountHelper.activateSavings(toSavingsId);
SavingsStatusChecker.verifySavingsIsActive(toSavingsStatusHashMap);
HashMap fromSavingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(fromSavingsId);
Float fromSavingsBalanceBefore = (Float) fromSavingsSummaryBefore.get("accountBalance");
HashMap toSavingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(toSavingsId);
Float toSavingsBalanceBefore = (Float) toSavingsSummaryBefore.get("accountBalance");
Integer standingInstructionId = this.standingInstructionsHelper.createStandingInstruction(clientID.toString(),
fromSavingsId.toString(), toSavingsId.toString(), FROM_ACCOUNT_TYPE_SAVINGS, TO_ACCOUNT_TYPE_SAVINGS, VALID_FROM, VALID_TO,
MONTH_DAY);
Assert.assertNotNull(standingInstructionId);
String JobName = "Execute Standing Instruction";
this.schedulerJobHelper.excuteJob(JobName);
HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsId);
Float fromSavingsBalanceAfter = (Float) fromSavingsSummaryAfter.get("accountBalance");
HashMap toSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(toSavingsId);
Float toSavingsBalanceAfter = (Float) toSavingsSummaryAfter.get("accountBalance");
final HashMap standingInstructionData = this.standingInstructionsHelper
.getStandingInstructionById(standingInstructionId.toString());
Float expectedFromSavingsBalance = fromSavingsBalanceBefore - (Float) standingInstructionData.get("amount");
Float expectedToSavingsBalance = toSavingsBalanceBefore + (Float) standingInstructionData.get("amount");
Assert.assertEquals("Verifying From Savings Balance after Successful completion of Scheduler Job", expectedFromSavingsBalance,
fromSavingsBalanceAfter);
Assert.assertEquals("Verifying To Savings Balance after Successful completion of Scheduler Job", expectedToSavingsBalance,
toSavingsBalanceAfter);
}
@Test
public void testApplyPenaltyForOverdueLoansJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Integer overdueFeeChargeId = ChargesHelper
.createCharges(this.requestSpec, this.responseSpec, ChargesHelper.getLoanOverdueFeeJSON());
Assert.assertNotNull(overdueFeeChargeId);
final Integer loanProductID = createLoanProduct(overdueFeeChargeId.toString());
Assert.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(AccountTransferTest.LOAN_APPROVAL_DATE_PLUS_ONE, loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
ArrayList<HashMap> repaymentScheduleDataBefore = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
this.responseSpec, loanID);
String JobName = "Apply penalty to overdue loans";
this.schedulerJobHelper.excuteJob(JobName);
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
Float chargeAmount = (Float) chargeData.get("amount");
ArrayList<HashMap> repaymentScheduleDataAfter = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
this.responseSpec, loanID);
Assert.assertEquals("Verifying From Penalty Charges due fot first Repayment after Successful completion of Scheduler Job",
chargeAmount, (Float) repaymentScheduleDataAfter.get(1).get("penaltyChargesDue"));
loanStatusHashMap = this.loanTransactionHelper.undoDisbursal(loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
}
@Test
public void testUpdateOverdueDaysForNPA() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(AccountTransferTest.LOAN_DISBURSAL_DATE, loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
final Boolean isNPABefore = (Boolean) this.loanTransactionHelper.getLoanDetail(requestSpec, responseSpec, loanID, "isNPA");
Assert.assertFalse(isNPABefore);
// Integer jobId = (Integer) allSchedulerJobsData.get(1).get("jobId");
String JobName = "Update Non Performing Assets";
this.schedulerJobHelper.excuteJob(JobName);
final Boolean isNPAAfter = (Boolean) this.loanTransactionHelper.getLoanDetail(requestSpec, responseSpec, loanID, "isNPA");
Assert.assertTrue(isNPAAfter);
}
@Test
public void testInterestTransferForSavings() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
AccountHelper accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
FixedDepositAccountHelper fixedDepositAccountHelper = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec);
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
DateFormat monthDayFormat = new SimpleDateFormat("dd MMM");
Calendar todaysDate = Calendar.getInstance();
todaysDate.add(Calendar.MONTH, -3);
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
todaysDate.add(Calendar.YEAR, 10);
final String VALID_TO = dateFormat.format(todaysDate.getTime());
todaysDate = Calendar.getInstance();
todaysDate.add(Calendar.MONTH, -2);
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
todaysDate.add(Calendar.MONTH, 1);
final String WHOLE_TERM = "1";
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Float balance = new Float(MINIMUM_OPENING_BALANCE) + new Float(FixedDepositAccountHelper.depositAmount);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, String.valueOf(balance));
Assert.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientId, savingsProductID,
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsId);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
HashMap summary = savingsAccountHelper.getSavingsSummary(savingsId);
assertEquals("Verifying opening Balance", balance, summary.get("accountBalance"));
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, savingsId.toString(), true, fixedDepositAccountHelper);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
FixedDepositAccountStatusChecker.verifyFixedDepositIsPending(fixedDepositAccountStatusHashMap);
fixedDepositAccountStatusHashMap = fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
fixedDepositAccountStatusHashMap = fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = new Float(MINIMUM_OPENING_BALANCE);
assertEquals("Verifying Balance", balance, summary.get("accountBalance"));
fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
HashMap fixedDepositSummary = savingsAccountHelper.getSavingsSummary(fixedDepositAccountId);
Float interestPosted = (Float) fixedDepositSummary.get("accountBalance") - new Float(FixedDepositAccountHelper.depositAmount);
String JobName = "Transfer Interest To Savings";
this.schedulerJobHelper.excuteJob(JobName);
fixedDepositSummary = savingsAccountHelper.getSavingsSummary(fixedDepositAccountId);
assertEquals("Verifying opening Balance", new Float(FixedDepositAccountHelper.depositAmount),
fixedDepositSummary.get("accountBalance"));
summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = new Float(MINIMUM_OPENING_BALANCE) + interestPosted;
validateNumberForEqualExcludePrecission(String.valueOf(balance), String.valueOf(summary.get("accountBalance")));
}
private Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String minOpenningBalance) {
System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------");
SavingsProductHelper savingsProductHelper = new SavingsProductHelper();
final String savingsProductJSON = savingsProductHelper //
.withInterestCompoundingPeriodTypeAsDaily() //
.withInterestPostingPeriodTypeAsMonthly() //
.withInterestCalculationPeriodTypeAsDailyBalance() //
.withMinimumOpenningBalance(minOpenningBalance).build();
return SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
}
private static Integer createSavingsProduct(final String minOpenningBalance, final Account... accounts) {
System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------");
final String savingsProductJSON = new SavingsProductHelper().withInterestCompoundingPeriodTypeAsDaily() //
.withInterestPostingPeriodTypeAsQuarterly() //
.withInterestCalculationPeriodTypeAsDailyBalance() //
.withMinimumOpenningBalance(minOpenningBalance).withAccountingRuleAsCashBased(accounts).build();
return SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
}
private Integer createLoanProduct(final String chargeId) {
System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
final String loanProductJSON = new LoanProductTestBuilder() //
.withPrincipal("15,000.00") //
.withNumberOfRepayments("4") //
.withRepaymentAfterEvery("1") //
.withRepaymentTypeAsMonth() //
.withinterestRatePerPeriod("1") //
.withInterestRateFrequencyTypeAsMonths() //
.withAmortizationTypeAsEqualInstallments() //
.withInterestTypeAsDecliningBalance() //
.build(chargeId);
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
}
private Integer applyForLoanApplication(final String clientID, final String loanProductID, final String savingsID) {
System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
final String loanApplicationJSON = new LoanApplicationTestBuilder() //
.withPrincipal("15,000.00") //
.withLoanTermFrequency("4") //
.withLoanTermFrequencyAsMonths() //
.withNumberOfRepayments("4") //
.withRepaymentEveryAfter("1") //
.withRepaymentFrequencyTypeAsMonths() //
.withInterestRatePerPeriod("2") //
.withAmortizationTypeAsEqualInstallments() //
.withInterestTypeAsDecliningBalance() //
.withInterestCalculationPeriodTypeSameAsRepaymentPeriod() //
.withExpectedDisbursementDate("10 January 2013") //
.withSubmittedOnDate("10 January 2013") //
.build(clientID, loanProductID, savingsID);
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
}
private Integer createFixedDepositProduct(final String validFrom, final String validTo, Account... accounts) {
System.out.println("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------");
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
final String fixedDepositProductJSON = fixedDepositProductHelper //
// .withAccountingRuleAsCashBased(accounts)
.build(validFrom, validTo);
return FixedDepositProductHelper.createFixedDepositProduct(fixedDepositProductJSON, requestSpec, responseSpec);
}
private Integer applyForFixedDepositApplication(final String clientID, final String productID, final String validFrom,
final String validTo, final String submittedOnDate, final String penalInterestType, String savingsId,
final boolean transferInterest, final FixedDepositAccountHelper fixedDepositAccountHelper) {
System.out.println("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------");
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec)
//
.withSubmittedOnDate(submittedOnDate).withSavings(savingsId).transferInterest(true)
.withLockinPeriodFrequency("1", FixedDepositAccountHelper.DAYS)
.build(clientID, productID, validFrom, validTo, penalInterestType);
return fixedDepositAccountHelper.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
}
public void validateNumberForEqualExcludePrecission(String val, String val2) {
DecimalFormat twoDForm = new DecimalFormat("#");
Assert.assertTrue(new Float(twoDForm.format(new Float(val))).compareTo(new Float(twoDForm.format(new Float(val2)))) == 0);
}
}
@@ -0,0 +1,32 @@
package org.mifosplatform.integrationtests;
import org.junit.Before;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
/**
* Client Loan Integration Test for checking Loan Application Repayment
* Schedule.
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public class SurveyIntegrationTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
private LoanTransactionHelper loanTransactionHelper;
@Before
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
}
}
@@ -0,0 +1,359 @@
package org.mifosplatform.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import java.util.HashMap;
import java.util.List;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.CommonConstants;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.system.CodeHelper;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
/**
* Test for creating, updating, deleting codes and code values
*
*/
public class SystemCodeTest {
private ResponseSpecification responseSpec;
private ResponseSpecification generalResponseSpec;
private RequestSpecification requestSpec;
@Before
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(
ContentType.JSON).build();
this.requestSpec
.header("Authorization",
"Basic "
+ Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200)
.build();
this.generalResponseSpec = new ResponseSpecBuilder().build();
}
// @Ignore()
@Test
// scenario 57, 58, 59, 60
public void testCreateCode() {
final String codeName = "Client Marital Status";
final Integer createResponseId = (Integer) CodeHelper.createCode(
this.requestSpec, this.responseSpec, codeName,
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
// verify code created
final HashMap newCodeAttributes = (HashMap) CodeHelper.getCodeById(
this.requestSpec, this.responseSpec, createResponseId, "");
Assert.assertNotNull(newCodeAttributes);
assertEquals("Verify value of codeId", createResponseId,
newCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME));
assertEquals("Verify code name", codeName,
newCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME));
assertEquals("Verify system defined is false", false,
newCodeAttributes
.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME));
// update code
final HashMap updateChangeResponse = (HashMap) CodeHelper.updateCode(
this.requestSpec, this.responseSpec, createResponseId, codeName
+ "(CHANGE)", "changes");
assertEquals("Verify code name updated", codeName + "(CHANGE)",
updateChangeResponse.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME));
// delete code
final Integer deleteResponseId = (Integer) CodeHelper.deleteCodeById(
this.requestSpec, this.responseSpec, createResponseId,
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
assertEquals("Verify code deleted", createResponseId, deleteResponseId);
// verify code deleted
final HashMap deletedCodeValues = (HashMap) CodeHelper.getCodeById(
this.requestSpec, this.generalResponseSpec, deleteResponseId,
"");
Assert.assertNotNull(deletedCodeValues);
assertNull("Verify value of codeId",
deletedCodeValues.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME));
assertNull("Verify code name",
deletedCodeValues.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME));
assertNull("Verify system defined is false",
deletedCodeValues
.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME));
}
// @Ignore()
@Test
// scenario 57, 60
public void testPreventCreateDuplicateCode() {
final String codeName = "Client Marital Status";
// create code
final Integer createResponseId = (Integer) CodeHelper.createCode(
this.requestSpec, this.responseSpec, codeName,
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
// verify code created
final HashMap newCodeAttributes = (HashMap) CodeHelper.getCodeById(
this.requestSpec, this.responseSpec, createResponseId, "");
Assert.assertNotNull(newCodeAttributes);
assertEquals("Verify value of codeId", createResponseId,
newCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME));
assertEquals("Verify code name", codeName,
newCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME));
assertEquals("Verify system defined is false", false,
newCodeAttributes
.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME));
// try to create duplicate-- should fail
final List<HashMap> error = (List) CodeHelper.createCode(
this.requestSpec, this.generalResponseSpec, codeName,
CommonConstants.RESPONSE_ERROR);
assertEquals("Verify duplication error",
"error.msg.code.duplicate.name",
error.get(0).get("userMessageGlobalisationCode"));
// delete code that was just created
final Integer deleteResponseId = (Integer) CodeHelper.deleteCodeById(
this.requestSpec, this.responseSpec, createResponseId,
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
assertEquals("Verify code deleted", createResponseId, deleteResponseId);
// verify code deleted
final HashMap deletedCodeAttributes = (HashMap) CodeHelper.getCodeById(
this.requestSpec, this.generalResponseSpec, deleteResponseId,
"");
Assert.assertNotNull(deletedCodeAttributes);
assertNull("Verify value of codeId",
deletedCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME));
assertNull("Verify code name",
deletedCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME));
assertNull("Verify system defined is false",
deletedCodeAttributes
.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME));
}
// @Ignore
@Test
public void testUpdateDeleteSystemDefinedCode() {
// get any systemDefined code
final HashMap systemDefinedCode = (HashMap) CodeHelper
.getSystemDefinedCodes(this.requestSpec, this.responseSpec);
// delete system-defined code should fail
final List<HashMap> error = (List) CodeHelper.deleteCodeById(
this.requestSpec, this.generalResponseSpec,
(Integer) systemDefinedCode
.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME),
CommonConstants.RESPONSE_ERROR);
assertEquals("Cannot delete system-defined code",
"error.msg.code.systemdefined",
error.get(0).get("userMessageGlobalisationCode"));
// update system-defined code should fail
final List<HashMap> updateError = (List) CodeHelper.updateCode(
this.requestSpec, this.generalResponseSpec,
(Integer) systemDefinedCode
.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME),
systemDefinedCode.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME)
+ "CHANGE", CommonConstants.RESPONSE_ERROR);
assertEquals("Cannot update system-defined code",
"error.msg.code.systemdefined",
error.get(0).get("userMessageGlobalisationCode"));
}
// @Ignore
@Test
public void testCodeValuesNotAssignedToTable() {
final String codeName = "Client Marital Status";
final String codeValue1 = "Married";
final String codeValue2 = "Unmarried";
final int codeValue1Position = 1;
final int codeValue2Position = 2;
// create code
final Integer createCodeResponseId = (Integer) CodeHelper.createCode(
this.requestSpec, this.responseSpec, codeName,
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
// create first code value
final Integer createCodeValueResponseId1 = (Integer) CodeHelper
.createCodeValue(this.requestSpec, this.responseSpec,
createCodeResponseId, codeValue1, codeValue1Position,
CodeHelper.SUBRESPONSE_ID_ATTRIBUTE_NAME);
// create second code value
final Integer createCodeValueResponseId2 = (Integer) CodeHelper
.createCodeValue(this.requestSpec, this.responseSpec,
createCodeResponseId, codeValue2, codeValue2Position,
CodeHelper.SUBRESPONSE_ID_ATTRIBUTE_NAME);
// verify two code values created
final List<HashMap> codeValuesList = (List) CodeHelper
.getCodeValuesForCode(this.requestSpec, this.responseSpec,
createCodeResponseId, "");
assertEquals("Number of code values returned matches number created",
2, codeValuesList.size());
// verify values of first code value
final HashMap codeValuesAttributes1 = (HashMap) CodeHelper
.getCodeValueById(this.requestSpec, this.responseSpec,
createCodeResponseId, createCodeValueResponseId1, "");
Assert.assertNotNull(codeValuesAttributes1);
assertEquals("Verify value of codeValueId", createCodeValueResponseId1,
codeValuesAttributes1
.get(CodeHelper.CODE_VALUE_ID_ATTRIBUTE_NAME));
assertEquals("Verify value of code name", codeValue1,
codeValuesAttributes1
.get(CodeHelper.CODE_VALUE_NAME_ATTRIBUTE_NAME));
assertEquals("Verify position of code value", codeValue1Position,
codeValuesAttributes1
.get(CodeHelper.CODE_VALUE_POSITION_ATTRIBUTE_NAME));
// verify values of second code value
final HashMap codeValuesAttributes2 = (HashMap) CodeHelper
.getCodeValueById(this.requestSpec, this.responseSpec,
createCodeResponseId, createCodeValueResponseId2, "");
Assert.assertNotNull(codeValuesAttributes2);
assertEquals("Verify value of codeValueId", createCodeValueResponseId2,
codeValuesAttributes2
.get(CodeHelper.CODE_VALUE_ID_ATTRIBUTE_NAME));
assertEquals("Verify value of code name", codeValue2,
codeValuesAttributes2
.get(CodeHelper.CODE_VALUE_NAME_ATTRIBUTE_NAME));
assertEquals("Verify position of code value", codeValue2Position,
codeValuesAttributes2
.get(CodeHelper.CODE_VALUE_POSITION_ATTRIBUTE_NAME));
// update code value 1
final HashMap codeValueChanges = (HashMap) CodeHelper
.updateCodeValue(this.requestSpec, this.responseSpec,
createCodeResponseId, createCodeValueResponseId1,
codeValue1 + "CHANGE", 4, "changes");
assertEquals("Verify changed code value name",
codeValueChanges.get("name"), codeValue1 + "CHANGE");
// delete code value
final Integer deletedCodeValueResponseId1 = (Integer) CodeHelper
.deleteCodeValueById(this.requestSpec,
this.generalResponseSpec, createCodeResponseId,
createCodeValueResponseId1,
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
// Verify code value deleted
final HashMap deletedCodeValueAttributes1 = (HashMap) CodeHelper
.getCodeValueById(this.requestSpec, this.generalResponseSpec,
createCodeResponseId, deletedCodeValueResponseId1, "");
// Assert.assertNotNull(deletedCodeValueAttributes1);
assertNull("Verify value of codeValueId",
deletedCodeValueAttributes1
.get(CodeHelper.CODE_VALUE_ID_ATTRIBUTE_NAME));
assertNull("Verify value of code name",
deletedCodeValueAttributes1
.get(CodeHelper.CODE_VALUE_NAME_ATTRIBUTE_NAME));
assertNull("Verify position of code value",
deletedCodeValueAttributes1
.get(CodeHelper.CODE_VALUE_POSITION_ATTRIBUTE_NAME));
final List<HashMap> deletedCodeValuesList = (List) CodeHelper
.getCodeValuesForCode(this.requestSpec, this.responseSpec,
createCodeResponseId, "");
assertEquals("Number of code values is 1", 1,
deletedCodeValuesList.size());
// delete code, remaining code values automatically deleted
final Integer deleteCodeResponseId = (Integer) CodeHelper
.deleteCodeById(this.requestSpec, this.generalResponseSpec,
createCodeResponseId,
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
assertEquals("Verify code deleted", createCodeResponseId,
deleteCodeResponseId);
// verify code deleted
final HashMap deletedCodeAttributes = (HashMap) CodeHelper.getCodeById(
this.requestSpec, this.generalResponseSpec,
createCodeResponseId, "");
Assert.assertNotNull(deletedCodeAttributes);
assertNull("Verify value of codeId is null",
deletedCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME));
assertNull("Verify code name is null",
deletedCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME));
assertNull("Verify system defined is null",
deletedCodeAttributes
.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME));
// Verify remaining code value deleted
final HashMap deletedCodeValues2 = (HashMap) CodeHelper
.getCodeValueById(this.requestSpec, this.generalResponseSpec,
createCodeResponseId, createCodeValueResponseId2, "");
assertNull("Verify value of codeValueId is null",
deletedCodeValues2.get(CodeHelper.CODE_VALUE_ID_ATTRIBUTE_NAME));
assertNull("Verify value of code name is null",
deletedCodeValues2
.get(CodeHelper.CODE_VALUE_NAME_ATTRIBUTE_NAME));
assertNull("Verify position of code value null",
deletedCodeValues2
.get(CodeHelper.CODE_VALUE_POSITION_ATTRIBUTE_NAME));
}
@Ignore
@Test
public void testCodeValuesAssignedToTable() {
}
}
@@ -18,15 +18,21 @@ public class ClientHelper {
public static Integer createClient(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String activationDate) {
System.out.println("---------------------------------CREATING A CLIENT---------------------------------------------");
return Utils.performServerPost(requestSpec, responseSpec, CREATE_CLIENT_URL, getTestClientAsJSON(activationDate), "clientId");
return createClient(requestSpec, responseSpec, activationDate, "1");
}
public static String getTestClientAsJSON(final String dateOfJoining) {
public static Integer createClient(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String activationDate, final String officeId) {
System.out.println("---------------------------------CREATING A CLIENT---------------------------------------------");
return Utils.performServerPost(requestSpec, responseSpec, CREATE_CLIENT_URL, getTestClientAsJSON(activationDate, officeId),
"clientId");
}
public static String getTestClientAsJSON(final String dateOfJoining, final String officeId) {
final HashMap<String, String> map = new HashMap<String, String>();
map.put("officeId", "1");
map.put("firstname", randomNameGenerator("Client_FirstName_", 5));
map.put("lastname", randomNameGenerator("Client_LastName_", 4));
map.put("officeId", officeId);
map.put("firstname", Utils.randomNameGenerator("Client_FirstName_", 5));
map.put("lastname", Utils.randomNameGenerator("Client_LastName_", 4));
map.put("externalId", randomIDGenerator("ID_", 7));
map.put("dateFormat", "dd MMMM yyyy");
map.put("locale", "en");
@@ -44,10 +50,6 @@ public class ClientHelper {
assertEquals("ERROR IN CREATING THE CLIENT", generatedClientID, responseClientID);
}
public static String randomNameGenerator(final String prefix, final int lenOfRandomSuffix) {
return Utils.randomStringGenerator(prefix, lenOfRandomSuffix);
}
private static String randomIDGenerator(final String prefix, final int lenOfRandomSuffix) {
return Utils.randomStringGenerator(prefix, lenOfRandomSuffix, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
}
@@ -0,0 +1,12 @@
package org.mifosplatform.integrationtests.common;
public interface CommonConstants {
public final static String locale = "en";
public static final String dateFormat = "dd MMMM yyyy";
public static final String RESPONSE_RESOURCE_ID = "resourceId";
public static final String RESPONSE_CHANGES = "changes";
public static final String RESPONSE_ERROR = "errors";
public static final String RESPONSE_ERROR_MESSAGE_CODE = "userMessageGlobalisationCode";
}
@@ -0,0 +1,90 @@
package org.mifosplatform.integrationtests.common;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
import com.google.gson.Gson;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings({ "unused", "rawtypes" })
public class GlobalConfigurationHelper {
private final RequestSpecification requestSpec;
private final ResponseSpecification responseSpec;
public GlobalConfigurationHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
this.requestSpec = requestSpec;
this.responseSpec = responseSpec;
}
public static ArrayList getAllGlobalConfigurations(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
final String GET_ALL_GLOBAL_CONFIG_URL = "/mifosng-provider/api/v1/configurations?tenantIdentifier=default";
System.out.println("------------------------ RETRIEVING ALL GLOBAL CONFIGURATIONS -------------------------");
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_ALL_GLOBAL_CONFIG_URL, "");
return (ArrayList) response.get("globalConfiguration");
}
public static HashMap getGlobalConfigurationById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String configId) {
final String GET_GLOBAL_CONFIG_BY_ID_URL = "/mifosng-provider/api/v1/configurations/" + configId + "?tenantIdentifier=default";
System.out.println("------------------------ RETRIEVING GLOBAL CONFIGURATION BY ID -------------------------");
return Utils.performServerGet(requestSpec, responseSpec, GET_GLOBAL_CONFIG_BY_ID_URL, "");
}
public static Integer updateValueForGlobalConfiguration(final RequestSpecification requestSpec,
final ResponseSpecification responseSpec, final String configId, final String value) {
final String GLOBAL_CONFIG_UPDATE_URL = "/mifosng-provider/api/v1/configurations/" + configId + "?tenantIdentifier=default";
System.out.println("---------------------------------UPDATE VALUE FOR GLOBAL CONFIG---------------------------------------------");
return Utils.performServerPut(requestSpec, responseSpec, GLOBAL_CONFIG_UPDATE_URL, updateGlobalConfigUpdateValueAsJSON(value),
"resourceId");
}
public static Integer updateEnabledFlagForGlobalConfiguration(final RequestSpecification requestSpec,
final ResponseSpecification responseSpec, final String configId, final Boolean enabled) {
final String GLOBAL_CONFIG_UPDATE_URL = "/mifosng-provider/api/v1/configurations/" + configId + "?tenantIdentifier=default";
System.out
.println("---------------------------------UPDATE GLOBAL CONFIG FOR ENABLED FLAG---------------------------------------------");
return Utils.performServerPut(requestSpec, responseSpec, GLOBAL_CONFIG_UPDATE_URL,
updateGlobalConfigUpdateEnabledFlagAsJSON(enabled), "resourceId");
}
public static ArrayList getGlobalConfigurationIsCacheEnabled(final RequestSpecification requestSpec,
final ResponseSpecification responseSpec) {
final String GET_IS_CACHE_GLOBAL_CONFIG_URL = "/mifosng-provider/api/v1/caches?tenantIdentifier=default";
System.out.println("------------------------ RETRIEVING IS CACHE ENABLED GLOBAL CONFIGURATION -------------------------");
final ArrayList<HashMap> response = Utils.performServerGet(requestSpec, responseSpec, GET_IS_CACHE_GLOBAL_CONFIG_URL, "");
return response;
}
public static HashMap updateIsCacheEnabledForGlobalConfiguration(final RequestSpecification requestSpec,
final ResponseSpecification responseSpec, final String cacheType) {
final String IS_CACHE_GLOBAL_CONFIG_UPDATE_URL = "/mifosng-provider/api/v1/caches?tenantIdentifier=default";
System.out.println("------------------UPDATE GLOBAL CONFIG FOR IS CACHE ENABLED----------------------");
return Utils.performServerPut(requestSpec, responseSpec, IS_CACHE_GLOBAL_CONFIG_UPDATE_URL,
updateIsCacheEnabledGlobalConfigUpdateAsJSON(cacheType), "changes");
}
public static String updateGlobalConfigUpdateValueAsJSON(final String value) {
final HashMap<String, String> map = new HashMap<String, String>();
map.put("value", value);
System.out.println("map : " + map);
return new Gson().toJson(map);
}
public static String updateGlobalConfigUpdateEnabledFlagAsJSON(final Boolean enabled) {
final HashMap<String, Boolean> map = new HashMap<String, Boolean>();
map.put("enabled", enabled);
System.out.println("map : " + map);
return new Gson().toJson(map);
}
public static String updateIsCacheEnabledGlobalConfigUpdateAsJSON(final String cacheType) {
final HashMap<String, String> map = new HashMap<String, String>();
map.put("cacheType", cacheType);
System.out.println("map : " + map);
return new Gson().toJson(map);
}
}
@@ -0,0 +1,74 @@
package org.mifosplatform.integrationtests.common;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.mifosplatform.integrationtests.common.Utils;
import com.google.gson.Gson;
import com.jayway.restassured.specification.RequestSender;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings({ "unused", "rawtypes" })
public class HolidayHelper {
private static final String HOLIDAYS_URL = "/mifosng-provider/api/v1/holidays";
private static final String CREATE_HOLIDAY_URL = HOLIDAYS_URL + "?" + Utils.TENANT_IDENTIFIER;
private static final String OFFICE_ID = "1";
private final RequestSpecification requestSpec;
private final ResponseSpecification responseSpec;
public HolidayHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
this.requestSpec = requestSpec;
this.responseSpec = responseSpec;
}
public static String getCreateHolidayDataAsJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>();
List<HashMap<String, String>> offices = new ArrayList<HashMap<String, String>>();
HashMap<String, String> officeMap = new HashMap<String, String>();
officeMap.put("officeId", OFFICE_ID);
offices.add(officeMap);
map.put("offices", offices);
map.put("locale", "en");
map.put("dateFormat", "dd MMMM yyyy");
map.put("name", Utils.randomNameGenerator("HOLIDAY_", 5));
map.put("fromDate", "01 April 2013");
map.put("toDate", "01 April 2013");
map.put("repaymentsRescheduledTo", "08 April 2013");
String HolidayCreateJson = new Gson().toJson(map);
System.out.println(HolidayCreateJson);
return HolidayCreateJson;
}
public static String getActivateHolidayDataAsJSON() {
final HashMap<String, String> map = new HashMap<String, String>();
String activateHoliday = new Gson().toJson(map);
System.out.println(activateHoliday);
return activateHoliday;
}
public static Integer createHolidays(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
return Utils.performServerPost(requestSpec, responseSpec, CREATE_HOLIDAY_URL, getCreateHolidayDataAsJSON(), "resourceId");
}
public static Integer activateHolidays(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String holidayID) {
final String ACTIVATE_HOLIDAY_URL = HOLIDAYS_URL + "/" + holidayID + "?command=activate";
return Utils.performServerPost(requestSpec, responseSpec, ACTIVATE_HOLIDAY_URL, getActivateHolidayDataAsJSON(), "resourceId");
}
public static HashMap getHolidayById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String holidayID) {
final String GET_HOLIDAY_BY_ID_URL = HOLIDAYS_URL + "/" + holidayID + "?tenantIdentifier=default";
System.out.println("------------------------ RETRIEVING HOLIDAY BY ID -------------------------");
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_HOLIDAY_BY_ID_URL, "");
return response;
}
}
@@ -0,0 +1,38 @@
package org.mifosplatform.integrationtests.common;
import java.util.HashMap;
import com.google.gson.Gson;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
public class OfficeHelper {
private static final String OFFICE_URL = "/mifosng-provider/api/v1/offices";
private final RequestSpecification requestSpec;
private final ResponseSpecification responseSpec;
public OfficeHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
this.requestSpec = requestSpec;
this.responseSpec = responseSpec;
}
public Integer createOffice(final String openingDate) {
String json = getAsJSON(openingDate);
return Utils.performServerPost(this.requestSpec, this.responseSpec, OFFICE_URL + "?" + Utils.TENANT_IDENTIFIER, json,
CommonConstants.RESPONSE_RESOURCE_ID);
}
public static String getAsJSON(final String openingDate) {
final HashMap<String, String> map = new HashMap<String, String>();
map.put("parentId", "1");
map.put("name", Utils.randomNameGenerator("Office_", 4));
map.put("dateFormat", "dd MMMM yyyy");
map.put("locale", "en");
map.put("openingDate", openingDate);
System.out.println("map : " + map);
return new Gson().toJson(map);
}
}
@@ -0,0 +1,124 @@
package org.mifosplatform.integrationtests.common;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
import org.junit.Assert;
import com.google.gson.Gson;
import com.jayway.restassured.builder.ResponseSpecBuilder;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings({ "unused", "rawtypes", "unchecked" })
public class SchedulerJobHelper {
private final RequestSpecification requestSpec;
private final ResponseSpecification responseSpec;
public SchedulerJobHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
this.requestSpec = requestSpec;
this.responseSpec = responseSpec;
}
public static ArrayList getAllSchedulerJobs(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
final String GET_ALL_SCHEDULER_JOBS_URL = "/mifosng-provider/api/v1/jobs?tenantIdentifier=default";
System.out.println("------------------------ RETRIEVING ALL SCHEDULER JOBS -------------------------");
final ArrayList response = Utils.performServerGet(requestSpec, responseSpec, GET_ALL_SCHEDULER_JOBS_URL, "");
return response;
}
public static HashMap getSchedulerJobById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String jobId) {
final String GET_SCHEDULER_JOB_BY_ID_URL = "/mifosng-provider/api/v1/jobs/" + jobId + "?tenantIdentifier=default";
System.out.println("------------------------ RETRIEVING SCHEDULER JOB BY ID -------------------------");
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_SCHEDULER_JOB_BY_ID_URL, "");
return response;
}
public static HashMap getSchedulerStatus(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
final String GET_SCHEDULER_STATUS_URL = "/mifosng-provider/api/v1/scheduler?tenantIdentifier=default";
System.out.println("------------------------ RETRIEVING SCHEDULER STATUS -------------------------");
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_SCHEDULER_STATUS_URL, "");
return response;
}
public static void updateSchedulerStatus(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String command) {
final String UPDATE_SCHEDULER_STATUS_URL = "/mifosng-provider/api/v1/scheduler?command=" + command +"&tenantIdentifier=default";
System.out.println("------------------------ UPDATING SCHEDULER STATUS -------------------------");
Utils.performServerPost(requestSpec, responseSpec, UPDATE_SCHEDULER_STATUS_URL, runSchedulerJobAsJSON(), null);
}
public static HashMap updateSchedulerJob(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String jobId, final String active) {
final String UPDATE_SCHEDULER_JOB_URL = "/mifosng-provider/api/v1/jobs/" + jobId + "?tenantIdentifier=default";
System.out.println("------------------------ UPDATING SCHEDULER JOB -------------------------");
final HashMap response = Utils.performServerPut(requestSpec, responseSpec, UPDATE_SCHEDULER_JOB_URL,
updateSchedulerJobAsJSON(active), "changes");
return response;
}
public static String updateSchedulerJobAsJSON(final String active) {
final HashMap<String, String> map = new HashMap<String, String>();
map.put("active", active);
System.out.println("map : " + map);
return new Gson().toJson(map);
}
public static ArrayList getSchedulerJobHistory(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String jobId) {
final String GET_SCHEDULER_STATUS_URL = "/mifosng-provider/api/v1/jobs/" + jobId + "/runhistory?tenantIdentifier=default";
System.out.println("------------------------ RETRIEVING SCHEDULER JOB HISTORY -------------------------");
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_SCHEDULER_STATUS_URL, "");
return (ArrayList) response.get("pageItems");
}
public static void runSchedulerJob(final RequestSpecification requestSpec, final String jobId) {
final ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(202).build();
final String RUN_SCHEDULER_JOB_URL = "/mifosng-provider/api/v1/jobs/" + jobId + "?command=executeJob&tenantIdentifier=default";
System.out.println("------------------------ RUN SCHEDULER JOB -------------------------");
Utils.performServerPost(requestSpec, responseSpec, RUN_SCHEDULER_JOB_URL, runSchedulerJobAsJSON(), null);
}
public static String runSchedulerJobAsJSON() {
final HashMap<String, String> map = new HashMap<String, String>();
String runSchedulerJob = new Gson().toJson(map);
System.out.println(runSchedulerJob);
return runSchedulerJob;
}
public void excuteJob(String JobName) throws InterruptedException {
ArrayList<HashMap> allSchedulerJobsData = getAllSchedulerJobs(this.requestSpec, this.responseSpec);
Assert.assertNotNull(allSchedulerJobsData);
for (Integer jobIndex = 0; jobIndex < allSchedulerJobsData.size(); jobIndex++) {
if (allSchedulerJobsData.get(jobIndex).get("displayName").equals(JobName)) {
Integer jobId = (Integer) allSchedulerJobsData.get(jobIndex).get("jobId");
// Executing Scheduler Job
runSchedulerJob(this.requestSpec, jobId.toString());
// Retrieving Scheduler Job by ID
HashMap schedulerJob = getSchedulerJobById(this.requestSpec, this.responseSpec, jobId.toString());
Assert.assertNotNull(schedulerJob);
// Waiting for Job to complete
while ((Boolean) schedulerJob.get("currentlyRunning") == true) {
Thread.sleep(15000);
schedulerJob = getSchedulerJobById(this.requestSpec, this.responseSpec, jobId.toString());
Assert.assertNotNull(schedulerJob);
System.out.println("Job is Still Running");
}
ArrayList<HashMap> jobHistoryData = getSchedulerJobHistory(this.requestSpec, this.responseSpec, jobId.toString());
// Verifying the Status of the Recently executed Scheduler Job
Assert.assertEquals("Verifying Last Scheduler Job Status", "success",
jobHistoryData.get(jobHistoryData.size() - 1).get("status"));
break;
}
}
}
}
@@ -0,0 +1,98 @@
package org.mifosplatform.integrationtests.common;
import java.util.HashMap;
import org.mifosplatform.integrationtests.common.Utils;
import ch.qos.logback.classic.pattern.Util;
import com.google.gson.Gson;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings({ "unused", "rawtypes" })
public class StandingInstructionsHelper {
private static final String STANDING_INSTRUCTIONS_URL = "/mifosng-provider/api/v1/standinginstructions";
private static final String LOCALE = "en_GB";
private static final String OFFICE_ID = "1";
private static final String INSTRUCTION_TYPE_FIXED = "1";
private static final String INSTRUCTION_TYPE_DUES = "2";
private static final String PRIORITY_URGENT = "1";
private static final String PRIORITY_HIGH = "2";
private static final String PRIORITY_MEDIUM = "3";
private static final String PRIORITY_LOW = "4";
private static final String RECURRENCE_FREQUENCY_DAYS = "0";
private static final String RECURRENCE_FREQUENCY_WEEKS = "1";
private static final String RECURRENCE_FREQUENCY_MONTHS = "2";
private static final String RECURRENCE_FREQUENCY_YEARS = "3";
private static final String RECURRENCE_TYPE_PERIODIC = "1";
private static final String RECURRENCE_TYPE_AS_PER_DUES = "2";
private static final String STATUS_ACTIVE = "1";
private static final String STATUS_DISABLED = "2";
private static final String TRANSFER_TYPE_ACCOUNT_TRANSFER = "1";
private static final String TRANSFER_TYPE_LOAN_REPAYMENT = "2";
private static final String ACCOUNT_TRANSFER_DATE = "01 March 2013";
private String transferDate = "";
private String officeId = OFFICE_ID;
private RequestSpecification requestSpec;
private ResponseSpecification responseSpec;
public StandingInstructionsHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
this.requestSpec = requestSpec;
this.responseSpec = responseSpec;
}
public String build(final String clientId, final String fromAccountId, final String toAccountId, final String fromAccountType,
final String toAccountType, final String validFrom, final String validTo, final String monthDay) {
final HashMap<String, String> map = new HashMap<String, String>();
map.put("name", Utils.randomNameGenerator("STANDING_INSTRUCTION_", 5));
map.put("dateFormat", "dd MMMM yyyy");
map.put("monthDayFormat", "dd MMMM");
map.put("locale", LOCALE);
map.put("fromClientId", clientId);
map.put("fromAccountId", fromAccountId);
map.put("fromAccountType", fromAccountType);
map.put("fromOfficeId", this.officeId);
map.put("toClientId", clientId);
map.put("toAccountId", toAccountId);
map.put("toAccountType", toAccountType);
map.put("toOfficeId", this.officeId);
map.put("amount", "500");
map.put("transferType", TRANSFER_TYPE_ACCOUNT_TRANSFER);
map.put("priority", PRIORITY_URGENT);
map.put("status", STATUS_ACTIVE);
map.put("instructionType", INSTRUCTION_TYPE_FIXED);
map.put("validFrom", validFrom);
map.put("validTill", validTo);
map.put("recurrenceType", RECURRENCE_TYPE_PERIODIC);
map.put("recurrenceInterval", "1");
map.put("recurrenceFrequency", RECURRENCE_FREQUENCY_MONTHS);
map.put("recurrenceOnMonthDay", monthDay);
String savingsApplicationJSON = new Gson().toJson(map);
System.out.println(savingsApplicationJSON);
return savingsApplicationJSON;
}
public Integer createStandingInstruction(final String clientId, final String fromAccountId, final String toAccountId,
final String fromAccountType, final String toAccountType, final String validFrom, final String validTo, final String monthDay) {
System.out.println("-------------------------------- CREATE STANDING INSTRUCTIONS --------------------------------");
final String standingInstructionAsJSON = new StandingInstructionsHelper(this.requestSpec, this.responseSpec) //
.build(clientId.toString(), fromAccountId.toString(), toAccountId.toString(), fromAccountType, toAccountType, validFrom,
validTo, monthDay);
return Utils.performServerPost(this.requestSpec, this.responseSpec, STANDING_INSTRUCTIONS_URL + "?" + Utils.TENANT_IDENTIFIER,
standingInstructionAsJSON, "resourceId");
}
public HashMap getStandingInstructionById(final String standingInstructionId) {
System.out.println("----------------------------- RETRIEVING STANDING INSTRUCTION BY ID---------------------------");
final String GET_STANDING_INSTRUCTION_BY_ID_URL = STANDING_INSTRUCTIONS_URL + "/" + standingInstructionId + "?"
+ Utils.TENANT_IDENTIFIER;
final HashMap response = Utils.performServerGet(this.requestSpec, this.responseSpec, GET_STANDING_INSTRUCTION_BY_ID_URL, "");
return response;
}
}
@@ -21,7 +21,9 @@ import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings("unchecked")
public class Utils {
private static final String LOGIN_URL = "/mifosng-provider/api/v1/authentication?username=mifos&password=password&tenantIdentifier=default";
public static final String TENANT_IDENTIFIER = "tenantIdentifier=default";
private static final String LOGIN_URL = "/mifosng-provider/api/v1/authentication?username=mifos&password=password&" + TENANT_IDENTIFIER;
public static void initializeRESTAssured() {
RestAssured.baseURI = "https://localhost";
@@ -55,6 +57,7 @@ public class Utils {
final String postURL, final String jsonBodyToSend, final String jsonAttributeToGetBack) {
final String json = given().spec(requestSpec).body(jsonBodyToSend).expect().spec(responseSpec).log().ifError().when().post(postURL)
.andReturn().asString();
if (jsonAttributeToGetBack == null) { return (T) json; }
return (T) from(json).get(jsonAttributeToGetBack);
}
@@ -97,4 +100,9 @@ public class Utils {
public static String randomStringGenerator(final String prefix, final int len) {
return randomStringGenerator(prefix, len, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ");
}
public static String randomNameGenerator(final String prefix, final int lenOfRandomSuffix) {
return randomStringGenerator(prefix, lenOfRandomSuffix);
}
}
@@ -1,10 +1,14 @@
package org.mifosplatform.integrationtests.common.accounting;
import java.util.ArrayList;
import java.util.HashMap;
import org.mifosplatform.integrationtests.common.Utils;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings("rawtypes")
public class AccountHelper {
private final String CREATE_GL_ACCOUNT_URL = "/mifosng-provider/api/v1/glaccounts?tenantIdentifier=default";
@@ -45,5 +49,17 @@ public class AccountHelper {
assetAccountJSON, this.GL_ACCOUNT_ID_RESPONSE);
return new Account(accountID, Account.AccountType.LIABILITY);
}
public ArrayList getAccountingWithRunningBalances() {
final String GET_RUNNING_BALANCE_URL = "/mifosng-provider/api/v1/glaccounts?fetchRunningBalance=true";
final ArrayList<HashMap> accountRunningBalance = Utils.performServerGet(this.requestSpec, this.responseSpec, GET_RUNNING_BALANCE_URL, "");
return accountRunningBalance;
}
public HashMap getAccountingWithRunningBalanceById(final String accountId) {
final String GET_RUNNING_BALANCE_URL = "/mifosng-provider/api/v1/glaccounts/" + accountId + "?fetchRunningBalance=true";
final HashMap accountRunningBalance = Utils.performServerGet(this.requestSpec, this.responseSpec, GET_RUNNING_BALANCE_URL, "");
return accountRunningBalance;
}
}
@@ -2,6 +2,7 @@ package org.mifosplatform.integrationtests.common.accounting;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.HashMap;
@@ -22,7 +23,7 @@ public class JournalEntryHelper {
this.responseSpec = responseSpec;
}
public void checkJournalEntryForExpenseAccount(final Account expenseAccount, final String date, final JournalEntry accountEntries) {
public void checkJournalEntryForExpenseAccount(final Account expenseAccount, final String date, final JournalEntry... accountEntries) {
checkJournalEntry(expenseAccount, date, accountEntries);
}
@@ -30,9 +31,19 @@ public class JournalEntryHelper {
checkJournalEntry(assetAccount, date, accountEntries);
}
public void checkJournalEntryForIncomeAccount(final Account incomeAccount, final String date, final JournalEntry accountEntries) {
public void checkJournalEntryForIncomeAccount(final Account incomeAccount, final String date, final JournalEntry... accountEntries) {
checkJournalEntry(incomeAccount, date, accountEntries);
}
public void checkJournalEntryForLiabilityAccount(final Account liabilityAccount, final String date, final JournalEntry... accountEntries) {
checkJournalEntry(liabilityAccount, date, accountEntries);
}
public void ensureNoAccountingTransactionsWithTransactionId(final String transactionId) {
ArrayList<HashMap> transactions = getJournalEntriesByTransactionId(transactionId);
assertTrue("Tranasactions are is not empty", transactions.isEmpty());
}
private String getEntryValueFromJournalEntry(final ArrayList<HashMap> entryResponse, final int entryNumber) {
final HashMap map = (HashMap) entryResponse.get(entryNumber).get("entryType");
@@ -58,4 +69,15 @@ public class JournalEntryHelper {
+ "&orderBy=id&sortOrder=desc&locale=en&dateFormat=dd MMMM yyyy");
}
private ArrayList<HashMap> getJournalEntriesByTransactionId(final String transactionId) {
final String url = createURLForGettingAccountEntriesByTransactionId(transactionId);
final ArrayList<HashMap> response = Utils.performServerGet(this.requestSpec, this.responseSpec, url, "pageItems");
return response;
}
private String createURLForGettingAccountEntriesByTransactionId(final String transactionId) {
return new String("/mifosng-provider/api/v1/journalentries?transactionId=" + transactionId + "&tenantIdentifier=default"
+ "&orderBy=id&sortOrder=desc&locale=en&dateFormat=dd MMMM yyyy");
}
}
@@ -0,0 +1,15 @@
package org.mifosplatform.integrationtests.common.accounting;
import java.util.HashMap;
import com.google.gson.Gson;
public class OfficeAccountMappingBuilder {
public static String build(Integer officeId, Integer glAccountId) {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("officeId", officeId);
map.put("liabilityTransferInSuspenseAccountId", glAccountId);
return new Gson().toJson(map);
}
}
@@ -0,0 +1,44 @@
package org.mifosplatform.integrationtests.common.accounting;
import java.util.HashMap;
import org.mifosplatform.integrationtests.common.Utils;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings("rawtypes")
public class OfficeAccountMappingHelper {
private static final String ACCOUNT_MAPPING_URL = "/mifosng-provider/api/v1/officeglaccounts";
private final RequestSpecification requestSpec;
private final ResponseSpecification responseSpec;
public OfficeAccountMappingHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
this.requestSpec = requestSpec;
this.responseSpec = responseSpec;
}
public Object createOfficeAccountMapping(Integer officeId, Integer glAccountId, String jsonBack) {
String json = OfficeAccountMappingBuilder.build(officeId, glAccountId);
return Utils.performServerPost(this.requestSpec, this.responseSpec, ACCOUNT_MAPPING_URL + "?" + Utils.TENANT_IDENTIFIER, json,
jsonBack);
}
public Object updateOfficeAccountMapping(Integer mappingId, Integer officeId, Integer glAccountId, String jsonBack) {
String json = OfficeAccountMappingBuilder.build(officeId, glAccountId);
return Utils.performServerPut(this.requestSpec, this.responseSpec, ACCOUNT_MAPPING_URL + "/" + mappingId + "?"
+ Utils.TENANT_IDENTIFIER, json, jsonBack);
}
public HashMap getOfficeAccountMapping(final Integer mappingId) {
final String URL = ACCOUNT_MAPPING_URL + "/" + mappingId + "?" + Utils.TENANT_IDENTIFIER;
return Utils.performServerGet(requestSpec, responseSpec, URL, "");
}
public HashMap getOfficeAccountMappings() {
final String URL = ACCOUNT_MAPPING_URL + "?" + Utils.TENANT_IDENTIFIER;
return Utils.performServerGet(requestSpec, responseSpec, URL, "");
}
}
@@ -0,0 +1,344 @@
package org.mifosplatform.integrationtests.common.charges;
import java.util.ArrayList;
import java.util.HashMap;
import org.mifosplatform.integrationtests.common.CommonConstants;
import org.mifosplatform.integrationtests.common.Utils;
import com.google.gson.Gson;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings({ "rawtypes", "unchecked" })
public class ChargesHelper {
private static final String CHARGES_URL = "/mifosng-provider/api/v1/charges";
private static final String CREATE_CHARGES_URL = CHARGES_URL + "?" + Utils.TENANT_IDENTIFIER;
private static final Integer CHARGE_APPLIES_TO_LOAN = 1;
private static final Integer CHARGE_APPLIES_TO_SAVINGS = 2;
private static final Integer CHARGE_DISBURSEMENT_FEE = 1;
private static final Integer CHARGE_SPECIFIED_DUE_DATE = 2;
private static final Integer CHARGE_SAVINGS_ACTIVATION_FEE = 3;
private static final Integer CHARGE_WITHDRAWAL_FEE = 5;
private static final Integer CHARGE_ANNUAL_FEE = 6;
private static final Integer CHARGE_MONTHLY_FEE = 7;
private static final Integer CHARGE_INSTALLMENT_FEE = 8;
private static final Integer CHARGE_OVERDUE_INSTALLMENT_FEE = 9;
private static final Integer CHARGE_OVERDRAFT_FEE = 10;
public static final Integer CHARGE_CALCULATION_TYPE_FLAT = 1;
public static final Integer CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT = 2;
public static final Integer CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST = 3;
public static final Integer CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST = 4;
private static final Integer CHARGE_PAYMENT_MODE_REGULAR = 0;
private static final Integer CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER = 1;
private static final Integer CHARGE_FEE_FREQUENCY_DAYS = 0;
private static final Integer CHARGE_FEE_FREQUENCY_WEEKS = 1;
private static final Integer CHARGE_FEE_FREQUENCY_MONTHS = 2;
private static final Integer CHARGE_FEE_FREQUENCY_YEARS = 3;
private final static boolean active = true;
private final static boolean penalty = true;
private final static String amount = "100";
private final static String currencyCode = "USD";
public final static String feeOnMonthDay = "04 March";
private final static String monthDayFormat = "dd MMM";
public static String getSavingsSpecifiedDueDateJSON() {
final HashMap<String, Object> map = populateDefaultsForSavings();
map.put("chargeTimeType", CHARGE_SPECIFIED_DUE_DATE);
map.put("feeInterval", 2);
String chargesCreateJson = new Gson().toJson(map);
System.out.println(chargesCreateJson);
return chargesCreateJson;
}
public static String getSavingsActivationFeeJSON() {
final HashMap<String, Object> map = populateDefaultsForSavings();
map.put("chargeTimeType", CHARGE_SAVINGS_ACTIVATION_FEE);
String chargesCreateJson = new Gson().toJson(map);
System.out.println(chargesCreateJson);
return chargesCreateJson;
}
public static String getSavingsWithdrawalFeeJSON() {
final HashMap<String, Object> map = populateDefaultsForSavings();
map.put("chargeTimeType", CHARGE_WITHDRAWAL_FEE);
String chargesCreateJson = new Gson().toJson(map);
System.out.println(chargesCreateJson);
return chargesCreateJson;
}
public static String getSavingsAnnualFeeJSON() {
final HashMap<String, Object> map = populateDefaultsForSavings();
map.put("feeOnMonthDay", ChargesHelper.feeOnMonthDay);
map.put("chargeTimeType", CHARGE_ANNUAL_FEE);
String chargesCreateJson = new Gson().toJson(map);
System.out.println(chargesCreateJson);
return chargesCreateJson;
}
public static String getSavingsMonthlyFeeJSON() {
final HashMap<String, Object> map = populateDefaultsForSavings();
map.put("feeOnMonthDay", ChargesHelper.feeOnMonthDay);
map.put("chargeTimeType", CHARGE_MONTHLY_FEE);
map.put("feeInterval", 2);
String chargesCreateJson = new Gson().toJson(map);
System.out.println(chargesCreateJson);
return chargesCreateJson;
}
public static String getSavingsOverdraftFeeJSON() {
final HashMap<String, Object> map = populateDefaultsForSavings();
map.put("chargeTimeType", CHARGE_OVERDRAFT_FEE);
String chargesCreateJson = new Gson().toJson(map);
System.out.println(chargesCreateJson);
return chargesCreateJson;
}
public static HashMap<String, Object> populateDefaultsForSavings() {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("active", ChargesHelper.active);
map.put("amount", ChargesHelper.amount);
map.put("chargeAppliesTo", ChargesHelper.CHARGE_APPLIES_TO_SAVINGS);
map.put("chargeCalculationType", ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT);
map.put("currencyCode", ChargesHelper.currencyCode);
map.put("locale", CommonConstants.locale);
map.put("monthDayFormat", ChargesHelper.monthDayFormat);
map.put("name", Utils.randomNameGenerator("Charge_Savings_", 6));
return map;
}
public static String getLoanDisbursementJSON() {
return getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, ChargesHelper.amount);
}
public static String getLoanDisbursementJSON(final Integer chargeCalculationType, final String amount) {
return getLoanDisbursementJSON(chargeCalculationType, amount, ChargesHelper.CHARGE_PAYMENT_MODE_REGULAR);
}
public static String getLoanDisbursementAccountTransferJSON(final Integer chargeCalculationType, final String amount) {
return getLoanDisbursementJSON(chargeCalculationType, amount, ChargesHelper.CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
}
public static String getLoanDisbursementJSON(final Integer chargeCalculationType, final String amount, final Integer paymentmode) {
final HashMap<String, Object> map = populateDefaultsForLoan();
map.put("chargeTimeType", CHARGE_DISBURSEMENT_FEE);
map.put("chargePaymentMode", paymentmode);
map.put("amount", amount);
map.put("chargeCalculationType", chargeCalculationType);
String chargesCreateJson = new Gson().toJson(map);
System.out.println(chargesCreateJson);
return chargesCreateJson;
}
public static String getLoanSpecifiedDueDateJSON() {
return getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, ChargesHelper.amount, ChargesHelper.penalty);
}
public static String getLoanSpecifiedDueDateJSON(final Integer chargeCalculationType, final String amount, boolean penalty) {
return getLoanSpecifiedDueDateJSON(chargeCalculationType, amount, penalty, ChargesHelper.CHARGE_PAYMENT_MODE_REGULAR);
}
public static String getLoanSpecifiedDueDateJSON(final Integer chargeCalculationType, final String amount, final boolean penalty,
final Integer paymentMode) {
final HashMap<String, Object> map = populateDefaultsForLoan();
map.put("chargeTimeType", CHARGE_SPECIFIED_DUE_DATE);
map.put("chargePaymentMode", paymentMode);
map.put("penalty", penalty);
map.put("amount", amount);
map.put("chargeCalculationType", chargeCalculationType);
String chargesCreateJson = new Gson().toJson(map);
System.out.println(chargesCreateJson);
return chargesCreateJson;
}
public static String getLoanSpecifiedDueDateWithAccountTransferJSON(final Integer chargeCalculationType, final String amount,
boolean penalty) {
return getLoanSpecifiedDueDateJSON(chargeCalculationType, amount, penalty, ChargesHelper.CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
}
public static String getLoanSpecifiedDueDateWithAccountTransferJSON() {
return getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, ChargesHelper.amount, ChargesHelper.penalty,
ChargesHelper.CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
}
public static String getLoanInstallmentJSON(final Integer chargeCalculationType, final String amount, boolean penalty) {
return getLoanInstallmentJSON(chargeCalculationType, amount, penalty, ChargesHelper.CHARGE_PAYMENT_MODE_REGULAR);
}
public static String getLoanInstallmentJSON(final Integer chargeCalculationType, final String amount, final boolean penalty,
final Integer paymentMode) {
final HashMap<String, Object> map = populateDefaultsForLoan();
map.put("chargeTimeType", CHARGE_INSTALLMENT_FEE);
map.put("chargePaymentMode", paymentMode);
map.put("penalty", penalty);
map.put("amount", amount);
map.put("chargeCalculationType", chargeCalculationType);
String chargesCreateJson = new Gson().toJson(map);
System.out.println(chargesCreateJson);
return chargesCreateJson;
}
public static String getLoanInstallmentWithAccountTransferJSON(final Integer chargeCalculationType, final String amount, boolean penalty) {
return getLoanInstallmentJSON(chargeCalculationType, amount, penalty, ChargesHelper.CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
}
public static String getLoanInstallmentFeeJSON() {
return getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, ChargesHelper.amount, ChargesHelper.penalty);
}
public static String getLoanOverdueFeeJSON() {
final HashMap<String, Object> map = populateDefaultsForLoan();
map.put("penalty", ChargesHelper.penalty);
map.put("chargePaymentMode", ChargesHelper.CHARGE_PAYMENT_MODE_REGULAR);
map.put("chargeTimeType", CHARGE_OVERDUE_INSTALLMENT_FEE);
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_MONTHS);
map.put("feeOnMonthDay", ChargesHelper.feeOnMonthDay);
map.put("feeInterval", 2);
String chargesCreateJson = new Gson().toJson(map);
System.out.println(chargesCreateJson);
return chargesCreateJson;
}
public static HashMap<String, Object> populateDefaultsForLoan() {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("active", ChargesHelper.active);
map.put("amount", ChargesHelper.amount);
map.put("chargeAppliesTo", ChargesHelper.CHARGE_APPLIES_TO_LOAN);
map.put("chargeCalculationType", ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT);
map.put("currencyCode", ChargesHelper.currencyCode);
map.put("locale", CommonConstants.locale);
map.put("monthDayFormat", ChargesHelper.monthDayFormat);
map.put("name", Utils.randomNameGenerator("Charge_Loans_", 6));
return map;
}
public static Integer createCharges(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String request) {
return Utils.performServerPost(requestSpec, responseSpec, CREATE_CHARGES_URL, request, "resourceId");
}
public static ArrayList<HashMap> getCharges(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
return (ArrayList) Utils.performServerGet(requestSpec, responseSpec, CHARGES_URL + "?" + Utils.TENANT_IDENTIFIER, "");
}
public static HashMap getChargeById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final Integer chargeId) {
return Utils.performServerGet(requestSpec, responseSpec, CHARGES_URL + "/" + chargeId + "?" + Utils.TENANT_IDENTIFIER, "");
}
public static HashMap getChargeChanges(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final Integer chargeId) {
return Utils.performServerGet(requestSpec, responseSpec, CHARGES_URL + "/" + chargeId + "?" + Utils.TENANT_IDENTIFIER,
CommonConstants.RESPONSE_CHANGES);
}
public static HashMap updateCharges(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final Integer chargeId, final String request) {
return Utils.performServerPut(requestSpec, responseSpec, CHARGES_URL + "/" + chargeId + "?" + Utils.TENANT_IDENTIFIER, request,
CommonConstants.RESPONSE_CHANGES);
}
public static Integer deleteCharge(final ResponseSpecification responseSpec, final RequestSpecification requestSpec,
final Integer chargeId) {
return Utils.performServerDelete(requestSpec, responseSpec, CHARGES_URL + "/" + chargeId + "?" + Utils.TENANT_IDENTIFIER,
CommonConstants.RESPONSE_RESOURCE_ID);
}
public static String getModifyChargeJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("amount", "200.0");
String json = new Gson().toJson(map);
System.out.println(json);
return json;
}
public static String getModifyWithdrawalFeeSavingsChargeJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT);
String json = new Gson().toJson(map);
System.out.println(json);
return json;
}
public static String getModifyChargeAsPecentageAmountJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT);
map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
String json = new Gson().toJson(map);
System.out.println(json);
return json;
}
public static String getModifyChargeAsPecentageLoanAmountWithInterestJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST);
map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
String json = new Gson().toJson(map);
System.out.println(json);
return json;
}
public static String getModifyChargeAsPercentageInterestJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST);
map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
String json = new Gson().toJson(map);
System.out.println(json);
return json;
}
public static String getModifyChargeFeeFrequencyAsDaysJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_DAYS);
map.put("feeInterval", 2);
String json = new Gson().toJson(map);
System.out.println(json);
return json;
}
public static String getModifyChargeFeeFrequencyAsWeeksJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_WEEKS);
map.put("feeInterval", 2);
String json = new Gson().toJson(map);
System.out.println(json);
return json;
}
public static String getModifyChargeFeeFrequencyAsMonthsJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_MONTHS);
map.put("feeInterval", 2);
String json = new Gson().toJson(map);
System.out.println(json);
return json;
}
public static String getModifyChargeFeeFrequencyAsYearsJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_YEARS);
map.put("feeInterval", 2);
String json = new Gson().toJson(map);
System.out.println(json);
return json;
}
}
@@ -0,0 +1,472 @@
package org.mifosplatform.integrationtests.common.fixeddeposit;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import org.mifosplatform.integrationtests.common.CommonConstants;
import org.mifosplatform.integrationtests.common.Utils;
import com.google.gson.Gson;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings({ "unused", "rawtypes" })
public class FixedDepositAccountHelper {
private final RequestSpecification requestSpec;
private final ResponseSpecification responseSpec;
public FixedDepositAccountHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
this.requestSpec = requestSpec;
this.responseSpec = responseSpec;
}
private static final String FIXED_DEPOSIT_ACCOUNT_URL = "/mifosng-provider/api/v1/fixeddepositaccounts";
private static final String APPLY_FIXED_DEPOSIT_ACCOUNT_URL = FIXED_DEPOSIT_ACCOUNT_URL + "?" + Utils.TENANT_IDENTIFIER;
private static final String APPROVE_FIXED_DEPOSIT_COMMAND = "approve";
private static final String UNDO_APPROVAL_FIXED_DEPOSIT_COMMAND = "undoapproval";
private static final String REJECT_FIXED_DEPOSIT_COMMAND = "reject";
private static final String WITHDRAWN_BY_CLIENT_FIXED_DEPOSIT_COMMAND = "withdrawnByApplicant";
private static final String ACTIVATE_FIXED_DEPOSIT_COMMAND = "activate";
private static final String CLOSE_FIXED_DEPOSIT_COMMAND = "close";
private static final String POST_INTEREST_FIXED_DEPOSIT_COMMAND = "postInterest";
private static final String CALCULATE_INTEREST_FIXED_DEPOSIT_COMMAND = "calculateInterest";
private static final String CALCULATE_PREMATURE_AMOUNT_COMMAND = "calculatePrematureAmount";
private static final String PREMATURE_CLOSE_COMMAND = "prematureClose";
private static final String LOCALE = "en_GB";
private static final String DIGITS_AFTER_DECIMAL = "4";
private static final String IN_MULTIPLES_OF = "100";
private static final String USD = "USD";
public static final String DAYS = "0";
private static final String WEEKS = "1";
private static final String MONTHS = "2";
private static final String YEARS = "3";
private static final String DAILY = "1";
private static final String MONTHLY = "4";
private static final String QUARTERLY = "5";
private static final String BI_ANNUALLY = "6";
private static final String ANNUALLY = "7";
private static final String INTEREST_CALCULATION_USING_DAILY_BALANCE = "1";
private static final String INTEREST_CALCULATION_USING_AVERAGE_DAILY_BALANCE = "2";
private static final String DAYS_360 = "360";
private static final String DAYS_365 = "365";
public final static String depositAmount = "100000";
private String interestCompoundingPeriodType = MONTHLY;
private String interestPostingPeriodType = MONTHLY;
private String interestCalculationType = INTEREST_CALCULATION_USING_DAILY_BALANCE;
private String lockinPeriodFrequency = "1";
private String lockingPeriodFrequencyType = MONTHS;
private final String minDepositTerm = "6";
private final String minDepositTermTypeId = MONTHS;
private final String maxDepositTerm = "10";
private final String maxDepositTermTypeId = YEARS;
private final String inMultiplesOfDepositTerm = "2";
private final String inMultiplesOfDepositTermTypeId = MONTHS;
private final String preClosurePenalInterest = "2";
private String interestCalculationDaysInYearType = DAYS_365;
private final boolean preClosurePenalApplicable = true;
private final boolean isActiveChart = true;
private final String currencyCode = USD;
private final String depositPeriod = "14";
private final String depositPeriodFrequencyId = MONTHS;
private String submittedOnDate = "";
private String savingsId = null;
private boolean transferInterest = false;
public String build(final String clientId, final String productId, final String validFrom, final String validTo,
final String penalInterestType) {
final HashMap<String, Object> map = new HashMap<String, Object>();
List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
HashMap<String, String> chartSlabsMap1 = new HashMap<String, String>();
chartSlabsMap1.put("description", "First");
chartSlabsMap1.put("periodType", MONTHS);
chartSlabsMap1.put("fromPeriod", "1");
chartSlabsMap1.put("toPeriod", "6");
chartSlabsMap1.put("annualInterestRate", "5");
chartSlabsMap1.put("locale", LOCALE);
chartSlabs.add(0, chartSlabsMap1);
HashMap<String, String> chartSlabsMap2 = new HashMap<String, String>();
chartSlabsMap2.put("description", "Second");
chartSlabsMap2.put("periodType", MONTHS);
chartSlabsMap2.put("fromPeriod", "7");
chartSlabsMap2.put("toPeriod", "12");
chartSlabsMap2.put("annualInterestRate", "6");
chartSlabsMap2.put("locale", LOCALE);
chartSlabs.add(1, chartSlabsMap2);
HashMap<String, String> chartSlabsMap3 = new HashMap<String, String>();
chartSlabsMap3.put("description", "Third");
chartSlabsMap3.put("periodType", MONTHS);
chartSlabsMap3.put("fromPeriod", "13");
chartSlabsMap3.put("toPeriod", "18");
chartSlabsMap3.put("annualInterestRate", "7");
chartSlabsMap3.put("locale", LOCALE);
chartSlabs.add(2, chartSlabsMap3);
HashMap<String, String> chartSlabsMap4 = new HashMap<String, String>();
chartSlabsMap4.put("description", "Fourth");
chartSlabsMap4.put("periodType", MONTHS);
chartSlabsMap4.put("fromPeriod", "19");
chartSlabsMap4.put("toPeriod", "24");
chartSlabsMap4.put("annualInterestRate", "8");
chartSlabsMap4.put("locale", LOCALE);
chartSlabs.add(3, chartSlabsMap4);
List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>();
HashMap<String, Object> chartsMap = new HashMap<String, Object>();
chartsMap.put("fromDate", validFrom);
chartsMap.put("endDate", validTo);
chartsMap.put("dateFormat", "dd MMMM yyyy");
chartsMap.put("locale", LOCALE);
chartsMap.put("isActiveChart", this.isActiveChart);
chartsMap.put("chartSlabs", chartSlabs);
charts.add(chartsMap);
map.put("charts", charts);
map.put("productId", productId);
map.put("clientId", clientId);
map.put("interestCalculationDaysInYearType", this.interestCalculationDaysInYearType);
map.put("locale", LOCALE);
map.put("dateFormat", "dd MMMM yyyy");
map.put("monthDayFormat", "dd MMM");
map.put("interestCalculationType", this.interestCalculationType);
map.put("interestCompoundingPeriodType", this.interestCompoundingPeriodType);
map.put("interestPostingPeriodType", this.interestPostingPeriodType);
map.put("lockinPeriodFrequency", this.lockinPeriodFrequency);
map.put("lockinPeriodFrequencyType", this.lockingPeriodFrequencyType);
map.put("preClosurePenalApplicable", "true");
map.put("minDepositTermTypeId", this.minDepositTermTypeId);
map.put("minDepositTerm", this.minDepositTerm);
map.put("maxDepositTermTypeId", this.maxDepositTermTypeId);
map.put("maxDepositTerm", this.maxDepositTerm);
map.put("preClosurePenalApplicable", this.preClosurePenalApplicable);
map.put("inMultiplesOfDepositTerm", this.inMultiplesOfDepositTerm);
map.put("inMultiplesOfDepositTermTypeId", this.inMultiplesOfDepositTermTypeId);
map.put("preClosurePenalInterest", this.preClosurePenalInterest);
map.put("preClosurePenalInterestOnTypeId", penalInterestType);
map.put("depositAmount", depositAmount);
map.put("depositPeriod", this.depositPeriod);
map.put("depositPeriodFrequencyId", this.depositPeriodFrequencyId);
map.put("submittedOnDate", this.submittedOnDate);
map.put("linkAccountId", savingsId);
map.put("transferInterestToSavings", transferInterest);
String fixedDepositAccountJson = new Gson().toJson(map);
System.out.println(fixedDepositAccountJson);
return fixedDepositAccountJson;
}
public static Integer applyFixedDepositApplication(final String fixedDepositAccountAsJson, final RequestSpecification requestSpec,
final ResponseSpecification responseSpec) {
System.out.println("--------------------- APPLYING FOR FIXED DEPOSIT ACCOUNT ------------------------");
return Utils.performServerPost(requestSpec, responseSpec, APPLY_FIXED_DEPOSIT_ACCOUNT_URL, fixedDepositAccountAsJson,
CommonConstants.RESPONSE_RESOURCE_ID);
}
public static HashMap getFixedDepositAccountById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final Integer accountID) {
final String GET_FIXED_DEPOSIT_BY_ID_URL = FIXED_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?" + Utils.TENANT_IDENTIFIER;
System.out.println("------------------------ RETRIEVING FIXED DEPOSIT ACCOUNT BY ID -------------------------");
return Utils.performServerGet(requestSpec, responseSpec, GET_FIXED_DEPOSIT_BY_ID_URL, "");
}
public HashMap getFixedDepositSummary(final Integer accountID) {
final String URL = FIXED_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?" + Utils.TENANT_IDENTIFIER;
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, URL, "summary");
return response;
}
public static Float getInterestRate(ArrayList<ArrayList<HashMap>> interestSlabData, Integer depositPeriod) {
Float annualInterestRate = 0.0f;
for (Integer slabIndex = 0; slabIndex < interestSlabData.get(0).size(); slabIndex++) {
Integer fromPeriod = (Integer) interestSlabData.get(0).get(slabIndex).get("fromPeriod");
Integer toPeriod = (Integer) interestSlabData.get(0).get(slabIndex).get("toPeriod");
if (depositPeriod >= fromPeriod && depositPeriod <= toPeriod) {
annualInterestRate = (Float) interestSlabData.get(0).get(slabIndex).get("annualInterestRate");
break;
}
}
return annualInterestRate;
}
public static Float getPrincipalAfterCompoundingInterest(Calendar currentDate, Float principal, Integer depositPeriod,
double interestPerDay, Integer compoundingInterval, Integer postingInterval) {
Float totalInterest = 0.0f;
Float interestEarned = 0.0f;
for (int i = 1; i <= depositPeriod; i++) {
Integer daysInMonth = currentDate.getActualMaximum(Calendar.DATE);
for (int j = 0; j < daysInMonth; j++) {
interestEarned = (float) (principal * interestPerDay);
totalInterest += interestEarned;
if (compoundingInterval == 0) {
principal += interestEarned;
}
}
if ((i % postingInterval) == 0 || i == depositPeriod) {
if (compoundingInterval != 0) {
principal += totalInterest;
}
totalInterest = 0.0f;
System.out.println(principal);
}
currentDate.add(Calendar.MONTH, 1);
interestEarned = 0.0f;
}
return principal;
}
public HashMap updateFixedDepositAccount(final String clientID, final String productID, final String accountID, final String validFrom,
final String validTo, final String penalInterestType, final String submittedOnDate) {
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) //
.withSubmittedOnDate(submittedOnDate) //
.build(clientID, productID, validFrom, validTo, penalInterestType);
return Utils.performServerPut(this.requestSpec, this.responseSpec, FIXED_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?"
+ Utils.TENANT_IDENTIFIER, fixedDepositApplicationJSON, CommonConstants.RESPONSE_CHANGES);
}
public HashMap updateInterestCalculationConfigForFixedDeposit(final String clientID, final String productID, final String accountID,
final String submittedOnDate, final String validFrom, final String validTo, final String numberOfDaysPerYear,
final String penalInterestType, final String interestCalculationType, final String interestCompoundingPeriodType,
final String interestPostingPeriodType) {
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) //
.withSubmittedOnDate(submittedOnDate) //
.withNumberOfDaysPerYear(numberOfDaysPerYear) //
.withInterestCalculationPeriodType(interestCalculationType) //
.withInterestCompoundingPeriodType(interestCompoundingPeriodType) //
.withInterestPostingPeriodType(interestPostingPeriodType) //
.build(clientID, productID, validFrom, validTo, penalInterestType);
return Utils.performServerPut(this.requestSpec, this.responseSpec, FIXED_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?"
+ Utils.TENANT_IDENTIFIER, fixedDepositApplicationJSON, CommonConstants.RESPONSE_CHANGES);
}
public HashMap approveFixedDeposit(final Integer fixedDepositAccountID, final String approvedOnDate) {
System.out.println("--------------------------------- APPROVING FIXED DEPOSIT APPLICATION ------------------------------------");
return performFixedDepositApplicationActions(createFixedDepositOperationURL(APPROVE_FIXED_DEPOSIT_COMMAND, fixedDepositAccountID),
getApproveFixedDepositAccountAsJSON(approvedOnDate));
}
public HashMap undoApproval(final Integer fixedDepositAccountID) {
System.out.println("--------------------------------- UNDO APPROVING FIXED DEPOSIT APPLICATION -------------------------------");
final String undoBodyJson = "{'note':'UNDO APPROVAL'}";
return performFixedDepositApplicationActions(
createFixedDepositOperationURL(UNDO_APPROVAL_FIXED_DEPOSIT_COMMAND, fixedDepositAccountID), undoBodyJson);
}
public HashMap rejectApplication(final Integer fixedDepositAccountID, final String rejectedOnDate) {
System.out.println("--------------------------------- REJECT FIXED DEPOSIT APPLICATION -------------------------------");
return performFixedDepositApplicationActions(createFixedDepositOperationURL(REJECT_FIXED_DEPOSIT_COMMAND, fixedDepositAccountID),
getRejectedFixedDepositAsJSON(rejectedOnDate));
}
public HashMap withdrawApplication(final Integer fixedDepositAccountID, final String withdrawApplicationOnDate) {
System.out.println("--------------------------------- Withdraw FIXED DEPOSIT APPLICATION -------------------------------");
return performFixedDepositApplicationActions(
createFixedDepositOperationURL(WITHDRAWN_BY_CLIENT_FIXED_DEPOSIT_COMMAND, fixedDepositAccountID),
getWithdrawnFixedDepositAccountAsJSON(withdrawApplicationOnDate));
}
public HashMap activateFixedDeposit(final Integer fixedDepositAccountID, final String activationDate) {
System.out.println("---------------------------------- ACTIVATING FIXED DEPOSIT APPLICATION ----------------------------------");
return performFixedDepositApplicationActions(createFixedDepositOperationURL(ACTIVATE_FIXED_DEPOSIT_COMMAND, fixedDepositAccountID),
getActivatedFixedDepositAccountAsJSON(activationDate));
}
public Object deleteFixedDepositApplication(final Integer fixedDepositAccountID, final String jsonAttributeToGetBack) {
System.out.println("---------------------------------- DELETE FIXED DEPOSIT APPLICATION ----------------------------------");
return Utils.performServerDelete(this.requestSpec, this.responseSpec, FIXED_DEPOSIT_ACCOUNT_URL + "/" + fixedDepositAccountID + "?"
+ Utils.TENANT_IDENTIFIER, jsonAttributeToGetBack);
}
public Integer calculateInterestForFixedDeposit(final Integer fixedDepositAccountId) {
System.out.println("--------------------------------- CALCULATING INTEREST FOR FIXED DEPOSIT --------------------------------");
return (Integer) performFixedDepositActions(
createFixedDepositCalculateInterestURL(CALCULATE_INTEREST_FIXED_DEPOSIT_COMMAND, fixedDepositAccountId),
getCalculatedInterestForFixedDepositApplicationAsJSON(), CommonConstants.RESPONSE_RESOURCE_ID);
}
public Integer postInterestForFixedDeposit(final Integer fixedDepositAccountId) {
System.out.println("--------------------------------- POST INTEREST FOR FIXED DEPOSIT --------------------------------");
return (Integer) performFixedDepositActions(
createFixedDepositCalculateInterestURL(POST_INTEREST_FIXED_DEPOSIT_COMMAND, fixedDepositAccountId),
getCalculatedInterestForFixedDepositApplicationAsJSON(), CommonConstants.RESPONSE_RESOURCE_ID);
}
public HashMap calculatePrematureAmountForFixedDeposit(final Integer fixedDepositAccountId, final String closedOnDate) {
System.out.println("--------------------- CALCULATING PREMATURE AMOUNT FOR FIXED DEPOSIT ----------------------------");
return (HashMap) performFixedDepositActions(
createFixedDepositCalculateInterestURL(CALCULATE_PREMATURE_AMOUNT_COMMAND, fixedDepositAccountId),
getCalculatedPrematureAmountForFixedDepositAccountAsJSON(closedOnDate), "");
}
public Object prematureCloseForFixedDeposit(final Integer fixedDepositAccountId, final String closedOnDate, final String closureType,
final Integer toSavingsId, final String jsonAttributeToGetBack) {
System.out.println("--------------------- PREMATURE CLOSE FOR FIXED DEPOSIT ----------------------------");
return performFixedDepositActions(createFixedDepositCalculateInterestURL(PREMATURE_CLOSE_COMMAND, fixedDepositAccountId),
getPrematureCloseForFixedDepositAccountAsJSON(closedOnDate, closureType, toSavingsId), jsonAttributeToGetBack);
}
private String getApproveFixedDepositAccountAsJSON(final String approvedOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat);
map.put("approvedOnDate", approvedOnDate);
map.put("note", "Approval NOTE");
String fixedDepositAccountApproveJson = new Gson().toJson(map);
System.out.println(fixedDepositAccountApproveJson);
return fixedDepositAccountApproveJson;
}
private String getRejectedFixedDepositAsJSON(final String rejectedOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat);
map.put("rejectedOnDate", rejectedOnDate);
map.put("note", "Rejected NOTE");
String fixedDepositAccountJson = new Gson().toJson(map);
System.out.println(fixedDepositAccountJson);
return fixedDepositAccountJson;
}
private String getWithdrawnFixedDepositAccountAsJSON(final String withdrawnApplicationOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat);
map.put("withdrawnOnDate", withdrawnApplicationOnDate);
map.put("note", "Withdraw NOTE");
String fixedDepositAccountJson = new Gson().toJson(map);
System.out.println(fixedDepositAccountJson);
return fixedDepositAccountJson;
}
private String getActivatedFixedDepositAccountAsJSON(final String activationDate) {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat);
map.put("activatedOnDate", activationDate);
String fixedDepositAccountActivateJson = new Gson().toJson(map);
System.out.println(fixedDepositAccountActivateJson);
return fixedDepositAccountActivateJson;
}
private String getCalculatedInterestForFixedDepositApplicationAsJSON() {
final HashMap<String, String> map = new HashMap<String, String>();
String fixedDepositAccountCalculatedInterestJson = new Gson().toJson(map);
System.out.println(fixedDepositAccountCalculatedInterestJson);
return fixedDepositAccountCalculatedInterestJson;
}
private String getCalculatedPrematureAmountForFixedDepositAccountAsJSON(final String closedOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat);
map.put("closedOnDate", closedOnDate);
String fixedDepositAccountPrematureClosureJson = new Gson().toJson(map);
System.out.println(fixedDepositAccountPrematureClosureJson);
return fixedDepositAccountPrematureClosureJson;
}
private String getPrematureCloseForFixedDepositAccountAsJSON(final String closedOnDate, final String closureType,
final Integer toSavingsId) {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat);
map.put("closedOnDate", closedOnDate);
map.put("onAccountClosureId", closureType);
if (toSavingsId != null) {
map.put("toSavingsAccountId", toSavingsId);
map.put("transferDescription", "Transferring To Savings Account");
}
String fixedDepositAccountPrematureCloseJson = new Gson().toJson(map);
System.out.println(fixedDepositAccountPrematureCloseJson);
return fixedDepositAccountPrematureCloseJson;
}
private String createFixedDepositOperationURL(final String command, final Integer fixedDepositAccountID) {
return FIXED_DEPOSIT_ACCOUNT_URL + "/" + fixedDepositAccountID + "?command=" + command + "&" + Utils.TENANT_IDENTIFIER;
}
private Object performFixedDepositActions(final String postURLForFixedDeposit, final String jsonToBeSent,
final String jsonAttributeToGetBack) {
return Utils.performServerPost(this.requestSpec, this.responseSpec, postURLForFixedDeposit, jsonToBeSent, jsonAttributeToGetBack);
}
private HashMap performFixedDepositApplicationActions(final String postURLForFixedDepositAction, final String jsonToBeSent) {
HashMap status = null;
final HashMap response = Utils.performServerPost(this.requestSpec, this.responseSpec, postURLForFixedDepositAction, jsonToBeSent,
CommonConstants.RESPONSE_CHANGES);
if (response != null) {
status = (HashMap) response.get("status");
}
return status;
}
private String createFixedDepositCalculateInterestURL(final String command, final Integer fixedDepositAccountID) {
return FIXED_DEPOSIT_ACCOUNT_URL + "/" + fixedDepositAccountID + "?command=" + command + "&" + Utils.TENANT_IDENTIFIER;
}
public static ArrayList retrieveAllFixedDepositAccounts(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
System.out.println("-------------------- RETRIEVING ALL FIXED DEPOSIT ACCOUNTS ---------------------");
final ArrayList response = Utils.performServerGet(requestSpec, responseSpec, FIXED_DEPOSIT_ACCOUNT_URL + "?"
+ Utils.TENANT_IDENTIFIER, "");
return response;
}
public FixedDepositAccountHelper withSubmittedOnDate(final String fixedDepositApplicationSubmittedDate) {
this.submittedOnDate = fixedDepositApplicationSubmittedDate;
return this;
}
public FixedDepositAccountHelper withNumberOfDaysPerYear(final String numberOfDaysPerYearTypeId) {
this.interestCalculationDaysInYearType = numberOfDaysPerYearTypeId;
return this;
}
public FixedDepositAccountHelper withInterestCalculationPeriodType(final String interestCalculationTypeId) {
this.interestCalculationType = interestCalculationTypeId;
return this;
}
public FixedDepositAccountHelper withInterestCompoundingPeriodType(final String interestCompoundingPeriodTypeId) {
this.interestCompoundingPeriodType = interestCompoundingPeriodTypeId;
return this;
}
public FixedDepositAccountHelper withInterestPostingPeriodType(final String interestPostingPeriodTypeId) {
this.interestPostingPeriodType = interestPostingPeriodTypeId;
return this;
}
public FixedDepositAccountHelper withSavings(final String savingsId) {
this.savingsId = savingsId;
return this;
}
public FixedDepositAccountHelper transferInterest(final boolean transferInterest) {
this.transferInterest = transferInterest;
return this;
}
public FixedDepositAccountHelper withLockinPeriodFrequency(final String lockingPeriodFrequencyType, final String lockinPeriodFrequency) {
this.lockingPeriodFrequencyType = lockingPeriodFrequencyType;
this.lockinPeriodFrequency = lockinPeriodFrequency;
return this;
}
}
@@ -0,0 +1,76 @@
package org.mifosplatform.integrationtests.common.fixeddeposit;
import static org.junit.Assert.assertTrue;
import java.util.HashMap;
import org.junit.Assert;
import org.mifosplatform.integrationtests.common.Utils;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings("rawtypes")
public class FixedDepositAccountStatusChecker {
private static final String FIXED_DEPOSIT_ACCOUNT_URL = "/mifosng-provider/api/v1/fixeddepositaccounts";
public static void verifyFixedDepositIsApproved(final HashMap fixedDepositStatusHashMap) {
System.out.println("-------------------- VERIFYING FIXED DEPOSIT APPLICATION IS APPROVED --------------------");
assertTrue("Error in Approving Fixed deposit application", getStatus(fixedDepositStatusHashMap, "approved"));
System.out.println(fixedDepositStatusHashMap);
}
public static void verifyFixedDepositIsPending(final HashMap fixedDepositStatusHashMap) {
System.out.println("-------------------- VERIFYING FIXED DEPOSIT APPLICATION IS PENDING --------------------");
assertTrue("FIXED DEPOSIT ACCOUNT IS NOT IN PENDING STATE", getStatus(fixedDepositStatusHashMap, "submittedAndPendingApproval"));
System.out.println(fixedDepositStatusHashMap);
}
public static void verifyFixedDepositIsActive(final HashMap fixedDepositStatusHashMap) {
System.out.println("----------------- VERIFYING FIXED DEPOSIT APPLICATION IS ACTIVE -----------------");
assertTrue("ERROR IN ACTIVATING THE FIXED DEPOSIT APPLICATION", getStatus(fixedDepositStatusHashMap, "active"));
System.out.println(fixedDepositStatusHashMap);
}
public static void verifyFixedDepositIsRejected(final HashMap fixedDepositStatusHashMap) {
System.out.println("-------------- VERIFYING FIXED DEPOSIT APPLICATION IS REJECTED ----------------");
assertTrue("ERROR IN REJECTING THE FIXED DEPOSIT APPLICATION", getStatus(fixedDepositStatusHashMap, "rejected"));
System.out.println(fixedDepositStatusHashMap);
}
public static void verifyFixedDepositIsWithdrawn(final HashMap fixedDepositStatusHashMap) {
System.out.println("---------------- VERIFYING FIXED DEPOSIT APPLICATION IS WITHDRAWN ----------------");
assertTrue("ERROR IN WITHDRAW THE FIXED DEPOSIT APPLICATION", getStatus(fixedDepositStatusHashMap, "withdrawnByApplicant"));
System.out.println(fixedDepositStatusHashMap);
}
public static void verifyFixedDepositAccountIsClosed(final HashMap fixedDepositStatusHashMap) {
System.out.println("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS CLOSED ---------------------");
assertTrue("ERROR IN CLOSING THE FIXED DEPOSIT APPLICATION", getStatus(fixedDepositStatusHashMap, "closed"));
System.out.println(fixedDepositStatusHashMap);
}
public static void verifyFixedDepositAccountIsNotActive(final HashMap fixedDepositStatusHashMap) {
System.out.println("------------------ VERIFYING FIXED DEPOSIT APPLICATION IS INACTIVE --------------------");
Assert.assertFalse(getStatus(fixedDepositStatusHashMap, "active"));
System.out.println(fixedDepositStatusHashMap);
}
public static HashMap getStatusOfFixedDepositAccount(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String fixedDepositAccountID) {
final String GET_STATUS_OF_FIXED_DEPOSIT_ACCOUNT_URL = FIXED_DEPOSIT_ACCOUNT_URL + "/" + fixedDepositAccountID + "?"
+ Utils.TENANT_IDENTIFIER;
return Utils.performServerGet(requestSpec, responseSpec, GET_STATUS_OF_FIXED_DEPOSIT_ACCOUNT_URL, "status");
}
public static void verifyFixedDepositAccountIsPrematureClosed(HashMap fixedDepositStatusHashMap) {
System.out.println("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS CLOSED ---------------------");
assertTrue("ERROR IN PREMATURELY CLOSING THE FIXED DEPOSIT ACCOUNT", getStatus(fixedDepositStatusHashMap, "prematureClosed"));
System.out.println(fixedDepositStatusHashMap);
}
private static boolean getStatus(final HashMap fixedDepositStatusMap, final String fixedDepositStatusString) {
return (Boolean) fixedDepositStatusMap.get(fixedDepositStatusString);
}
}
@@ -0,0 +1,236 @@
package org.mifosplatform.integrationtests.common.fixeddeposit;
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.mifosplatform.integrationtests.common.CommonConstants;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.accounting.Account;
import org.mifosplatform.integrationtests.common.accounting.Account.AccountType;
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
import com.google.gson.Gson;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings({ "unused", "rawtypes" })
public class FixedDepositProductHelper {
private final RequestSpecification requestSpec;
private final ResponseSpecification responseSpec;
public FixedDepositProductHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
this.requestSpec = requestSpec;
this.responseSpec = responseSpec;
}
private static final String FIXED_DEPOSIT_PRODUCT_URL = "/mifosng-provider/api/v1/fixeddepositproducts";
private static final String INTEREST_CHART_URL = "/mifosng-provider/api/v1/interestratecharts";
private static final String CREATE_FIXED_DEPOSIT_PRODUCT_URL = FIXED_DEPOSIT_PRODUCT_URL + "?" + Utils.TENANT_IDENTIFIER;
private static final String LOCALE = "en_GB";
private static final String DIGITS_AFTER_DECIMAL = "4";
private static final String IN_MULTIPLES_OF = "100";
private static final String USD = "USD";
private static final String DAYS = "0";
private static final String WEEKS = "1";
private static final String MONTHS = "2";
private static final String YEARS = "3";
private static final String DAILY = "1";
private static final String MONTHLY = "4";
private static final String QUARTERLY = "5";
private static final String BI_ANNUALLY = "6";
private static final String ANNUALLY = "7";
private static final String INTEREST_CALCULATION_USING_DAILY_BALANCE = "1";
private static final String INTEREST_CALCULATION_USING_AVERAGE_DAILY_BALANCE = "2";
private static final String DAYS_360 = "360";
private static final String DAYS_365 = "365";
private static final String NONE = "1";
private static final String CASH_BASED = "2";
private static final String ACCRUAL_PERIODIC = "3";
private static final String ACCRUAL_UPFRONT = "4";
private static final String WHOLE_TERM = "1";
private static final String TILL_PREMATURE_WITHDRAWAL = "2";
private String name = Utils.randomNameGenerator("FIXED_DEPOSIT_PRODUCT_", 6);
private String shortName = Utils.randomNameGenerator("", 4);
private String description = Utils.randomNameGenerator("", 20);
private String interestCompoundingPeriodType = MONTHLY;
private String interestPostingPeriodType = MONTHLY;
private String interestCalculationType = INTEREST_CALCULATION_USING_DAILY_BALANCE;
private String accountingRule = NONE;
private String lockinPeriodFrequency = "1";
private String lockingPeriodFrequencyType = MONTHS;
private String minDepositTerm = "6";
private String minDepositTermTypeId = MONTHS;
private String maxDepositTerm = "10";
private String maxDepositTermTypeId = YEARS;
private String inMultiplesOfDepositTerm = "2";
private final String depositAmount = "100000";
private String inMultiplesOfDepositTermTypeId = MONTHS;
private String preClosurePenalInterest = "2";
private String preClosurePenalInterestOnTypeId = WHOLE_TERM;
private final boolean preClosurePenalApplicable = true;
private final String currencyCode = USD;
private final String interestCalculationDaysInYearType = DAYS_365;
private Account[] accountList = null;
public String build(final String validFrom, final String validTo) {
final HashMap<String, Object> map = new HashMap<String, Object>();
List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
HashMap<String, String> chartSlabsMap1 = new HashMap<String, String>();
chartSlabsMap1.put("description", "First");
chartSlabsMap1.put("periodType", MONTHS);
chartSlabsMap1.put("fromPeriod", "1");
chartSlabsMap1.put("toPeriod", "6");
chartSlabsMap1.put("annualInterestRate", "5");
chartSlabsMap1.put("locale", LOCALE);
chartSlabs.add(0, chartSlabsMap1);
HashMap<String, String> chartSlabsMap2 = new HashMap<String, String>();
chartSlabsMap2.put("description", "Second");
chartSlabsMap2.put("periodType", MONTHS);
chartSlabsMap2.put("fromPeriod", "7");
chartSlabsMap2.put("toPeriod", "12");
chartSlabsMap2.put("annualInterestRate", "6");
chartSlabsMap2.put("locale", LOCALE);
chartSlabs.add(1, chartSlabsMap2);
HashMap<String, String> chartSlabsMap3 = new HashMap<String, String>();
chartSlabsMap3.put("description", "Third");
chartSlabsMap3.put("periodType", MONTHS);
chartSlabsMap3.put("fromPeriod", "13");
chartSlabsMap3.put("toPeriod", "18");
chartSlabsMap3.put("annualInterestRate", "7");
chartSlabsMap3.put("locale", LOCALE);
chartSlabs.add(2, chartSlabsMap3);
HashMap<String, String> chartSlabsMap4 = new HashMap<String, String>();
chartSlabsMap4.put("description", "Fourth");
chartSlabsMap4.put("periodType", MONTHS);
chartSlabsMap4.put("fromPeriod", "19");
chartSlabsMap4.put("toPeriod", "24");
chartSlabsMap4.put("annualInterestRate", "8");
chartSlabsMap4.put("locale", LOCALE);
chartSlabs.add(3, chartSlabsMap4);
List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>();
HashMap<String, Object> chartsMap = new HashMap<String, Object>();
chartsMap.put("fromDate", validFrom);
chartsMap.put("endDate", validTo);
chartsMap.put("dateFormat", "dd MMMM yyyy");
chartsMap.put("locale", LOCALE);
chartsMap.put("chartSlabs", chartSlabs);
charts.add(chartsMap);
map.put("charts", charts);
map.put("name", this.name);
map.put("shortName", this.shortName);
map.put("description", this.description);
map.put("currencyCode", this.currencyCode);
map.put("interestCalculationDaysInYearType", this.interestCalculationDaysInYearType);
map.put("locale", LOCALE);
map.put("digitsAfterDecimal", DIGITS_AFTER_DECIMAL);
map.put("inMultiplesOf", IN_MULTIPLES_OF);
map.put("interestCalculationType", this.interestCalculationType);
map.put("interestCompoundingPeriodType", this.interestCompoundingPeriodType);
map.put("interestPostingPeriodType", this.interestPostingPeriodType);
map.put("accountingRule", this.accountingRule);
map.put("lockinPeriodFrequency", this.lockinPeriodFrequency);
map.put("lockinPeriodFrequencyType", this.lockingPeriodFrequencyType);
map.put("preClosurePenalApplicable", "true");
map.put("minDepositTermTypeId", this.minDepositTermTypeId);
map.put("minDepositTerm", this.minDepositTerm);
map.put("maxDepositTermTypeId", this.maxDepositTermTypeId);
map.put("maxDepositTerm", this.maxDepositTerm);
map.put("depositAmount", this.depositAmount);
map.put("preClosurePenalApplicable", this.preClosurePenalApplicable);
map.put("inMultiplesOfDepositTerm", this.inMultiplesOfDepositTerm);
map.put("inMultiplesOfDepositTermTypeId", this.inMultiplesOfDepositTermTypeId);
map.put("preClosurePenalInterest", this.preClosurePenalInterest);
map.put("preClosurePenalInterestOnTypeId", this.preClosurePenalInterestOnTypeId);
if (this.accountingRule.equals(CASH_BASED)) {
map.putAll(getAccountMappingForCashBased());
}
String FixedDepositProductCreateJson = new Gson().toJson(map);
System.out.println(FixedDepositProductCreateJson);
return FixedDepositProductCreateJson;
}
public FixedDepositProductHelper withAccountingRuleAsNone() {
this.accountingRule = NONE;
return this;
}
public FixedDepositProductHelper withAccountingRuleAsCashBased(final Account[] account_list) {
this.accountingRule = CASH_BASED;
this.accountList = account_list;
return this;
}
private Map<String, String> getAccountMappingForCashBased() {
final Map<String, String> map = new HashMap<String, String>();
if (accountList != null) {
for (int i = 0; i < this.accountList.length; i++) {
if (this.accountList[i].getAccountType().equals(Account.AccountType.ASSET)) {
final String ID = this.accountList[i].getAccountID().toString();
map.put("savingsReferenceAccountId", ID);
}
if (this.accountList[i].getAccountType().equals(Account.AccountType.LIABILITY)) {
final String ID = this.accountList[i].getAccountID().toString();
map.put("savingsControlAccountId", ID);
map.put("transfersInSuspenseAccountId", ID);
}
if (this.accountList[i].getAccountType().equals(Account.AccountType.EXPENSE)) {
final String ID = this.accountList[i].getAccountID().toString();
map.put("interestOnSavingsAccountId", ID);
}
if (this.accountList[i].getAccountType().equals(Account.AccountType.INCOME)) {
final String ID = this.accountList[i].getAccountID().toString();
map.put("incomeFromFeeAccountId", ID);
map.put("incomeFromPenaltyAccountId", ID);
}
}
}
return map;
}
public static Integer createFixedDepositProduct(final String fixedDepositProductCreateJson, final RequestSpecification requestSpec,
final ResponseSpecification responseSpec) {
System.out.println("--------------------- CREATING FIXED DEPOSIT PRODUCT ------------------------");
return Utils.performServerPost(requestSpec, responseSpec, CREATE_FIXED_DEPOSIT_PRODUCT_URL, fixedDepositProductCreateJson,
CommonConstants.RESPONSE_RESOURCE_ID);
}
public static ArrayList retrieveAllFixedDepositProducts(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
System.out.println("-------------------- RETRIEVING ALL FIXED DEPOSIT PRODUCTS ---------------------");
final ArrayList response = Utils.performServerGet(requestSpec, responseSpec, FIXED_DEPOSIT_PRODUCT_URL + "?"
+ Utils.TENANT_IDENTIFIER, "");
return response;
}
public static HashMap retrieveFixedDepositProductById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String productId) {
System.out.println("------------------------ RETRIEVING FIXED DEPOSIT PRODUCT BY ID ------------------------");
final String GET_FD_PRODUCT_BY_ID_URL = FIXED_DEPOSIT_PRODUCT_URL + "/" + productId + "?" + Utils.TENANT_IDENTIFIER;
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_FD_PRODUCT_BY_ID_URL, "");
return response;
}
public static ArrayList getInterestRateChartSlabsByProductId(final RequestSpecification requestSpec,
final ResponseSpecification responseSpec, final Integer productId) {
System.out.println("-------------------- RETRIEVE INTEREST CHART BY PRODUCT ID ---------------------");
final ArrayList response = Utils.performServerGet(requestSpec, responseSpec, INTEREST_CHART_URL + "?productId=" + productId,
"chartSlabs");
return response;
}
}
@@ -1,6 +1,8 @@
package org.mifosplatform.integrationtests.common.loans;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.google.gson.Gson;
@@ -32,10 +34,14 @@ public class LoanApplicationTestBuilder {
private String expectedDisbursmentDate = "";
private String submittedOnDate = "";
private String loanType = "individual";
private String fixedEmiAmount = "10000";
private String maxOutstandingLoanBalance = "36000";
private List<HashMap> disbursementData = null;
private List<HashMap> charges = new ArrayList<HashMap>();
public String build(final String ID, final String loanProductId) {
public String build(final String ID, final String loanProductId, final String savingsID) {
final HashMap<String, String> map = new HashMap<String, String>();
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("dateFormat", "dd MMMM yyyy");
map.put("locale", "en_GB");
if (this.loanType == "group") {
@@ -58,6 +64,20 @@ public class LoanApplicationTestBuilder {
map.put("expectedDisbursementDate", this.expectedDisbursmentDate);
map.put("submittedOnDate", this.submittedOnDate);
map.put("loanType", this.loanType);
if (charges != null) {
map.put("charges", charges);
}
if (savingsID != null) {
map.put("linkAccountId", savingsID);
}
if (disbursementData != null) {
map.put("disbursementData", disbursementData);
map.put("fixedEmiAmount", fixedEmiAmount);
map.put("maxOutstandingLoanBalance", maxOutstandingLoanBalance);
}
return new Gson().toJson(map);
}
@@ -161,9 +181,18 @@ public class LoanApplicationTestBuilder {
return this;
}
public LoanApplicationTestBuilder withCharges(final List<HashMap> charges) {
this.charges = charges;
return this;
}
public LoanApplicationTestBuilder withLoanType(final String loanType) {
this.loanType = loanType;
return this;
}
public LoanApplicationTestBuilder withTranches(final List<HashMap> disbursementData) {
this.disbursementData = disbursementData;
return this;
}
}
@@ -1,9 +1,11 @@
package org.mifosplatform.integrationtests.common.loans;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.mifosplatform.integrationtests.common.ClientHelper;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.accounting.Account;
import com.google.gson.Gson;
@@ -12,7 +14,7 @@ public class LoanProductTestBuilder {
private static final String LOCALE = "en_GB";
private static final String DIGITS_AFTER_DECIMAL = "2";
private static final String INR = "INR";
private static final String USD = "USD";
private static final String DAYS = "0";
private static final String WEEK = "1";
private static final String MONTHS = "2";
@@ -28,9 +30,11 @@ public class LoanProductTestBuilder {
// private static final String RBI_INDIA_STRATEGY ="4";
private static final String NONE = "1";
private static final String CASH_BASED = "2";
private static final String ACCRUAL_BASED = "3";
private static final String ACCRUAL_PERIODIC = "3";
private static final String ACCRUAL_UPFRONT = "4";
private String nameOfLoanProduct = ClientHelper.randomNameGenerator("LOAN_PRODUCT_", 6);
private String nameOfLoanProduct = Utils.randomNameGenerator("LOAN_PRODUCT_", 6);
private String shortName = Utils.randomNameGenerator("", 4);
private String principal = "10000.00";
private String numberOfRepayments = "5";
private String repaymentFrequency = MONTHS;
@@ -38,20 +42,33 @@ public class LoanProductTestBuilder {
private String interestRatePerPeriod = "2";
private String interestRateFrequencyType = MONTHS;
private String interestType = FLAT_BALANCE;
private String overdueDaysForNPA = "5";
private String interestCalculationPeriodType = CALCULATION_PERIOD_SAME_AS_REPAYMENT_PERIOD;
private String inArrearsTolerance = "0";
private final String transactionProcessingStrategy = MIFOS_STANDARD_STRATEGY;
private String accountingRule = NONE;
private final String currencyCode = INR;
private final String currencyCode = USD;
private String amortizationType = EQUAL_INSTALLMENTS;
private String minPrincipal = "1000.00";
private String maxPrincipal = "100000.00";
private Account[] accountList = null;
public String build() {
final HashMap<String, String> map = new HashMap<String, String>();
private Boolean multiDisburseLoan = false;
private String outstandingLoanBalance = "35000";
private String maxTrancheCount = "35000";
public String build(final String chargeId) {
final HashMap<String, Object> map = new HashMap<String, Object>();
if (chargeId != null) {
List<HashMap<String, String>> charges = new ArrayList<HashMap<String, String>>();
HashMap<String, String> chargeMap = new HashMap<String, String>();
chargeMap.put("id", chargeId);
charges.add(chargeMap);
map.put("charges", charges);
}
map.put("name", this.nameOfLoanProduct);
map.put("shortName", this.shortName);
map.put("currencyCode", this.currencyCode);
map.put("locale", LOCALE);
map.put("digitsAfterDecimal", DIGITS_AFTER_DECIMAL);
@@ -69,8 +86,14 @@ public class LoanProductTestBuilder {
map.put("accountingRule", this.accountingRule);
map.put("minPrincipal", this.minPrincipal);
map.put("maxPrincipal", this.maxPrincipal);
map.put("overdueDaysForNPA", this.overdueDaysForNPA);
if (multiDisburseLoan) {
map.put("multiDisburseLoan", this.multiDisburseLoan);
map.put("maxTrancheCount", this.maxTrancheCount);
map.put("outstandingLoanBalance", this.outstandingLoanBalance);
}
if (this.accountingRule.equals(ACCRUAL_BASED)) {
if (this.accountingRule.equals(ACCRUAL_UPFRONT) || this.accountingRule.equals(ACCRUAL_PERIODIC)) {
map.putAll(getAccountMappingForAccrualBased());
} else if (this.accountingRule.equals(CASH_BASED)) {
map.putAll(getAccountMappingForCashBased());
@@ -158,6 +181,11 @@ public class LoanProductTestBuilder {
return this;
}
public LoanProductTestBuilder withOverdueDaysForNPA(String days) {
this.overdueDaysForNPA = days;
return this;
}
public LoanProductTestBuilder withInterestCalculationPeriodTypeAsDays() {
this.interestCalculationPeriodType = DAYS;
return this;
@@ -184,12 +212,23 @@ public class LoanProductTestBuilder {
return this;
}
public LoanProductTestBuilder withAccountingRuleAsAccrualBased(final Account[] account_list) {
this.accountingRule = ACCRUAL_BASED;
public LoanProductTestBuilder withAccountingRuleUpfrontAccrual(final Account[] account_list) {
this.accountingRule = ACCRUAL_UPFRONT;
this.accountList = account_list;
return this;
}
public LoanProductTestBuilder withAccountingRulePeriodicAccrual(final Account[] account_list) {
this.accountingRule = ACCRUAL_PERIODIC;
this.accountList = account_list;
return this;
}
public LoanProductTestBuilder withTranches(boolean multiDisburseLoan) {
this.multiDisburseLoan = multiDisburseLoan;
return this;
}
private Map<String, String> getAccountMappingForCashBased() {
final Map<String, String> map = new HashMap<String, String>();
for (int i = 0; i < this.accountList.length; i++) {
@@ -204,6 +243,7 @@ public class LoanProductTestBuilder {
map.put("interestOnLoanAccountId", ID);
map.put("incomeFromFeeAccountId", ID);
map.put("incomeFromPenaltyAccountId", ID);
map.put("incomeFromRecoveryAccountId", ID);
}
if (this.accountList[i].getAccountType().equals(Account.AccountType.EXPENSE)) {
final String ID = this.accountList[i].getAccountID().toString();
@@ -235,6 +275,7 @@ public class LoanProductTestBuilder {
map.put("interestOnLoanAccountId", ID);
map.put("incomeFromFeeAccountId", ID);
map.put("incomeFromPenaltyAccountId", ID);
map.put("incomeFromRecoveryAccountId", ID);
}
if (this.accountList[i].getAccountType().equals(Account.AccountType.EXPENSE)) {
final String ID = this.accountList[i].getAccountID().toString();
@@ -249,4 +290,10 @@ public class LoanProductTestBuilder {
return map;
}
public LoanProductTestBuilder withAccounting(final String accountingRule, final Account[] account_list) {
this.accountingRule = accountingRule;
this.accountList = account_list;
return this;
}
}
@@ -37,6 +37,10 @@ public class LoanStatusChecker {
assertFalse(getStatus(loanStatusHashMap, "active"));
}
public static void verifyLoanAccountIsOverPaid(final HashMap loanStatusHashMap) {
assertTrue(getStatus(loanStatusHashMap, "overpaid"));
}
public static HashMap getStatusOfLoan(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final Integer loanID) {
final String url = "/mifosng-provider/api/v1/loans/" + loanID + "?tenantIdentifier=default";
@@ -1,17 +1,19 @@
package org.mifosplatform.integrationtests.common.loans;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.HashMap;
import org.joda.time.LocalDate;
import org.mifosplatform.integrationtests.common.Utils;
import com.google.gson.Gson;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings("rawtypes")
@SuppressWarnings({ "rawtypes", "unchecked" })
public class LoanTransactionHelper {
private final RequestSpecification requestSpec;
@@ -22,6 +24,7 @@ public class LoanTransactionHelper {
private static final String APPROVE_LOAN_COMMAND = "approve";
private static final String UNDO_APPROVAL_LOAN_COMMAND = "undoApproval";
private static final String DISBURSE_LOAN_COMMAND = "disburse";
private static final String DISBURSE_LOAN_TO_SAVINGS_COMMAND = "disburseToSavings";
private static final String UNDO_DISBURSE_LOAN_COMMAND = "undoDisbursal";
private static final String WRITE_OFF_LOAN_COMMAND = "writeoff";
private static final String WAIVE_INTEREST_COMMAND = "waiveinterest";
@@ -41,6 +44,11 @@ public class LoanTransactionHelper {
return Utils.performServerPost(this.requestSpec, this.responseSpec, APPLY_LOAN_URL, loanApplicationJSON, "loanId");
}
public Integer updateLoan(final Integer id, final String loanApplicationJSON) {
return Utils.performServerPut(this.requestSpec, this.responseSpec, "/mifosng-provider/api/v1/loans/" + id
+ "?tenantIdentifier=default", loanApplicationJSON, "loanId");
}
public ArrayList getLoanRepaymentSchedule(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final Integer loanID) {
final String URL = "/mifosng-provider/api/v1/loans/" + loanID + "?associations=repaymentSchedule&tenantIdentifier=default";
@@ -48,6 +56,23 @@ public class LoanTransactionHelper {
return (ArrayList) response.get("periods");
}
public HashMap getLoanSummary(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer loanID) {
final String URL = "/mifosng-provider/api/v1/loans/" + loanID + "?associations=all&tenantIdentifier=default";
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, URL, "summary");
return response;
}
public Object getLoanDetail(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer loanID,
final String param) {
final String URL = "/mifosng-provider/api/v1/loans/" + loanID + "?associations=all&tenantIdentifier=default";
return Utils.performServerGet(requestSpec, responseSpec, URL, param);
}
public ArrayList getLoanCharges(final Integer loanId) {
final String GET_LOAN_CHARGES_URL = "/mifosng-provider/api/v1/loans/" + loanId + "/charges?" + Utils.TENANT_IDENTIFIER;
return Utils.performServerGet(requestSpec, responseSpec, GET_LOAN_CHARGES_URL, "");
}
public HashMap approveLoan(final String approvalDate, final Integer loanID) {
return performLoanTransaction(createLoanOperationURL(APPROVE_LOAN_COMMAND, loanID), getApproveLoanAsJSON(approvalDate));
}
@@ -60,6 +85,10 @@ public class LoanTransactionHelper {
public HashMap disburseLoan(final String date, final Integer loanID) {
return performLoanTransaction(createLoanOperationURL(DISBURSE_LOAN_COMMAND, loanID), getDisburseLoanAsJSON(date));
}
public HashMap disburseLoanToSavings(final String date, final Integer loanID) {
return performLoanTransaction(createLoanOperationURL(DISBURSE_LOAN_TO_SAVINGS_COMMAND, loanID), getDisburseLoanAsJSON(date));
}
public HashMap undoDisbursal(final Integer loanID) {
final String undoDisburseJson = "{'note' : 'UNDO DISBURSAL'}";
@@ -76,6 +105,12 @@ public class LoanTransactionHelper {
public HashMap waiveInterest(final String date, final String amountToBeWaived, final Integer loanID) {
return performLoanTransaction(createLoanTransactionURL(WAIVE_INTEREST_COMMAND, loanID), getWaiveBodyAsJSON(date, amountToBeWaived));
}
public Integer waiveInterestAndReturnTransactionId(final String date, final String amountToBeWaived, final Integer loanID) {
Integer resourceId = Utils.performServerPost(this.requestSpec, this.responseSpec, createLoanTransactionURL(WAIVE_INTEREST_COMMAND, loanID),
getWaiveBodyAsJSON(date, amountToBeWaived), "resourceId");
return resourceId;
}
public HashMap makeRepayment(final String date, final Float amountToBePaid, final Integer loanID) {
return performLoanTransaction(createLoanTransactionURL(MAKE_REPAYMENT_COMMAND, loanID),
@@ -87,6 +122,45 @@ public class LoanTransactionHelper {
getWithdrawLoanApplicationBodyAsJSON(date));
}
public Integer addChargesForLoan(final Integer loanId, final String request) {
System.out.println("--------------------------------- ADD CHARGES FOR LOAN --------------------------------");
final String ADD_CHARGES_URL = "/mifosng-provider/api/v1/loans/" + loanId + "/charges?tenantIdentifier=default";
final HashMap response = Utils.performServerPost(requestSpec, responseSpec, ADD_CHARGES_URL, request, "");
return (Integer) response.get("resourceId");
}
public Integer updateChargesForLoan(final Integer loanId, final Integer loanchargeId, final String request) {
System.out.println("--------------------------------- ADD CHARGES FOR LOAN --------------------------------");
final String UPDATE_CHARGES_URL = "/mifosng-provider/api/v1/loans/" + loanId + "/charges/" + loanchargeId
+ "?tenantIdentifier=default";
final HashMap response = Utils.performServerPut(requestSpec, responseSpec, UPDATE_CHARGES_URL, request, "");
return (Integer) response.get("resourceId");
}
public Integer deleteChargesForLoan(final Integer loanId, final Integer loanchargeId) {
System.out.println("--------------------------------- DELETE CHARGES FOR LOAN --------------------------------");
final String DELETE_CHARGES_URL = "/mifosng-provider/api/v1/loans/" + loanId + "/charges/" + loanchargeId
+ "?tenantIdentifier=default";
final HashMap response = Utils.performServerDelete(requestSpec, responseSpec, DELETE_CHARGES_URL, "");
return (Integer) response.get("resourceId");
}
public Integer waiveChargesForLoan(final Integer loanId, final Integer loanchargeId, final String json) {
System.out.println("--------------------------------- WAIVE CHARGES FOR LOAN --------------------------------");
final String CHARGES_URL = "/mifosng-provider/api/v1/loans/" + loanId + "/charges/" + loanchargeId
+ "?command=waive&tenantIdentifier=default";
final HashMap response = Utils.performServerPost(requestSpec, responseSpec, CHARGES_URL, json, "");
return (Integer) response.get("resourceId");
}
public Integer payChargesForLoan(final Integer loanId, final Integer loanchargeId, final String json) {
System.out.println("--------------------------------- WAIVE CHARGES FOR LOAN --------------------------------");
final String CHARGES_URL = "/mifosng-provider/api/v1/loans/" + loanId + "/charges/" + loanchargeId
+ "?command=pay&tenantIdentifier=default";
final HashMap response = Utils.performServerPost(requestSpec, responseSpec, CHARGES_URL, json, "");
return (Integer) response.get("resourceId");
}
private String getDisburseLoanAsJSON(final String actualDisbursementDate) {
final HashMap<String, String> map = new HashMap<String, String>();
map.put("locale", "en");
@@ -144,6 +218,80 @@ public class LoanTransactionHelper {
}
public static String getSpecifiedDueDateChargesForLoanAsJSON(final String chargeId) {
return getSpecifiedDueDateChargesForLoanAsJSON(chargeId, "12 January 2013", "100");
}
public static String getSpecifiedDueDateChargesForLoanAsJSON(final String chargeId, final String dueDate, final String amount) {
final HashMap<String, String> map = new HashMap<String, String>();
map.put("locale", "en_GB");
map.put("dateFormat", "dd MMMM yyyy");
map.put("amount", amount);
map.put("dueDate", dueDate);
map.put("chargeId", chargeId);
String json = new Gson().toJson(map);
System.out.println(json);
return json;
}
public static String getDisbursementChargesForLoanAsJSON(final String chargeId) {
return getDisbursementChargesForLoanAsJSON(chargeId, "100");
}
public static String getDisbursementChargesForLoanAsJSON(final String chargeId, String amount) {
final HashMap<String, String> map = new HashMap<String, String>();
map.put("locale", "en_GB");
map.put("dateFormat", "dd MMMM yyyy");
map.put("amount", amount);
map.put("chargeId", chargeId);
String json = new Gson().toJson(map);
System.out.println(json);
return json;
}
public static String getInstallmentChargesForLoanAsJSON(final String chargeId, final String amount) {
final HashMap<String, String> map = new HashMap<String, String>();
map.put("locale", "en_GB");
map.put("dateFormat", "dd MMMM yyyy");
map.put("amount", amount);
map.put("chargeId", chargeId);
String json = new Gson().toJson(map);
System.out.println(json);
return json;
}
public static String getUpdateChargesForLoanAsJSON(String amount) {
final HashMap<String, String> map = new HashMap<String, String>();
map.put("locale", "en_GB");
map.put("dateFormat", "dd MMMM yyyy");
map.put("amount", amount);
String json = new Gson().toJson(map);
System.out.println(json);
return json;
}
public static String getPayChargeJSON(final String date, final String installmentNumber) {
final HashMap<String, String> map = new HashMap<String, String>();
map.put("locale", "en_GB");
map.put("dateFormat", "dd MMMM yyyy");
map.put("transactionDate", date);
if (installmentNumber != null) {
map.put("installmentNumber", installmentNumber);
}
String json = new Gson().toJson(map);
System.out.println(json);
return json;
}
public static String getWaiveChargeJSON(final String installmentNumber) {
final HashMap<String, String> map = new HashMap<String, String>();
map.put("locale", "en_GB");
map.put("installmentNumber", installmentNumber);
String json = new Gson().toJson(map);
System.out.println(json);
return json;
}
public String getLoanCalculationBodyAsJSON(final String productID) {
final HashMap<String, String> map = new HashMap<String, String>();
map.put("dateFormat", "dd MMMM yyyy");
@@ -180,11 +328,40 @@ public class LoanTransactionHelper {
return (HashMap) response.get("status");
}
@SuppressWarnings("unchecked")
public void verifyRepaymentScheduleEntryFor(final int repaymentNumber, final float expectedPrincipalOutstanding, final Integer loanID) {
System.out.println("---------------------------GETTING LOAN REPAYMENT SCHEDULE--------------------------------");
final ArrayList<HashMap> repaymentPeriods = getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
assertEquals("Mismatch in Principal Loan Balance Outstanding ", expectedPrincipalOutstanding, repaymentPeriods.get(repaymentNumber)
.get("principalLoanBalanceOutstanding"));
}
public void checkAccrualTransactionForRepayment(final LocalDate transactionDate, final Float interestPortion, final Float feePortion,
final Float penaltyPortion, final Integer loanID) {
ArrayList<HashMap> transactions = (ArrayList<HashMap>) getLoanDetail(this.requestSpec, this.responseSpec, loanID, "transactions");
boolean isTransactionFound = false;
for (int i = 0; i < transactions.size(); i++) {
HashMap transactionType = (HashMap) transactions.get(i).get("type");
boolean isAccrualTransaction = (Boolean) transactionType.get("accrual");
if (isAccrualTransaction) {
ArrayList<Integer> accrualEntryDateAsArray = (ArrayList<Integer>) transactions.get(i).get("date");
LocalDate accrualEntryDate = new LocalDate(accrualEntryDateAsArray.get(0), accrualEntryDateAsArray.get(1),
accrualEntryDateAsArray.get(2));
if (transactionDate.equals(accrualEntryDate)) {
isTransactionFound = true;
assertEquals("Mismatch in transaction amounts", interestPortion,
Float.valueOf(String.valueOf(transactions.get(i).get("interestPortion"))));
assertEquals("Mismatch in transaction amounts", feePortion,
Float.valueOf(String.valueOf(transactions.get(i).get("feeChargesPortion"))));
assertEquals("Mismatch in transaction amounts", penaltyPortion,
Float.valueOf(String.valueOf(transactions.get(i).get("penaltyChargesPortion"))));
break;
}
}
}
assertTrue("No Accrual entries are posted", isTransactionFound);
}
}
@@ -0,0 +1,537 @@
package org.mifosplatform.integrationtests.common.recurringdeposit;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import org.mifosplatform.integrationtests.common.CommonConstants;
import org.mifosplatform.integrationtests.common.Utils;
import com.google.gson.Gson;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings({ "unused", "rawtypes" })
public class RecurringDepositAccountHelper {
private final RequestSpecification requestSpec;
private final ResponseSpecification responseSpec;
public RecurringDepositAccountHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
this.requestSpec = requestSpec;
this.responseSpec = responseSpec;
}
private static final String RECURRING_DEPOSIT_ACCOUNT_URL = "/mifosng-provider/api/v1/recurringdepositaccounts";
private static final String APPLY_RECURRING_DEPOSIT_ACCOUNT_URL = RECURRING_DEPOSIT_ACCOUNT_URL + "?" + Utils.TENANT_IDENTIFIER;
private static final String APPROVE_RECURRING_DEPOSIT_COMMAND = "approve";
private static final String UNDO_APPROVAL_RECURRING_DEPOSIT_COMMAND = "undoapproval";
private static final String REJECT_RECURRING_DEPOSIT_COMMAND = "reject";
private static final String WITHDRAWN_BY_CLIENT_RECURRING_DEPOSIT_COMMAND = "withdrawnByApplicant";
private static final String ACTIVATE_RECURRING_DEPOSIT_COMMAND = "activate";
private static final String CLOSE_RECURRING_DEPOSIT_COMMAND = "close";
private static final String POST_INTEREST_RECURRING_DEPOSIT_COMMAND = "postInterest";
private static final String CALCULATE_INTEREST_RECURRING_DEPOSIT_COMMAND = "calculateInterest";
private static final String CALCULATE_PREMATURE_AMOUNT_COMMAND = "calculatePrematureAmount";
private static final String PREMATURE_CLOSE_COMMAND = "prematureClose";
private static final String DEPOSIT_INTO_RECURRING_DEPOSIT_COMMAND = "deposit";
private static final String MODIFY_TRANSACTION_COMMAND = "modify";
private static final String UNDO_TRANSACTION_COMMAND = "undo";
private static final String LOCALE = "en_GB";
private static final String DIGITS_AFTER_DECIMAL = "4";
private static final String IN_MULTIPLES_OF = "100";
private static final String USD = "USD";
private static final String DAYS = "0";
private static final String WEEKS = "1";
private static final String MONTHS = "2";
private static final String YEARS = "3";
private static final String DAILY = "1";
private static final String MONTHLY = "4";
private static final String QUARTERLY = "5";
private static final String BI_ANNUALLY = "6";
private static final String ANNUALLY = "7";
private static final String INTEREST_CALCULATION_USING_DAILY_BALANCE = "1";
private static final String INTEREST_CALCULATION_USING_AVERAGE_DAILY_BALANCE = "2";
private static final String DAYS_360 = "360";
private static final String DAYS_365 = "365";
private static final String NONE = "1";
private static final String CASH_BASED = "2";
private static final String ACCRUAL_PERIODIC = "3";
private static final String ACCRUAL_UPFRONT = "4";
private String interestCompoundingPeriodType = MONTHLY;
private String interestPostingPeriodType = MONTHLY;
private String interestCalculationType = INTEREST_CALCULATION_USING_DAILY_BALANCE;
private final String lockinPeriodFrequency = "1";
private final String lockingPeriodFrequencyType = MONTHS;
private final String minDepositTerm = "6";
private final String minDepositTermTypeId = MONTHS;
private final String maxDepositTerm = "10";
private final String maxDepositTermTypeId = YEARS;
private final String inMultiplesOfDepositTerm = "2";
private final String inMultiplesOfDepositTermTypeId = MONTHS;
private final String preClosurePenalInterest = "2";
private final boolean preClosurePenalApplicable = true;
private final boolean isActiveChart = true;
private final String currencyCode = USD;
private String interestCalculationDaysInYearType = DAYS_365;
private final String depositAmount = "2000";
private final String depositPeriod = "14";
private final String depositPeriodFrequencyId = MONTHS;
private final String recurringFrequency = "1";
private final String recurringFrequencyType = MONTHS;
private final String mandatoryRecommendedDepositAmount = "2000";
private String submittedOnDate = "";
private String expectedFirstDepositOnDate = "";
private boolean isCalendarInherited = false;
public String build(final String clientId, final String productId, final String validFrom, final String validTo,
final String penalInterestType) {
final HashMap<String, Object> map = new HashMap<String, Object>();
List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
HashMap<String, String> chartSlabsMap1 = new HashMap<String, String>();
chartSlabsMap1.put("description", "First");
chartSlabsMap1.put("periodType", MONTHS);
chartSlabsMap1.put("fromPeriod", "1");
chartSlabsMap1.put("toPeriod", "6");
chartSlabsMap1.put("annualInterestRate", "5");
chartSlabsMap1.put("locale", LOCALE);
chartSlabs.add(0, chartSlabsMap1);
HashMap<String, String> chartSlabsMap2 = new HashMap<String, String>();
chartSlabsMap2.put("description", "Second");
chartSlabsMap2.put("periodType", MONTHS);
chartSlabsMap2.put("fromPeriod", "7");
chartSlabsMap2.put("toPeriod", "12");
chartSlabsMap2.put("annualInterestRate", "6");
chartSlabsMap2.put("locale", LOCALE);
chartSlabs.add(1, chartSlabsMap2);
HashMap<String, String> chartSlabsMap3 = new HashMap<String, String>();
chartSlabsMap3.put("description", "Third");
chartSlabsMap3.put("periodType", MONTHS);
chartSlabsMap3.put("fromPeriod", "13");
chartSlabsMap3.put("toPeriod", "18");
chartSlabsMap3.put("annualInterestRate", "7");
chartSlabsMap3.put("locale", LOCALE);
chartSlabs.add(2, chartSlabsMap3);
HashMap<String, String> chartSlabsMap4 = new HashMap<String, String>();
chartSlabsMap4.put("description", "Fourth");
chartSlabsMap4.put("periodType", MONTHS);
chartSlabsMap4.put("fromPeriod", "19");
chartSlabsMap4.put("toPeriod", "24");
chartSlabsMap4.put("annualInterestRate", "8");
chartSlabsMap4.put("locale", LOCALE);
chartSlabs.add(3, chartSlabsMap4);
List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>();
HashMap<String, Object> chartsMap = new HashMap<String, Object>();
chartsMap.put("fromDate", validFrom);
chartsMap.put("endDate", validTo);
chartsMap.put("dateFormat", "dd MMMM yyyy");
chartsMap.put("locale", LOCALE);
chartsMap.put("isActiveChart", this.isActiveChart);
chartsMap.put("chartSlabs", chartSlabs);
charts.add(chartsMap);
map.put("charts", charts);
map.put("productId", productId);
map.put("clientId", clientId);
map.put("interestCalculationDaysInYearType", this.interestCalculationDaysInYearType);
map.put("locale", LOCALE);
map.put("dateFormat", "dd MMMM yyyy");
map.put("monthDayFormat", "dd MMM");
map.put("interestCalculationType", this.interestCalculationType);
map.put("interestCompoundingPeriodType", this.interestCompoundingPeriodType);
map.put("interestPostingPeriodType", this.interestPostingPeriodType);
map.put("lockinPeriodFrequency", this.lockinPeriodFrequency);
map.put("lockinPeriodFrequencyType", this.lockingPeriodFrequencyType);
map.put("preClosurePenalApplicable", "true");
map.put("minDepositTermTypeId", this.minDepositTermTypeId);
map.put("minDepositTerm", this.minDepositTerm);
map.put("maxDepositTermTypeId", this.maxDepositTermTypeId);
map.put("maxDepositTerm", this.maxDepositTerm);
map.put("preClosurePenalApplicable", this.preClosurePenalApplicable);
map.put("inMultiplesOfDepositTerm", this.inMultiplesOfDepositTerm);
map.put("inMultiplesOfDepositTermTypeId", this.inMultiplesOfDepositTermTypeId);
map.put("preClosurePenalInterest", this.preClosurePenalInterest);
map.put("preClosurePenalInterestOnTypeId", penalInterestType);
map.put("depositAmount", this.depositAmount);
map.put("depositPeriod", this.depositPeriod);
map.put("depositPeriodFrequencyId", this.depositPeriodFrequencyId);
map.put("submittedOnDate", this.submittedOnDate);
map.put("recurringFrequency", this.recurringFrequency);
map.put("recurringFrequencyType", this.recurringFrequencyType);
map.put("mandatoryRecommendedDepositAmount", this.mandatoryRecommendedDepositAmount);
map.put("expectedFirstDepositOnDate", this.expectedFirstDepositOnDate);
map.put("isCalendarInherited", this.isCalendarInherited);
String recurringDepositAccountJson = new Gson().toJson(map);
System.out.println(recurringDepositAccountJson);
return recurringDepositAccountJson;
}
public static Integer applyRecurringDepositApplication(final String recurringDepositAccountAsJson,
final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
System.out.println("--------------------- APPLYING FOR RECURRING DEPOSIT ACCOUNT ------------------------");
return Utils.performServerPost(requestSpec, responseSpec, APPLY_RECURRING_DEPOSIT_ACCOUNT_URL, recurringDepositAccountAsJson,
CommonConstants.RESPONSE_RESOURCE_ID);
}
public static HashMap getRecurringDepositAccountById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final Integer accountID) {
final String GET_RECURRING_DEPOSIT_BY_ID_URL = RECURRING_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?" + Utils.TENANT_IDENTIFIER;
System.out.println("------------------------ RETRIEVING RECURRING DEPOSIT ACCOUNT BY ID -------------------------");
return Utils.performServerGet(requestSpec, responseSpec, GET_RECURRING_DEPOSIT_BY_ID_URL, "");
}
public HashMap getRecurringDepositSummary(final Integer accountID) {
final String URL = RECURRING_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?" + Utils.TENANT_IDENTIFIER;
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, URL, "summary");
return response;
}
public static Float getInterestRate(ArrayList<ArrayList<HashMap>> interestSlabData, Integer depositPeriod) {
Float annualInterestRate = 0.0f;
for (Integer slabIndex = 0; slabIndex < interestSlabData.get(0).size(); slabIndex++) {
Integer fromPeriod = (Integer) interestSlabData.get(0).get(slabIndex).get("fromPeriod");
Integer toPeriod = (Integer) interestSlabData.get(0).get(slabIndex).get("toPeriod");
if (depositPeriod >= fromPeriod && depositPeriod <= toPeriod) {
annualInterestRate = (Float) interestSlabData.get(0).get(slabIndex).get("annualInterestRate");
break;
}
}
return annualInterestRate;
}
public static Float getPrincipalAfterCompoundingInterest(Calendar currentDate, Float principal, Float depositAmount, Integer depositPeriod,
double interestPerDay, Integer compoundingInterval, Integer postingInterval) {
Float totalInterest = 0.0f;
Float interestEarned = 0.0f;
for (int i = 1; i <= depositPeriod; i++) {
Integer daysInMonth = currentDate.getActualMaximum(Calendar.DATE);
principal += depositAmount;
for (int j = 0; j < daysInMonth; j++) {
interestEarned = (float) (principal * interestPerDay);
totalInterest += interestEarned;
if (compoundingInterval == 0) {
principal += interestEarned;
}
}
if ((i % postingInterval) == 0 || i == depositPeriod) {
if (compoundingInterval != 0) {
principal += totalInterest;
}
totalInterest = 0.0f;
System.out.println(principal);
}
currentDate.add(Calendar.MONTH, 1);
interestEarned = 0.0f;
}
return principal;
}
public HashMap updateRecurringDepositAccount(final String clientID, final String productID, final String accountID,
final String validFrom, final String validTo, final String penalInterestType, final String submittedOnDate) {
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
Calendar todaysDate = Calendar.getInstance();
todaysDate.add(Calendar.MONTH, -1);
todaysDate.add(Calendar.DATE, -1);
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
final String EXPECTED_FIRST_DEPOSIT_ON_ON_DATE = SUBMITTED_ON_DATE;
final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec)
.withSubmittedOnDate(SUBMITTED_ON_DATE).withExpectedFirstDepositOnDate(EXPECTED_FIRST_DEPOSIT_ON_ON_DATE)
.build(clientID, productID, validFrom, validTo, penalInterestType);
return Utils.performServerPut(this.requestSpec, this.responseSpec, RECURRING_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?"
+ Utils.TENANT_IDENTIFIER, recurringDepositApplicationJSON, CommonConstants.RESPONSE_CHANGES);
}
public HashMap updateInterestCalculationConfigForRecurringDeposit(final String clientID, final String productID,
final String accountID, final String submittedOnDate, final String validFrom, final String validTo,
final String numberOfDaysPerYear, final String penalInterestType, final String interestCalculationType,
final String interestCompoundingPeriodType, final String interestPostingPeriodType, final String expectedFirstDepositOnDate) {
final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec) //
.withSubmittedOnDate(submittedOnDate) //
.withNumberOfDaysPerYear(numberOfDaysPerYear) //
.withInterestCalculationPeriodType(interestCalculationType) //
.withInterestCompoundingPeriodType(interestCompoundingPeriodType) //
.withInterestPostingPeriodType(interestPostingPeriodType) //
.withExpectedFirstDepositOnDate(expectedFirstDepositOnDate) //
.build(clientID, productID, validFrom, validTo, penalInterestType);
return Utils.performServerPut(this.requestSpec, this.responseSpec, RECURRING_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?"
+ Utils.TENANT_IDENTIFIER, recurringDepositApplicationJSON, CommonConstants.RESPONSE_CHANGES);
}
public Integer updateTransactionForRecurringDeposit(final Integer accountID, final Integer transactionId, final String transactionDate,
final Float transactionAmount) {
System.out.println("--------------------------------- UPDATE RECURRING DEPOSIT TRANSACTION ------------------------------------");
return Utils.performServerPost(this.requestSpec, this.responseSpec, RECURRING_DEPOSIT_ACCOUNT_URL + "/" + accountID
+ "/transactions/" + transactionId + "?command=" + MODIFY_TRANSACTION_COMMAND,
getUpdateTransactionAsJSON(transactionDate, transactionAmount), CommonConstants.RESPONSE_RESOURCE_ID);
}
public Integer undoTransactionForRecurringDeposit(final Integer accountID, final Integer transactionId, final String transactionDate,
final Float transactionAmount) {
System.out.println("--------------------------------- UNDO RECURRING DEPOSIT TRANSACTION ------------------------------------");
return Utils.performServerPost(this.requestSpec, this.responseSpec, RECURRING_DEPOSIT_ACCOUNT_URL + "/" + accountID
+ "/transactions/" + transactionId + "?command=" + UNDO_TRANSACTION_COMMAND,
getUpdateTransactionAsJSON(transactionDate, transactionAmount), CommonConstants.RESPONSE_RESOURCE_ID);
}
public HashMap approveRecurringDeposit(final Integer recurringDepositAccountID, final String approvedOnDate) {
System.out
.println("--------------------------------- APPROVING RECURRING DEPOSIT APPLICATION ------------------------------------");
return performRecurringDepositApplicationActions(
createRecurringDepositOperationURL(APPROVE_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountID),
getApproveRecurringDepositAccountAsJSON(approvedOnDate));
}
public HashMap undoApproval(final Integer recurringDepositAccountID) {
System.out
.println("--------------------------------- UNDO APPROVING RECURRING DEPOSIT APPLICATION -------------------------------");
final String undoBodyJson = "{'note':'UNDO APPROVAL'}";
return performRecurringDepositApplicationActions(
createRecurringDepositOperationURL(UNDO_APPROVAL_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountID), undoBodyJson);
}
public HashMap rejectApplication(final Integer recurringDepositAccountID, final String rejectedOnDate) {
System.out.println("--------------------------------- REJECT RECURRING DEPOSIT APPLICATION -------------------------------");
return performRecurringDepositApplicationActions(
createRecurringDepositOperationURL(REJECT_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountID),
getRejectedRecurringDepositAsJSON(rejectedOnDate));
}
public HashMap withdrawApplication(final Integer recurringDepositAccountID, final String withdrawApplicationOnDate) {
System.out.println("--------------------------------- WITHDRAW RECURRING DEPOSIT APPLICATION -------------------------------");
return performRecurringDepositApplicationActions(
createRecurringDepositOperationURL(WITHDRAWN_BY_CLIENT_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountID),
getWithdrawnRecurringDepositAccountAsJSON(withdrawApplicationOnDate));
}
public HashMap activateRecurringDeposit(final Integer recurringDepositAccountID, final String activationDate) {
System.out
.println("---------------------------------- ACTIVATING RECURRING DEPOSIT APPLICATION ----------------------------------");
return performRecurringDepositApplicationActions(
createRecurringDepositOperationURL(ACTIVATE_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountID),
getActivatedRecurringDepositAccountAsJSON(activationDate));
}
public Object deleteRecurringDepositApplication(final Integer recurringDepositAccountID, final String jsonAttributeToGetBack) {
System.out.println("---------------------------------- DELETE RECURRING DEPOSIT APPLICATION ----------------------------------");
return Utils.performServerDelete(this.requestSpec, this.responseSpec, RECURRING_DEPOSIT_ACCOUNT_URL + "/"
+ recurringDepositAccountID + "?" + Utils.TENANT_IDENTIFIER, jsonAttributeToGetBack);
}
public Integer calculateInterestForRecurringDeposit(final Integer recurringDepositAccountId) {
System.out.println("--------------------------------- CALCULATING INTEREST FOR RECURRING DEPOSIT --------------------------------");
return (Integer) performRecurringDepositActions(
createRecurringDepositCalculateInterestURL(CALCULATE_INTEREST_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountId),
getCalculatedInterestForRecurringDepositApplicationAsJSON(), CommonConstants.RESPONSE_RESOURCE_ID);
}
public Integer postInterestForRecurringDeposit(final Integer recurringDepositAccountId) {
System.out.println("--------------------------------- POST INTEREST FOR RECURRING DEPOSIT --------------------------------");
return (Integer) performRecurringDepositActions(
createRecurringDepositCalculateInterestURL(POST_INTEREST_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountId),
getCalculatedInterestForRecurringDepositApplicationAsJSON(), CommonConstants.RESPONSE_RESOURCE_ID);
}
public Integer depositToRecurringDepositAccount(final Integer recurringDepositAccountId, final Float depositAmount,
final String depositedOnDate) {
System.out.println("--------------------------------- DEPOSIT TO RECURRING DEPOSIT ACCOUNT --------------------------------");
return (Integer) performRecurringDepositActions(
createDepositToRecurringDepositURL(DEPOSIT_INTO_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountId),
getDepositToRecurringDepositAccountAsJSON(depositAmount, depositedOnDate), CommonConstants.RESPONSE_RESOURCE_ID);
}
public HashMap calculatePrematureAmountForRecurringDeposit(final Integer recurringDepositAccountId, final String closedOnDate) {
System.out.println("--------------------- CALCULATING PREMATURE AMOUNT FOR RECURRING DEPOSIT ----------------------------");
return (HashMap) performRecurringDepositActions(
createRecurringDepositCalculateInterestURL(CALCULATE_PREMATURE_AMOUNT_COMMAND, recurringDepositAccountId),
getCalculatedPrematureAmountForRecurringDepositAccountAsJSON(closedOnDate), "");
}
public Object prematureCloseForRecurringDeposit(final Integer recurringDepositAccountId, final String closedOnDate,
final String closureType, final Integer toSavingsId, final String jsonAttributeToGetBack) {
System.out.println("--------------------- PREMATURE CLOSE FOR RECURRING DEPOSIT ----------------------------");
return performRecurringDepositActions(
createRecurringDepositCalculateInterestURL(PREMATURE_CLOSE_COMMAND, recurringDepositAccountId),
getPrematureCloseForRecurringDepositAccountAsJSON(closedOnDate, closureType, toSavingsId), jsonAttributeToGetBack);
}
private String getApproveRecurringDepositAccountAsJSON(final String approvedOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat);
map.put("approvedOnDate", approvedOnDate);
map.put("note", "Approval NOTE");
String recurringDepositAccountApproveJson = new Gson().toJson(map);
System.out.println(recurringDepositAccountApproveJson);
return recurringDepositAccountApproveJson;
}
private String getUpdateTransactionAsJSON(final String transactionDate, final Float transactionAmount) {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat);
map.put("transactionDate", transactionDate);
map.put("transactionAmount", transactionAmount);
String updateTransactionJson = new Gson().toJson(map);
System.out.println(updateTransactionJson);
return updateTransactionJson;
}
private String getRejectedRecurringDepositAsJSON(final String rejectedOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat);
map.put("rejectedOnDate", rejectedOnDate);
map.put("note", "Rejected NOTE");
String recurringDepositAccountJson = new Gson().toJson(map);
System.out.println(recurringDepositAccountJson);
return recurringDepositAccountJson;
}
private String getWithdrawnRecurringDepositAccountAsJSON(final String withdrawnApplicationOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat);
map.put("withdrawnOnDate", withdrawnApplicationOnDate);
map.put("note", "Withdraw NOTE");
String recurringDepositAccountJson = new Gson().toJson(map);
System.out.println(recurringDepositAccountJson);
return recurringDepositAccountJson;
}
private String getActivatedRecurringDepositAccountAsJSON(final String activationDate) {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat);
map.put("activatedOnDate", activationDate);
String recurringDepositAccountActivateJson = new Gson().toJson(map);
System.out.println(recurringDepositAccountActivateJson);
return recurringDepositAccountActivateJson;
}
private String getCalculatedInterestForRecurringDepositApplicationAsJSON() {
final HashMap<String, String> map = new HashMap<String, String>();
String recurringDepositAccountCalculatedInterestJson = new Gson().toJson(map);
System.out.println(recurringDepositAccountCalculatedInterestJson);
return recurringDepositAccountCalculatedInterestJson;
}
private String getCalculatedPrematureAmountForRecurringDepositAccountAsJSON(final String closedOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat);
map.put("closedOnDate", closedOnDate);
String recurringDepositAccountPrematureClosureJson = new Gson().toJson(map);
System.out.println(recurringDepositAccountPrematureClosureJson);
return recurringDepositAccountPrematureClosureJson;
}
private String getDepositToRecurringDepositAccountAsJSON(final Float depositAmount, final String depositedOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat);
map.put("transactionAmount", depositAmount);
map.put("transactionDate", depositedOnDate);
String recurringDepositAccountPrematureClosureJson = new Gson().toJson(map);
System.out.println(recurringDepositAccountPrematureClosureJson);
return recurringDepositAccountPrematureClosureJson;
}
private String getPrematureCloseForRecurringDepositAccountAsJSON(final String closedOnDate, final String closureType,
final Integer toSavingsId) {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat);
map.put("closedOnDate", closedOnDate);
map.put("onAccountClosureId", closureType);
if (toSavingsId != null) {
map.put("toSavingsAccountId", toSavingsId);
map.put("transferDescription", "Transferring To Savings Account");
}
String recurringDepositAccountPrematureCloseJson = new Gson().toJson(map);
System.out.println(recurringDepositAccountPrematureCloseJson);
return recurringDepositAccountPrematureCloseJson;
}
private String createRecurringDepositOperationURL(final String command, final Integer recurringDepositAccountID) {
return RECURRING_DEPOSIT_ACCOUNT_URL + "/" + recurringDepositAccountID + "?command=" + command + "&" + Utils.TENANT_IDENTIFIER;
}
private Object performRecurringDepositActions(final String postURLForRecurringDeposit, final String jsonToBeSent,
final String jsonAttributeToGetBack) {
return Utils.performServerPost(this.requestSpec, this.responseSpec, postURLForRecurringDeposit, jsonToBeSent,
jsonAttributeToGetBack);
}
private HashMap performRecurringDepositApplicationActions(final String postURLForRecurringDepositAction, final String jsonToBeSent) {
HashMap status = null;
final HashMap response = Utils.performServerPost(this.requestSpec, this.responseSpec, postURLForRecurringDepositAction,
jsonToBeSent, CommonConstants.RESPONSE_CHANGES);
if (response != null) {
status = (HashMap) response.get("status");
}
return status;
}
private String createRecurringDepositCalculateInterestURL(final String command, final Integer recurringDepositAccountID) {
return RECURRING_DEPOSIT_ACCOUNT_URL + "/" + recurringDepositAccountID + "?command=" + command + "&" + Utils.TENANT_IDENTIFIER;
}
private String createDepositToRecurringDepositURL(final String command, final Integer recurringDepositAccountID) {
return RECURRING_DEPOSIT_ACCOUNT_URL + "/" + recurringDepositAccountID + "/transactions" + "?command=" + command + "&"
+ Utils.TENANT_IDENTIFIER;
}
public RecurringDepositAccountHelper withSubmittedOnDate(final String recurringDepositApplicationSubmittedDate) {
this.submittedOnDate = recurringDepositApplicationSubmittedDate;
return this;
}
public RecurringDepositAccountHelper withExpectedFirstDepositOnDate(final String recurringDepositApplicationExpectedFirstDepositOnDate) {
this.expectedFirstDepositOnDate = recurringDepositApplicationExpectedFirstDepositOnDate;
return this;
}
public RecurringDepositAccountHelper withNumberOfDaysPerYear(final String numberOfDaysPerYearTypeId) {
this.interestCalculationDaysInYearType = numberOfDaysPerYearTypeId;
return this;
}
public RecurringDepositAccountHelper withInterestCalculationPeriodType(final String interestCalculationTypeId) {
this.interestCalculationType = interestCalculationTypeId;
return this;
}
public RecurringDepositAccountHelper withInterestCompoundingPeriodType(final String interestCompoundingPeriodTypeId) {
this.interestCompoundingPeriodType = interestCompoundingPeriodTypeId;
return this;
}
public RecurringDepositAccountHelper withInterestPostingPeriodType(final String interestPostingPeriodTypeId) {
this.interestPostingPeriodType = interestPostingPeriodTypeId;
return this;
}
}
@@ -0,0 +1,78 @@
package org.mifosplatform.integrationtests.common.recurringdeposit;
import static org.junit.Assert.assertTrue;
import java.util.HashMap;
import org.junit.Assert;
import org.mifosplatform.integrationtests.common.Utils;
import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
@SuppressWarnings("rawtypes")
public class RecurringDepositAccountStatusChecker {
private static final String RECURRING_DEPOSIT_ACCOUNT_URL = "/mifosng-provider/api/v1/recurringdepositaccounts";
public static void verifyRecurringDepositIsApproved(final HashMap recurringDepositStatusHashMap) {
System.out.println("-------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS APPROVED --------------------");
assertTrue("Error in Approving Recurring deposit application", getStatus(recurringDepositStatusHashMap, "approved"));
System.out.println(recurringDepositStatusHashMap);
}
public static void verifyRecurringDepositIsPending(final HashMap recurringDepositStatusHashMap) {
System.out.println("-------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS PENDING --------------------");
assertTrue("RECURRING DEPOSIT ACCOUNT IS NOT IN PENDING STATE",
getStatus(recurringDepositStatusHashMap, "submittedAndPendingApproval"));
System.out.println(recurringDepositStatusHashMap);
}
public static void verifyRecurringDepositIsActive(final HashMap recurringDepositStatusHashMap) {
System.out.println("----------------- VERIFYING RECURRING DEPOSIT APPLICATION IS ACTIVE -----------------");
assertTrue("ERROR IN ACTIVATING THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "active"));
System.out.println(recurringDepositStatusHashMap);
}
public static void verifyRecurringDepositIsRejected(final HashMap recurringDepositStatusHashMap) {
System.out.println("-------------- VERIFYING RECURRING DEPOSIT APPLICATION IS REJECTED ----------------");
assertTrue("ERROR IN REJECTING THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "rejected"));
System.out.println(recurringDepositStatusHashMap);
}
public static void verifyRecurringDepositIsWithdrawn(final HashMap recurringDepositStatusHashMap) {
System.out.println("---------------- VERIFYING RECURRING DEPOSIT APPLICATION IS WITHDRAWN ----------------");
assertTrue("ERROR IN WITHDRAW THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "withdrawnByApplicant"));
System.out.println(recurringDepositStatusHashMap);
}
public static void verifyRecurringDepositAccountIsClosed(final HashMap recurringDepositStatusHashMap) {
System.out.println("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS CLOSED ---------------------");
assertTrue("ERROR IN CLOSING THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "closed"));
System.out.println(recurringDepositStatusHashMap);
}
public static void verifyRecurringDepositAccountIsNotActive(final HashMap recurringDepositStatusHashMap) {
System.out.println("------------------ VERIFYING RECURRING DEPOSIT APPLICATION IS INACTIVE --------------------");
Assert.assertFalse(getStatus(recurringDepositStatusHashMap, "active"));
System.out.println(recurringDepositStatusHashMap);
}
public static HashMap getStatusOfRecurringDepositAccount(final RequestSpecification requestSpec,
final ResponseSpecification responseSpec, final String recurringDepositAccountID) {
final String GET_STATUS_OF_RECURRING_DEPOSIT_ACCOUNT_URL = RECURRING_DEPOSIT_ACCOUNT_URL + "/" + recurringDepositAccountID + "?"
+ Utils.TENANT_IDENTIFIER;
return Utils.performServerGet(requestSpec, responseSpec, GET_STATUS_OF_RECURRING_DEPOSIT_ACCOUNT_URL, "status");
}
public static void verifyRecurringDepositAccountIsPrematureClosed(HashMap recurringDepositStatusHashMap) {
System.out.println("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS CLOSED ---------------------");
assertTrue("ERROR IN PREMATURELY CLOSING THE RECURRING DEPOSIT ACCOUNT",
getStatus(recurringDepositStatusHashMap, "prematureClosed"));
System.out.println(recurringDepositStatusHashMap);
}
private static boolean getStatus(final HashMap recurringDepositStatusMap, final String recurringDepositStatusString) {
return (Boolean) recurringDepositStatusMap.get(recurringDepositStatusString);
}
}

Some files were not shown because too many files have changed in this diff Show More