Compare commits

...
502 Commits
Author SHA1 Message Date
Nazeer Hussain Shaik 4be363d171 Merge branch 'PR265' into develop 2016-12-27 16:06:12 +05:30
Satish 9d83361d13 Integration test cases for SMS Campaign 2016-12-23 17:33:37 +05:30
Satish 7fa796abb7 Fixed issue with calculate repayment schedule 2016-12-23 12:17:42 +05:30
Satish c8cedfc70d Integration test cases for Entity-Datatable Check 2016-12-20 16:53:31 +05:30
Satish 9cc60c9b7e Fixed issue with Create Center 2016-12-19 11:59:12 +05:30
Satish 8b20f0818c Fixed issue with entity datatable check 2016-12-19 09:45:57 +05:30
Satish 94baf15b97 API DOC UPDATE FOR WORKFLOW 2016-12-14 18:16:34 +05:30
Nazeer Hussain Shaik 5e897a90a7 Merge branch 'PR255' into develop 2016-12-13 19:16:58 +05:30
Nazeer Hussain Shaik 98a865087e Correction in ClientChargesTest after merging PR 250 2016-12-13 13:38:56 +05:30
Nazeer Hussain Shaik f1d0ce60b0 Merge branch 'FINERACT-267' into develop 2016-12-13 17:02:37 +05:30
Nazeer Hussain Shaik d5ac4e04ac Merge branch 'FINERACT-260' into develop 2016-12-13 16:13:57 +05:30
Nazeer Hussain Shaik bc93c278cc Modifying DatatabaleEntryRequiredException to extend from AbstractPlatformDomainRuleException 2016-12-13 15:35:02 +05:30
Adi Narayana Raju 09629933e1 Merge branch 'AmazonS3ImageFix' into develop 2016-12-09 16:38:56 +05:30
Nazeer Hussain Shaik 628fb30347 FINERACT-288 - Client's Image Uploaded Not Showing on UI in Amazon S3 2016-12-09 16:07:35 +05:30
Satish dde6eaec2a Entity datatable check implementation 2016-12-08 09:48:28 +05:30
Nazeer Hussain Shaik b60779b9a0 Adding idea files in rat exclusion list 2016-12-06 12:15:15 +05:30
Justin Du f88b1cb556 Update the README File
* Reformatted requirements
* Reworded instructions to build war file and execute tests
* Added Version, License, API, Online Demos, Developers, Roadmap, and Demo sections
* Updated SQL Commands by capitalizing CREATE DATABASE to emphasize it as a command
2016-12-05 21:04:25 -06:00
Nazeer Hussain Shaik cd75af2962 Updating Jackson license details in Notice file 2016-12-05 17:27:33 +05:30
Nazeer Hussain Shaik 3d03595ffd FINERACT-266 - Handling License issues for both source and binary distributions 2016-12-05 16:48:36 +05:30
jyothsnag e37ffca34c 267: Installment Fee fix on Foreclosure 2016-11-29 14:02:26 +05:30
abdulazizali77 46c0cec835 FIN-260: add ensure client charge date not before client activation date 2016-11-28 18:53:31 +08:00
Nazeer Hussain Shaik e9e3326f5b Integrating Apache RAT FINERACT-245 2016-11-23 13:23:13 +05:30
Nazeer Hussain Shaik aac5ae0d48 Dropping m_survey_scorecardsa and recreating it with correct foreign key relation 2016-11-22 18:01:02 +05:30
Nazeer Hussain Shaik 1bfb0b97cb Merge branch 'PR248' into develop 2016-11-22 17:55:25 +05:30
gkrishnan724 8cc4b6e4f1 Better E-mail for new user 2016-11-19 16:53:37 +05:30
Markus Geiss 0a4dc11a87 Fix for resolving scorecards, and replacing dead fk relation 2016-11-18 14:29:25 +01:00
Satish e79d51ee5a Added pagination for listing SMS campaign 2016-11-18 14:43:57 +05:30
Satish 117a9f51c5 SMS Campaign issues fix on 16-11 2016-11-17 17:38:28 +05:30
Satish 9aa4425c48 Removed ALL option from r_enum_value table for loan_type_enum 2016-11-15 17:16:10 +05:30
Nazeer Hussain Shaik 5fdac2282f Adding License header to CompoundinterestValues 2016-11-15 15:04:10 +05:30
Satish b35beb622e Added waiting for delivery report tab in view SMS Campaign 2016-11-15 14:10:08 +05:30
Adi Narayana Raju 73f8d5eba5 Correct V322 sql... remove DB name in SQL 2016-11-14 19:13:32 +05:30
Adi Narayana Raju 19ba91a6d3 Merge branch 'PR240' into develop 2016-11-14 18:11:41 +05:30
Adi Narayana Raju b86a3377ad Merge branch 'PR236' into develop 2016-11-14 18:11:36 +05:30
Nazeer Hussain Shaik 2d1f6ab391 Addressing SMS Review Comments 2016-11-14 17:50:37 +05:30
Satish 911cab85b0 SMS Campaign feature implementation 2016-11-11 18:56:12 +05:30
jyothsnag b28be9b33f #792 : fixes related to savings interest posting 2016-11-10 23:56:57 +05:30
jyothsnag 9195315512 #164_compounding interest is greater than posting inerest 2016-11-10 21:51:49 +05:30
nikpawar89 48c8cf994a addressModuleFix 2016-11-08 00:36:31 -06:00
Koustav Muhuri 580840c35e interest posting on specified date 2016-11-03 15:39:29 +05:30
Adi Narayana Raju b3c4f75f11 Add API to allow self service user to change their password 2016-10-25 14:08:22 +05:30
Nazeer Hussain Shaik 525e8becb4 Merge branch 'FINERACT-37' into develop 2016-10-18 11:24:58 +05:30
Adi Narayana Raju e20ec293be Updating release notes for 0.4.0-incubating 2016-10-17 15:39:55 +05:30
Nazeer Hussain Shaik 9d7f1c2197 OpenJPA Integration Changes 2016-10-17 11:46:52 +05:30
Adi Narayana Raju 8d3f7af16f [MIFOSX-2784] Including all transactions in Teller Cashier transaction list 2016-09-21 17:07:55 +05:30
Nazeer Hussain Shaik 025ff9c707 Loading child entites lazy 2016-09-19 14:03:37 +05:30
Nazeer Hussain Shaik 19c0defe44 Merge branch 'MIFOSX-2731' into develop 2016-09-06 12:31:41 +05:30
Vishwa 95ebe210ee [MIFOSX-2731] Combined both savings charges and penalties into charges dropdown 2016-09-01 11:05:40 +05:30
pramod 9e68c4d5bb performance issue fix for repayment template 2016-08-30 17:25:11 +05:30
pramod ca1adedd40 fix for performance issues 2016-08-26 19:05:30 +05:30
Terence Denzil Monteiro b478064ac0 Reschedule repayment on holidays+extend term 2016-08-25 17:45:14 +05:30
Adi Narayana Raju ff58f74d79 [FINERACT-211] Corrected code to avoid detached entity persist exception 2016-08-24 15:35:21 +05:30
Adi Narayana Raju f33b583083 [FINERACT-223] In topup loan if the "Choose loan to close" is selected in modified loan product then internal server error is displaying. 2016-08-23 13:25:26 +05:30
Nazeer Hussain Shaik 8327b112a1 Adding Apache License to missed files 2016-08-22 14:05:58 +05:30
Nazeer Hussain Shaik 0c47dc8d6f Merge branch 'PR216' into develop 2016-08-22 13:53:23 +05:30
Adi Narayana Raju bf48c97de3 [FINERACT-212] & [FINERACT-216] & [FINERACT-218] & Correction of error messages on loan to be closed status and application submitted date 2016-08-22 12:35:19 +05:30
Nazeer Hussain Shaik 84651e0542 Merge branch 'FINERACT-214' into develop 2016-08-22 12:26:15 +05:30
Nazeer Hussain Shaik 830412fdde Merge branch 'FINERACT-215' into develop 2016-08-22 11:22:41 +05:30
venkatconflux 4e9f534eaa FINERACT-214 : adding validation for overdue charges while rescheuling 2016-08-19 18:11:11 +05:30
venkatconflux 2a7a8d4bc9 FINERACT-215 issue resolved 2016-08-19 16:22:33 +05:30
jinjurajan d22ef5decb #1319:Foreclosure charge issue 2016-08-18 22:05:19 +05:30
Adi Narayana Raju 416a6e5286 Fixed hiberante join issue 2016-08-17 10:30:39 +05:30
Adi Raju cc07999d6c Correct SQL version 319 2016-08-16 16:27:06 +05:30
Adi Raju 5e43acc8a0 Merge branch 'PR209' into develop 2016-08-16 16:25:51 +05:30
satish-confluxandAdi Narayana Raju 961aa3df86 [FINERACT-131] Topup Loan Feature 2016-08-16 14:32:27 +05:30
Nazeer Hussain Shaik 11cd6ef333 Disabling address configuration by default 2016-08-16 12:19:44 +05:30
jyothsnag 58bbaa2e2b feature implementation of undoreject and undowithdrawal for client 2016-08-12 16:32:56 +05:30
Nazeer Hussain Shaik 47f21bc8d0 Renaming sql migration script to 317 2016-08-12 08:57:09 +05:30
Nazeer Hussain Shaik 1d51258cd8 Merge branch 'FINERACT-65' into develop 2016-08-12 08:54:21 +05:30
Nazeer Hussain Shaik f8f3f743c5 Merge branch 'FINERACT-71' into develop 2016-08-12 08:31:25 +05:30
Nazeer Hussain Shaik 7e6f764c7b adding missed apache license header in 316 migration script 2016-08-12 08:25:09 +05:30
Nazeer Hussain Shaik 75d657ada0 Merge branch 'fineract-206' into develop 2016-08-12 08:18:58 +05:30
Nazeer Hussain Shaik bfad909636 renaming address module sql script number from 312 to 315 2016-08-12 08:01:02 +05:30
Nazeer Hussain Shaik 012b15f207 Merge branch 'address_module' into develop 2016-08-12 07:59:25 +05:30
nikpawar89 b086e005ab address_module 2016-08-11 17:59:31 +05:30
Emmanuel Nnaa 4cfd56fa92 commit for FINERACT-71 ('AuditReadPlatformServiceImpl.retrieveEntries' returns duplicate results for users without the 'ALL_FUNCTIONS' and 'CHECKER_SUPER_USER' permissions.) 2016-08-08 14:49:52 +02:00
Emmanuel Nnaa b30976bbfd commit for FINERACT-65 (Implement ability to schedule & e-mail reports) 2016-08-08 14:18:11 +02:00
andrew.dzak 42f019d304 fineract-206 fixed MySQLIntegrityConstraintViolationException issue when deleting a group 2016-08-04 13:43:04 +02:00
Emmanuel Nnaa 5647ffb966 commit for FINERACT-70 (Rename deleted standing instruction by appending '_deleted_' string and the id) 2016-08-02 15:46:47 +02:00
Nazeer Hussain Shaik 56da30c3f9 Adding Apache License to V315 sql script 2016-08-02 11:53:23 +05:30
jinjurajanandNazeer Hussain Shaik 68f013abc2 validating disbursement date against expected disbursement date 2016-08-02 11:53:22 +05:30
Nazeer Hussain Shaik 8dfcd13641 Updating version from V306 to V314 and adding Apache License to V314 sql script 2016-08-02 10:33:47 +05:30
venkatconfluxandNazeer Hussain Shaik 4ad3baade3 adding code values to r_enum; 2016-08-02 10:33:46 +05:30
Nazeer Hussain Shaik 90942f11cd Merge branch 'FINERACT-190' into develop 2016-08-02 10:02:28 +05:30
Nazeer Hussain Shaik c44cf55fce Adding Apache License Text in V313__multi_rescheduling_script.sql 2016-08-01 19:08:21 +05:30
venkatconflux fe6171237e FINERACT-202 : enabling the option for multi reshedule 2016-08-01 17:07:34 +05:30
Nazeer Hussain Shaik ada9ced9a5 Merge branch 'FINERACT-61' into develop 2016-08-01 11:47:16 +05:30
Nazeer Hussain Shaik 0a390f7a08 Merge branch 'FINERACT-57' into develop 2016-08-01 11:28:21 +05:30
Nazeer Hussain Shaik f6fb56b940 adding License Header in V312__add_is_mandatory_to_code_value.sql 2016-08-01 11:24:01 +05:30
Nazeer Hussain Shaik da9601483f Merge branch 'FINERACT-55' into develop 2016-08-01 11:07:32 +05:30
Nazeer Hussain Shaik a01d3e1fcc Merge branch 'FINERACT-53' into develop 2016-07-29 15:05:22 +05:30
Nazeer Hussain Shaik a232d1b1ae Merge branch 'FINERACT-50' into develop 2016-07-29 14:31:29 +05:30
Nazeer Hussain Shaik 4232d6c6a6 Merge branch 'FINERACT-47' into develop 2016-07-29 12:10:03 +05:30
Nazeer Hussain Shaik 95b30c5a7f Merge branch 'FINERACT-45' into develop 2016-07-28 16:14:47 +05:30
Emmanuel Nnaa 31a3d16170 commit for FINERACT-61 (Incorrect penalty and fee charges amount inserted into the 'm_loan_arrears_aging' table) 2016-07-25 14:20:31 +02:00
Emmanuel Nnaa af1ef23db4 commit for FINERACT-57 (Set closure properties of reactivated closed client entity to null) 2016-07-21 16:01:19 +02:00
Emmanuel Nnaa 0e2da60065 commit for FINERACT-55 (Standing instruction not disabled at loan/savings account closure) 2016-07-21 15:46:50 +02:00
Emmanuel Nnaa fd3b6323a4 commit for FINERACT-53 (Make the clientId URL parameter optional for 'loan details template' retrieval) 2016-07-19 12:00:20 +02:00
Emmanuel Nnaa 29b663b00b commit for FINERACT-50 (Add 'mandatory' property to code value entity) 2016-07-18 11:32:38 +02:00
Emmanuel Nnaa a771c998f6 commit for FINERACT-47 (Expired user password cannot be updated by the same user) 2016-07-18 09:41:12 +02:00
Emmanuel Nnaa 149c084d1f commit for FINERACT-45 (The getRejectedByUser method in the LoanRescheduleRequest entity class returns the wrong value.) 2016-07-14 15:37:15 +02:00
Emmanuel Nnaa 65df32c444 commit for FINERACT-44 (Cannot delete an inactive charge associated with a product (loan/savings)) 2016-07-14 15:32:59 +02:00
Nazeer Hussain Shaik 5ac0da03d3 Adding Apache License to gradle build scripts. 2016-07-12 19:12:34 +05:30
Nazeer Hussain Shaik be01e460f5 0.3.2 release changes 2016-07-12 16:24:10 +05:30
Nazeer Hussain Shaik 03558fbe8c adding glyphicons.MIT and removing bootstrap.MIT 2016-07-07 04:27:43 +05:30
Nazeer Hussain Shaik a626208119 Adding Apache License Headers to sql files in fineract-db directory 2016-07-06 21:15:44 +05:30
Nazeer Hussain Shaik 1c2aa1980e Merge remote-tracking branch 'github/0.3.0-incubating' into develop 2016-06-29 20:01:27 +05:30
Nazeer Hussain Shaik f310cc0f51 Updating release version 2016-06-29 17:24:59 +05:30
Nazeer Hussain Shaik 8ce9edc1a1 Removing junk chars 2016-06-29 16:04:45 +05:30
Nazeer Hussain Shaik 7d8e9f57cc Adding DISCLAIMER and modifying README.md on Main Repo 2016-06-29 14:14:17 +05:30
Nazeer Hussain Shaik 07c3cd1b68 Adding License, Notice, Apache license to sql, sh, bat files 2016-06-29 12:09:31 +05:30
Nazeer Hussain Shaik a462d1461a Merge branch 'Remove_HibernateAnnotations' into develop 2016-06-28 16:58:34 +05:30
Nazeer Hussain Shaik 59825080b7 MySQL is returning Long value where Drizzle was returning Big Integer 2016-06-28 13:52:55 +05:30
Nazeer Hussain Shaik 9e5e7329ad Removing Hibernate annotations 2016-06-28 11:09:42 +05:30
Nazeer Hussain Shaik 9a2568d152 Merge branch 'FINERACT-179' into develop 2016-06-24 19:34:47 +05:30
venkatconflux 785589a4fd FINERACT-179 issue resolved 2016-06-24 19:23:53 +05:30
venkatconflux 8c5deb40ce FINERACT-182 and FINERACT-195 issues resolved 2016-06-24 18:25:33 +05:30
Nazeer Hussain Shaik e2b0084c96 Merge branch 'FINERACT-182' into develop 2016-06-23 17:42:43 +05:30
venkatconflux 8894269543 FINERACT-182 2016-06-23 14:37:37 +05:30
venkatconflux 91a51698fb multi tranche loan validation add and foreclose issues for multi tranche issues fixed 2016-06-22 18:47:56 +05:30
Terence Monteiro 34353938a7 Fixed client share activated user join 2016-06-22 14:02:22 +05:30
Nazeer Hussain Shaik c31c46b6d9 Merge branch 'FINERACT-183' into develop 2016-06-22 11:46:23 +05:30
Nazeer Hussain Shaik dfd33bd2de Merge branch 'foreclosureissues' into develop 2016-06-22 11:41:32 +05:30
Nazeer Hussain Shaik e338658a48 Merge branch 'compoundingissue' into develop 2016-06-22 11:30:37 +05:30
Nazeer Hussain Shaik d7e7feb361 FINERACT-183 Not able to save Edit Fixed deposit product page displays Internal server error 2016-06-22 07:20:23 +05:30
keshav10 b5be4d2504 fineract(185,182,173,175) 2016-06-21 19:15:43 +05:30
Nazeer Hussain Shaik b7ba924174 FINERACT-181 2016-06-21 13:15:08 +05:30
venkatconflux 4945040fff compounding issues fixed 2016-06-20 14:45:39 +05:30
Adi Narayana Raju a89a43a3f7 Merge branch 'PR145' into develop 2016-06-17 10:35:44 +05:30
keshav10 65767869b0 fineract-170,171 2016-06-16 18:34:48 +05:30
Nazeer Hussain Shaik 94ef2b0684 FINERACT-174 2016-06-16 17:17:32 +05:30
Nazeer Hussain Shaik 7fe50160ce Merge branch 'FINERACT-167' into develop 2016-06-13 16:15:12 +05:30
Nazeer Hussain Shaik 882132739e Second Disbursement date was hard coded, due to this 1 test case was failing 2016-06-13 16:12:12 +05:30
sachinkulkarni12 b9b345a563 [FINERACT-167] Loan foreclosure implementation and integration test cases for the same. 2016-06-10 18:59:26 +05:30
Nazeer Hussain Shaik b43d3ef064 renaming sql script number 2016-06-09 16:57:08 +05:30
Nazeer Hussain Shaik a0f7da3f46 Merge branch 'pull134' into develop 2016-06-09 16:55:59 +05:30
Nazeer Hussain Shaik 3774900aec renaming sql script name 2016-06-09 16:31:06 +05:30
Nazeer Hussain Shaik 8bdc5f3c6a Merge branch 'pull133' into develop 2016-06-09 16:30:13 +05:30
jinjurajan 66f8d7ce43 Changing dependency of m_entity_to_entity_access to m_entity_mapping and adding validation for new loan application 2016-06-09 16:29:04 +05:30
Nazeer Hussain Shaik b4cb1a5702 Merge branch 'pull132' into develop 2016-06-09 15:52:21 +05:30
aj-ankitjain 1153022fe7 504 reason for loan write of added 2016-06-09 15:19:12 +05:30
Nazeer Hussain Shaik 41440de255 Merge branch 'pull126' into develop 2016-06-09 12:42:44 +05:30
venkatconflux 3d0f48999d adding charges to loan was creating duplicate gl entries 2016-06-08 14:43:35 +05:30
Nazeer Hussain Shaik 979b57c38c Merge branch 'pull127' into develop 2016-06-06 12:48:12 +05:30
AvinashKumarG 59cfe08980 162_checking null values before computing the interest not posted 2016-06-02 15:34:17 +05:30
Nazeer Hussain Shaik 6f25da56ea FINERACT-145 2016-05-31 12:48:51 +05:30
Koustav Muhuri 3fa07c8bc5 fineract collection sheet 2016-05-30 16:01:25 +05:30
AvinashKumarG f96d96a147 show Interest Earnings/Overdraft Interest not yet posted 2016-05-27 12:17:09 +05:30
Nazeer Hussain Shaik 851b22d166 Merge branch 'MIFOSX-2656' into develop 2016-05-24 16:35:03 +05:30
Adi Narayana Raju 2faea6d27f [MIFOSX-2656] - Accrual transaction should be added only on the first tranche disbursal 2016-05-24 14:47:28 +05:30
Adi Narayana Raju 66eb337e33 [FINERACT-160] - Not able to add any charges after the savings application is submitted 2016-05-23 11:54:45 +05:30
Nazeer Hussain Shaik 7ae9b67d93 Shares Integration Tests and Fixes 2016-05-17 12:34:54 +05:30
Vishwa 0b81e80233 [MIFOSX-2652] Correcting repayment schedule for the loans with variable installments enabled 2016-05-13 12:37:53 +05:30
Adi Narayana Raju b4a43e6e98 Merge branch 'PR112' into develop 2016-05-11 13:21:36 +05:30
Adi Narayana Raju 76e488692e Merge branch 'PR111' into develop 2016-05-11 13:21:29 +05:30
Adi Narayana Raju 9353a52013 [FINERACT-152][FINERACT-153] - Dormant Savings Issues Corrections 2016-05-11 13:15:29 +05:30
pramod 72a1fff645 MIFOSX-2565 : fixed prepay with floating rates 2016-05-11 11:39:15 +05:30
venkatconflux 3c254f94e4 FINERACT-155 issue fixed 2016-05-11 09:54:43 +05:30
Adi Narayana Raju d2b853561f Merge branch 'PR107' into develop 2016-05-10 17:56:24 +05:30
Adi Narayana Raju 83e2d3e6fc Merge branch 'PR106' into develop 2016-05-10 17:56:19 +05:30
Adi Narayana Raju a4aee1a3c0 Integration tests for Savings Dormancy Tracking feature 2016-05-10 17:51:09 +05:30
pramod e58e591c89 FINERACT-108 : disbursement change with tranche loan 2016-05-10 16:58:46 +05:30
Adi Narayana Raju f3f6f4bf8f Merge branch 'PR105' into develop 2016-05-10 14:44:52 +05:30
Adi Narayana Raju b3f6666087 [FINERACT-152][FINERACT-153][FINERACT-154] - Dormant savings issues 2016-05-10 14:17:53 +05:30
jinjurajan 5578c6e4d3 adding new supported parameter recurringMoratoriumOnPrincipalPeriods on loanProduct 2016-05-10 11:12:23 +05:30
Vishwa 45e250331a [BUG-327] Stop interest calculation as well as posting income transaction, once the loan has moved to NPA state 2016-05-10 09:56:32 +05:30
Vishwa d1067e5a84 [BUG-17] Fixed issue with loan pre-closure 2016-05-06 16:56:17 +05:30
Adi Narayana Raju 318830fd45 Merge branch 'PR101' into develop 2016-05-06 16:51:53 +05:30
pramod 3946d7714d FINERACT-151 : removed interest recalculation from date 2016-05-06 16:48:36 +05:30
Vishwa e7fbec05be [BUG-347] Stop interest posting once the loan has moved to overpaid state 2016-05-05 18:28:57 +05:30
Nazeer Hussain Shaik 401cad4d35 Updating Shares API doc 2016-05-04 21:51:13 +05:30
Adi Narayana Raju ffe6a139f6 Merge branch 'PR95' into develop 2016-05-04 19:10:57 +05:30
Vishwa 763cf18b90 FINERACT-60 : Interest compounding, nth day rest frequency and meeting calendar date changes 2016-05-04 17:27:00 +05:30
Nazeer Hussain Shaik 92286b3910 Merge branch 'pullrequest97' into develop 2016-05-04 17:25:06 +05:30
Nazeer Hussain Shaik a9f811ca61 Merge branch 'removehibernateexceptions' into develop 2016-05-04 16:21:05 +05:30
Nazeer Hussain Shaik e507d6e204 Adding validation to check whether savings account is his own account 2016-05-04 15:56:13 +05:30
Adi Narayana Raju 2bd3b0625a Customer Self Service : APIs for Third Party Beneficiary management and Third Party Account Transfers 2016-05-04 13:01:25 +05:30
Adi Narayana Raju 9d4d90121a Dormant Savings Feature 2016-05-02 19:21:37 +05:30
Nazeer Hussain Shaik a2d794a34d adding driver property for flyway tasks 2016-05-02 16:34:46 +05:30
Nazeer Hussain Shaik 4d8ad87d93 Merge branch 'FINERACT-144' into develop 2016-04-27 14:15:50 +05:30
Nazeer Hussain Shaik e552e04fd4 Removing org.hibernate.exception imports 2016-04-27 10:28:45 +05:30
Nazeer Hussain Shaik 0480e08546 Merge branch 'pullrequest83' into develop 2016-04-26 20:27:07 +05:30
Nazeer Hussain Shaik c8159d83f3 Merge branch 'pullrequest82' into develop 2016-04-26 20:20:03 +05:30
Nazeer Hussain Shaik f755564599 removing non-apache licensed imports which are not used 2016-04-26 19:54:42 +05:30
Nazeer Hussain Shaik 7eed1dbd22 removing javax.transaction.Transactional imports 2016-04-26 19:23:24 +05:30
Nazeer Hussain Shaik 2ac38ffc58 removing third party licensed files import as they are not used 2016-04-26 18:58:07 +05:30
Nazeer Hussain Shaik 90d238167c Merge branch 'PULLREQUEST80' into develop 2016-04-26 12:11:11 +05:30
Nazeer Hussain Shaik df690ec894 Moving actualDisbursementDate outside in LoanWritePlatformServiceJpaRepositoryImpl 2016-04-26 12:06:24 +05:30
Nazeer Hussain Shaik 19329c4a12 Merge branch 'PULLREQUEST79' into develop 2016-04-26 11:53:19 +05:30
Nazeer Hussain Shaik c0c6f1d83c Merge branch 'PULLREQUEST78' into develop 2016-04-26 11:51:44 +05:30
Nazeer Hussain Shaik baad7ac019 Merge branch 'PULLREQUEST77' into develop 2016-04-26 11:50:18 +05:30
Nazeer Hussain Shaik 218663ac31 Merge branch 'PullREQUEST73' into develop 2016-04-26 11:45:49 +05:30
Nazeer Hussain Shaik ded0c7b845 Merge branch 'fixschedulegeneratorforwaivers' into develop 2016-04-26 11:43:02 +05:30
Nazeer Hussain Shaik f9746718fb Changing sql script number 2016-04-26 11:35:46 +05:30
Nazeer Hussain Shaik 93e615badd Merge branch 'PULLREQUEST68' into develop 2016-04-26 11:34:44 +05:30
Nazeer Hussain Shaik e083d79047 changing name of sql script 2016-04-26 11:12:26 +05:30
Nazeer Hussain Shaik fdf008d73e Merge branch 'FINERACT-94' into develop 2016-04-26 11:11:00 +05:30
sachinkulkarni12 6c84834459 254:In tranche loans, if repayment date is same as tranche disbursement date then allow to change the emi amount 2016-04-26 10:54:32 +05:30
sachinkulkarni12 67be38e71a 136 : accrual exception while doing repayment 2016-04-22 10:45:58 +05:30
sachinkulkarni12 aa20ba36a5 112:Edit disbursement causes the full amount to be shown - in repayment schedule 2016-04-22 10:40:19 +05:30
sachinkulkarni12 c9d4b63122 152:Repayment schedule not regenerating when frp is changed at the time of disbursal 2016-04-22 10:35:18 +05:30
Nazeer Hussain Shaik 3970b2ede1 Issues Found during QA 2016-04-21 18:29:07 +05:30
Nazeer Hussain Shaik 60588a78e0 Issue fixes on shares and dividends reported by QA 2016-04-19 17:55:23 +05:30
pramod 2dae8f8a0e MIFOSX-2505 : included due date charge for interest only recalcualtion installments 2016-04-18 16:10:35 +05:30
pramod 1cd226d4c6 MIFOSX-2497 : fixed schedule generator for waivers 2016-04-18 13:23:43 +05:30
Nazeer Hussain Shaik fe6e1e88fe Edit share account is not working because of merge 2016-04-14 13:45:14 +05:30
Nazeer Hussain Shaik 08c553f9fc Shares And Dividends Implementation 2016-04-13 16:34:38 +05:30
pramod 9fedac2ba1 added api doc 2016-04-12 14:37:35 +05:30
pramod 3015747f3d FINERACT-33 : savings withhold tax changes 2016-04-11 14:44:59 +05:30
guptas9 d6668d2e89 MIFOSX-2405 : modified rest calls to save and fetch status of client identifiers. Added ability to mark Client Identifier as Active or Inactive 2016-04-11 04:13:44 -04:00
guptas9 abc5290563 added licence headers 2016-04-11 04:12:52 -04:00
sachinkulkarni12 a83747822b changes for fees 2016-04-08 12:33:43 +05:30
binnygopinath 437de26c33 FINERACT-94: Flexible morotorium(only principal portion) 2016-04-07 10:44:02 +05:30
Nazeer Hussain Shaik 446ff4403f migration file change license error 2016-04-02 15:57:28 +05:30
Koustav Muhuri 5178d3a8bf Capturing Time 2016-04-01 13:00:13 +05:30
Adi Narayana Raju 8dfec9a375 Merge branch '53' into develop 2016-03-28 15:39:55 +05:30
Adi Narayana Raju ae5d01a912 Merge branch '51' into develop 2016-03-28 15:39:40 +05:30
sachinkulkarni12 3c69d35da7 FINERACT-98:fix for deleting a tranche 2016-03-25 11:01:55 +05:30
jinjurajan b533916ab6 Populate Display Name as Full Name when client is a Person 2016-03-24 16:14:59 +05:30
jinjurajan bba8ca47be Skip Repayment Date Falling On First Day of Month 2016-03-23 14:50:47 +05:30
Nazeer Hussain Shaik 9c38078de3 Merge branch 'FINERACT86' into develop 2016-03-22 15:47:25 +05:30
sachinkulkarni12 25b66ad1a1 center reschedule fix 2016-03-22 15:29:57 +05:30
Nazeer Hussain Shaik c1af84dd4b Merge branch 'FINERACT64' into develop 2016-03-22 14:59:41 +05:30
Nazeer Hussain Shaik dd736852f8 Merge branch 'FINERACT90' into develop 2016-03-22 14:13:15 +05:30
venkatconflux db367216a9 FINERACT-64 issues resolved 2016-03-21 18:19:05 +05:30
Adi Narayana Raju 2ddea0aaee Self Service - Loan Application 2016-03-21 17:32:19 +05:30
sachinkulkarni12 aad266def8 FINERACT-90:addind a new tranche to an active loan is changing the disbursement amount 2016-03-21 16:44:08 +05:30
sachinkulkarni12 04fe104dde adding global config for interest charged from date same as disbursement date 2016-03-15 18:06:24 +05:30
Nazeer Hussain Shaik bf6d0eaa5b Merge branch 'FINERACT68' into develop 2016-03-14 16:16:22 +05:30
sachinkulkarni12 8331deb9be FINERACT-68:Validating for first repayment date while center rescheduling 2016-03-14 14:54:20 +05:30
Nazeer Hussain Shaik 4d6488eb00 Merge branch 'FINERACT67' into develop 2016-03-14 14:49:42 +05:30
sachinkulkarni12 746d2a79f0 fix for undo last tranche if we change emi amount for second tranche 2016-03-14 11:34:53 +05:30
venkatconflux e3f0ecafc3 MIFOSX-2626 Resolved 2016-03-11 17:59:08 +05:30
Nazeer Hussain Shaik 7e9a7596c4 Chanrging the version 2016-03-09 17:25:43 +05:30
venkatconflux 6ecbd28121 payment type applicable for disbursement charge configuration added 2016-03-09 12:43:10 +05:30
Nazeer Hussain Shaik b786d459bc Merge branch 'FINERACT-59' into develop 2016-03-09 12:24:09 +05:30
Nazeer Hussain Shaik a6c9d3d3e2 Merge branch 'organizationstart' into develop 2016-03-09 12:12:21 +05:30
pramod 859c0affef FINERACT-59 : corrected interest calculation for flat loans 2016-03-07 17:15:56 +05:30
sachinkulkarni12 6e521f81ac fix for Junit test cases 2016-03-07 16:50:43 +05:30
pramod 37dfe1a0bf MIFOSX-2426 : added support for Interest Rate Charts based on Amount 2016-03-04 15:57:27 +05:30
Adi Narayana Raju 14499a26fb Merge branch 'repay' into develop 2016-03-04 11:14:54 +05:30
Adi Narayana Raju c1125cfdf3 Merge branch 'sql' into develop 2016-03-04 11:11:11 +05:30
sachinkulkarni12 fa02a3a712 fix for repayment info 2016-03-03 16:59:38 +05:30
Nazeer Hussain Shaik 1485dc9a87 Merge branch 'reschedule_center' into develop 2016-03-02 17:59:18 +05:30
sachinkulkarni12 a01c1e361f Center Rescheduling 2016-03-02 17:12:31 +05:30
sachinkulkarni12 0e0673e3ac insert script for organisation start date 2016-03-02 15:45:20 +05:30
Adi Narayana Raju 00e0ea6730 Correction in interest recalculation scheduler job to avoid infinite loop 2016-03-02 14:27:14 +05:30
sachinkulkarni12 79fe66e30d adding organisation start in global configuartion 2016-02-29 12:37:18 +05:30
Nazeer Hussain Shaik 8d160d3e7d Updating release notes 2016-02-24 12:06:01 +05:30
pramod 331e8e4dec MIFOSX-2516: fix for Floating rates with multi tranche loan 2016-02-23 14:29:02 +05:30
unknown 1be4d026cf Adding Notice.txt file 2016-02-17 19:18:24 +05:30
unknown 1c0e5502e0 moving driver info to a property file 2016-02-16 18:41:33 +05:30
unknown 9c27413cf1 License text missing error in application.properties 2016-02-16 18:16:47 +05:30
pramod b5dc6b2b5b corrected type while fethcing data from metadata 2016-02-16 12:21:30 +05:30
pramod a13a80794f MIFOSX-2400 : fix for overdue charges on payment time 2016-02-15 16:01:32 +05:30
unknown bb4799f583 mysql data type changes and provisiong update validation changes 2016-02-09 18:17:56 +05:30
unknown 06fd26b896 new date types newdecimal and longlong handling with drizzle connector 2016-02-08 14:11:19 +05:30
unknown 2a45fe1390 Connector changes from mysql to drizzle 2016-02-08 11:27:46 +05:30
Adi Narayana Raju 86ca062150 Migrate to Java 8 2016-02-02 12:16:02 +05:30
Adi Narayana Raju 5d7520d3e0 Merge branch 'adiLicense' into develop 2016-02-02 08:48:33 +05:30
Adi Narayana Raju ee2819b793 License text spill overs 2016-02-01 16:48:06 +05:30
pramod c9afea91fe removed Pentaho from validation and template 2016-02-01 16:19:46 +05:30
mage 5903a851f4 small edit to trigger mirror 2016-02-01 10:50:23 +01:00
mage 378330084c Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-fineract 2016-02-01 10:41:47 +01:00
mage 66cee7856b deleted initial code 2016-02-01 10:23:53 +01:00
Shaik Nazeer Hussain e409a4f17c Merge pull request #1616 from rajuan/fineractwithhistory
Changes for Apache Fineract
2016-02-01 13:42:16 +05:30
Adi Narayana Raju 7098d7f83d Modify file contents 2016-02-01 12:05:28 +05:30
Adi Narayana Raju a3b7a5c772 Delete unwanted files 2016-02-01 12:00:59 +05:30
Adi Narayana Raju 881cc41480 Rename filesnames containing mifos 2016-02-01 11:56:25 +05:30
Adi Narayana Raju 494ba87c4c Rename java root packages 2016-02-01 11:34:52 +05:30
Adi Narayana Raju 139e066d3d Rename root folders 2016-02-01 11:00:15 +05:30
mage 4b1ec9ef54 initial code push 2016-01-28 06:45:31 +01:00
pramod c5b56dae8f Report related changes 2016-01-25 17:22:30 +05:30
Adi Narayana Raju 97587d9019 Updating release notes for 16.01.2.RELEASE 2016-01-20 18:28:14 +05:30
pramod 104aa3a14f Merge pull request #1614 from venkatconflux/MIFOSX-2481
MIFOSX-2481 : Adding Tranche - Branch Closure Issue Resolved
2016-01-20 16:52:17 +05:30
venkatconflux 2ae4f02414 MIFOSX-2481 adding tranche - branch closure issue resolved 2016-01-20 16:41:54 +05:30
Adi Narayana Raju 02a1681784 Merge pull request #1612 from pramodn02/MIFOSX-2390
MIFOSX-2390 : fixed prepay loan with installment charges & junit fixes
2016-01-20 16:27:24 +05:30
pramod 10fd3f8978 junit test case fixes 2016-01-20 16:04:32 +05:30
pramod 4caeecfeb9 MIFOSX-2390 : fixed prepay loan with installment charges 2016-01-20 16:04:31 +05:30
Adi Narayana Raju f6f5af5c07 Merge pull request #1611 from nazeer1100126/SharesAndDividends
Shares and dividends
2016-01-20 16:01:01 +05:30
unknown b57db81a66 Shares and Dividends Mockup API implementation 2016-01-20 15:54:36 +05:30
unknown b4d9c88ba4 Share and dividends implementation 2016-01-20 15:53:00 +05:30
Adi Narayana Raju 7e6fcede85 Merge pull request #1610 from sangameshn/patch-11
Update INSTALL.md
2016-01-20 14:42:09 +05:30
sangameshn 7c1d9e5a7a Update INSTALL.md 2016-01-20 14:36:23 +05:30
Adi Narayana Raju 3cf5c5dffa Merge pull request #1608 from deepak7conflux/clientNonPersonFeature
Added Client as Entity feature
2016-01-20 14:22:21 +05:30
deepak7conflux 843b5ec04b Added Client as Entity feature 2016-01-20 10:16:51 +05:30
Adi Narayana Raju fcc597a2bf Merge pull request #1605 from venkatconflux/OverdraftInterest
Added Overdraft Interest Feature
2016-01-20 10:02:58 +05:30
Adi Narayana Raju 7ef1de1431 Merge pull request #1606 from pramodn02/MIFOSX-2441
MIFOSX-2441: fix for prepay loan on the same day
2016-01-20 09:59:56 +05:30
pramod c7369fda96 MIFOSX-2441: fix for prepay loan on the same day 2016-01-20 09:47:25 +05:30
pramod dc949d5386 Merge pull request #1603 from rajuan/MIFOSX-2435
MIFOSX-2435 : Differentiate between charges and penalty
2016-01-20 09:45:49 +05:30
venkatconflux 4aa8cc9892 Added Overdraft Interest Feature 2016-01-19 20:41:12 +05:30
Adi Narayana Raju 51341532e1 MIFOSX-2435 : Differentiate between charges and penalty 2016-01-19 16:18:24 +05:30
pramod 866cd25d9a Merge pull request #1600 from sachinkulkarni12/CC-36-New
Loan Repayment Rescheduling while disbursement
2016-01-18 12:08:33 +05:30
pramod 2eafc13604 Merge pull request #1599 from sachinkulkarni12/CC-57
Interest recalculation scheduler job enhancement
2016-01-18 12:06:59 +05:30
sachinkulkarni12 72bd70243a Loan Repayment Rescheduling while disbursement 2016-01-14 18:34:36 +05:30
sachinkulkarni12 2c98046961 Interest recalculation scheduler job enhancement 2016-01-14 17:09:16 +05:30
Markus Geiß 787bad8179 Merge pull request #1597 from mgeiss/MIFSX-SPM-5
Mifsx spm 5
2016-01-14 12:03:01 +01:00
mage b5c355c3c3 added additional files 2016-01-14 11:59:56 +01:00
mage 265a6c4b42 changed scorecard from staff to appuser 2016-01-14 11:55:09 +01:00
Shaik Nazeer Hussain 34fe42cd16 Merge pull request #1596 from pramodn02/variableInstallment
Added installment amount for period in schedule data
2016-01-14 16:07:04 +05:30
pramod 0b19ddff32 Added installment amount for period in schedule data 2016-01-14 15:39:54 +05:30
Shaik Nazeer Hussain 6fd2141945 Merge pull request #1595 from rajuan/FloatingRatesOrdering
Determine base lending rate correctly based on the order of rate periods
2016-01-14 15:11:42 +05:30
Adi Narayana Raju 1b04614f42 Determine base lending rate correctly based on the order of rate periods 2016-01-14 15:05:27 +05:30
Vishwas Babu A J 47974cfa43 Update INSTALL.md
One click installer does not work
2016-01-13 18:52:30 -08:00
Shaik Nazeer Hussain 3ace65d493 Merge pull request #1592 from rajuan/FixFloatingRatesPeriodsOrder
Fixing ordering of Rate periods while retrieving floating rate data
2016-01-13 17:35:30 +05:30
Adi Narayana Raju 0d3338ab16 Fixing ordering of Rate periods while retrieving floating rate data 2016-01-13 17:31:42 +05:30
Adi Narayana Raju b4f61c5ed0 Merge pull request #1591 from pramodn02/preclosefix
MIFOSX-2437: fix for prepay of loan
2016-01-13 15:49:40 +05:30
pramod 7c45056f88 MIFOSX-2437: fix for prepay of loan 2016-01-13 15:27:50 +05:30
Markus Geiß e965ea78d0 Merge pull request #1589 from mgeiss/MIFOSX-SPM-4
eased survey handling for scorecard
2016-01-13 08:35:06 +01:00
mage 548eb1a110 eased survey handling for scorecard 2016-01-13 08:33:42 +01:00
unknown ecb2c93334 Updating release notes for 16.01.1.RELEASE 2016-01-12 18:26:42 +05:30
Shaik Nazeer Hussain 1bfeb384df Merge pull request #1585 from pramodn02/variableinstalmentchanges
Partial periods interest calculation & variable installment junits
2016-01-11 16:17:28 +05:30
pramod bb6e3b4537 MIFOSX-2434 : junit test cases for variable instalments 2016-01-11 16:13:17 +05:30
pramod 96ea36b101 MIFOSX-2419 : added flag to consider partial periods while interest calculation 2016-01-11 14:40:43 +05:30
Shaik Nazeer Hussain 73f3df5229 Merge pull request #1582 from mgeiss/MIFOSX-SPM-3
retrofitted SPM API to ease the usage
2016-01-07 23:02:27 +05:30
pramod b19a5764b9 Merge pull request #1583 from sachinkulkarni12/CC-32New
CC-32: undo last tranche disbursal feature
2016-01-06 16:44:38 +05:30
sachinkulkarni12 63751ceb8c CC-32: undo last tranche disbursal feature 2016-01-05 12:06:42 +05:30
mage c7cc9b205f retrofitted SPM API to ease the usage 2016-01-04 16:31:51 +01:00
Adi Narayana Raju 0492b2a10b Merge pull request #1580 from pramodn02/variableinstalmentchanges
MIFOSX-2358:fix for last installment overdue charge
2015-12-29 14:06:58 +05:30
pramod 9901fc0d3f added support to accept interest charged from before disburse date 2015-12-29 10:21:32 +05:30
Roman Shaposhnik 453d50a4df Repo init 2015-12-25 12:13:16 -08:00
pramod 09df00c078 MIFOSX-2358:fix for last installment overdue charge 2015-12-24 17:34:42 +05:30
pramod 0e2fba6427 Merge pull request #1579 from sachinkulkarni12/CC-38_new
CC-38:adding client account no in client data
2015-12-24 17:32:58 +05:30
sachinkulkarni12 2f29a77f02 CC-38:adding client account no in client data 2015-12-24 17:22:49 +05:30
pramod a425a9605f Merge pull request #1567 from sachinkulkarni12/CC-42
CC-42:adding new transaction date in collection sheet
2015-12-24 17:00:58 +05:30
pramod 21aca2863b Merge pull request #1570 from sachinkulkarni12/CC-61
CC-61:validate holiday only once while doing repayment through collection sheet.
2015-12-24 16:59:41 +05:30
pramod c32ad6d07d Merge pull request #1578 from sachinkulkarni12/CC-48
CC-48:enabling code values based on active or inactive status
2015-12-24 16:59:04 +05:30
sachinkulkarni12 23ff03b0c2 CC-48:enabling code values based on active or inactive status 2015-12-24 15:28:54 +05:30
pramod 5a356f9d3f Merge pull request #1577 from nazeer1100126/provisioningintegrationtests
Provisioning Integration Tests
2015-12-24 14:00:36 +05:30
unknown 795bd4932c Provisioning Integration Tests 2015-12-24 13:29:57 +05:30
Adi Narayana Raju a17d5ab9df Merge pull request #1574 from pramodn02/variableinstalmentchanges
interest calculation fix for months with partial period
2015-12-23 09:19:40 +05:30
pramod 1d56e8062b interest calculation fix for months with partial period 2015-12-23 09:14:29 +05:30
pramod 782160c912 Merge pull request #1572 from rajuan/MIFOSX-2207
MIFOSX-2207 : Fixed outstanding balance calculation to exclude transfer transactions
2015-12-22 14:05:35 +05:30
Adi Narayana Raju c2744eafea MIFOSX-2207 : Fixed outstanding balance calculation to exclude transfer transactions 2015-12-22 13:07:25 +05:30
Adi Narayana Raju a5e915d456 Merge pull request #1571 from pramodn02/variableinstalmentchanges
MIFOSX-579:variable installment feature
2015-12-21 17:23:06 +05:30
pramod b46b14acd3 MIFOSX-579:variable installment feature 2015-12-21 17:18:16 +05:30
sachinkulkarni12 6a78b6eae1 CC-61:validate holiday only once while doing repayment through collection sheet 2015-12-21 16:41:55 +05:30
sachinkulkarni12 877ef133a3 CC-42:adding new transaction date in collection sheet 2015-12-21 13:21:47 +05:30
Adi Narayana Raju 3f45a904b1 Update release notes for 15.12.2.RELEASE 2015-12-17 10:32:01 +05:30
pramod b1ac9aef95 Merge pull request #1563 from rajuan/CustomerSelfService
Customer Self Service API Phase 1
2015-12-17 09:24:57 +05:30
pramod 70e7aa5847 Merge pull request #1565 from dtsuran/MIFOSX-2388
MIFOSX-2388: Frequency type isn't loaded during modifying loan application
2015-12-17 09:05:15 +05:30
Tsuran D.V b79090806c MIFOSX-2388: Frequency type isn't loaded during modifying loan application 2015-12-16 18:26:09 +02:00
Adi Narayana Raju 196d19d87a Customer Self Service API Phase 1 2015-12-16 17:38:52 +05:30
pramod 65b767c31d Merge pull request #1560 from minerals/mifosx-2384
MIFOSX-2384 - Fix incorrect total in repayment schedule
2015-12-16 10:04:21 +05:30
pramod e00f40f2bd Merge pull request #1558 from Musoni/MIFOSX-2371
MIFOSX-2371 fixed days in year issue
2015-12-16 10:03:11 +05:30
Adi Narayana Raju 6961d3e97c Merge pull request #1562 from mgeiss/MIFOSX-SPM-2
changed fetch type, edited API docs
2015-12-16 09:20:47 +05:30
pramod 15c204e4db Merge pull request #1561 from dtsuran/MIFOSX-2385
MIFOSX-2385: When request data of floating rate, server side send JSON data with locale specific format of date
2015-12-16 08:47:52 +05:30
Markus Geiss 4444a8a0e9 changed fetch type, edited API docs 2015-12-14 10:22:59 +01:00
Tsuran D.V be252fb91c MIFOSX-2385: When request data of floating rate, server side send JSON data with locale specific format of date 2015-12-12 14:43:45 +02:00
Arvind Sujeeth 5c4f5fcbd7 MIFOSX-2384 - Fix incorrect total in repayment schedule
Issue occurs when a non-disbursement charge is used.
2015-12-09 21:19:35 -08:00
andrew-dzak 5384067737 MIFOSX-2371 fixed days in year issue 2015-12-04 21:32:31 +01:00
pramod c50a45b2c8 Merge pull request #1556 from minerals/mifosx-2372
MIFOSX-2372 fix incorrect charge in ScheduledJobRunner
2015-12-04 14:50:38 +05:30
Arvind Sujeeth e13d0e7339 MIFOSX-2372 fix incorrect charge in ScheduledJobRunner 2015-12-03 14:27:05 -08:00
Adi Narayana Raju 2c0e98ac75 Merge branch 'develop' 2015-12-02 16:24:53 +05:30
Adi Narayana Raju 59dbdad628 Update release notes for 15.12.1.RELEASE 2015-12-02 16:23:26 +05:30
Adi Narayana Raju b981233015 Correcting sql file version 2015-12-02 12:12:11 +05:30
pramod 954f513ca3 Merge pull request #1552 from Musoni/MIFOSX-2184
MIFOSX-2184 - Add ability to disable backdating of penalties
2015-12-02 11:32:15 +05:30
Adi Narayana Raju 5cff3a9fea Merge pull request #1553 from mgeiss/MIFOSX-SPM
initial push for spm framework
2015-12-02 11:28:44 +05:30
pramod 64ab498c9f Merge pull request #1546 from theupscale/template
Reverted Back to basicAuth MIFOSX-2322
2015-12-02 11:23:54 +05:30
Adi Narayana Raju 2d214fd6d0 Merge pull request #1554 from nazeer1100126/MIFOSX-2368
Issue MIFOSX-2368 for last installment amount for equal principal pay…
2015-11-30 15:22:52 +05:30
unknown c241c295cc Issue MIFOSX-2368 for last installment amount for equal principal payment Loan 2015-11-30 15:14:40 +05:30
Markus Geiss f98b4e3fa9 initial push for spm framework 2015-11-27 10:10:04 +01:00
Sander van der Heijden 883ca09346 MIFOSX-2184 - Add ability to disable backdating of penalties 2015-11-26 16:12:09 +01:00
Adi Narayana Raju 3cdf64fa16 Merge pull request #1550 from pramodn02/MIFOSX-2363
MIFOSX-2363 : isFirstRepayment set to false  for partial updates
2015-11-24 12:54:21 +05:30
pramod 4a99634a25 MIFOSX-2363 : isFirstRepayment set to false for partial updates 2015-11-24 12:36:00 +05:30
pramod feda68209f Merge pull request #1549 from nazeer1100126/MIFOSX-2313_Provisioning
MIFOSX-2313 Loan provisioning entries not getting created for multi t…
2015-11-19 15:50:37 +05:30
unknown e29e43b80b MIFOSX-2313 Loan provisioning entries not getting created for multi tranche loans 2015-11-19 15:44:12 +05:30
pramod 55958b50d2 Merge pull request #1545 from Musoni/MIFOSX-2348
MIFOSX-2348 fixed Insufficient account balance due to guarantors fun…
2015-11-19 12:55:33 +05:30
Adi Narayana Raju 8e6715992f Merge pull request #1548 from sangameshn/patch-5
Update INSTALL.md
2015-11-19 09:21:57 +05:30
sangameshn 00759619f5 Update INSTALL.md 2015-11-18 18:40:11 +05:30
Adi Narayana Raju 2686988954 Update release notes for 15.11.2.RELEASE 2015-11-18 16:27:04 +05:30
Shaik Nazeer Hussain f58bc239ab Merge pull request #1547 from rajuan/FRBug
Consider disbursement date during floating rate read for a loan
2015-11-18 14:47:04 +05:30
Adi Narayana Raju a8cf131ccf Consider disbursement date during floating rate read for a loan 2015-11-18 14:41:25 +05:30
Maek Twain 95c2921ff0 Reverted Back to basicauth 2015-11-17 15:33:07 +05:30
andrew-dzak 9e4cb99853 MIFOSX-2348 fixed Insufficient account balance due to guarantors funds onhold 2015-11-17 09:35:58 +01:00
Maek Twain b52e3bc233 Template ERROR bug 2015-11-16 20:56:11 +05:30
Shaik Nazeer Hussain 7ba9545dd1 Merge pull request #1543 from rajuan/MIFOSX-2350
MIFOSX-2350 : Added additional validations
2015-11-16 13:27:22 +05:30
Adi Narayana Raju a9912c5cb8 MIFOSX-2350 : Added additional validations 2015-11-16 13:20:40 +05:30
pramod 82242a0fb0 Merge pull request #1541 from rajuan/FloatingRates
Floating Rates Feature
2015-11-10 16:46:55 +05:30
Adi Narayana Raju c60f148856 Floating Rates Feature 2015-11-10 15:25:08 +05:30
Adi Narayana Raju 5567319d2f Merge pull request #1537 from pramodn02/MIFOSX-2328
MIFOSX-2328 : added call to update maturity date on approval
2015-11-05 16:15:42 +05:30
pramod 3685c2868e MIFOSX-2328 : added call to update maturity date on approval 2015-11-05 16:06:57 +05:30
Adi Narayana Raju 55b1c8c97b Update Release notes for 15.11.1.RELEASE 2015-11-04 17:19:06 +05:30
pramod 1333e79c30 Merge pull request #1534 from Musoni/MIFOSX-2334
Mifosx-2334 meltdown in advanced accounting...sum of all charges is no…
2015-11-04 15:54:08 +05:30
pramod 0b34ee8068 Merge pull request #1535 from Musoni/MIFOSX-2335
MIFOSX-2335 fix removing a charge on a recalculateLoanSchedule
2015-11-04 15:49:53 +05:30
andrew-dzak 5503d5a22f MIFOSX-2335 fix removing a charge on a recalculateLoanSchedule 2015-11-03 11:14:03 +01:00
andrew-dzak e5078f9bac Mifosx-2334 eltdown in advanced accounting...sum of all charges is not equal to the fee charge for a transaction fix 2015-11-03 10:54:06 +01:00
Adi Narayana Raju dcce0e6a92 Merge pull request #1530 from nazeer1100126/MIFOSX-2303-Provisioning
MIFOSX-2303 Add Product/Branch/Category filtering to Loan Provisionin…
2015-11-02 11:08:16 +05:30
unknown 6ae5d7d52d MIFOSX-2303 Add Product/Branch/Category filtering to Loan Provisioning report 2015-10-29 18:20:19 +05:30
Adi Narayana Raju e61a5fba03 Merge pull request #1529 from nazeer1100126/MIFOSX-2045_RepaymentStrategy
MIFOSX-2045 Clarify New Loan Repayment Strategy Wording
2015-10-29 11:28:03 +05:30
unknown dd472c4bbc MIFOSX-2045 Clarify New Loan Repayment Strategy Wording 2015-10-29 11:22:58 +05:30
Adi Narayana Raju 51d3ff7b8b Merge pull request #1528 from nazeer1100126/provision
MIFOSX-2314 MIFOSX-2313 All Provisioning Critical Issues
2015-10-29 10:02:45 +05:30
Adi Narayana Raju 5a0fa8940a Merge pull request #1527 from nazeer1100126/MIFOSX-2045_RepaymentStrategy
MIFOSX-2045 Clarify New Loan Repayment Strategy Wording
2015-10-29 10:02:30 +05:30
Adi Narayana Raju 2108a2fb4d Merge pull request #1526 from pramodn02/MIFOSX-2320
MIFOSX-2320 : Moved stop processing check as first statement
2015-10-29 10:02:17 +05:30
Adi Narayana Raju b37fb4a2e8 Merge pull request #1520 from msiegel07/patch-1
Update INSTALL.md
2015-10-29 10:02:06 +05:30
unknown 88d7d05893 MIFOSX-2314 MIFOSX-2313 All Provisioning Critical Issues 2015-10-28 15:25:44 +05:30
unknown 8cc65d676e MIFOSX-2045 Clarify New Loan Repayment Strategy Wording 2015-10-28 13:58:58 +05:30
pramod af089f06e4 MIFOSX-2320 : Moved stop processing check as first statement 2015-10-28 11:01:24 +05:30
Adi Narayana Raju bbc89ebbd1 Update release notes for 15.10.2.RELEASE 2015-10-21 12:05:39 +05:30
Adi Narayana Raju 74b2c2567e Merge pull request #1525 from nazeer1100126/provision
MIFOSX-2307 Provisioning entries are not generated if tenant have gro…
2015-10-21 11:59:01 +05:30
unknown e19835ce46 MIFOSX-2307 Provisioning entries are not generated if tenant have group loans 2015-10-21 11:53:43 +05:30
Adi Narayana Raju 5bbe8dd192 Fixing 277 SQL 2015-10-20 20:52:44 +05:30
Adi Narayana Raju e09a94cdf5 Update release notes for 15.10.1.RELEASE 2015-10-20 20:06:21 +05:30
Adi Narayana Raju f5f8fa50a5 Merge pull request #1524 from nazeer1100126/provision
MIFOSX-2200 Adding Provisioning Implementation
2015-10-20 19:48:56 +05:30
unknown 7fabfa5cb9 MIFOSX-2200 Adding Provisioning Implementation 2015-10-20 19:42:47 +05:30
pramod 5deba1c71a Merge pull request #1522 from LisaBennett/develop2
Validation changes when setting staff to inactive.
2015-10-15 11:27:22 +05:30
LisaBennett 25ddb88db9 Validation changes when setting staff to inactive. 2015-10-14 09:41:22 -04:00
msiegel07 f4fdc64bc2 Update INSTALL.md
Update database set up for running a database on another host
2015-10-12 13:08:06 -04:00
pramod 1f0ce4670e Merge pull request #1519 from sachinkulkarni12/MIFOSX-2289
MIFOSX-2289:fix for Journal Entry not created for new transaction when recalculate interest batch job is ran
2015-10-12 16:00:46 +05:30
sachinkulkarni12 7710058690 MIFOSX-2289:fix for Journal Entry not created for new transaction when recalculate interest batch job is ran 2015-10-12 15:10:26 +05:30
Adi Narayana Raju 75178272b9 Merge pull request #1517 from pramodn02/MIFOSX-2228
MIFOSX-2228 : changed the order of calculating outstanding for multidisburse loan
2015-10-12 12:27:18 +05:30
pramod 0f65d4dd27 MIFOSX-2228 : changed the order of calculating outstanding for multi disburse loan 2015-10-12 11:21:55 +05:30
pramod c35d4b8a9a Merge pull request #1496 from sangameshn/patch-4
Update INSTALL.md
2015-10-09 15:09:47 +05:30
Adi Narayana Raju 49b65827ba Merge pull request #1516 from pramodn02/MIFOSX-2228
MIFOSX-2228 : added recalcualte from date flexibility for interest recalculation
2015-10-09 15:07:16 +05:30
pramod 5b78a2ace9 Merge pull request #1498 from prasadpatill2/jira-cc-18
Implemented Loan purpose display
2015-10-09 11:09:36 +05:30
pramod 1c17e73ec2 MIFOSX-2228 : added recalcualte from date flexibility for interest recalculation 2015-10-08 15:51:15 +05:30
pramod b732fca525 Merge pull request #1513 from Musoni/MIFOSX-2271
MIFOSX-2271 done
2015-09-24 09:57:38 +05:30
andrew-dzak 093a9844c6 MIFOSX-2271 done 2015-09-23 16:14:45 +02:00
Adi Narayana Raju 2100fc806f Updates release versions for 15.09.4.RELEASE 2015-09-21 20:36:38 +05:30
Adi Narayana Raju cd17e609cb Merge pull request #1511 from nazeer1100126/DisablingReschedule
MIFOSX-2258
2015-09-21 19:43:59 +05:30
unknown f51ebeb967 MIFOSX-2258 2015-09-21 19:38:20 +05:30
pramod d9c6ddbeca Merge pull request #1509 from nazeer1100126/develop_chargesIssue
MIFOSX-2240
2015-09-21 18:52:29 +05:30
unknown c3607f19a0 MIFOSX-2240 2015-09-21 17:40:00 +05:30
Adi Narayana Raju 6e2d6c2242 Merge pull request #1505 from pramodn02/develop
MIFOSX-2227 : added mapping between Loan transaction and repayment schedule
2015-09-21 12:46:20 +05:30
pramod 72dcd866fa Merge pull request #1508 from rajuan/MIFOSX-2259
MIFOSX-2259 : Added parameter validation
2015-09-21 10:04:33 +05:30
Adi Narayana Raju d255f7b3ef MIFOSX-2259 : Added parameter validation 2015-09-21 09:05:25 +05:30
pramod 0cb619fa80 MIFOSX-2227 : added mapping between Loan transaction and repayment schedule 2015-09-18 16:23:52 +05:30
Adi Raju 6914b1ee93 Update sample data sql 2015-09-15 18:13:35 +05:30
Adi Raju 2fb9fc0575 Updating release versions 2015-09-15 18:02:48 +05:30
Adi Narayana Raju 132e869315 Update CHANGELOG.md 2015-09-15 17:33:27 +05:30
pramod 2124d1bcbb Merge pull request #1504 from nazeer1100126/Mifosx_1523_-_Loan_Rescheduling
Mifosx 1523   loan rescheduling
2015-09-15 16:55:01 +05:30
unknown 97a499b071 Mifosx 1523 loan rescheduling 2015-09-15 16:50:32 +05:30
unknown e6def2a988 Mifosx 1523 loan rescheduling 2015-09-15 16:38:09 +05:30
pramod 326dca1e41 Merge pull request #1502 from nazeer1100126/Mifosx_1523_-_Loan_Rescheduling
Mifosx 1523   loan rescheduling
2015-09-15 13:20:36 +05:30
unknown f094d13058 Mifosx 1523 - Loan Rescheduling modification 2015-09-15 12:37:18 +05:30
unknown 928dbccfc4 Mifosx 1523 - Loan Rescheduling modification 2015-09-15 11:57:52 +05:30
unknown 75df514526 Mifosx 1523 - Loan Rescheduling modification 2015-09-15 11:53:44 +05:30
unknown 9f0020d8de MIFOSX-1923 Adding Tranche Disbursement Implementation 2015-09-14 18:02:33 +05:30
unknown dfa51dd7b3 MIFOSX-1523 Loan Rescheduling 2015-09-14 17:40:12 +05:30
pramod 88685e1f0b Merge pull request #1497 from pramodn02/develop
MIFOSX-2209 : corrected refund transaction reversals on adjust transaction
2015-09-14 13:09:16 +05:30
Pramod Nuthakki b9e60c0acf Implemented Loan purpose display 2015-09-14 13:02:39 +05:30
pramod d112f4a79d MIFOSX-2209 : corrected refund transaction reversals on adjust transaction 2015-09-14 10:14:09 +05:30
sangameshn 9626995b9f Update INSTALL.md 2015-09-14 09:21:49 +05:30
Vishwas Babu A J a9a5e735da Merge pull request #1494 from pramodn02/develop
MIFOSX-2123 : added fix to change the principal amount
2015-09-11 15:32:15 +05:30
pramod ac70343a04 MIFOSX-2123 : added fix to change the principal amount 2015-09-11 14:50:02 +05:30
Vishwas Babu A J 30f7e7022f Update CHANGELOG.md
with details of 15.09.2 release
2015-09-09 14:00:36 +05:30
Vishwas Babu A J 2348c4d78e updating properties for 15.09.02 release 2015-09-09 13:48:13 +05:30
Vishwas Babu A J d33d34a7b5 Merge branch 'MIFOSX-1746' of https://github.com/rajuan/mifosx into rajuan-MIFOSX-1746 2015-09-09 12:58:53 +05:30
Vishwas Babu A J dedae5dd97 Merge pull request #1493 from pramodn02/develop
MIFOSX-2199 : column name corrected in the query
2015-09-09 12:54:25 +05:30
pramod d52809fd1f MIFOSX-2199 : column name corrected in the query 2015-09-09 12:48:11 +05:30
Vishwas Babu A J dbfbe7d016 updating release properties 2015-09-08 18:02:13 +05:30
Vishwas Babu A J 923fbba14b Update CHANGELOG.md
with details for 15.09.1.release
2015-09-08 17:56:50 +05:30
Vishwas Babu A J 33d4a48be5 MIFOSX-2195 2015-09-08 17:27:24 +05:30
Adi Raju c9767e76d7 MIFOSX-1746: Add support for Oauth2 and make it build time configurable 2015-09-08 11:42:34 +05:30
Vishwas Babu A J 07f8812957 fixing transaction scope for client charges deletion 2015-09-06 21:44:01 +05:30
Vishwas Babu A J b7b6e39c42 updating release properties and sample data 2015-09-06 21:02:10 +05:30
Vishwas Babu A J 8f1eb39d5d MIFOSX-2049 and fix failing test cases 2015-09-06 00:04:35 +05:30
Vishwas Babu A J 66ce3b4873 Client fees and MIFOSX-2169 2015-09-05 01:49:11 +05:30
VenuShyam 670b6eef19 Review comments addressed 2015-09-03 19:51:07 +05:30
Vishwas Babu A J 5a990af553 Update CHANGELOG.md
with release notes
2015-09-03 17:37:06 +05:30
Vishwas Babu A J 73cd56c491 Merge pull request #1421 from chandrikamohith/MIFOSX-1578
MIFOSX-1578 submitted/approved loan status clients are no more displa…
2015-09-02 17:15:12 +05:30
Vishwas Babu A J 342c056ee9 Merge pull request #1427 from chandrikamohith/newMIFOSX-1775
MIFOSX-1775 Adding validation to not allow edit meeting date at group…
2015-09-02 17:08:37 +05:30
Vishwas Babu A J 63cca6be42 Merge pull request #1480 from shahrahul1985/MIFOSX-2157
MIFOSX-2157: Fxing the UI Issue
2015-09-02 17:01:55 +05:30
Vishwas Babu A J c181b67afa adding licence files 2015-09-02 16:57:04 +05:30
shahrahul1985 d226ea59ad MIFOSX-2157: Fxing the UI Issue 2015-09-02 16:54:02 +05:30
Vishwas Babu A J 99318bdba5 merging chandrika's pull request for test cases 2015-09-02 16:53:55 +05:30
Vishwas Babu A J b217b95a18 MIFOSX-1573 2015-09-02 15:49:06 +05:30
Vishwas Babu A J 59d4515c61 Merge pull request #1479 from prasadpatill2/jire-2015and2013
Jira issues 2015 and 2013 are resolved
2015-09-02 15:40:56 +05:30
Pramod Nuthakki 2a7ab8cf18 2015 and 2013 jira issues resolved 2015-09-02 15:30:12 +05:30
Vishwas Babu A J 5b4ca41eb3 merging MIFOSX-1923 2015-09-01 22:25:42 +05:30
Vishwas Babu A J 532506608f bug fixes for client charges 2015-09-01 06:11:12 +05:30
Vishwas Babu A J 2a7c4919db updating release properties 2015-09-01 04:27:19 +05:30
Vishwas Babu A J 4bf6eb186c MIFOSX-2180 2015-09-01 04:25:47 +05:30
Vishwas Babu A J a4cee3b1d0 Merge branch 'client-fees' into develop 2015-09-01 04:22:35 +05:30
Vishwas Babu A J 56fe13852d MIFOSX-2180 2015-09-01 04:19:55 +05:30
Vishwas Babu A J 879f3082ba client charges:adding accounting 2015-09-01 03:28:31 +05:30
unknown 971e23e8b7 MIFOSX-1923 Adding Tranche Disbursement Implementation 2015-08-31 19:51:33 +05:30
keshav10andpramod da5663f15c MIFOSX-2039 2015-08-27 15:12:04 +05:30
pramod 87adf49f44 MIFOSX-2038 : cleanup 2015-08-27 15:04:40 +05:30
keshav10andpramod 80f122446a MIFOSX-2038 2015-08-27 14:42:33 +05:30
pramod 2d9fc6dca4 Merge pull request #1402 from chandrikamohith/MIFOSX-2049
MIFOSX-2049 Able to withdraw from savings account when overdraft limi…
2015-08-27 11:35:20 +05:30
pramod 21cc6e946d Merge pull request #1413 from chandrikamohith/MIFOSX-1881Review
MIFOSX-1881 Breadcrumb issue is resolved.Able to navigate to the resp…
2015-08-27 10:20:37 +05:30
pramod f495723c76 MIFOSX-2148 : fixed junit test case 2015-08-26 19:36:31 +05:30
pramod ded3006f74 MIFOSX-2148 : fixed junit test case 2015-08-26 18:22:24 +05:30
pramod 14eb1c0b72 MIFOSX-2148 : cleanup 2015-08-26 16:25:44 +05:30
shahrahul1985andpramod fd5ef09360 MIFOSX-2148: Make Rounding Mode as configurable throughout Mifos 2015-08-26 16:25:43 +05:30
Vishwas Babu A J f0252a1747 Merge pull request #1472 from pramodn02/performanceissues
MIFOSX-2168 : changed transaction scope
2015-08-26 14:24:55 +05:30
pramod ed68b0676d MIFOSX-2168 : changed transaction scope 2015-08-26 14:19:49 +05:30
Vishwas Babu A J 293787f913 Merge pull request #1471 from pramodn02/performanceissues
MIFOSX-2166: changed transaction scope to loan level instead of repay…
2015-08-25 17:16:36 +05:30
pramod 5f7c005b49 MIFOSX-2166: changed transaction scope to loan level instead of repayment schedule level 2015-08-25 15:02:01 +05:30
Vishwas Babu A J 3ff52f902a Merge pull request #1468 from pramodn02/performanceissues
MIFOSX-2163 : added transaction scope at loan level
2015-08-25 14:20:35 +05:30
Vishwas Babu A J a76b60f7c0 Merge pull request #1470 from pramodn02/MIFOSX-2165
MIFOSX-2165 : Calendar title column length increased to 70
2015-08-25 13:59:23 +05:30
pramod 08e22737eb MIFOSX-2165 : Calendar title column length increased to 70 2015-08-25 13:37:32 +05:30
pramod 6628b227a7 MIFOSX-2163 : added transaction scope at loan level 2015-08-25 11:41:55 +05:30
Vishwas Babu A J 6716a5a00a bumping up sql patch 2015-08-24 17:48:52 +05:30
Vishwas Babu A J 5a1ebfe768 Merge branch 'MIFOSX-2117' of https://github.com/shahrahul1985/mifosx into shahrahul1985-MIFOSX-2117 2015-08-24 17:48:06 +05:30
Vishwas Babu A J 80bfc5e811 trivial updates to sql patch v4 2015-08-24 17:46:21 +05:30
shahrahul1985 840fd4c0a7 MIFOSX-2117: Unable to create user - with auto email generate password option 2015-08-19 16:08:45 +05:30
Chandrika b359db2ac9 MIFOSX-1775 Adding validation to not allow edit meeting date at group level,if meeting is created by center. 2015-06-18 10:21:51 -04:00
Chandrika 57344f9137 MIFOSX-1578 submitted/approved loan status clients are no more displayed.Able to save the collection sheet now. 2015-06-17 16:59:01 -04:00
Chandrika 00ba422705 MIFOSX-1881 Breadcrumb issue is resolved.Able to navigate to the respective center/group.Group Level has been fetched for this case. 2015-06-09 12:07:03 -04:00
Chandrika b89daf38a8 MIFOSX-2049 Able to withdraw from savings account when overdraft limit is not defined in savings product. 2015-06-01 20:47:43 -04:00
5078 changed files with 270264 additions and 149519 deletions
-20
View File
@@ -1,24 +1,4 @@
bin
build
repos
.classpath
.project
.settings
.gradle
.idea
*.log
*.class
*.jar
*.war
*.ear
*.bak
*.iml
*.ipr
*.iws
rebel.xml
*.sublime-workspace
*.DS_Store
*.ini
*.gradletasknamecache
*~
.metadata
-4
View File
@@ -1,4 +0,0 @@
[submodule "apps/community-app"]
path = apps/community-app
url = https://github.com/openMF/community-app.git
branch = develop
BIN
View File
Binary file not shown.
-20
View File
@@ -1,20 +0,0 @@
# This (sudo: false) is needed to "run on container-based infrastructure" on which cache: is available
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: false
language: java
jdk:
- openjdk7
script: ./travis_build.sh
notifications:
email: true
# This is so that the Gradle output is readable on the Travis web console
# @see http://stackoverflow.com/questions/17942819/how-can-i-get-clean-gradle-output-on-travis-ci
# @see http://gradle.1045684.n5.nabble.com/Plain-console-output-td5710237.html
env:
- TERM=dumb
# http://docs.travis-ci.com/user/caching/#Arbitrary-directories
cache:
apt: true
directories:
- $HOME/.gradle
- $HOME/.m2
+1 -1644
View File
File diff suppressed because it is too large Load Diff
-6
View File
@@ -1,6 +0,0 @@
Contributors
=====
List of code contributors on the mifosplatform codebase (mifosx) can be viewed @ https://github.com/openMF/mifosx/contributors
List of code contributors on applications built on mifosplatform such as the reference app (IndividualLendingJavascript) can be viewed @ https://github.com/openMF/mifosx-community-apps/contributors
-26
View File
@@ -1,26 +0,0 @@
# Getting started with Mifos X
Instructions for getting started are located at https://mifosforge.jira.com/wiki/display/MIFOSX/Getting+started+-+Contributing+to+MifosX
# Pull Request Checklist
Before sending out a pull request, please ensure that the following pre-requisites are taken care of
1. API documentation has been updated to reflect any changes made to the API (new API's, adding new Fields or Options to existing API etc)
1. Any relevant database changes are encapsulated in an SQL file with the next avilable version number at https://github.com/openMF/mifosx/tree/develop/mifosng-provider/src/main/resources/sql/migrations/core_db. These patches are automatically applied by Flyway on server startup.
For any modifications to the schema which affects data on existing installations (Ex: moving columns to new table etc), ensure that the upgrade scripts are also accompanied by data migration scripts in the same patch file
1. An integration test is added/updated to test the new feature developed/bug-fix being made
1. The pull request has a Jira issue associated with it. Details for creating issues on Jira are located at https://mifosforge.jira.com/wiki/display/MIFOSX/Getting+started+-+Contributing+to+MifosX#Gettingstarted-ContributingtoMifosX-CreateIssues
1. The Relevant Jira number (Ex: MIFOSX-1454) is present as a part of the commit message. Refer http://comments.gmane.org/gmane.comp.finance.mifos.devel/14664 for details
1. Newly added code has been formatted and cleaned up as per our preferences at https://github.com/openMF/mifosx/wiki/Eclipse#apply-project-preferences-to-eclipse
1. Comments are added where relevant to ease peer review
1. Your work is present in a single commit rather than several broken up commits. This helps us maintain a cleaner commit history. https://github.com/openMF/mifosx/wiki/Github-&-Git#contributing-back-changes-to-original-repositoryauthors has instructions for squashing multiple commits or resetting head and recommiting your work as a single commit
1. Your work is rebased on top of the latest code from develop branch to make life easier for our Committers
1. "gradlew licenseFormatMain licenseFormatTest licenseFormatIntegrationTest" has been run to apply the Mozilla License on all newly added files (your pull requests are verified to ensure compliance with this since https://github.com/openMF/mifosx/pull/1053)
+1
View File
@@ -0,0 +1 @@
Apache Fineract is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator PMC. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
-304
View File
@@ -1,304 +0,0 @@
# Installation Mifos Platform
This file describes how to install mifos platform for use in a production or test environment.
## Release Artifact Structure
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 along with sample data required for installation
+ pentahoReports ... folder contains any out-of-the-box reports provided through pentaho
+ apps ... folder contains apps like community app that speak to the platform
+ runmifosx.bat ... launch script for Windows
+ runmifosx.sh ... launch script for Mac OS X and Linux
|
-- CHANGELOG.MD ... file documents changelog of project up to this release
-- CONTRIBUTORS.MD ... file provides details on contributors to project
-- INSTALL.MD ... file provides details on installation instructions
-- LICENSE.MD ... file provides details on the open source license used by the project
-- mifosng-provider.war ... the platform WAR file to be dropped into Tomcat 7
-- README.MD ... initial readme file for the project
-- VERSIONING.MD ... file provides details on approach to release versioning
```
## How to Install
The three ways to get up and running with mifos platform is:
1. Use Amazon AWS and mifosplatform public AMI to spin up a new instance in the cloud
2. Manually install the prerequisite software on your own machine, follow setup instructions and use release artifacts to get platform running yourself.
3. ~~The (and the easiest) method is to just fire up the launch script provided in the release artifact and Mifos takes care of all the database, server-side and client-side setup for you.~~ Currently Broken
## 1. Launch script automatic out-of-the box setup
Important : Automatic setup is currently broken, please follow the instructions for **Manual Installation** instead. For details of the issue, refer comments at https://mifosforge.jira.com/browse/MIFOSX-1756
The Mifos release artifact contains two launch scripts with names starting with "**runmifosx**". One of them (the one with the *.bat* file extension) is used to launch the platform on a Windows machine while the other (which has the *.sh* file extension) is used to launch the platform on Mac OS X and Linux. Just double-click on the respective script (depending on your OS) and voila! you have your own Mifos X platform running locally on your computer.
**Note**: *In case your script does not launch by double clicking on Linux or Mac OS X, here's what you can do. Head over to bash and type the following:*
```
$ cd /path/where/runmifosx.sh/is/located
$ chmod 0755 ./runmifosx.sh
$ ./runmifosx.sh
```
## 2. Amazon Public AMI
Use AWS Wizard to launch instance by using this link: <a target="_blank" href="https://console.aws.amazon.com/ec2/home?region=ap-southeast-1#launchAmi=ami-2a734b78" title="Latest Mifos Platform Public AMI">Mifos Platform AMI (ami-2a734b78)</a>
*Note:* Read through the following as you step through the AWS Wizard
- You are automatically brought to Step 2 on the wizard, by default a 'micro' instance is selected, you may need to select a 'General Purpose' m1.small as the t1.micro's memory is right on the edge of whats needed to support MySQL, Tomcat 7 + Mifos Platform
- Use default settings for steps 3 to 5 until you reach step 6 configure security group.
- If your first time using AWS you should use the create new security group option and add the following 'rules' to the security group:
- SSH (PORT 22), MYSQL (3306), HTTPS (443), Custom TCP Rule (8443) all with a 'Source' value of 'Anywhere'
- Click 'Review and Launch'
- You will be asked to use a 'keypair' which you will need to SSH onto the new instance, if this is your first time create a new keypair, be srue to download it and store in place as you will need it later, otherwise use an existing keypair.
- When the instance starts, the following should be available at:
- Platform application should be available @ https://[public DNS]:8443/mifosng-provider/api/v1/offices?tenantIdentifier=default&pretty=true
- Community app should be available @ https://[public DNS]:8443/community-app
- API docs should be available @ https://[public DNS]:8443/api-docs/apiLive.htm
*Name:* Mifos Platform 15.03.1.RELEASE Public AMI
- AMI ID: ami-2a734b78
- Kernel ID: aki-503e7402
- Name: Mifos Platform 15.03.1.RELEASE Public AMI
- Owner: 239215483039
- Source: 239215483039/Mifos X-15.03.1 release
- Architecture: Ubuntu12.04 LTS x86_64
- Built starting from Ubuntu AMI ami-2a734b78
- Java 1.7.0_51 64 bit JVM
- Tomcat 7.0.39 (with SSL configured for self-signed certificate)
- MySql 5.5.31
## 3. Manual Installation
### 3.1 Prerequisite Software
Before running mifos platform you must have the following software installed:
- Oracle Java - JDK 7 (http://www.oracle.com/technetwork/java/javase/downloads/index.html)
- Oracle MySQL - (http://dev.mysql.com/downloads/)
- Apache Tomcat 7 - (http://tomcat.apache.org/download-70.cgi)
### 3.2 MySQL Setup
Assumption: MySQL server is now installed.
You should know your password for MySQL root user. If you wish you can change it by doing:
```
mysqladmin -u root -p 'oldpassword' password newpassword
```
The mifosplatform settings default to a mysql root user with username: root, password: mysql
If you have never installed mifosplatform before follow section 2.2.1 for first time setup of database, otherwise read section 2.2.2 on database upgrades.
#### 3.2.1 First Time Database setup
Mifos platform has support for hosting multiple tenants so we use two database schemas:
- *mifosplatform-tenants*: which is responsible for persisting the tenant information which is used when deciding what schema each incoming request in the platform should route to. It acts as a registry which contains the details of all the tenant databases, and their connection information, which is used by MifosX to connect to the appropriate tenant.
- *mifostenant-default*: All tenant specific schemas follow the pattern mifostenant-xxxx, out of the box the default schema is used.
Step one: create mifosplatform-tenants database
```
mysql -uroot -pmysql
create database `mifosplatform-tenants`;
exit
```
Step two: create mifostenant-default database
```
mysql -uroot -pmysql
create database `mifostenant-default`;
exit
```
The tables and lookup data for both databases are created on application startup.
Step three (optional): to be followed only if your mysql credentials are other than root/mysql
Manually restore the contents of *mifosplatform-tenants* database
```
mysql -uroot -pmysql mifosplatform-tenants < database/mifospltaform-tenants-first-time-install.sql
```
Next, update the default credentials for connecting to *mifoplatform-default* database stored in the *tenants* table of *mifosplatform-tenants* with your credentials
```
UPDATE tenants SET schema_username = "your_username", schema_password = "your_password" WHERE identifier = "default";
```
#### 3.2.2 Upgrade existing database(s)
The list database *mifosplatform-tenants* is upgraded when the application starts. Any *tenant* databases will also 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 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.
##### 3.2.2.1 Special Instructions for those upgrading from version 1.24.* or lower
Starting from version 1.25.* , updates to *mifosplatform-tenants* database are managed by Flyway (http://flywaydb.org/). To ensure that flyway works correctly, verify that table *schema_version* is present along with two entries in *mifosplatform-tenants* database.
You can do so as follows
````
mysql -uroot -pmysql
use `mifosplatform-tenants`;
select * from schema_version;
```
If the table does not exist, create the same using the script at https://gist.github.com/vishwasbabu/dc105b6a9450cff8ff1f
Next, check if the patch for "externalizing mysql connection properties" has been run (i.e if you are updating from 1.21 or a higher version of Mifos X)
````
mysql -uroot -pmysql
use `mifosplatform-tenants`;
select pool_initial_size from tenants;
```
If the above query does **not** throw an error (Unknown column 'pool_initial_size'), *schema_version* needs to be updated with the details of this patch by executing the scripts below
```
mysql -uroot -pmysql
use `mifosplatform-tenants`;
INSERT INTO `schema_version` (`version_rank`, `installed_rank`, `version`, `description`, `type`, `script`, `checksum`, `installed_by`, `installed_on`, `execution_time`, `success`) VALUES
(2, 2, '2', 'externalize-connection-properties', 'SQL', 'V2__externalize-connection-properties.sql', 210473669, 'root', '2014-10-12 22:13:51', 661, 1);
```
#### 3.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
```
### 3.3 Tomcat 7 Setup
Assumption: You have downloaded and installed Tomcat 7 correctly for your operation system: see http://tomcat.apache.org/tomcat-7.0-doc/setup.html
#### 3.3.1 Environment Variables Check
Check that the following environment variables exist:
- JAVA_HOME ... should point to directory where a 1.7 JDK or JRE is on machine
- CATALINA_HOME ... should point to a directory where a Tomcat 7 instance is installed
Check that the following is on your path:
- %JAVA_HOME%\bin;
#### 3.3.2 Logging
- In the [TOMCAT_HOME]/logs create a file called ```mifos-platform.log```
#### 3.3.3 Libraries
Ensure the following libraries are in the [TOMCAT_HOME]/lib folder
- tomcat-jdbc.jar (You can download the same from http://central.maven.org/maven2/org/apache/tomcat/tomcat-jdbc/7.0.57/tomcat-jdbc-7.0.57.jar)
- mysql-connector-java-5.1.22 (You will need to download the latest MySQL Connector/J Jar file from http://dev.mysql.com/downloads/connector/j/)
#### 3.3.4 Configure for SSL
Generate a new keystore using java keytool (if you havent already done this):
- Follow docs to create keystore.(http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration)
- Update server.xml as in docs. (Ther server.xml configuration given in the configure tomcat 7 below is what is need.)
```sudo keytool -genkey -alias mifostom -keyalg RSA -keystore /home/ubuntu/.keystore```
#### 3.3.5 Update tomcat configuration files for SSL, compression and JNDI connection to MySql
```
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml"
/>
<Resource type="javax.sql.DataSource"
name="jdbc/mifosplatform-tenants"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/mifosplatform-tenants"
username="root"
password="[root mysql password]"
initialSize="3"
maxActive="10"
maxIdle="6"
minIdle="3"
validationQuery="SELECT 1"
testOnBorrow="true"
testOnReturn="true"
testWhileIdle="true"
timeBetweenEvictionRunsMillis="30000"
minEvictableIdleTimeMillis="60000"
logAbandoned="true"
suspectTimeout="60"
/>
</GlobalNamingResources>
<Service name="Catalina">
<Connector protocol="org.apache.coyote.http11.Http11Protocol"
port="8443" maxThreads="200" scheme="https"
secure="true" SSLEnabled="true"
keystoreFile="/home/ubuntu/.keystore"
keystorePass="testmifos"
clientAuth="false" sslProtocol="TLS"
URIEncoding="UTF-8"
compression="force"
compressableMimeType="text/html,text/xml,text/plain,text/javascript,text/css"/>
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".log"
pattern="%h %l %u %t &quot;%r&quot; %s %b" />
</Host>
</Engine>
</Service>
</Server>
```
#### 3.3.6 Drop application into tomcat webapps folder
Drop the following from the release artifact into the [TOMCAT_HOME]/webapps folder:
- mifosng-provider.war
Drop the following from the release artifact into [TOMCAT_HOME]/webapps/ROOT folder:
- The entire ```apps/community-app``` folder.
- The entire api-docs folder
#### 3.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
- 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
*where [server ip address] is the hostname or IP address of your computer. For instance, if you've installed Mifos on your local machine then [server ip address] is localhost*
## How to integrate the web front-end UI with the back-end
To be able to use the front-end UI along with the back-end, you simply need to copy the webapp's source code files to the ```apps``` folder. For instance, you could copy the source code files of the community app to ```apps/community-app```. This would enable you to access the commuity app from the following URL:
*https://[server ip address]:8443/mifosng-provider/apps/community-app?baseApiUrl=https://[server ip address]:8443*
+340
View File
@@ -0,0 +1,340 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
******************************************
======================================
LICENSES FOR INCLUDED DEPENDENCIES
======================================
All the source code for the Apache Fineract project is released under the
license above. Additionally, the Apache Fineract source and binary distribution includes a number of third-party files that are required in
order to the software to function. Unless noted below, these jars
and resource files are also released under the ASF license above.
==================================================
*The exceptions for source release are as follows:
==================================================
For API & System Architecture Documentation Apache Fineract includes following css and js packages.
This product bundles normalize v1.1.1 and v2.1.0, copyright Nicolas Gallagher and Jonathan Neal, which is available under a MIT license.
For details, see licenses/source/normalize.MIT
This product bundles Modernizr v2.6.2, which is available under a MIT license.
For details, see licenses/source/modernizr.MIT
This product bundles filesaver, copyright Eli Grey, which is available under a MIT license.
For details, see licenses/source/filesaver.MIT
This product bundles Glyphicons Halflings Regular, copyright Jan Kovarik,
which is available under a MIT license.
For details, see licenses/source/glyphicons.MIT
This product bundles jszip, copyright Stuart Knightley,
David Duponchel, Franz Buchinger and António Afonso, which is available under a MIT license.
For details, see licenses/source/jszip.MIT
This product bundles jQuery v1.7, v1.7.1, v1.9.1, v1.10.2, copyright jQuery Foundation, Inc. which is available under a MIT license.
For details, see licenses/source/jQuery.MIT
This product bundles Respond v1.1.0, copyright Scott Jehl,
which is available under a MIT license.
For details, see licenses/source/respond.MIT
This product bundles matchMedia polyfill, copyright Scott Jehl,
which is available under a MIT license.
For details, see licenses/polyfill.MIT
This product bundles HTML5Shiv v3.6.2pre, copyright Alexander Farkas,
which is available under a MIT license.
For details, see licenses/source/html5shiv.MIT
This product bundles UglifyJS copyright Mihai Bazon,
which available under a BSD license.
For details, see licenses/source/uglify.BSD
This product bundles sizzle copyright jQuery Foundation and other contributors, which is available under a MIT license.
For details, see licenses/source/sizzle.MIT
This product bundles some parts of es5-shim, copyright Kristopher Michael Kowal and contributors, which is available under a MIT license.
For details, see licenses/source/es5shim.MIT
This product bundles toc v0.1.2, copyright Greg Allen,
which is available under a MIT license.
For details, see licenses/source/toc.MIT
This product bundles livejs Version 4, copyright Martin Kool and Q42,
which is available under a MIT license.
For details, see licenses/source/livejs.MIT
This product bundles HTML5 Boilerplate, which is under a MIT license.
For details, see licenses/source/h5bp.MIT.
==================================================
*The exceptions for binary release are as follows:
==================================================
This product bundles AOP Alliance v1.0, which is available under a Public Domain license. For details, see licenses/binary/Aopa.PL
This product bundles ASM Core v3.1, which is available under a BSD license.
For details, see licenses/binary/Asm.BSD
This product bundles JavaMail API(compat) v1.5.0-b01,
which is available under a CDDL v1.0 license.
For details, see licenses/binary/Javamail.CDDL
This product bundles AspectJ Runtime v1.8.2, Copyright (c) 1999-2001 Xerox Corporation, 2002 Palo Alto Research Center, Incorporated (PARC), which is available under a EPL v1.0 license.
For details, see licenses/binary/Aspectrt.EPL
This product bundles AspectJ Weaver v1.8.2, Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC), which is available under a EPL v1.0 license. For details, see licenses/binary/Aspectweaver.EPL
This product bundles IText(A Free Java PDF Library) v2.1.7, Copyright 2007 Bruno Lowagie, which is available under a MPL v1.1 license.
For details, see licenses/binary/IText.MPL
This product bundles DOM4J, Copyright 2001-2005 (C) MetaStuff, Ltd., which is available under a BSD license.
For details, see licenses/binary/Dom4J.BSD
This product bundles JDBC driver for MySQL and Drizzle v1.3, Copyright (c) 2009-2013, Marcus Eriksson which is available under a BSD license.
For details, see licenses/binary/Drizzle.BSD
This product bundles Ical4J v1.0.4, Copyright (c) 2012, Ben Fortuna,
which is available under a BSD license.
For details, see licenses/binary/Ical4J.BSD
This product bundles Jersey Core v1.17, Copyright (c) 2010-2012 Oracle and/or its affiliates, which is available under a CDDL 1.1 license.
For details, see licenses/binary/Jersey.CDDL
This product bundles Jersey Json v1.17, Copyright (c) 2010-2012 Oracle and/or its affiliates, which is available under a CDDL 1.1 license.
For details, see licenses/binary/Jersey.CDDL
This product bundles Jersey Multipart v1.17, Copyright (c) 2010-2011 Oracle and/or its affiliates, which is available under a CDDL 1.1 license.
For details, see licenses/binary/Jersey.CDDL
This product bundles Jersey Server v1.17, Copyright (c) 2010-2011 Oracle and/or its affiliates, which is available under a CDDL 1.1 license.
For details, see licenses/binary/Jersey.CDDL
This product bundles Jersey Servlet v1.17, Copyright (c) 2010-2011 Oracle and/or its affiliates, which is available under a CDDL 1.1 license.
For details, see licenses/binary/Jersey.CDDL
This product bundles Jersey Spring v1.17, Copyright (c) 2010-2011 Oracle and/or its affiliates, which is available under a CDDL 1.1 license.
For details, see licenses/binary/Jersey.CDDL
This product bundles Logback Classic Module v1.1.2, Copyright (C) 1999-2012, QOS.ch. All rights reserved, which is available under a EPL v1.0 license.
For details, see licenses/binary/Logback.EPL
This product bundles Logback Core Module v1.1.2, Copyright (C) 1999-2012, QOS.ch. All rights reserved, which is available under a EPL v1.0 license.
For details, see licenses/binary/Logback.EPL
This product bundles MIME Streaming Extension v1.6, Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved., which is available under a CDDL v1.1 license.
For details, see licenses/binary/Mimepull.CDDL
This product bundles JUnit v3.8.1 created by Erich Gamma and Kent Beck which is available under a CPL v1.0 license.
For details, see licenses/binary/Junit.CPL
This product bundles SLF4J API Module v1.7.7 opyright (c) 2004-2013 QOS.ch All rights reserved., which is available under a MIT license.
For details, see licenses/binary/Slf4j.MIT
This product bundles Backport Util Concurrent v3.1 written by Dawid Kurzyniec,
which is avilable under Public Domain license. For details see licenses/binary/Backport.PL
******************************************
+16 -3
View File
@@ -1,3 +1,16 @@
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this file,
You can obtain one at http://mozilla.org/MPL/2.0/.
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
+62
View File
@@ -0,0 +1,62 @@
Apache Fineract
Copyright 2008-2016 The Apache Software Foundation
This product includes software developed by The Apache Software
Foundation (http://www.apache.org/).
Apache Fineract - notice for binary distribution
==========================================
Apache Fineract includes JavaMail API(compat) v1.5.0-b01.
Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved.
Fineract elects to include this software in this distribution under the
CDDL license. You can obtain a copy of the License at:
https://glassfish.java.net/public/CDDL+GPL.html
Apache Fineract includes all Jersey libraries (Jersey Core v1.17, Jersey Json v1.17, Jersey Multipart v1.17, Jersey Server v1.17,Jersey Servlet v1.17,
Jersey Spring v1.17). Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved. Fineract elects to include this software in this distribution under the CDDL license. You can obtain a copy of the License at:
https://glassfish.java.net/public/CDDL+GPL.html
Apache Fineract includes Logback Classic Module v1.1.2 and Logback Core Module v1.1.2, Copyright (C) 1999-2012, QOS.ch. All rights reserved. Fineract elects to include this software in this distribution under the
EPL license. You can obtain a copy of the License at:
http://www.eclipse.org/legal/epl-v10.html
Apache Fineract includes MIME Streaming Extension v1.6, CCopyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
Fineract elects to include this software in this distribution under the
CDDL license. You can obtain a copy of the License at:
https://glassfish.java.net/public/CDDL+GPL_1_1.html
Apache Fineract includes JUnit v3.8.1 created by Erich Gamma and Kent Beck.
Fineract elects to include this software in this distribution under the
CPL license. You can obtain a copy of the License at:
https://opensource.org/licenses/cpl1.0.txt
Apache Fineract includes Log4j Implemented Over SLF4J. Fineract elects to include this software in this distribution under the Apache license. You can obtain a copy of the License at:
http://apache.org/licenses/LICENSE-2.0
Apache Fineract includes Jackson Core v2.3.4, Jackson Annotations v2.3.0,
Jackson Databind v2.3.4, JAX RS Provider For JSON Content Type v1.9.2, Xml Compatibility Extensions For Jackson v1.9.2 libraries. Fineract elects to include this software in this distribution under the Apache license. You can obtain a copy of the License at:
http://apache.org/licenses/LICENSE-2.0
Apache Fineract includes AspectJ Runtime v1.8.2, Copyright (c) 1999-2001 Xerox Corporation, 2002 Palo Alto Research Center, Incorporated (PARC) and AspectJ Weaver v1.8.2 Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC)., libraries. The library information is available at
(https://eclipse.org/aspectj/)
Apache Fineract includes IText(A Free Java PDF Library) v2.1.7 library, Copyright 2007 Bruno Lowagie. The library information is available at (http://developers.itextpdf.com/itext-java)
=====================
Apache OpenJPA NOTICE
OpenJPA includes software developed by the SERP project
Copyright (c) 2002-2006, A. Abram White. All rights reserved.
OpenJPA includes the persistence and orm schemas from the JPA specifications.
Copyright 2005-2014 Sun Microsystems, Inc. All rights reserved.
OpenJPA includes the persistence and orm schemas from the JPA specifications.
Copyright 2005-2009 Sun Microsystems, Inc. All rights reserved.
OpenJPA elects to include this software in this distribution under the
CDDL license. You can obtain a copy of the License at:
https://glassfish.dev.java.net/public/CDDL+GPL.html
The source code is available at:
https://glassfish.dev.java.net/source/browse/glassfish/
OpenJPA includes software written by Miroslav Nachev
+42 -45
View File
@@ -1,72 +1,69 @@
Mifos X: A Platform for Microfinance
======
The next evolution of mifos focussing being faster, lighter and cheaper to change (than existing mifos) so that it is more responsive to the needs of MFI’s and Integrators
Build Status
Apache Fineract: A Platform for Microfinance
============
Travis
The next evolution of Apache Fineract focuses on being faster, lighter and cheaper to change (than the existing Mifos) so that it is more responsive to the needs of Microfinance Institutions and Integrators.
[![Build
Status](https://travis-ci.org/openMF/mifosx.png?branch=master)](https://travis-ci.org/openMF/mifosx)
Requirements
============
* Java >= 1.8 (Oracle JVMS have been tested)
* gradle-wrapper.jar version 2.10
* MySQL 5.5
Cloudbees Jenkins
Instructions to build war file
============
[![Build
Status](https://openmf.ci.cloudbees.com/job/MIFOSX%20INTEGRATION%20TEST/badge/icon)](https://openmf.ci.cloudbees.com/job/MIFOSX%20INTEGRATION%20TEST/)
1. Extract the archive file to your local directory.
2. Download gradle-wrapper.jar version 2.10 and place it in the fineract-provider/gradle/wrapper folder.
3. Change the current working directory to fineract-provider.
4. Run `./gradlew clean war` or `./gradlew build` to build deployable war file which will be created at fineract-provider/build/libs directory.
<a target="_blank" href="https://openmf.ci.cloudbees.com/job/MIFOSX%20INTEGRATION%20TEST/" title="Jenkins@CloudBees">Jenkins@CloudBees Unit + Integration Tests</a>
Instructions to execute Integration tests
============
1. Login to mysql DB using `mysql -u root -pmysql`
2. Create the mifosplatform-tenants database using `CREATE DATABASE mifosplatform-tenants`.
3. Create the default tenant database using `CREATE DATABASE mifostenant-default`.
4. With fineract-provider as current working directory run the following commands:
1. `./gradlew migrateTenantListDB -PdbName=mifosplatform-tenants`
2. `./gradlew migrateTenantDB -PdbName=mifostenant-default`
5. Run `./gradlew clean integrationTest`
Version
==========
============
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>
The latest stable release can be viewed on the develop branch: [Latest Release on Develop](https://github.com/apache/incubator-fineract/tree/develop "Latest Release"), [View change log](https://github.com/apache/incubator-fineract/blob/develop/CHANGELOG.md "Latest release change log")
License
=============
============
This project is licensed under the open source MPL V2. See https://github.com/openMF/mifosx/blob/master/LICENSE.md
This project is licensed under Apache License Version 2.0. See <https://github.com/apache/incubator-fineract/blob/develop/LICENSE.md>.
Mifos Platform API
=====================
<a target="_blank" href="https://demo.openmf.org/api-docs/apiLive.htm" title="mifos platform api">API Documentation (Demo Server)</a>
Apache Fineract Platform API
============
The API for the Fineract-platform (project named 'Apache Fineract') is documented in the API-docs under <b>Full API Matrix</b> and can be viewed [here](https://demo.openmf.org/api-docs/apiLive.htm "API Documentation").
Online Demos
=============================
============
* <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>~~
* [Community App](https://demo.openmf.org "Reference Client App")
Developers
==========
see https://mifosforge.jira.com/wiki/display/MIFOSX/MifosX+Technical - Developers Wiki Page
============
Please see <https://cwiki.apache.org/confluence/display/FINERACT/Contributor%27s+Zone> for the developers wiki page.
see https://mifosforge.jira.com/wiki/display/MIFOSX/Getting+started+-+Contributing+to+MifosX - Getting Started.
see https://mifosforge.jira.com/wiki/display/MIFOSX/The+Basic+Design - Overview of Platform Implementation
see https://github.com/openMF/mifosx/wiki/Screen-Based-Reporting for info around reporting
see https://github.com/openMF/mifosx/wiki/Git-Usuage for info around using git
see https://www.ohloh.net/p/mifosx for activity overview and basic code analysis.
Please see <https://cwiki.apache.org/confluence/display/FINERACT/How-to+articles> for technical details to get started.
Roadmap
==============
============
<a target="_blank" href="http://goo.gl/IXS9Q" title="Community Roadmap (High Level)">Community Roadmap (High Level)</a>
<a target="_blank" href="https://mifosforge.jira.com/browse/MIFOSX#selectedTab=com.atlassian.jira.plugin.system.project%3Aroadmap-panel"
title="Project Release Roadmap on JIRA (Detailed View)">Project Release Roadmap on JIRA (Detailed View)</a>
[Project Release Roadmap on JIRA (Detailed View)](https://issues.apache.org/jira/browse/FINERACT-268?jql=project%20%3D%20FINERACT "Project Release Roadmap on JIRA (Detailed View)")
Video Demonstration
===============
============
Demonstration of first Prototype of this platform with browser App (April 2012) - http://www.youtube.com/watch?v=zN5Dn1Lc_js
Apache Fineract / Mifos X Demo (November 2016) - <https://www.youtube.com/watch?v=h61g9TptMBo>
More Information
============
More details of the project can be found at <https://cwiki.apache.org/confluence/display/FINERACT>.
-46
View File
@@ -1,46 +0,0 @@
Versioning
=====
For releases, we follow a simplified date versioning scheme which ties in nicely with our time based release cycle (with stables releases being promoted on a three month cycle)
Prior to 15.03.RELEASE, we followed a semantic versioning approach. (http://semver.org/)
Date Versioning
===================
Our date versioning scheme is built around the YY.MM.{PATCH}.{release_type} concept (for example 15.06.RELEASE or 15.06.1.BUILD-SNAPSHOT) where
YY represents the year of the release
MM represents the month of the major release
PATCH (optional) gets incremented whenever a new release is made from an existing major release
release_type differentiates different builds off the same branch. It also differentiates between development, test and production builds.
Version structure
{number}.{release_type}
where {number} is further broken down as YY.MM.{PATCH}.
Examples:
15.03.BUILD-SNAPSHOT
15.03.M1
15.03.RC1
15.03.RELEASE
15.03.1.RC1
15.03.1.RELEASE
Number semantics
In general:
a major version (Ex:15.03) does not have a patch number and suggests many significant new features, an associated marketing campaign, and possible breaking of backward compatibility. You can expect major releases every 3 months
a minor version (Ex:15.03.1) may also contain serious new features, but typically contains many bug fixes and improvements and does not break compatibility. You can expect minor releases between the quarterly major release cycle.
What You Should Install Where
As a rule of thumb …
Snapshot or Milestone versions should only be installed on dev boxes and integration environments. They shouldn’t be deployed to any of the dedicated test environments.
Release candidates should be installed in the dedicated test environments. In an emergency, a release candidate can be installed into the production environment.
Production releases can be installed anywhere - and they are the only kind of build that should be installed into the production environment.
+11760 -364
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -74,7 +74,7 @@
background-color: #6eb4db !important;
}
.mifosXHeading2 {
.fineractHeading2 {
color: white;
font-weight: bold;
//font-size: 125%
@@ -192,7 +192,7 @@ body {
.flybar-nav {
display: block;
float: left;
min-width: 90px;
min-width: 60px;
position: relative;
}
-31
View File
@@ -1,31 +0,0 @@
Mifos Platform Apps
======
Community created apps built on top of mifosplatform are stored in source control repository @ https://github.com/openMF/
To get the Git sub modules from here, use "--recursive" in your original git clone, or, if already cloned, do:
git submodule update --init --recursive; git submodule status
Later to update both this main repo but also get the latest from the submodule(s), do:
git pull; git submodule update --remote
Here is how a new Git submodule can (was originally) added here:
git submodule add -b develop https://github.com/openMF/community-app.git
git submodule init
The Community App (AngularJS-based)
===============
https://github.com/openMF/community-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 was used to showcase platform API capabilities and is also used in production by MFIs.
+19
View File
@@ -1,4 +1,23 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
set -e
# https://developer.cloudbees.com/bin/view/DEV/Node+Builds
+20 -1
View File
@@ -1,4 +1,23 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Exit the script if any command returns a non-true return value (http://www.davidpashley.com/articles/writing-robust-shell-scripts/)
set -e
@@ -15,5 +34,5 @@ git submodule foreach 'git checkout develop && git pull --ff-only origin develop
cd apps/community-app
./build.sh
cd ../../mifosng-provider/
cd ../../fineract-provider/
./gradlew -Penv=dev clean dist
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1,3 +1,22 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
--
-- Host: localhost Database: mifosplatform-tenants
@@ -1,3 +1,22 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
--
-- Host: localhost Database: mifosplatform-tenants
@@ -1,3 +1,22 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
--
-- Host: localhost Database: mifostenant-default
@@ -1,3 +1,22 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
--
-- Host: localhost Database: mifostenant-default
@@ -1,3 +1,22 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
--
-- Host: localhost Database: mifostenant-ceda
@@ -1,3 +1,22 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
--
-- Host: localhost Database: mifostenant-ceda
@@ -1,3 +1,22 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
DELETE FROM `ref_loan_transaction_processing_strategy` WHERE id in (1, 3, 4);
INSERT INTO `m_code` (`code_name`, `is_system_defined`)
@@ -0,0 +1,123 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
DELETE FROM `m_organisation_currency` WHERE id>0;
INSERT INTO `m_organisation_currency`
(
`code`,
`decimal_places`,
`name`,
`display_symbol`,
`internationalized_name_code`)
VALUES
('UGX', 2, 'Uganda Shilling', 'USh', 'currency.UGX');
UPDATE `m_appuser` SET `username` = 'admin' WHERE id=1;
INSERT INTO `m_appuser`
(`is_deleted`,
`office_id`,
`username`,
`firstname`,
`lastname`,
`password`,
`email`,
`firsttime_login_remaining`,
`nonexpired`,
`nonlocked`,
`nonexpired_credentials`,
`enabled`)
VALUES
(0, 1, 'keithwoodlock', 'Keith', 'Woodlock',
'4f607e9b6cffbe7d3db92d4bfa3391c7aa751727b4ea29d08fddf9dd72e6e7e3', 'keithwoodlock@gmail.com', 0, 1, 1, 1, 1);
INSERT INTO `m_appuser_role`
(`appuser_id`,`role_id`) VALUES (2,1);
UPDATE `m_office` SET `name` = 'CEDA Microfinance Ltd.' WHERE id=1;
INSERT INTO `m_office`
(
`parent_id`,
`hierarchy`,
`external_id`,
`name`,
`opening_date`)
VALUES
(1, '.2.', 2, 'Uganda (Kampala)', '2009-01-01');
INSERT INTO `m_staff`
(
`is_loan_officer`,
`office_id`,
`firstname`,
`lastname`,
`display_name`)
VALUES
(1, 1, 'CEDA HO', 'LoanOfficer', 'LoanOfficer, CEDA HO'),
(1, 2, 'Kampala', 'LoanOfficer', 'LoanOfficer, Kampala');
INSERT INTO `m_charge`
(
`name`,
`currency_code`,
`charge_applies_to_enum`,
`charge_time_enum`,
`charge_calculation_enum`,
`amount`,
`is_penalty`,
`is_active`,
`is_deleted`)
VALUES ('Bank Fee (per installment)', 'UGX', 1, 2, 1, 1500.000000, 0, 1, 0);
INSERT INTO `m_product_loan`
(
`currency_code`,
`currency_digits`,
`principal_amount`,
`min_principal_amount`,
`max_principal_amount`,
`arrearstolerance_amount`,
`name`,
`description`,
`fund_id`,
`nominal_interest_rate_per_period`,
`interest_period_frequency_enum`,
`annual_nominal_interest_rate`,
`interest_method_enum`,
`interest_calculated_in_period_enum`,
`repay_every`,
`repayment_period_frequency_enum`,
`number_of_repayments`,
`amortization_method_enum`,
`accounting_type`,
`loan_transaction_strategy_id`)
VALUES
('UGX', 2, 1000000.000000, 0, 1000000000000.000000, null , 'Kampala Product (with cash accounting)',
'Typical Kampala loan product with cash accounting enabled for testing.', null ,
24.000000, 3, 24.000000, 1, 1, 1, 2, 12, 1, 2, 2);
-- mapping of that loan product to GL Accounts
INSERT INTO `acc_product_mapping`
VALUES (1,4,1,1,1),(2,8,1,1,2),(3,34,1,1,3),(4,37,1,1,4),(5,35,1,1,5),(6,97,1,1,6);
@@ -1,3 +1,22 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
--
-- Host: localhost Database: mifostenant-default
@@ -1,3 +1,22 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
-- add code and code values for datatables dropdowns
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
@@ -0,0 +1,58 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
DROP TABLE IF EXISTS `risk_analysis`;
CREATE TABLE `risk_analysis` (
`client_id` bigint(20) NOT NULL,
`proposed_loan_amount` decimal(19,6) DEFAULT NULL,
`assets_cash` decimal(19,6) DEFAULT NULL,
`assets_bank_accounts` decimal(19,6) DEFAULT NULL,
`assets_accounts_receivable` decimal(19,6) DEFAULT NULL,
`assets_inventory` decimal(19,6) DEFAULT NULL,
`assets_total_fixed_business` decimal(19,6) DEFAULT NULL,
`assets_total_business` decimal(19,6) DEFAULT NULL,
`assets_total_household` decimal(19,6) DEFAULT NULL,
`liabilities_accounts_payable` decimal(19,6) DEFAULT NULL,
`liabilities_business_debts` decimal(19,6) DEFAULT NULL,
`liabilities_total_business` decimal(19,6) DEFAULT NULL,
`liabilities_equity_working_capital` decimal(19,6) DEFAULT NULL,
`liabilities_total_household` decimal(19,6) DEFAULT NULL,
`liabilities_household_equity` decimal(19,6) DEFAULT NULL,
`cashflow_cash_sales` decimal(19,6) DEFAULT NULL,
`cashflow_cash_sales2` decimal(19,6) DEFAULT NULL,
`cashflow_cost_goods_sold` decimal(19,6) DEFAULT NULL,
`cashflow_cost_goods_sold2` decimal(19,6) DEFAULT NULL,
`cashflow_gross_profit` decimal(19,6) DEFAULT NULL,
`cashflow_other_income1` decimal(19,6) DEFAULT NULL,
`cashflow_total_income2` decimal(19,6) DEFAULT NULL,
`cashflow_household_expense` decimal(19,6) DEFAULT NULL,
`cashflow_payments_to_savings` decimal(19,6) DEFAULT NULL,
`cashflow_operational_expenses` decimal(19,6) DEFAULT NULL,
`cashflow_disposable_income` decimal(19,6) DEFAULT NULL,
`cashflow_amount_loan_installment` decimal(19,6) DEFAULT NULL,
`cashflow_available_surplus` decimal(19,6) DEFAULT NULL,
`fi_inventory_turnover` decimal(19,6) DEFAULT NULL,
`fi_gross_margin` decimal(19,6) DEFAULT NULL,
`fi_indebtedness` decimal(19,6) DEFAULT NULL,
`fi_loan_recommendation` decimal(19,6) DEFAULT NULL,
`fi_roe` decimal(19,6) DEFAULT NULL,
`fi_repayment_capacity` decimal(19,6) DEFAULT NULL,
PRIMARY KEY (`client_id`),
CONSTRAINT `FK_risk_analysis_1` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1,3 +1,22 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
--
-- Host: localhost Database: mifostenant-default
@@ -1,3 +1,22 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
DROP TABLE IF EXISTS `latam_extra_client_details`;
CREATE TABLE `latam_extra_client_details` (
`client_id` bigint(20) NOT NULL,
@@ -1,3 +1,22 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
-- drop tables in base-schema
SET foreign_key_checks = 0;
@@ -1,3 +1,22 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
-- currency symbols may not apply through command line on windows so use a different client like mysql workbench
INSERT INTO `ref_loan_transaction_processing_strategy`
@@ -1,3 +1,22 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--

-- ========= roles and permissions =========
@@ -1,3 +1,22 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
truncate table stretchy_report;
truncate table stretchy_parameter;
truncate table stretchy_report_parameter;
+11
View File
@@ -0,0 +1,11 @@
bin
out/
build
repos
.classpath
.project
.settings
.gradle
*.log
!gradle/wrapper/gradle-wrapper.jar
/gradle
+498
View File
@@ -0,0 +1,498 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
description = '''\
Run as:
gradle clean tomcatrunwar
'''
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'org.gradle.api.plugins:gradle-tomcat-plugin:1.0',
'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0',
'org.zeroturnaround:gradle-jrebel-plugin:1.1.2',
'org.springframework.boot:spring-boot-gradle-plugin:1.1.6.RELEASE' // also change springDataJpaVersion below
classpath 'org.apache.openjpa:openjpa-all:2.4.1'
classpath 'at.schmutterer.oss.gradle:gradle-openjpa:0.2.0'
classpath 'gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.2.2'
}
}
apply plugin: "org.nosphere.apache.rat"
apply plugin: 'rebel'
apply plugin: 'license'
apply plugin: 'war'
apply plugin: 'spring-boot'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'tomcat'
apply plugin: 'project-report'
apply plugin: 'java'
apply plugin: 'openjpa'
/* define the valid syntax level for source files */
sourceCompatibility = JavaVersion.VERSION_1_8
/* define binary compatibility version */
targetCompatibility = JavaVersion.VERSION_1_8
project.ext.springBootVersion = '1.1.6.RELEASE'
project.ext.springVersion = '4.0.7.RELEASE'
project.ext.springOauthVersion = '2.0.4.RELEASE'
project.ext.jerseyVersion = '1.17'
project.ext.springDataJpaVersion = '1.7.0.RELEASE' // also change spring-boot-gradle-plugin version above
project.ext.mysqlUser='root'
project.ext.mysqlPassword='mysql'
group = 'org.apache.fineract'
repositories {
jcenter()
// mavenLocal() // useful for local dev using MariaDB4j SNAPSHOTs (not needed for real-world non-SNAPHOT builds)
}
openjpa {
files = fileTree(sourceSets.main.output.classesDir).matching {
include '**/AbstractPersistableCustom.class'
include '**/domain/*.class'
}
enforcePropertyRestrictions = true
}
rat {
xmlOutput = false
htmlOutput = false
plainOutput = true
verbose = true
inputDir = './..'
excludes = [
'**/licenses/**',
'**/*.md',
'**/*.txt',
'**/*.log',
'**/fineractdev-eclipse-preferences.epf',
'**/template-expected.html',
'**/template.mustache',
'**/.classpath',
'**/.project',
'**/.idea/**',
'**/.settings/**',
'**/bin/**',
'**/.git/**',
'**/.gitignore',
'**/.gitkeep',
'**/*.iml',
// gradle
'**/.gradle/**',
'**/gradlew',
'**/gradlew.bat',
'**/gradle/wrapper/gradle-wrapper.properties',
'**/caches/**',
'**/daemon/**',
'**/native/**',
'**/wrapper/**',
'**/build/**',
//Api Docs
'**/api-docs/*.*',
'**/docs/system-architecture/.htaccess',
'**/docs/system-architecture/404.html',
'**/docs/system-architecture/index.html',
'**/docs/system-architecture/**/*.xml',
'**/bootstrap-3.0.0/assets/application.js',
'**/system-architecture/js/plugins.js',
//Apache License
'**/bootstrap-3.0.0/assets/less.js',
'**/css/bootstrap-3.0.0/**/*.*',
//Public Domain See http://www.JSON.org/js.html
'**/bootstrap-3.0.0/assets/json2.js.htm',
// MIT License
'**/modernizr-2.6.2.min.js',
'**/css/normalize.css',
'**/assets/filesaver.js',
'**/css/fonts/glyphicons-halflings-regular.svg',
'**/assets/jszip.js',
'**/assets/jquery.js',
'**/api-docs/jquery-1.7.min.js',
'**/css/toc-0.1.2/**/*.*',
'**/docs/system-architecture/css/main.css',
'**/system-architecture/js/vendor/jquery-1.9.1.min.js',
'**/system-architecture/js/vendor/toc-0.1.2/jquery.toc.min.js',
'**/assets/respond.min.js',
'**/assets/html5shiv.js',
//BSD License
'**/assets/uglify.js'
]
}
configurations {
providedRuntime // needed for Spring Boot executable WAR
providedCompile
compile() {
exclude module: 'hibernate-entitymanager'
exclude module: 'hibernate-validator'
exclude module: 'activation'
exclude module: 'bcmail-jdk14'
exclude module: 'bcprov-jdk14'
exclude module: 'bctsp-jdk14'
exclude module: 'bval-core'
exclude module: 'org.apache.bval.bundle'
exclude module: 'bval-jsr303'
exclude module: 'c3p0'
exclude module: 'stax-api'
exclude module: 'jaxb-api'
exclude module: 'jaxb-impl'
exclude module: 'jboss-logging'
exclude module: 'itext-rtf'
exclude module: 'classworlds'
exclude module: 'jcl-over-slf4j'
exclude module: 'jul-to-slf4j'
exclude module: 'serp'
}
runtime
all*.exclude group: 'commons-logging'
}
/* Pick up dependencies based on the environemnt, defaults to production */
if (project.hasProperty('env') && project.getProperty('env') == 'dev') {
apply from: 'dev-dependencies.gradle'
} else {
apply from: 'dependencies.gradle'
}
/* Enable Oauth2 authentication based on environment, default to HTTP basic auth */
if (project.hasProperty('security') && project.getProperty('security') == 'oauth') {
copy {
from './properties/oauth/'
into 'src/main/resources/'
include '*.properties'
}
} else {
copy {
from './properties/basicauth/'
into 'src/main/resources/'
include '*.properties'
}
}
task dist(type:Zip){
baseName = 'fineractplatform'
version = qualifyVersionIfNecessary(releaseVersion)
includeEmptyDirs = true
from('../') {
fileMode = 0755
include '*.md'
}
from('src/main/dist') {
fileMode = 0755
include '*'
}
from('../apps') {
fileMode = 0755
include '**/*'
into('apps')
}
from('../api-docs/') {
fileMode = 0755
include '*'
into('api-docs')
}
from('../fineract-db/') {
fileMode = 0755
include '*.sql'
into('database')
}
from('src/main/resources/sql/migrations') {
fileMode = 0755
include '**/*'
into('database/migrations')
}
from war.outputs.files
into(baseName + '-' + version)
}
compileJava{
dependsOn rat
}
war {
from('../licenses') { // notice the parens
into "WEB-INF/licenses/" // no leading slash
}
from('../LICENSE') { // notice the parens
into "WEB-INF/" // no leading slash
}
from('../NOTICE') { // notice the parens
into "WEB-INF/" // no leading slash
}
war.finalizedBy(bootRepackage)
}
license {
header rootProject.file('../LICENSE.md')
excludes(["**/*.html", "**/*.mustache", "**/package-info.java", "**/keystore.jks"])
strictCheck true
}
task licenseFormatBuildScripts (type:nl.javadude.gradle.plugins.license.License) {
source = fileTree(dir: '../', includes: ['**/*.bat', '**/*.sh', '**/*.sql'])
}
licenseFormat.dependsOn licenseFormatBuildScripts
tomcatRun {
httpPort = 8080
httpsPort = 8443
stopPort = 8081
stopKey= 'stopKey'
enableSSL = true
configFile = file('src/test/resources/META-INF/context.xml')
}
tomcatRunWar {
httpPort = 8080
httpsPort = 8443
stopPort = 8081
stopKey= 'stopKey'
enableSSL = true
keystoreFile = file('src/main/resources/keystore.jks')
keystorePass = 'openmf'
configFile = file('src/test/resources/META-INF/context.xml')
}
/* http://stackoverflow.com/questions/19653311/jpa-repository-works-in-idea-and-production-but-not-in-gradle */
sourceSets.main.output.resourcesDir = sourceSets.main.output.classesDir
sourceSets.test.output.resourcesDir = sourceSets.test.output.classesDir
/* Exclude maria db and embedded tomcat related files for non dev builds */
if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
sourceSets {
main {
java {
exclude '**/Server*'
exclude '**/MariaDB4j*'
exclude '**/EmbeddedTomcatWithSSLConfiguration.java'
}
}
test {
java {
exclude '**/core/boot/tests/**'
}
}
}
}
sourceSets {
integrationTest {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
}
}
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}
task integrationTest(type:Test){
description = "Run integration tests (located in src/integrationTest/java). Starts tomcat in daemon mode before executing the tests."
it.dependsOn war
doFirst {
tomcatRunWar.daemon = true
tomcatRunWar.execute()
}
testClassesDir = project.sourceSets.integrationTest.output.classesDir
classpath = project.sourceSets.integrationTest.runtimeClasspath
}
import groovy.sql.Sql
repositories {
mavenCentral()
}
configurations {
driver
}
dependencies {
driver 'org.drizzle.jdbc:drizzle-jdbc:1.3'
}
test {
filter {
//includeTestsMatching "org.apache.fineract.infrastructure.configuration.spring.SpringConfigurationTest.*"
includeTestsMatching "org.apache.fineract.template.TemplateMergeServiceTest.*"
}
}
URLClassLoader loader = GroovyObject.class.classLoader
configurations.driver.each {File file ->
loader.addURL(file.toURL())
}
task createDB<<{
description= "Creates the Database. Needs database name to be passed (like: -PdbName=someDBname)"
sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
sql.execute( 'create database '+"`$dbName`" )
}
task dropDB<<{
description= "Drops the specified database. The database name has to be passed (like: -PdbName=someDBname)"
sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
sql.execute( 'DROP DATABASE '+"`$dbName`")
}
task setBlankPassword<<{
sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
sql.execute('USE `mifosplatform-tenants`')
sql.execute('UPDATE mifosplatform-tenants.tenants SET schema_server = \'localhost\', schema_server_port = \'3306\', schema_username = \'mifos\', schema_password = \'mysql\' WHERE id=1;')
}
apply plugin: 'flyway'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.flywaydb:flyway-gradle-plugin:3.0" // version upgraded during Spring Boot & MariaDB4j work, as prev. used v0.2 didn't work well after *.sql moved from fineract-db to fineract-provider/src/main/resources (new version also has clearer errors, e.g. in case of missing DB)
classpath 'org.drizzle.jdbc:drizzle-jdbc:1.3'
}
}
flyway {
url = "jdbc:mysql:thin://localhost:3306/mifostenant-default"
driver = "org.drizzle.jdbc.DrizzleDriver"
user = mysqlUser
password = mysqlPassword
}
task migrateTenantDB<<{
description="Migrates a Tenant DB. Optionally can pass dbName. Defaults to 'mifostenant-default' (Example: -PdbName=someTenantDBname)"
def filePath = "filesystem:$projectDir" + '/src/main/resources/sql/migrations/core_db'
def tenantDbName = 'mifostenant-default';
if (rootProject.hasProperty("dbName")) {
tenantDbName = rootProject.getProperty("dbName")
}
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantDbName"
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
flyway.locations= [filePath]
/**We use ${ as the prefix for strecthy reporting, do not want them to be interpreted by Flyway**/
flyway.placeholderPrefix = "\$\${"
flywayMigrate.execute()
}
task showTenantDBInfo<<{
description="Shows the migration info for a Tenant DB. Optionally can pass dbName. Defaults to 'mifostenant-default' (Example: -PdbName=someTenantDBname)"
def filePath = "filesystem:$projectDir" + '/src/main/resources/sql/migrations/core_db'
def tenantDbName = 'mifostenant-default';
if (rootProject.hasProperty("dbName")) {
tenantDbName = rootProject.getProperty("dbName")
}
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantDbName"
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
flyway.locations= [filePath]
flywayInfo.execute()
}
task migrateTenantListDB<<{
description="Migrates a Tenant List DB. Optionally can pass dbName. Defaults to 'mifosplatform-tenants' (Example: -PdbName=someDBname)"
def filePath = "filesystem:$projectDir" + '/src/main/resources/sql/migrations/list_db'
def tenantsDbName = 'mifosplatform-tenants';
if (rootProject.hasProperty("dbName")) {
tenantsDbName = rootProject.getProperty("dbName")
}
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantsDbName"
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
flyway.locations= [filePath]
flywayMigrate.execute()
}
task showTenantListDBInfo<<{
description="Shows the migration info for a List DB. Optionally can pass dbName. Defaults to 'mifosplatform-tenants' (Example: -PdbName=someDBname)"
def filePath = "filesystem:$projectDir" + '/src/main/resources/sql/migrations/list_db'
def tenantsDbName = 'mifosplatform-tenants';
if (rootProject.hasProperty("dbName")) {
tenantsDbName = rootProject.getProperty("dbName")
}
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantsDbName"
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
flyway.locations= [filePath]
flywayInfo.execute()
}
task repairTenantDB<<{
description="repair migrate"
def filePath = "filesystem:$projectDir" + '/src/main/resources/sql/migrations/list_db'
def tenantsDbName = 'mifosplatform-tenants';
if (rootProject.hasProperty("dbName")) {
tenantsDbName = rootProject.getProperty("dbName")
}
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantsDbName"
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
flyway.locations= [filePath]
flywayRepair.execute()
}
/*
* Support publication of artifacts versioned by topic branch.
* CI builds supply `-P BRANCH_NAME=<TOPIC>` to gradle at build time.
* If <TOPIC> starts with 'MIFOSX-', change version
* from BUILD-SNAPSHOT => <TOPIC>-SNAPSHOT
* e.g. 1.1.0.BUILD-SNAPSHOT => 1.0.0.MIFOSX-1234-SNAPSHOT
*/
def qualifyVersionIfNecessary(version) {
if (rootProject.hasProperty("BRANCH_NAME")) {
def qualifier = rootProject.getProperty("BRANCH_NAME")
if (qualifier.startsWith("MIFOSX-")) {
return version.replace('BUILD', qualifier)
}
}
return version
}
springBoot {
mainClass = 'org.apache.fineract.ServerWithMariaDB4jApplication'
}
bootRepackage {
mainClass = 'org.apache.fineract.ServerWithMariaDB4jApplication'
}
+101
View File
@@ -0,0 +1,101 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
dependencies {
def tomcatVersion = '7.0.54'
tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
"org.apache.tomcat.embed:tomcat-embed-logging-log4j:${tomcatVersion}" // NOT tomcat-embed-logging-juli (http://stackoverflow.com/questions/23963049/classcircularityerror-java-util-logging-logrecord-running-gradle-webapp-with-ja)
tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") {
exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj'
}
tomcat "org.apache.tomcat:tomcat-dbcp:${tomcatVersion}"
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
providedCompile(
// [group: 'javax.servlet', name: 'servlet-api', version: '2.5'],
)
compile(
// [group: 'ch.vorburger.mariaDB4j', name: 'mariaDB4j', version: '2.1.3'],
[group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: springBootVersion],
[group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: springBootVersion],
[group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: springBootVersion],
//[group: 'org.eclipse.persistence', name: 'javax.persistence', version: '2.0.0'],
[group: 'org.springframework', name: 'spring-context-support', version: springVersion],
[group: 'org.springframework.security.oauth', name: 'spring-security-oauth2', version: springOauthVersion],
[group: 'org.apache.openjpa', name:'openjpa-all', version:'2.4.1'],
//[group: 'org.apache.openjpa', name:'openjpa-maven-plugin', version:'2.4.1'],
//[group: 'javax.ws.rs', name: 'jsr311-api', version: '1.1.1'],
[group: 'com.sun.jersey', name: 'jersey-core', version: jerseyVersion],
[group: 'com.sun.jersey', name: 'jersey-servlet', version: jerseyVersion],
[group: 'com.sun.jersey', name: 'jersey-server', version: jerseyVersion],
[group: 'com.sun.jersey', name: 'jersey-json', version: jerseyVersion],
[group: 'com.sun.jersey.contribs', name: 'jersey-spring', version: jerseyVersion],
[group: 'com.sun.jersey.contribs', name: 'jersey-multipart', version: jerseyVersion],
[group: 'com.squareup.retrofit', name: 'retrofit', version: '1.6.1'],
[group: 'com.squareup.okhttp', name: 'okhttp', version: '2.0.0'],
[group: 'com.squareup.okhttp', name: 'okhttp-urlconnection', version: '2.0.0'],
[group: 'com.google.code.gson', name: 'gson', version: '2.2.4'],
[group: 'com.google.guava', name: 'guava', version: '15.0'],
[group: 'joda-time', name: 'joda-time', version: '2.4'],
//[group: 'net.sourceforge.javacsv', name: 'javacsv', version: '2.0'],
[group: 'org.apache.commons', name: 'commons-email', version: '1.3.3'],
[group: 'org.apache.commons', name: 'commons-lang3', version: '3.3.2'],
// no slf4j & logback here (anymore), as spring-boot-starter-logging already brings this now, better assembled (log4j-over-slf4j was originally forgotten here)
//[group: 'mysql', name: 'mysql-connector-java', version: '5.1.27'],
[group: 'org.drizzle.jdbc', name: 'drizzle-jdbc', version: '1.3'],
// [group: 'org.apache.tomcat', name: 'tomcat-jdbc', version: tomcatVersion],
[group: 'org.apache.poi',name: 'poi', version: '3.9'],
[group: 'org.apache.poi',name: 'poi-ooxml', version: '3.9'],
[group: 'org.apache.poi',name: 'poi-ooxml-schemas', version: '3.9'],
[group: 'com.lowagie', name: 'itext', version: '2.1.7'],
//[group: 'com.lowagie', name: 'itext-rtf', version: '2.1.7'],
[group: 'org.mnode.ical4j', name: 'ical4j', version: '1.0.4'],
[group: 'com.googlecode.flyway', name: 'flyway-core', version: '2.1.1'],
[group: 'org.quartz-scheduler', name: 'quartz', version: '2.1.7'],
[group: 'com.amazonaws', name: 'aws-java-sdk', version: '1.2.1'],
[group: 'net.sf.ehcache', name: 'ehcache', version: '2.7.2'],
[group: 'com.github.spullara.mustache.java', name: 'compiler', version: '0.8.12'],
[group: 'com.jayway.jsonpath', name: 'json-path', version: '0.9.1'],
// Although fineract (at the time of writing) doesn't have any compile time dep. on this,
// it's useful to have this for the Spring Boot TestRestTemplate http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-rest-templates-test-utility
[group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.3.5'],
// Once we've switched to Java 8 this dep can be removed.
//[group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.0']
)
testCompile 'junit:junit:4.11',
'junit:junit-dep:4.11',
'org.mockito:mockito-core:1.9.5',
'com.jayway.restassured:rest-assured:2.3.3',
[group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: springBootVersion]
}
+100
View File
@@ -0,0 +1,100 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
dependencies {
def tomcatVersion = '7.0.54'
tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
"org.apache.tomcat.embed:tomcat-embed-logging-log4j:${tomcatVersion}" // NOT tomcat-embed-logging-juli (http://stackoverflow.com/questions/23963049/classcircularityerror-java-util-logging-logrecord-running-gradle-webapp-with-ja)
tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") {
exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj'
}
tomcat "org.apache.tomcat:tomcat-dbcp:${tomcatVersion}"
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
providedCompile(
// [group: 'javax.servlet', name: 'servlet-api', version: '2.5'],
)
compile(
[group: 'ch.vorburger.mariaDB4j', name: 'mariaDB4j', version: '2.1.3'],
[group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: springBootVersion],
[group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: springBootVersion],
[group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: springBootVersion],
//[group: 'org.eclipse.persistence', name: 'javax.persistence', version: '2.0.0'],
[group: 'org.springframework', name: 'spring-context-support', version: springVersion],
[group: 'org.springframework.security.oauth', name: 'spring-security-oauth2', version: springOauthVersion],
[group: 'org.apache.openjpa', name:'openjpa-all', version:'2.4.1'],
[group: 'org.apache.openjpa', name:'openjpa-maven-plugin', version:'2.4.1'],
[group: 'javax.ws.rs', name: 'jsr311-api', version: '1.1.1'],
[group: 'com.sun.jersey', name: 'jersey-core', version: jerseyVersion],
[group: 'com.sun.jersey', name: 'jersey-servlet', version: jerseyVersion],
[group: 'com.sun.jersey', name: 'jersey-server', version: jerseyVersion],
[group: 'com.sun.jersey', name: 'jersey-json', version: jerseyVersion],
[group: 'com.sun.jersey.contribs', name: 'jersey-spring', version: jerseyVersion],
[group: 'com.sun.jersey.contribs', name: 'jersey-multipart', version: jerseyVersion],
[group: 'com.squareup.retrofit', name: 'retrofit', version: '1.6.1'],
[group: 'com.squareup.okhttp', name: 'okhttp', version: '2.0.0'],
[group: 'com.squareup.okhttp', name: 'okhttp-urlconnection', version: '2.0.0'],
[group: 'com.google.code.gson', name: 'gson', version: '2.2.4'],
[group: 'com.google.guava', name: 'guava', version: '15.0'],
[group: 'joda-time', name: 'joda-time', version: '2.4'],
//[group: 'net.sourceforge.javacsv', name: 'javacsv', version: '2.0'],
[group: 'org.apache.commons', name: 'commons-email', version: '1.3.3'],
[group: 'org.apache.commons', name: 'commons-lang3', version: '3.3.2'],
// no slf4j & logback here (anymore), as spring-boot-starter-logging already brings this now, better assembled (log4j-over-slf4j was originally forgotten here)
//[group: 'mysql', name: 'mysql-connector-java', version: '5.1.27'],
[group: 'org.drizzle.jdbc', name: 'drizzle-jdbc', version: '1.3'],
[group: 'org.apache.tomcat', name: 'tomcat-jdbc', version: tomcatVersion],
[group: 'org.apache.poi',name: 'poi', version: '3.9'],
[group: 'org.apache.poi',name: 'poi-ooxml', version: '3.9'],
[group: 'org.apache.poi',name: 'poi-ooxml-schemas', version: '3.9'],
[group: 'com.lowagie', name: 'itext', version: '2.1.7'],
[group: 'com.lowagie', name: 'itext-rtf', version: '2.1.7'],
[group: 'org.mnode.ical4j', name: 'ical4j', version: '1.0.4'],
[group: 'com.googlecode.flyway', name: 'flyway-core', version: '2.1.1'],
[group: 'org.quartz-scheduler', name: 'quartz', version: '2.1.7'],
[group: 'com.amazonaws', name: 'aws-java-sdk', version: '1.2.1'],
[group: 'net.sf.ehcache', name: 'ehcache', version: '2.7.2'],
[group: 'com.github.spullara.mustache.java', name: 'compiler', version: '0.8.12'],
[group: 'com.jayway.jsonpath', name: 'json-path', version: '0.9.1'],
// Although fineract (at the time of writing) doesn't have any compile time dep. on this,
// it's useful to have this for the Spring Boot TestRestTemplate http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-rest-templates-test-utility
[group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.3.5'],
// Once we've switched to Java 8 this dep can be removed.
//[group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.0']
)
testCompile 'junit:junit:4.11',
'junit:junit-dep:4.11',
'org.mockito:mockito-core:1.9.5',
'com.jayway.restassured:rest-assured:2.3.3',
[group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: springBootVersion]
}
+22
View File
@@ -0,0 +1,22 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
releaseVersion=0.3.2-incubating
buildType=BUILD
Binary file not shown.
@@ -0,0 +1,6 @@
#Fri Jan 29 13:04:36 IST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-bin.zip
+1 -1
View File
@@ -10,7 +10,7 @@
DEFAULT_JVM_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8005,server=y,suspend=n"
CATALINA_OPTS="-Xms512m -Xmx2048m"
JAVA_OPTS="-Xms512m -Xmx2048m -XX:PermSize=256m -XX:MaxPermSize=512m"
JAVA_OPTS="-Xms512m -Xmx2048m"
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
+113
View File
@@ -0,0 +1,113 @@
@REM
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8005,server=y,suspend=n
set CATALINA_OPTS=-Xms512m -Xmx512m
set JAVA_OPTS=-Xms512m -Xmx512m
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@@ -0,0 +1,20 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
spring.profiles.default=basicauth
@@ -0,0 +1,21 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
spring.profiles.default=basicauth
spring.profiles.active=oauth
@@ -1,31 +1,44 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.CenterDomain;
import org.apache.fineract.integrationtests.common.CenterHelper;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.GroupHelper;
import org.apache.fineract.integrationtests.common.OfficeHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.system.AccountNumberPreferencesHelper;
import org.apache.fineract.integrationtests.common.system.CodeHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.CenterDomain;
import org.mifosplatform.integrationtests.common.CenterHelper;
import org.mifosplatform.integrationtests.common.ClientHelper;
import org.mifosplatform.integrationtests.common.CommonConstants;
import org.mifosplatform.integrationtests.common.GroupHelper;
import org.mifosplatform.integrationtests.common.OfficeHelper;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
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.system.AccountNumberPreferencesHelper;
import org.mifosplatform.integrationtests.common.system.CodeHelper;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -274,7 +287,7 @@ public class AccountNumberPreferencesTest {
this.groupID = GroupHelper.activateGroup(this.requestSpec, this.responseSpec, groupID.toString());
GroupHelper.verifyGroupActivatedOnServer(this.requestSpec, this.responseSpec, groupID, true);
final String GROUP_URL = "/mifosng-provider/api/v1/groups/" + this.groupID + "?" + Utils.TENANT_IDENTIFIER;
final String GROUP_URL = "/fineract-provider/api/v1/groups/" + this.groupID + "?" + Utils.TENANT_IDENTIFIER;
this.groupAccountNo = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "accountNo");
if (isAccountPreferenceSetUp) {
@@ -305,7 +318,7 @@ public class AccountNumberPreferencesTest {
if (isAccountPreferenceSetUp) {
String centerPrefixName = (String) this.accountNumberPreferencesHelper.getAccountNumberPreference(
this.centerAccountNumberPreferenceId, "prefixType.value");
final String CENTER_URL = "/mifosng-provider/api/v1/centers/" + this.centerId + "?" + Utils.TENANT_IDENTIFIER;
final String CENTER_URL = "/fineract-provider/api/v1/centers/" + this.centerId + "?" + Utils.TENANT_IDENTIFIER;
if (centerPrefixName.equals(this.officeName)) {
final String centerOfficeName = Utils.performServerGet(requestSpec, responseSpec, CENTER_URL, "officeName");
@@ -1,37 +1,50 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import java.util.HashMap;
import java.util.List;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.OfficeHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.accounting.Account;
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
import org.apache.fineract.integrationtests.common.accounting.FinancialActivityAccountHelper;
import org.apache.fineract.integrationtests.common.accounting.JournalEntry;
import org.apache.fineract.integrationtests.common.accounting.JournalEntryHelper;
import org.apache.fineract.integrationtests.common.accounting.Account.AccountType;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.savings.AccountTransferHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.junit.After;
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.FinancialActivityAccountHelper;
import org.mifosplatform.integrationtests.common.accounting.JournalEntry;
import org.mifosplatform.integrationtests.common.accounting.JournalEntryHelper;
import org.mifosplatform.integrationtests.common.accounting.Account.AccountType;
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;
@@ -1,9 +1,22 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
@@ -18,34 +31,34 @@ import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.accounting.Account;
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
import org.apache.fineract.integrationtests.common.accounting.JournalEntry;
import org.apache.fineract.integrationtests.common.accounting.JournalEntryHelper;
import org.apache.fineract.integrationtests.common.accounting.PeriodicAccrualAccountingHelper;
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositAccountHelper;
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositAccountStatusChecker;
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositProductHelper;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.recurringdeposit.RecurringDepositAccountHelper;
import org.apache.fineract.integrationtests.common.recurringdeposit.RecurringDepositAccountStatusChecker;
import org.apache.fineract.integrationtests.common.recurringdeposit.RecurringDepositProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.joda.time.Days;
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.accounting.PeriodicAccrualAccountingHelper;
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;
@@ -153,8 +166,7 @@ public class AccountingScenarioIntegrationTest {
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), };
new JournalEntry(FIRST_INTEREST + FIRST_PRINCIPAL, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[1], assetAccountFirstEntry);
System.out.println("Repayment 1 Done......");
@@ -166,8 +178,7 @@ public class AccountingScenarioIntegrationTest {
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_AND_THIRD_INTEREST, JournalEntry.TransactionType.CREDIT),
new JournalEntry(SECOND_PRINCIPAL, JournalEntry.TransactionType.CREDIT), };
new JournalEntry(SECOND_AND_THIRD_INTEREST + SECOND_PRINCIPAL, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[2], assetAccountSecondEntry);
System.out.println("Repayment 2 Done ......");
@@ -303,7 +314,7 @@ public class AccountingScenarioIntegrationTest {
ChargesHelper.getSavingsWithdrawalFeeJSON());
Assert.assertNotNull(withdrawalChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsID, withdrawalChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsID, withdrawalChargeId, false);
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsID);
Assert.assertEquals(1, chargesPendingState.size());
HashMap savingsChargeForPay = chargesPendingState.get(0);
@@ -508,6 +519,7 @@ public class AccountingScenarioIntegrationTest {
System.out.println("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------");
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
final String fixedDepositProductJSON = fixedDepositProductHelper //
.withPeriodRangeChart()//
.withAccountingRuleAsCashBased(accounts).build(validFrom, validTo);
return FixedDepositProductHelper.createFixedDepositProduct(fixedDepositProductJSON, requestSpec, responseSpec);
}
@@ -516,7 +528,7 @@ public class AccountingScenarioIntegrationTest {
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);
.withSubmittedOnDate(submittedOnDate).build(clientID, productID, penalInterestType);
return this.fixedDepositAccountHelper
.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
}
@@ -525,6 +537,7 @@ public class AccountingScenarioIntegrationTest {
System.out.println("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------");
RecurringDepositProductHelper recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
final String recurringDepositProductJSON = recurringDepositProductHelper //
.withPeriodRangeChart()//
.withAccountingRuleAsCashBased(accounts).build(validFrom, validTo);
return RecurringDepositProductHelper.createRecurringDepositProduct(recurringDepositProductJSON, requestSpec, responseSpec);
}
@@ -535,7 +548,7 @@ public class AccountingScenarioIntegrationTest {
final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec)
//
.withSubmittedOnDate(submittedOnDate).withExpectedFirstDepositOnDate(expectedFirstDepositOnDate)
.build(clientID, productID, validFrom, validTo, penalInterestType);
.build(clientID, productID, penalInterestType);
return this.recurringDepositAccountHelper.applyRecurringDepositApplication(recurringDepositApplicationJSON, this.requestSpec,
this.responseSpec);
}
@@ -590,8 +603,7 @@ public class AccountingScenarioIntegrationTest {
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), };
new JournalEntry(FIRST_INTEREST + FIRST_PRINCIPAL, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[1], assetAccountFirstEntry);
System.out.println("Repayment 1 Done......");
@@ -607,8 +619,7 @@ public class AccountingScenarioIntegrationTest {
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), };
new JournalEntry(SECOND_AND_THIRD_INTEREST + SECOND_PRINCIPAL, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[2], assetAccountSecondEntry);
System.out.println("Repayment 2 Done ......");
@@ -708,7 +719,7 @@ public class AccountingScenarioIntegrationTest {
float expected_value = this.LP_PRINCIPAL - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(1, expected_value, loanID);
final JournalEntry[] assetAccountEntry = { new JournalEntry(15000f, JournalEntry.TransactionType.DEBIT),
new JournalEntry(1000f, JournalEntry.TransactionType.CREDIT), new JournalEntry(10000f, JournalEntry.TransactionType.CREDIT) };
new JournalEntry(11000f, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[1], assetAccountEntry);
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(overpaymentAccount, this.REPAYMENT_DATE[1], new JournalEntry(4000f,
JournalEntry.TransactionType.CREDIT));
@@ -1,24 +1,37 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import java.util.ArrayList;
import java.util.List;
import org.apache.fineract.batch.domain.BatchRequest;
import org.apache.fineract.batch.domain.BatchResponse;
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
import org.apache.fineract.integrationtests.common.BatchHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.batch.domain.BatchRequest;
import org.mifosplatform.batch.domain.BatchResponse;
import org.mifosplatform.infrastructure.core.serialization.FromJsonHelper;
import org.mifosplatform.integrationtests.common.BatchHelper;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
@@ -30,14 +43,14 @@ import com.jayway.restassured.specification.ResponseSpecification;
/**
* Test class for
* {@link org.mifosplatform.batch.command.CommandStrategyProvider}. This tests
* {@link org.apache.fineract.batch.command.CommandStrategyProvider}. This tests
* the response provided by commandStrategy by injecting it with a
* {@code BatchRequest}.
*
* @author RishabhShukla
*
* @see org.mifosplatform.integrationtests.common.BatchHelper
* @see org.mifosplatform.batch.domain.BatchRequest
* @see org.apache.fineract.integrationtests.common.BatchHelper
* @see org.apache.fineract.batch.domain.BatchRequest
*/
public class BatchApiTest {
@@ -66,7 +79,7 @@ public class BatchApiTest {
* code. For a unknownRequest a statusCode 501 is returned back with
* response.
*
* @see org.mifosplatform.batch.command.internal.UnknownCommandStrategy
* @see org.apache.fineract.batch.command.internal.UnknownCommandStrategy
*/
@Test
public void shouldReturnStatusNotImplementedUnknownCommand() {
@@ -89,7 +102,7 @@ public class BatchApiTest {
* createClientCommand. A successful response with statusCode '200' is
* returned back.
*
* @see org.mifosplatform.batch.command.internal.CreateClientCommandStrategy
* @see org.apache.fineract.batch.command.internal.CreateClientCommandStrategy
*/
@Test
public void shouldReturnOkStatusForCreateClientCommand() {
@@ -110,9 +123,9 @@ public class BatchApiTest {
* one of the request in BatchRequest fails then all transactions are rolled
* back.
*
* @see org.mifosplatform.batch.command.internal.CreateClientCommandStrategy
* @see org.mifosplatform.batch.api.BatchApiResource
* @see org.mifosplatform.batch.service.BatchApiService
* @see org.apache.fineract.batch.command.internal.CreateClientCommandStrategy
* @see org.apache.fineract.batch.api.BatchApiResource
* @see org.apache.fineract.batch.service.BatchApiService
*/
@Test
public void shouldRollBackAllTransactionsOnFailure() {
@@ -152,7 +165,7 @@ public class BatchApiTest {
* updateClientCommand. A 'changes' parameter is returned in the response
* after successful update of client information.
*
* @see org.mifosplatform.batch.command.internal.UpdateClientCommandStrategy
* @see org.apache.fineract.batch.command.internal.UpdateClientCommandStrategy
*/
@Test
public void shouldReflectChangesOnClientUpdate() {
@@ -187,7 +200,7 @@ public class BatchApiTest {
* This also verifies the successful resolution of dependencies among two
* requests.
*
* @see org.mifosplatform.batch.command.internal.ApplyLoanCommandStrategy
* @see org.apache.fineract.batch.command.internal.ApplyLoanCommandStrategy
*/
@Test
public void shouldReturnOkStatusForApplyLoanCommand() {
@@ -236,7 +249,7 @@ public class BatchApiTest {
* 200(OK) status was returned. It first creates a new client and a savings
* product, then uses the cliendId and ProductId to apply a savings account.
*
* @see org.mifosplatform.batch.command.internal.ApplySavingsCommandStrategy
* @see org.apache.fineract.batch.command.internal.ApplySavingsCommandStrategy
*/
@Test
public void shouldReturnOkStatusForApplySavingsCommand() {
@@ -279,8 +292,8 @@ public class BatchApiTest {
* It first creates a new client and apply a loan, then creates a new charge
* for the create loan and then fetches all the applied charges
*
* @see org.mifosplatform.batch.command.internal.CollectChargesCommandStrategy
* @see org.mifosplatform.batch.command.internal.CreateChargeCommandStrategy
* @see org.apache.fineract.batch.command.internal.CollectChargesCommandStrategy
* @see org.apache.fineract.batch.command.internal.CreateChargeCommandStrategy
*/
@Test
public void shouldReturnOkStatusForCollectChargesCommand() {
@@ -330,7 +343,7 @@ public class BatchApiTest {
* 'ActivateClientCommandStrategy'. A '200' status code is expected on
* successful activation.
*
* @see org.mifosplatform.batch.command.internal.ActivateClientCommandStrategy
* @see org.apache.fineract.batch.command.internal.ActivateClientCommandStrategy
*/
@Test
public void shouldReturnOkStatusOnSuccessfulClientActivation() {
@@ -360,8 +373,8 @@ public class BatchApiTest {
* 'ApproveLoanCommandStrategy' and 'DisburseLoanCommandStrategy'. A '200'
* status code is expected on successful activation.
*
* @see org.mifosplatform.batch.command.internal.ApproveLoanCommandStrategy
* @see org.mifosplatform.batch.command.internal.DisburseLoanCommandStrategy
* @see org.apache.fineract.batch.command.internal.ApproveLoanCommandStrategy
* @see org.apache.fineract.batch.command.internal.DisburseLoanCommandStrategy
*/
@Test
public void shouldReturnOkStatusOnSuccessfulLoanApprovalAndDisburse() {
@@ -1,24 +1,37 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import java.util.ArrayList;
import java.util.List;
import org.apache.fineract.batch.domain.BatchRequest;
import org.apache.fineract.batch.domain.BatchResponse;
import org.apache.fineract.integrationtests.common.BatchHelper;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.GroupHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.batch.domain.BatchRequest;
import org.mifosplatform.batch.domain.BatchResponse;
import org.mifosplatform.integrationtests.common.BatchHelper;
import org.mifosplatform.integrationtests.common.ClientHelper;
import org.mifosplatform.integrationtests.common.GroupHelper;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -1,9 +1,22 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
@@ -12,14 +25,14 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.CenterDomain;
import org.apache.fineract.integrationtests.common.CenterHelper;
import org.apache.fineract.integrationtests.common.OfficeHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.CenterDomain;
import org.mifosplatform.integrationtests.common.CenterHelper;
import org.mifosplatform.integrationtests.common.OfficeHelper;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.organisation.StaffHelper;
import com.google.gson.Gson;
import com.jayway.restassured.builder.RequestSpecBuilder;
@@ -177,7 +190,7 @@ public class CenterIntegrationTest {
map.put("active", "true");
map.put("activationDate", "04 March 2011");
groupMembers[i] = Utils.performServerPost(requestSpec, responseSpec, "/mifosng-provider/api/v1/groups?"
groupMembers[i] = Utils.performServerPost(requestSpec, responseSpec, "/fineract-provider/api/v1/groups?"
+ Utils.TENANT_IDENTIFIER, new Gson().toJson(map), "groupId");
}
return groupMembers;
@@ -1,18 +1,31 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import java.util.ArrayList;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
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;
@@ -0,0 +1,61 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import java.util.HashMap;
public class ClientStatusChecker {
public static void verifyClientIsActive(final HashMap<String, Object> clientStatusHashMap) {
assertEquals((int) clientStatusHashMap.get("id"), 300);
}
public static void verifyClientClosed(final HashMap<String, Object> clientStatusHashMap) {
System.out.println("\n-------------------------------------- VERIFYING CLIENT IS CLOSED ------------------------------------");
assertEquals((int) clientStatusHashMap.get("id"), 600);
System.out.println("Client Status:" + clientStatusHashMap + "\n");
}
public static void verifyClientPending(final HashMap<String, Object> clientStatusHashMap) {
System.out.println("\n-------------------------------------- VERIFYING CLIENT IS PENDING ------------------------------------");
assertEquals((int) clientStatusHashMap.get("id"), 100);
System.out.println("Client Status:" + clientStatusHashMap + "\n");
}
public static void verifyClientRejected(final HashMap<String, Object> clientStatusHashMap) {
System.out.println("\n-------------------------------------- VERIFYING CLIENT IS REJECTED ------------------------------------");
assertEquals((int) clientStatusHashMap.get("id"), 700);
System.out.println("Client Status:" + clientStatusHashMap + "\n");
}
public static void verifyClientActiavted(final HashMap<String, Object> clientStatusHashMap) {
System.out.println("\n-------------------------------------- VERIFYING CLIENT IS ACTIVATED ------------------------------------");
assertEquals((int) clientStatusHashMap.get("id"), 300);
System.out.println("Client Status:" + clientStatusHashMap + "\n");
}
public static void verifyClientWithdrawn(final HashMap<String, Object> clientStatusHashMap) {
System.out.println("\n-------------------------------------- VERIFYING CLIENT IS WITHDRAWN ------------------------------------");
assertEquals((int) clientStatusHashMap.get("id"), 800);
System.out.println("Client Status:" + clientStatusHashMap + "\n");
}
}
@@ -0,0 +1,148 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.integrationtests;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
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;
public class ClientTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
private ClientHelper clientHelper;
@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 testClientStatus() {
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientIsActive(status);
HashMap<String, Object> clientStatusHashMap = this.clientHelper.closeClient(clientId);
ClientStatusChecker.verifyClientClosed(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.reactivateClient(clientId);
ClientStatusChecker.verifyClientPending(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.rejectClient(clientId);
ClientStatusChecker.verifyClientRejected(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.activateClient(clientId);
ClientStatusChecker.verifyClientActiavted(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.closeClient(clientId);
ClientStatusChecker.verifyClientClosed(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.reactivateClient(clientId);
ClientStatusChecker.verifyClientPending(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.withdrawClient(clientId);
ClientStatusChecker.verifyClientWithdrawn(clientStatusHashMap);
}
@Test
public void testClientAsPersonStatus() {
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientAsPerson(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientIsActive(status);
HashMap<String, Object> clientStatusHashMap = this.clientHelper.closeClient(clientId);
ClientStatusChecker.verifyClientClosed(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.reactivateClient(clientId);
ClientStatusChecker.verifyClientPending(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.rejectClient(clientId);
ClientStatusChecker.verifyClientRejected(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.activateClient(clientId);
ClientStatusChecker.verifyClientActiavted(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.closeClient(clientId);
ClientStatusChecker.verifyClientClosed(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.reactivateClient(clientId);
ClientStatusChecker.verifyClientPending(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.withdrawClient(clientId);
ClientStatusChecker.verifyClientWithdrawn(clientStatusHashMap);
}
@Test
public void testClientAsEntityStatus() {
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientAsEntity(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientIsActive(status);
HashMap<String, Object> clientStatusHashMap = this.clientHelper.closeClient(clientId);
ClientStatusChecker.verifyClientClosed(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.reactivateClient(clientId);
ClientStatusChecker.verifyClientPending(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.rejectClient(clientId);
ClientStatusChecker.verifyClientRejected(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.activateClient(clientId);
ClientStatusChecker.verifyClientActiavted(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.closeClient(clientId);
ClientStatusChecker.verifyClientClosed(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.reactivateClient(clientId);
ClientStatusChecker.verifyClientPending(clientStatusHashMap);
clientStatusHashMap = this.clientHelper.withdrawClient(clientId);
ClientStatusChecker.verifyClientWithdrawn(clientStatusHashMap);
}
}
@@ -0,0 +1,353 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Locale;
import java.util.Random;
import org.apache.fineract.infrastructure.core.data.ApiParameterError;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.apache.fineract.portfolio.client.api.ClientApiConstants;
import org.apache.fineract.portfolio.client.domain.Client;
import org.apache.fineract.portfolio.client.exception.InvalidClientStateTransitionException;
import org.apache.fineract.useradministration.domain.AppUser;
import org.joda.time.LocalDate;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import com.google.gson.Gson;
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" })
public class ClientUndoRejectAndWithdrawalIntegrationTest {
private static final String CREATE_CLIENT_URL = "/fineract-provider/api/v1/clients?" + Utils.TENANT_IDENTIFIER;
public static final String DATE_FORMAT = "dd MMMM yyyy";
private final String submittedOnDate = "submittedOnDate";
private final String officeId = "officeId";
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
private ClientHelper clientHelper;
@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.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
}
@Test
public void clientUndoRejectIntegrationTest() {
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
status = this.clientHelper.rejectClient(clientId);
ClientStatusChecker.verifyClientRejected(status);
status = this.clientHelper.undoReject(clientId);
ClientStatusChecker.verifyClientPending(status);
}
@Test
public void testClientUndoRejectWithDateBeforeRejectDate() {
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(403).build();
final ClientHelper validationErrorHelper = new ClientHelper(this.requestSpec, errorResponse);
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
status = this.clientHelper.rejectClient(clientId);
ClientStatusChecker.verifyClientRejected(status);
ArrayList<HashMap> clientErrorData = (ArrayList<HashMap>) validationErrorHelper.undoRejectedclient(clientId,
CommonConstants.RESPONSE_ERROR, ClientHelper.CREATED_DATE);
assertEquals("error.msg.client.reopened.date.cannot.before.client.rejected.date",
((HashMap<String, Object>) clientErrorData.get(0)).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
status = this.clientHelper.undoReject(clientId);
ClientStatusChecker.verifyClientPending(status);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void testClientUndoRejectWithoutReject() {
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(403).build();
final ClientHelper validationErrorHelper = new ClientHelper(this.requestSpec, errorResponse);
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
Calendar todaysDate = Calendar.getInstance();
final String undoRejectDate = dateFormat.format(todaysDate.getTime());
ArrayList<HashMap> clientErrorData = (ArrayList<HashMap>) validationErrorHelper.undoRejectedclient(clientId,
CommonConstants.RESPONSE_ERROR, undoRejectDate);
assertEquals("error.msg.client.undorejection.on.nonrejected.account",
((HashMap<String, Object>) clientErrorData.get(0)).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
status = this.clientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
}
@Test
public void testClientUndoRejectWithFutureDate() {
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(400).build();
final ClientHelper validationErrorHelper = new ClientHelper(this.requestSpec, errorResponse);
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
status = this.clientHelper.rejectClient(clientId);
ClientStatusChecker.verifyClientRejected(status);
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
Calendar todaysDate = Calendar.getInstance();
todaysDate.add(Calendar.DATE, 1);
final String undoRejectDate = dateFormat.format(todaysDate.getTime());
ArrayList<HashMap> clientErrorData = (ArrayList<HashMap>) validationErrorHelper.undoWithdrawclient(clientId,
CommonConstants.RESPONSE_ERROR, undoRejectDate);
assertEquals("validation.msg.client.reopenedDate.is.greater.than.date",
((HashMap<String, Object>) clientErrorData.get(0)).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
status = this.clientHelper.undoReject(clientId);
ClientStatusChecker.verifyClientPending(status);
}
@Test
public void clientUndoWithDrawnIntegrationTest() {
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
status = this.clientHelper.withdrawClient(clientId);
ClientStatusChecker.verifyClientWithdrawn(status);
status = this.clientHelper.undoWithdrawn(clientId);
ClientStatusChecker.verifyClientPending(status);
}
@Test
public void testClientUndoWithDrawnWithDateBeforeWithdrawal() {
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(403).build();
final ClientHelper validationErrorHelper = new ClientHelper(this.requestSpec, errorResponse);
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
status = this.clientHelper.withdrawClient(clientId);
ClientStatusChecker.verifyClientWithdrawn(status);
ArrayList<HashMap> clientErrorData = (ArrayList<HashMap>) validationErrorHelper.undoWithdrawclient(clientId,
CommonConstants.RESPONSE_ERROR, ClientHelper.CREATED_DATE);
assertEquals("error.msg.client.reopened.date.cannot.before.client.withdrawal.date",
((HashMap<String, Object>) clientErrorData.get(0)).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
status = this.clientHelper.undoWithdrawn(clientId);
ClientStatusChecker.verifyClientPending(status);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void testClientUndoWithDrawnWithoutWithdrawal() {
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(403).build();
final ClientHelper validationErrorHelper = new ClientHelper(this.requestSpec, errorResponse);
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
String.valueOf(clientId));
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
Calendar todaysDate = Calendar.getInstance();
final String undoWithdrawDate = dateFormat.format(todaysDate.getTime());
ArrayList<HashMap> clientErrorData = (ArrayList<HashMap>) validationErrorHelper.undoWithdrawclient(clientId,
CommonConstants.RESPONSE_ERROR, undoWithdrawDate);
assertEquals("error.msg.client.undoWithdrawal.on.nonwithdrawal.account",
((HashMap<String, Object>) clientErrorData.get(0)).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
status = this.clientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
}
@Test
public void testClientUndoWithDrawnWithFutureDate() {
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(400).build();
final ClientHelper validationErrorHelper = new ClientHelper(this.requestSpec, errorResponse);
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
status = this.clientHelper.withdrawClient(clientId);
ClientStatusChecker.verifyClientWithdrawn(status);
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
Calendar todaysDate = Calendar.getInstance();
todaysDate.add(Calendar.DATE, 1);
final String undoWithdrawDate = dateFormat.format(todaysDate.getTime());
ArrayList<HashMap> clientErrorData = (ArrayList<HashMap>) validationErrorHelper.undoWithdrawclient(clientId,
CommonConstants.RESPONSE_ERROR, undoWithdrawDate);
assertEquals("validation.msg.client.reopenedDate.is.greater.than.date",
((HashMap<String, Object>) clientErrorData.get(0)).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
status = this.clientHelper.undoWithdrawn(clientId);
ClientStatusChecker.verifyClientPending(status);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void testValidateReopenedDate() {
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(400).build();
final ClientHelper validationErrorHelper = new ClientHelper(this.requestSpec, errorResponse);
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
status = this.clientHelper.withdrawClient(clientId);
ClientStatusChecker.verifyClientWithdrawn(status);
status = this.clientHelper.undoWithdrawn(clientId);
ClientStatusChecker.verifyClientPending(status);
ArrayList<HashMap> clientErrorData = (ArrayList<HashMap>) validationErrorHelper.activateClient(clientId,
CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.clients.submittedOnDate.after.reopened.date",
((HashMap<String, Object>) clientErrorData.get(0)).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
}
@Test
public void testReopenedDate() {
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(400).build();
final ClientHelper validationErrorHelper = new ClientHelper(this.requestSpec, errorResponse);
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
status = this.clientHelper.withdrawClient(clientId);
ClientStatusChecker.verifyClientWithdrawn(status);
status = this.clientHelper.undoWithdrawn(clientId);
ClientStatusChecker.verifyClientPending(status);
status = this.clientHelper.activateClientWithDiffDateOption(clientId, ClientHelper.CREATED_DATE_PLUS_TWO);
}
private static String randomIDGenerator(final String prefix, final int lenOfRandomSuffix) {
return Utils.randomStringGenerator(prefix, lenOfRandomSuffix, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
}
}
@@ -1,9 +1,22 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@@ -12,14 +25,14 @@ import java.util.Locale;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.accounting.Account;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.ClientHelper;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.accounting.Account;
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -80,7 +93,7 @@ public class ConcurrencyIntegrationTest {
private Integer createLoanProduct(final boolean multiDisburseLoan, final String accountingRule, final Account... accounts) {
System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
final String loanProductJSON = new LoanProductTestBuilder() //
LoanProductTestBuilder builder = new LoanProductTestBuilder() //
.withPrincipal("12,000.00") //
.withNumberOfRepayments("4") //
.withRepaymentAfterEvery("1") //
@@ -90,7 +103,12 @@ public class ConcurrencyIntegrationTest {
.withAmortizationTypeAsEqualInstallments() //
.withInterestTypeAsDecliningBalance() //
.withTranches(multiDisburseLoan) //
.withAccounting(accountingRule, accounts).build(null);
.withAccounting(accountingRule, accounts);
if (multiDisburseLoan) {
builder = builder.withInterestCalculationPeriodTypeAsRepaymentPeriod(true);
}
final String loanProductJSON = builder.build(null);
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
}
@@ -0,0 +1,97 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.integrationtests;
import java.util.ArrayList;
import java.util.Collections;
import org.apache.fineract.integrationtests.common.CurrenciesHelper;
import org.apache.fineract.integrationtests.common.CurrencyDomain;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
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", "rawtypes" })
public class CurrenciesTest {
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 testCurrencyElements() {
CurrencyDomain currency = CurrenciesHelper.getCurrencybyCode(requestSpec, responseSpec, "USD");
CurrencyDomain usd = CurrencyDomain.create("USD", "US Dollar", 2, "$", "currency.USD", "US Dollar ($)").build();
Assert.assertTrue(currency.getDecimalPlaces() >= 0);
Assert.assertNotNull(currency.getName());
Assert.assertNotNull(currency.getDisplaySymbol());
Assert.assertNotNull(currency.getDisplayLabel());
Assert.assertNotNull(currency.getNameCode());
Assert.assertEquals(usd, currency);
}
@Test
public void testUpdateCurrencySelection() {
// Test updation
ArrayList<String> currenciestoUpdate = new ArrayList<String>();
currenciestoUpdate.add("KES");
currenciestoUpdate.add("BND");
currenciestoUpdate.add("LBP");
currenciestoUpdate.add("GHC");
currenciestoUpdate.add("USD");
currenciestoUpdate.add("INR");
ArrayList<String> currenciesOutput = CurrenciesHelper.updateSelectedCurrencies(this.requestSpec, this.responseSpec,
currenciestoUpdate);
Assert.assertNotNull(currenciesOutput);
Assert.assertEquals("Verifying Do Outputed Currencies Match after Updation", currenciestoUpdate, currenciesOutput);
// Test that output matches updation
ArrayList<CurrencyDomain> currenciesBeforeUpdate = new ArrayList<CurrencyDomain>();
for (String e : currenciestoUpdate) {
currenciesBeforeUpdate.add(CurrenciesHelper.getCurrencybyCode(requestSpec, responseSpec, e));
}
Collections.sort(currenciesBeforeUpdate);
ArrayList<CurrencyDomain> currenciesAfterUpdate = CurrenciesHelper.getSelectedCurrencies(requestSpec, responseSpec);
Assert.assertNotNull(currenciesAfterUpdate);
Assert.assertEquals("Verifying Do Selected Currencies Match after Updation", currenciesBeforeUpdate, currenciesAfterUpdate);
}
}
@@ -0,0 +1,45 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.integrationtests;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.junit.Before;
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;
public class CurrencyIntegrationTest {
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();
}
}
@@ -1,9 +1,22 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -14,12 +27,12 @@ import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import org.apache.fineract.integrationtests.common.*;
import org.apache.fineract.integrationtests.common.loans.*;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.*;
import org.mifosplatform.integrationtests.common.loans.*;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -51,7 +64,7 @@ public class DisbursalAndRepaymentScheduleTest {
private final String numberOfRepayments = "12";
private final String interestRatePerPeriod = "18";
private final SimpleDateFormat dateFormatterMifosStandard = new SimpleDateFormat("dd MMMM yyyy");
private final SimpleDateFormat dateFormatterStandard = new SimpleDateFormat("dd MMMM yyyy");
@Before
public void setup() {
@@ -78,17 +91,17 @@ public class DisbursalAndRepaymentScheduleTest {
meetingCalendar.add(Calendar.WEEK_OF_YEAR, -3);
final String groupMeetingDate = this.dateFormatterMifosStandard.format(meetingCalendar.getTime());
final String groupMeetingDate = this.dateFormatterStandard.format(meetingCalendar.getTime());
final String disbursalDate = groupMeetingDate; // first meeting date
// after group creation
final String rescheduleSubmittedDate = this.dateFormatterMifosStandard.format(new java.util.Date());
final String rescheduleSubmittedDate = this.dateFormatterStandard.format(new java.util.Date());
final String loanType = "jlg";
final String rescheduleInterestRate = "28.0";
groupMeetingChangeCalendar.add(Calendar.DAY_OF_YEAR, 1);
final String groupMeetingNewStartDate = this.dateFormatterMifosStandard.format(groupMeetingChangeCalendar.getTime());
final String groupMeetingNewStartDate = this.dateFormatterStandard.format(groupMeetingChangeCalendar.getTime());
// The date
// from
// which we
@@ -99,11 +112,11 @@ public class DisbursalAndRepaymentScheduleTest {
// this is a
// tuesday.
groupMeetingChangeCalendar.add(Calendar.WEEK_OF_YEAR, 2);
final String rescheduleDate = this.dateFormatterMifosStandard.format(groupMeetingChangeCalendar.getTime());
final String rescheduleDate = this.dateFormatterStandard.format(groupMeetingChangeCalendar.getTime());
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
this.requestSpec.header("X-Mifos-Platform-TenantId", "default");
this.requestSpec.header("Fineract-Platform-TenantId", "default");
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
this.generalResponseSpec = new ResponseSpecBuilder().build();
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
@@ -218,14 +231,14 @@ public class DisbursalAndRepaymentScheduleTest {
meetingCalendar.add(Calendar.WEEK_OF_YEAR, -3);
final String groupMeetingDate = this.dateFormatterMifosStandard.format(meetingCalendar.getTime());
final String groupMeetingDate = this.dateFormatterStandard.format(meetingCalendar.getTime());
final String disbursalDate = groupMeetingDate; // first meeting date
// after group creation
final String loanType = "jlg";
groupMeetingChangeCalendar.add(Calendar.DAY_OF_YEAR, 1);
final String groupMeetingNewStartDate = this.dateFormatterMifosStandard.format(groupMeetingChangeCalendar.getTime());
final String groupMeetingNewStartDate = this.dateFormatterStandard.format(groupMeetingChangeCalendar.getTime());
// The date
// from
// which we
@@ -238,7 +251,7 @@ public class DisbursalAndRepaymentScheduleTest {
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
this.requestSpec.header("X-Mifos-Platform-TenantId", "default");
this.requestSpec.header("Fineract-Platform-TenantId", "default");
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
this.generalResponseSpec = new ResponseSpecBuilder().build();
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
@@ -1,18 +1,31 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import java.util.ArrayList;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.ExternalServicesConfigurationHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.ExternalServicesConfigurationHelper;
import org.mifosplatform.integrationtests.common.Utils;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -1,28 +1,41 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import java.util.HashMap;
import java.util.List;
import org.apache.fineract.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
import org.apache.fineract.accounting.financialactivityaccount.exception.DuplicateFinancialActivityAccountFoundException;
import org.apache.fineract.accounting.financialactivityaccount.exception.FinancialActivityAccountInvalidException;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.accounting.Account;
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
import org.apache.fineract.integrationtests.common.accounting.FinancialActivityAccountHelper;
import org.junit.Assert;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
import org.mifosplatform.accounting.financialactivityaccount.exception.DuplicateFinancialActivityAccountFoundException;
import org.mifosplatform.accounting.financialactivityaccount.exception.FinancialActivityAccountInvalidException;
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.AccountHelper;
import org.mifosplatform.integrationtests.common.accounting.FinancialActivityAccountHelper;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -1,9 +1,22 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
@@ -14,12 +27,33 @@ import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import org.apache.fineract.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
import org.apache.fineract.integrationtests.common.TaxComponentHelper;
import org.apache.fineract.integrationtests.common.TaxGroupHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.accounting.Account;
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
import org.apache.fineract.integrationtests.common.accounting.FinancialActivityAccountHelper;
import org.apache.fineract.integrationtests.common.accounting.JournalEntry;
import org.apache.fineract.integrationtests.common.accounting.JournalEntryHelper;
import org.apache.fineract.integrationtests.common.accounting.Account.AccountType;
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositAccountHelper;
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositAccountStatusChecker;
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositProductHelper;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.joda.time.DateTime;
import org.joda.time.Days;
import org.joda.time.Months;
@@ -27,23 +61,6 @@ import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
import org.mifosplatform.integrationtests.common.ClientHelper;
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.AccountHelper;
import org.mifosplatform.integrationtests.common.accounting.FinancialActivityAccountHelper;
import org.mifosplatform.integrationtests.common.accounting.JournalEntry;
import org.mifosplatform.integrationtests.common.accounting.JournalEntryHelper;
import org.mifosplatform.integrationtests.common.accounting.Account.AccountType;
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.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;
@@ -94,15 +111,15 @@ public class FixedDepositTest {
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.requestSpec.header("Fineract-Platform-TenantId", "default");
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
this.financialActivityAccountHelper = new FinancialActivityAccountHelper(this.requestSpec);
}
/***
* Test case for Fixed Deposit Account premature closure with
* transaction type withdrawal and Cash Based accounting enabled
* Test case for Fixed Deposit Account premature closure with transaction
* type withdrawal and Cash Based accounting enabled
*/
@Test
public void testFixedDepositAccountWithPrematureClosureTypeWithdrawal() {
@@ -110,7 +127,7 @@ public class FixedDepositTest {
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.fixedDepositAccountHelper = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec);
/***
* Create GL Accounts for product account mapping
*/
@@ -157,8 +174,8 @@ public class FixedDepositTest {
/***
* Apply for FD account with created product and verify status
*/
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -176,11 +193,11 @@ public class FixedDepositTest {
*/
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
HashMap accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float depositAmount = (Float) accountSummary.get("totalDeposits");
/***
* Verify journal entries posted for initial deposit transaction which
* happened at activation time
@@ -201,7 +218,7 @@ public class FixedDepositTest {
*/
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(transactionIdForPostInterest);
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
@@ -227,18 +244,456 @@ public class FixedDepositTest {
this.responseSpec, fixedDepositAccountId.toString());
FixedDepositAccountStatusChecker.verifyFixedDepositAccountIsPrematureClosed(fixedDepositAccountStatusHashMap);
/***
* Verify journal entry transactions for preclosure transaction
*/
HashMap accountDetails = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
fixedDepositAccountId);
Float maturityAmount = Float.valueOf(accountDetails.get("maturityAmount").toString());
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount,
JournalEntry.TransactionType.CREDIT));
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount,
JournalEntry.TransactionType.DEBIT));
}
@Test
public void testFixedDepositAccountWithPrematureClosureTypeWithdrawal_WITH_HOLD_TAX() {
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);
/***
* Create GL Accounts for product account mapping
*/
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 liabilityAccountForTax = this.accountHelper.createLiabilityAccount();
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
DateFormat monthDayFormat = new SimpleDateFormat("dd MMM", Locale.US);
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 MONTH_DAY = monthDayFormat.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 String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
/***
* Create FD product with CashBased accounting enabled
*/
final String accountingRule = CASH_BASED;
final Integer taxGroupId = createTaxGroup("10", liabilityAccountForTax);
Integer fixedDepositProductId = createFixedDepositProductWithWithHoldTax(VALID_FROM, VALID_TO, String.valueOf(taxGroupId),
accountingRule, assetAccount, liabilityAccount, incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId);
/***
* Apply for FD account with created product and verify status
*/
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
SUBMITTED_ON_DATE, WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
FixedDepositAccountStatusChecker.verifyFixedDepositIsPending(fixedDepositAccountStatusHashMap);
/***
* Approve the FD account and verify whether account is approved
*/
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
/***
* Activate the FD Account and verify whether account is activated
*/
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
HashMap accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float depositAmount = (Float) accountSummary.get("totalDeposits");
/***
* Verify journal entries posted for initial deposit transaction which
* happened at activation time
*/
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);
/***
* Update interest earned of FD account
*/
fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(fixedDepositAccountId);
/***
* Post interest and verify the account summary
*/
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(transactionIdForPostInterest);
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
Assert.assertNull(accountSummary.get("totalWithholdTax"));
/***
* Verify journal entries transactions for interest posting transaction
*/
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);
/***
* Preclose the FD account verify whether account is preClosed
*/
HashMap fixedDepositPrematureData = this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId,
CLOSED_ON_DATE);
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(prematureClosureTransactionId);
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
FixedDepositAccountStatusChecker.verifyFixedDepositAccountIsPrematureClosed(fixedDepositAccountStatusHashMap);
/***
* Verify journal entry transactions for preclosure transaction
*/
HashMap accountDetails = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
fixedDepositAccountId);
Float maturityAmount = Float.valueOf(accountDetails.get("maturityAmount").toString());
HashMap summary = (HashMap) accountDetails.get("summary");
Assert.assertNotNull(summary.get("totalWithholdTax"));
Float withHoldTax = (Float) summary.get("totalWithholdTax");
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount,
JournalEntry.TransactionType.CREDIT));
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount,
JournalEntry.TransactionType.DEBIT));
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccountForTax, CLOSED_ON_DATE, new JournalEntry(withHoldTax,
JournalEntry.TransactionType.CREDIT));
}
@Test
public void testFixedDepositAccountClosureTypeWithdrawal_WITH_HOLD_TAX() throws InterruptedException {
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);
/***
* Create GL Accounts for product account mapping
*/
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 liabilityAccountForTax = this.accountHelper.createLiabilityAccount();
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
DateFormat monthDayFormat = new SimpleDateFormat("dd MMM", Locale.US);
DateFormat currentDateFormat = new SimpleDateFormat("dd");
Calendar todaysDate = Calendar.getInstance();
todaysDate.add(Calendar.MONTH, -20);
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, -20);
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 MONTH_DAY = monthDayFormat.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);
Calendar closedOn = Calendar.getInstance();
closedOn.add(Calendar.MONTH, -6);
final String CLOSED_ON_DATE = dateFormat.format(closedOn.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
/***
* Create FD product with CashBased accounting enabled
*/
final String accountingRule = CASH_BASED;
final Integer taxGroupId = createTaxGroup("10", liabilityAccountForTax);
Integer fixedDepositProductId = createFixedDepositProductWithWithHoldTax(VALID_FROM, VALID_TO, String.valueOf(taxGroupId),
accountingRule, assetAccount, liabilityAccount, incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId);
/***
* Apply for FD account with created product and verify status
*/
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
SUBMITTED_ON_DATE, WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
FixedDepositAccountStatusChecker.verifyFixedDepositIsPending(fixedDepositAccountStatusHashMap);
/***
* Approve the FD account and verify whether account is approved
*/
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
/***
* Activate the FD Account and verify whether account is activated
*/
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
HashMap accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float depositAmount = (Float) accountSummary.get("totalDeposits");
/***
* Verify journal entries posted for initial deposit transaction which
* happened at activation time
*/
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);
/***
* Update interest earned of FD account
*/
fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(fixedDepositAccountId);
/***
* Post interest and verify the account summary
*/
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(transactionIdForPostInterest);
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
Assert.assertNull(accountSummary.get("totalWithholdTax"));
/***
* FD account verify whether account is matured
*/
SchedulerJobHelper schedulerJobHelper = new SchedulerJobHelper(requestSpec, responseSpec);
String JobName = "Update Deposit Accounts Maturity details";
schedulerJobHelper.executeJob(JobName);
HashMap accountDetails = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
fixedDepositAccountId);
HashMap summary = (HashMap) accountDetails.get("summary");
Assert.assertNotNull(summary.get("totalWithholdTax"));
Float withHoldTax = (Float) summary.get("totalWithholdTax");
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccountForTax, CLOSED_ON_DATE, new JournalEntry(withHoldTax,
JournalEntry.TransactionType.CREDIT));
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
FixedDepositAccountStatusChecker.verifyFixedDepositAccountIsMatured(fixedDepositAccountStatusHashMap);
}
@Test
public void testFixedDepositAccountWithPeriodInterestRateChart() {
final String chartToUse = "period";
final String depositAmount = "10000";
final String depositPeriod = "12";
final Float interestRate = new Float(6.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testFixedDepositAccountWithPeriodInterestRateChart_AMOUNT_VARIATION() {
final String chartToUse = "period";
final String depositAmount = "2000";
final String depositPeriod = "12";
final Float interestRate = new Float(6.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testFixedDepositAccountWithPeriodInterestRateChart_PERIOD_VARIATION() {
final String chartToUse = "period";
final String depositAmount = "10000";
final String depositPeriod = "18";
final Float interestRate = new Float(7.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testFixedDepositAccountWithAmountInterestRateChart() {
final String chartToUse = "amount";
final String depositAmount = "10000";
final String depositPeriod = "12";
final Float interestRate = new Float(7.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testFixedDepositAccountWithAmountInterestRateChart_AMOUNT_VARIATION() {
final String chartToUse = "amount";
final String depositAmount = "5000";
final String depositPeriod = "12";
final Float interestRate = new Float(5.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testFixedDepositAccountWithAmountInterestRateChart_PERIOD_VARIATION() {
final String chartToUse = "amount";
final String depositAmount = "10000";
final String depositPeriod = "26";
final Float interestRate = new Float(7.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testFixedDepositAccountWithPeriodAndAmountInterestRateChart() {
final String chartToUse = "period_amount";
final String depositAmount = "10000";
final String depositPeriod = "12";
final Float interestRate = new Float(7.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testFixedDepositAccountWithPeriodAndAmountInterestRateChart_AMOUNT_VARIATION() {
final String chartToUse = "period_amount";
final String depositAmount = "5000";
final String depositPeriod = "12";
final Float interestRate = new Float(6.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testFixedDepositAccountWithPeriodAndAmountInterestRateChart_PERIOD_VARIATION() {
final String chartToUse = "period_amount";
final String depositAmount = "10000";
final String depositPeriod = "20";
final Float interestRate = new Float(9.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testFixedDepositAccountWithAmountAndPeriodInterestRateChart() {
final String chartToUse = "amount_period";
final String depositAmount = "10000";
final String depositPeriod = "12";
final Float interestRate = new Float(8.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testFixedDepositAccountWithAmountAndPeriodInterestRateChart_AMOUNT_VARIATION() {
final String chartToUse = "amount_period";
final String depositAmount = "5000";
final String depositPeriod = "12";
final Float interestRate = new Float(6.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testFixedDepositAccountWithAmountAndPeriodInterestRateChart_PERIOD_VARIATION() {
final String chartToUse = "amount_period";
final String depositAmount = "10000";
final String depositPeriod = "6";
final Float interestRate = new Float(7.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
private void testFixedDepositAccountForInterestRate(final String chartToUse, final String depositAmount, final String depositPeriod,
final Float interestRate) {
this.fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.fixedDepositAccountHelper = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec);
final String VALID_FROM = "01 March 2014";
final String VALID_TO = "01 March 2016";
final String SUBMITTED_ON_DATE = "01 March 2015";
final String APPROVED_ON_DATE = "01 March 2015";
final String ACTIVATION_DATE = "01 March 2015";
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
/***
* Create FD product with CashBased accounting enabled
*/
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, chartToUse);
Assert.assertNotNull(fixedDepositProductId);
/***
* Apply for FD account with created product and verify status
*/
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM, depositAmount, depositPeriod);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
FixedDepositAccountStatusChecker.verifyFixedDepositIsPending(fixedDepositAccountStatusHashMap);
/***
* Approve the FD account and verify whether account is approved
*/
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
/***
* Activate the FD Account and verify whether account is activated
*/
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
HashMap accountSummary = this.fixedDepositAccountHelper.getFixedDepositDetails(fixedDepositAccountId);
Assert.assertEquals(interestRate, accountSummary.get("nominalAnnualInterestRate"));
}
/***
* Test case for FD Account premature closure with transaction transfers to
@@ -250,7 +705,7 @@ public class FixedDepositTest {
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.fixedDepositAccountHelper = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec);
/***
* Create GL Accounts for product account mapping
*/
@@ -282,7 +737,7 @@ public class FixedDepositTest {
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
@@ -313,8 +768,8 @@ public class FixedDepositTest {
incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -330,7 +785,7 @@ public class FixedDepositTest {
HashMap accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float depositAmount = (Float) accountSummary.get("totalDeposits");
/***
* Verify journal entries posted for initial deposit transaction which
* happened at activation time
@@ -362,10 +817,10 @@ public class FixedDepositTest {
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);
HashMap savingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
Float balanceBefore = (Float) savingsSummaryBefore.get("accountBalance");
/***
* Retrieve mapped financial account for liability transfer
*/
@@ -399,7 +854,7 @@ public class FixedDepositTest {
this.journalEntryHelper.checkJournalEntryForAssetAccount(financialAccount, CLOSED_ON_DATE, new JournalEntry(prematurityAmount,
JournalEntry.TransactionType.DEBIT), new JournalEntry(prematurityAmount, JournalEntry.TransactionType.CREDIT));
HashMap savingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
Float balanceAfter = (Float) savingsSummaryAfter.get("accountBalance");
Float expectedSavingsBalance = balanceBefore + prematurityAmount;
@@ -409,8 +864,8 @@ public class FixedDepositTest {
}
/***
* Test case for Fixed Deposit Account premature closure with
* transaction type ReInvest and Cash Based accounting enabled
* Test case for Fixed Deposit Account premature closure with transaction
* type ReInvest and Cash Based accounting enabled
*/
@Test
public void testFixedDepositAccountWithPrematureClosureTypeReinvest() {
@@ -446,7 +901,7 @@ public class FixedDepositTest {
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
@@ -465,8 +920,8 @@ public class FixedDepositTest {
incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -478,11 +933,11 @@ public class FixedDepositTest {
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
HashMap accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float depositAmount = (Float) accountSummary.get("totalDeposits");
/***
* Verify journal entries posted for initial deposit transaction which
* happened at activation time
@@ -551,8 +1006,8 @@ public class FixedDepositTest {
HashMap fixedDepositProductData = this.fixedDepositProductHelper.retrieveFixedDepositProductById(this.requestSpec,
this.responseSpec, fixedDepositProductId.toString());
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
todaysDate.add(Calendar.DATE, -1);
@@ -590,8 +1045,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -633,8 +1088,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -674,8 +1129,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -713,8 +1168,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -756,8 +1211,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -826,8 +1281,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
@@ -903,8 +1358,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -1007,8 +1462,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
@@ -1115,8 +1570,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, TILL_PREMATURE_WITHDRAWAL);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
TILL_PREMATURE_WITHDRAWAL);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -1227,8 +1682,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, TILL_PREMATURE_WITHDRAWAL);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
TILL_PREMATURE_WITHDRAWAL);
Assert.assertNotNull(fixedDepositAccountId);
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
@@ -1339,8 +1794,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
@@ -1408,7 +1863,7 @@ public class FixedDepositTest {
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
System.out.println("Submitted Date:"+SUBMITTED_ON_DATE);
System.out.println("Submitted Date:" + SUBMITTED_ON_DATE);
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
@@ -1416,8 +1871,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
@@ -1496,8 +1951,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
@@ -1580,8 +2035,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
@@ -1665,8 +2120,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
@@ -1747,8 +2202,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
@@ -1829,8 +2284,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
@@ -1910,8 +2365,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
@@ -1962,16 +2417,74 @@ public class FixedDepositTest {
} else if (accountingRule.equals(NONE)) {
fixedDepositProductHelper = fixedDepositProductHelper.withAccountingRuleAsNone();
}
final String fixedDepositProductJSON = fixedDepositProductHelper.withPeriodRangeChart() //
.build(validFrom, validTo);
return FixedDepositProductHelper.createFixedDepositProduct(fixedDepositProductJSON, requestSpec, responseSpec);
}
private Integer createFixedDepositProductWithWithHoldTax(final String validFrom, final String validTo, final String taxGroupId,
final String accountingRule, Account... accounts) {
System.out.println("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------");
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
if (accountingRule.equals(CASH_BASED)) {
fixedDepositProductHelper = fixedDepositProductHelper.withAccountingRuleAsCashBased(accounts);
} else if (accountingRule.equals(NONE)) {
fixedDepositProductHelper = fixedDepositProductHelper.withAccountingRuleAsNone();
}
final String fixedDepositProductJSON = fixedDepositProductHelper.withPeriodRangeChart() //
.withWithHoldTax(taxGroupId)//
.build(validFrom, validTo);
return FixedDepositProductHelper.createFixedDepositProduct(fixedDepositProductJSON, requestSpec, responseSpec);
}
private Integer createFixedDepositProduct(final String validFrom, final String validTo, final String accountingRule,
final String chartToBePicked, Account... accounts) {
System.out.println("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------");
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
if (accountingRule.equals(CASH_BASED)) {
fixedDepositProductHelper = fixedDepositProductHelper.withAccountingRuleAsCashBased(accounts);
} else if (accountingRule.equals(NONE)) {
fixedDepositProductHelper = fixedDepositProductHelper.withAccountingRuleAsNone();
}
switch (chartToBePicked) {
case "period":
fixedDepositProductHelper = fixedDepositProductHelper.withPeriodRangeChart();
break;
case "amount":
fixedDepositProductHelper = fixedDepositProductHelper.withAmountRangeChart();
break;
case "period_amount":
fixedDepositProductHelper = fixedDepositProductHelper.withPeriodAndAmountRangeChart();
break;
case "amount_period":
fixedDepositProductHelper = fixedDepositProductHelper.withAmountAndPeriodRangeChart();
break;
default:
break;
}
final String fixedDepositProductJSON = fixedDepositProductHelper //
.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) {
private Integer applyForFixedDepositApplication(final String clientID, final String productID, 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);
.withSubmittedOnDate(submittedOnDate).build(clientID, productID, penalInterestType);
return this.fixedDepositAccountHelper
.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
}
private Integer applyForFixedDepositApplication(final String clientID, final String productID, final String submittedOnDate,
final String penalInterestType, final String depositAmount, final String depositPeriod) {
System.out.println("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------");
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec)
//
.withSubmittedOnDate(submittedOnDate).withDepositPeriod(depositPeriod).withDepositAmount(depositAmount)
.build(clientID, productID, penalInterestType);
return this.fixedDepositAccountHelper
.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
}
@@ -2048,6 +2561,12 @@ public class FixedDepositTest {
Assert.assertEquals(financialActivityId, ((HashMap) mappingDetails.get("financialActivityData")).get("id"));
Assert.assertEquals(glAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
}
private Integer createTaxGroup(final String percentage, final Account liabilityAccountForTax){
final Integer liabilityAccountId = liabilityAccountForTax.getAccountID();
final Integer taxComponentId = TaxComponentHelper.createTaxComponent(this.requestSpec, this.responseSpec, percentage, liabilityAccountId);
return TaxGroupHelper.createTaxGroup(this.requestSpec, this.responseSpec, Arrays.asList(taxComponentId));
}
/**
* Delete the Liability transfer account
@@ -1,9 +1,22 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
@@ -11,17 +24,17 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map.Entry;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.junit.After;
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.GlobalConfigurationHelper;
import org.mifosplatform.integrationtests.common.Utils;
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;
@@ -1,20 +1,34 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertEquals;
import com.google.gson.Gson;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.funds.FundsHelper;
import org.apache.fineract.integrationtests.common.funds.FundsResourceHandler;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.funds.FundsHelper;
import org.mifosplatform.integrationtests.common.funds.FundsResourceHandler;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -0,0 +1,79 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.integrationtests;
import java.util.ArrayList;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
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;
public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest {
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();
}
@SuppressWarnings( {"static-access", "rawtypes", "unchecked"})
@Test
public void testInterestChargedFromDateSameAsDisbursalDate(){
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 = "interest-charged-from-date-same-as-disbursal-date";
boolean newBooleanValue = true;
for (Integer configIndex = 0; configIndex < (globalConfig.size()); configIndex++) {
if (globalConfig.get(configIndex).get("name")
.equals(configName)) {
String configId = (globalConfig.get(configIndex).get("id"))
.toString();
Integer updateConfigId = this.globalConfigurationHelper
.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec,
configId.toString(), newBooleanValue);;
Assert.assertNotNull(updateConfigId);
break;
}
}
}
}
@@ -1,19 +1,32 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import java.util.ArrayList;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.CommonConstants;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.GlobalConfigurationHelper;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -1,9 +1,22 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
@@ -11,14 +24,14 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.GroupHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.ClientHelper;
import org.mifosplatform.integrationtests.common.GroupHelper;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -1,9 +1,22 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
@@ -16,18 +29,18 @@ import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.GroupHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
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.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;
@@ -426,7 +439,7 @@ public class GroupSavingsIntegrationTest {
ChargesHelper.getSavingsWithdrawalFeeJSON());
Assert.assertNotNull(withdrawalChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, withdrawalChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, withdrawalChargeId, false);
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(1, chargesPendingState.size());
@@ -452,7 +465,7 @@ public class GroupSavingsIntegrationTest {
ArrayList<HashMap> charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertTrue(charges == null || charges.size() == 0);
this.savingsAccountHelper.addChargesForSavings(savingsId, chargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, chargeId, true);
charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(1, charges.size());
@@ -473,7 +486,7 @@ public class GroupSavingsIntegrationTest {
ChargesHelper.getSavingsMonthlyFeeJSON());
Assert.assertNotNull(monthlyFeechargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, monthlyFeechargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, monthlyFeechargeId, true);
charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(2, charges.size());
@@ -491,7 +504,7 @@ public class GroupSavingsIntegrationTest {
final Integer weeklyFeeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, ChargesHelper.getSavingsWeeklyFeeJSON());
Assert.assertNotNull(weeklyFeeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, weeklyFeeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, weeklyFeeId, true);
charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(3, charges.size());
@@ -516,6 +529,10 @@ public class GroupSavingsIntegrationTest {
LocalDate expectedNextDueDate = new LocalDate((Integer) dates.get(0), (Integer) dates.get(1), (Integer) dates.get(2))
.plusWeeks((Integer) paidCharge.get("feeInterval"));
assertEquals(expectedNextDueDate, nextDueDate);
cal = Calendar.getInstance();
this.savingsAccountHelper.closeSavingsAccountAndGetBackRequiredField(savingsId, "true", null, sdf.format(cal.getTime()));
}
public static Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -1,25 +1,38 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.GroupHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.ClientHelper;
import org.mifosplatform.integrationtests.common.GroupHelper;
import org.mifosplatform.integrationtests.common.organisation.StaffHelper;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -1,9 +1,22 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import org.junit.Assert;
@@ -11,12 +24,12 @@ import static org.junit.Assert.fail;
import java.util.concurrent.TimeUnit;
import org.apache.fineract.integrationtests.common.HookHelper;
import org.apache.fineract.integrationtests.common.OfficeHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.http.conn.HttpHostConnectException;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.HookHelper;
import org.mifosplatform.integrationtests.common.OfficeHelper;
import org.mifosplatform.integrationtests.common.Utils;
import com.jayway.restassured.RestAssured;
import com.jayway.restassured.builder.RequestSpecBuilder;
@@ -1,9 +1,22 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
@@ -11,15 +24,15 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
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.loans.LoanApplicationTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanStatusChecker;
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -101,7 +114,7 @@ public class LoanApplicationApprovalTest {
}
private HashMap createTrancheDetail(final String date, final String amount) {
public HashMap createTrancheDetail(final String date, final String amount) {
HashMap<String, Object> detail = new HashMap<>();
detail.put("expectedDisbursementDate", date);
detail.put("principal", amount);
@@ -121,7 +134,8 @@ public class LoanApplicationApprovalTest {
+ clientID);
final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder()
.withInterestTypeAsDecliningBalance().withTranches(true).build(null));
.withInterestTypeAsDecliningBalance().withTranches(true).withInterestCalculationPeriodTypeAsRepaymentPeriod(true)
.build(null));
System.out.println("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------"
+ loanProductID);
@@ -242,7 +256,7 @@ public class LoanApplicationApprovalTest {
return this.loanTransactionHelper.getLoanId(loanApplication);
}
private Integer applyForLoanApplicationWithTranches(final Integer clientID, final Integer loanProductID, String principal,
public Integer applyForLoanApplicationWithTranches(final Integer clientID, final Integer loanProductID, String principal,
List<HashMap> tranches) {
System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
final String loanApplicationJSON = new LoanApplicationTestBuilder()
@@ -0,0 +1,157 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.integrationtests;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.fineract.integrationtests.LoanApplicationApprovalTest;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
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 LoanApplicationUndoLastTrancheTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
private LoanTransactionHelper loanTransactionHelper;
private LoanApplicationApprovalTest loanApplicationApprovalTest;
@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.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
this.loanApplicationApprovalTest = new LoanApplicationApprovalTest();
}
@Test
public void LoanApplicationUndoLastTranche() {
final String proposedAmount = "5000";
final String approvalAmount = "2000";
final String approveDate = "1 March 2014";
final String expectedDisbursementDate = "1 March 2014";
final String disbursalDate = "1 March 2014";
// CREATE CLIENT
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014");
System.out.println("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------"
+ clientID);
// CREATE LOAN MULTIDISBURSAL PRODUCT
final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder()
.withInterestTypeAsDecliningBalance().withTranches(true).withInterestCalculationPeriodTypeAsRepaymentPeriod(true)
.build(null));
System.out.println("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------"
+ loanProductID);
// CREATE TRANCHES
List<HashMap> createTranches = new ArrayList<>();
createTranches.add(this.loanApplicationApprovalTest.createTrancheDetail("1 March 2014", "1000"));
createTranches.add(this.loanApplicationApprovalTest.createTrancheDetail("23 June 2014", "4000"));
// APPROVE TRANCHES
List<HashMap> approveTranches = new ArrayList<>();
approveTranches.add(this.loanApplicationApprovalTest.createTrancheDetail("1 March 2014", "1000"));
approveTranches.add(this.loanApplicationApprovalTest.createTrancheDetail("23 June 2014", "1000"));
// APPLY FOR LOAN WITH TRANCHES
final Integer loanID = applyForLoanApplicationWithTranches(clientID, loanProductID, proposedAmount, createTranches);
System.out.println("-----------------------------------LOAN CREATED WITH LOANID-------------------------------------------------"
+ loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
// VALIDATE THE LOAN STATUS
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------");
loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount(approveDate, expectedDisbursementDate, approvalAmount,
loanID, approveTranches);
// VALIDATE THE LOAN IS APPROVED
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
// DISBURSE A LOAN
this.loanTransactionHelper.disburseLoan(disbursalDate, loanID);
loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
// VALIDATE THE LOAN IS ACTIVE STATUS
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
System.out.println("-------------Make repayment 1-----------");
this.loanTransactionHelper.makeRepayment("01 April 2014", Float.valueOf("420"), loanID);
System.out.println("-------------Make repayment 2-----------");
this.loanTransactionHelper.makeRepayment("01 May 2014", Float.valueOf("412"), loanID);
System.out.println("-------------Make repayment 3-----------");
this.loanTransactionHelper.makeRepayment("01 June 2014", Float.valueOf("204"), loanID);
// DISBURSE A SECOND TRANCHE
this.loanTransactionHelper.disburseLoan("23 June 2014", loanID);
// UNDO LAST TRANCHE
Float disbursedAmount = this.loanTransactionHelper.undoLastDisbursal(loanID);
validateDisbursedAmount(disbursedAmount);
}
private void validateDisbursedAmount(Float disbursedAmount) {
Assert.assertEquals(Float.valueOf("1000.0"), disbursedAmount);
}
public Integer applyForLoanApplicationWithTranches(final Integer clientID, final Integer loanProductID, String principal,
List<HashMap> tranches) {
System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
final String loanApplicationJSON = new LoanApplicationTestBuilder()
//
.withPrincipal(principal)
//
.withLoanTermFrequency("5")
//
.withLoanTermFrequencyAsMonths()
//
.withNumberOfRepayments("5").withRepaymentEveryAfter("1").withRepaymentFrequencyTypeAsMonths() //
.withInterestRatePerPeriod("2") //
.withExpectedDisbursementDate("1 March 2014") //
.withTranches(tranches) //
.withInterestTypeAsDecliningBalance() //
.withSubmittedOnDate("1 March 2014") //
.build(clientID.toString(), loanProductID.toString(), null);
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
}
}
@@ -0,0 +1,117 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.integrationtests;
import java.util.HashMap;
import java.util.List;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
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 LoanDisbursalDateValidationTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
private LoanTransactionHelper loanTransactionHelper;
private ResponseSpecification responseForbiddenError;
@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.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
this.responseForbiddenError = new ResponseSpecBuilder().expectStatusCode(403).build();
}
@Test
public void LoanApplicationValidateDisbursalDate() {
final String proposedAmount = "5000";
final String approveDate = "1 March 2014";
final String disbursalDate = "02 March 2014";
// CREATE CLIENT
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014");
System.out.println("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------"
+ clientID);
// CREATE LOAN PRODUCT
final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder()
.withSyncExpectedWithDisbursementDate(true).build(null));
System.out.println("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------"
+ loanProductID);
// APPLY FOR LOAN
final Integer loanID = applyForLoanApplication(clientID, loanProductID, proposedAmount);
System.out.println("-----------------------------------LOAN CREATED WITH LOANID-------------------------------------------------"
+ loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
// VALIDATE THE LOAN STATUS
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------");
loanStatusHashMap = this.loanTransactionHelper.approveLoan(approveDate, loanID);
// VALIDATE THE LOAN IS APPROVED
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
// DISBURSE A LOAN
@SuppressWarnings("unchecked")
List<HashMap> disbursalError = (List<HashMap>) this.loanTransactionHelper.disburseLoan(disbursalDate, loanID, this.responseForbiddenError);
Assert.assertEquals("error.msg.actual.disbursement.date.does.not.match.with.expected.disbursal.date",
disbursalError.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
}
private Integer applyForLoanApplication(final Integer clientID, final Integer loanProductID, final String proposedAmount) {
final String loanApplication = new LoanApplicationTestBuilder()
.withPrincipal(proposedAmount).withLoanTermFrequency("5")
.withLoanTermFrequencyAsMonths().withNumberOfRepayments("5")
.withRepaymentEveryAfter("1")
.withRepaymentFrequencyTypeAsMonths()
.withInterestRatePerPeriod("2")
.withExpectedDisbursementDate("1 March 2014")
.withSubmittedOnDate("26 February 2014").
build(clientID.toString(), loanProductID.toString(), null);
return this.loanTransactionHelper.getLoanId(loanApplication);
}
}
@@ -0,0 +1,501 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import java.math.BigDecimal;
import java.math.MathContext;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanDisbursementTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before;
import org.junit.Test;
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" })
public class LoanDisbursementDetailsIntegrationTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
private LoanTransactionHelper loanTransactionHelper;
private Integer loanID;
private Integer disbursementId;
final String approveDate = "01 March 2014";
final String expectedDisbursementDate = "01 March 2014";
final String proposedAmount = "5000";
final String approvalAmount = "5000";
@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.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
}
@Test
public void createAndValidateMultiDisburseLoansBasedOnEmi() {
List<HashMap> createTranches = new ArrayList<>();
String id = null;
String installmentAmount = "800";
String withoutInstallmentAmount = "";
String proposedAmount = "10000";
createTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "01 June 2015", "5000"));
createTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "01 Sep 2015", "5000"));
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014");
System.out.println("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------"
+ clientID);
final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder()
.withInterestTypeAsDecliningBalance().withMoratorium("", "").withAmortizationTypeAsEqualInstallments().withTranches(true)
.withInterestCalculationPeriodTypeAsRepaymentPeriod(true).build(null));
System.out.println("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------"
+ loanProductID);
final Integer loanIDWithEmi = applyForLoanApplicationWithEmiAmount(clientID, loanProductID, proposedAmount, createTranches,
installmentAmount);
System.out
.println("-----------------------------------LOAN CREATED WITH EMI LOANID-------------------------------------------------"
+ loanIDWithEmi);
HashMap repaymentScheduleWithEmi = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec,
loanIDWithEmi, "repaymentSchedule");
ArrayList<HashMap> periods = (ArrayList<HashMap>) repaymentScheduleWithEmi.get("periods");
assertEquals(periods.size(), 15);
this.validateRepaymentScheduleWithEMI(periods);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanIDWithEmi);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------");
loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount("01 June 2015", "01 June 2015", "10000", loanIDWithEmi,
createTranches);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
System.out
.println("-----------------------------------MULTI DISBURSAL LOAN WITH EMI APPROVED SUCCESSFULLY---------------------------------------");
final Integer loanIDWithoutEmi = applyForLoanApplicationWithEmiAmount(clientID, loanProductID, proposedAmount, createTranches,
withoutInstallmentAmount);
HashMap repaymentScheduleWithoutEmi = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec,
loanIDWithoutEmi, "repaymentSchedule");
ArrayList<HashMap> periods1 = (ArrayList<HashMap>) repaymentScheduleWithEmi.get("periods");
assertEquals(periods1.size(), 15);
System.out
.println("-----------------------------------LOAN CREATED WITHOUT EMI LOANID-------------------------------------------------"
+ loanIDWithoutEmi);
/* To be uncommented once issue MIFOSX-2006 is closed. */
// this.validateRepaymentScheduleWithoutEMI(periods1);
HashMap loanStatusMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanIDWithoutEmi);
LoanStatusChecker.verifyLoanIsPending(loanStatusMap);
System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------");
loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount("01 June 2015", "01 June 2015", "10000",
loanIDWithoutEmi, createTranches);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
System.out
.println("-----------------------------------MULTI DISBURSAL LOAN WITHOUT EMI APPROVED SUCCESSFULLY---------------------------------------");
}
private void validateRepaymentScheduleWithEMI(ArrayList<HashMap> periods) {
LoanDisbursementTestBuilder expectedRepaymentSchedule0 = new LoanDisbursementTestBuilder("[2015, 6, 1]", 0.0f, 0.0f, null, null,
5000.0f, null, null, null);
LoanDisbursementTestBuilder expectedRepaymentSchedule1 = new LoanDisbursementTestBuilder("[2015, 7, 1]", 800f, 800.0f, 50.0f,
750.0f, 4250.0f, 750.0f, 750.0f, "[2015, 6, 1]");
LoanDisbursementTestBuilder expectedRepaymentSchedule2 = new LoanDisbursementTestBuilder("[2015, 8, 1]", 800.0f, 800.0f, 42.5f,
757.5f, 3492.5f, 757.5f, 757.5f, "[2015, 7, 1]");
LoanDisbursementTestBuilder expectedRepaymentSchedule3 = new LoanDisbursementTestBuilder("[2015, 9, 1]", 0.0f, 0.0f, null, null,
5000.0f, null, null, null);
LoanDisbursementTestBuilder expectedRepaymentSchedule4 = new LoanDisbursementTestBuilder("[2015, 9, 1]", 800.0f, 800.0f, 34.92f,
765.08f, 7727.42f, 765.08f, 765.08f, "[2015, 8, 1]");
LoanDisbursementTestBuilder expectedRepaymentSchedule5 = new LoanDisbursementTestBuilder("[2015, 10, 1]", 800.0f, 800.0f, 77.27f,
722.73f, 7004.69f, 722.73f, 722.73f, "[2015, 9, 1]");
LoanDisbursementTestBuilder expectedRepaymentSchedule6 = new LoanDisbursementTestBuilder("[2015, 11, 1]", 800.0f, 800.0f, 70.05f,
729.95f, 6274.74f, 729.95f, 729.95f, "[2015, 10, 1]");
LoanDisbursementTestBuilder expectedRepaymentSchedule7 = new LoanDisbursementTestBuilder("[2015, 12, 1]", 800.0f, 800.0f, 62.75f,
737.25f, 5537.49f, 737.25f, 737.25f, "[2015, 11, 1]");
LoanDisbursementTestBuilder expectedRepaymentSchedule8 = new LoanDisbursementTestBuilder("[2016, 1, 1]", 800.0f, 800.0f, 55.37f,
744.63f, 4792.86f, 744.63f, 744.63f, "[2015, 12, 1]");
LoanDisbursementTestBuilder expectedRepaymentSchedule9 = new LoanDisbursementTestBuilder("[2016, 2, 1]", 800.0f, 800.0f, 47.93f,
752.07f, 4040.79f, 752.07f, 752.07f, "[2016, 1, 1]");
LoanDisbursementTestBuilder expectedRepaymentSchedule10 = new LoanDisbursementTestBuilder("[2016, 3, 1]", 800.0f, 800.0f, 40.41f,
759.59f, 3281.2f, 759.59f, 759.59f, "[2016, 2, 1]");
LoanDisbursementTestBuilder expectedRepaymentSchedule11 = new LoanDisbursementTestBuilder("[2016, 4, 1]", 800.0f, 800.0f, 32.81f,
767.19f, 2514.01f, 767.19f, 767.19f, "[2016, 3, 1]");
LoanDisbursementTestBuilder expectedRepaymentSchedule12 = new LoanDisbursementTestBuilder("[2016, 5, 1]", 800.0f, 800.0f, 25.14f,
774.86f, 1739.15f, 774.86f, 774.86f, "[2016, 4, 1]");
LoanDisbursementTestBuilder expectedRepaymentSchedule13 = new LoanDisbursementTestBuilder("[2016, 6, 1]", 800.0f, 800.0f, 17.39f,
782.61f, 956.54f, 782.61f, 782.61f, "[2016, 5, 1]");
LoanDisbursementTestBuilder expectedRepaymentSchedule14 = new LoanDisbursementTestBuilder("[2016, 7, 1]", 966.11f, 966.11f, 9.57f,
956.54f, 0.0f, 956.54f, 956.54f, "[2016, 6, 1]");
ArrayList<LoanDisbursementTestBuilder> list = new ArrayList<LoanDisbursementTestBuilder>();
list.add(expectedRepaymentSchedule0);
list.add(expectedRepaymentSchedule1);
list.add(expectedRepaymentSchedule2);
list.add(expectedRepaymentSchedule3);
list.add(expectedRepaymentSchedule4);
list.add(expectedRepaymentSchedule5);
list.add(expectedRepaymentSchedule6);
list.add(expectedRepaymentSchedule7);
list.add(expectedRepaymentSchedule8);
list.add(expectedRepaymentSchedule9);
list.add(expectedRepaymentSchedule10);
list.add(expectedRepaymentSchedule11);
list.add(expectedRepaymentSchedule12);
list.add(expectedRepaymentSchedule13);
list.add(expectedRepaymentSchedule14);
for (int i = 0; i < list.size(); i++) {
this.assertRepaymentScheduleValuesWithEMI(periods.get(i), list.get(i), i);
}
}
private void assertRepaymentScheduleValuesWithEMI(HashMap period, LoanDisbursementTestBuilder expectedRepaymentSchedule, int position) {
assertEquals(period.get("dueDate").toString(), expectedRepaymentSchedule.getDueDate());
assertEquals(period.get("principalLoanBalanceOutstanding"), expectedRepaymentSchedule.getPrincipalLoanBalanceOutstanding());
System.out.println(period.get("totalOriginalDueForPeriod").toString());
assertEquals(new Float(period.get("totalOriginalDueForPeriod").toString()), expectedRepaymentSchedule
.getTotalOriginalDueForPeriod().floatValue(), 0.0f);
assertEquals(new Float(period.get("totalOutstandingForPeriod").toString()).floatValue(),
expectedRepaymentSchedule.getTotalOutstandingForPeriod(), 0.0f);
if (position != 0 && position != 3) {
assertEquals(new Float(period.get("interestOutstanding").toString()).floatValue(),
expectedRepaymentSchedule.getInterestOutstanding(), 0.0f);
assertEquals(new Float(period.get("principalOutstanding").toString()).floatValue(),
expectedRepaymentSchedule.getPrincipalOutstanding(), 0.0f);
assertEquals(new Float(period.get("principalDue").toString()).floatValue(), expectedRepaymentSchedule.getPrincipalDue(), 0.0f);
assertEquals(new Float(period.get("principalOriginalDue").toString()).floatValue(),
expectedRepaymentSchedule.getPrincipalOriginalDue(), 0.0f);
assertEquals(period.get("fromDate").toString(), expectedRepaymentSchedule.getFromDate());
}
}
/* Uncomment and modify test builder values once MIFOSX-2006 is closed. */
/*
* private void validateRepaymentScheduleWithoutEMI(ArrayList<HashMap>
* periods){ LoanDisbursementTestBuilder expectedRepaymentSchedule0 = new
* LoanDisbursementTestBuilder( "[2015, 6, 1]", 0.0f, 0.0f, null, null,
* 5000.0f, null, null, null);
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule1 = new
* LoanDisbursementTestBuilder( "[2015, 7, 1]", 800.0f, 800.0f, 50.0f,
* 750.0f, 4250.0f, 750.0f, 750.0f, "[2015, 6, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule2 = new
* LoanDisbursementTestBuilder( "[2015, 8, 1]", 800.0f, 800.0f, 42.5f,
* 757.5f, 3492.5f, 757.5f, 757.5f, "[2015, 7, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule3 = new
* LoanDisbursementTestBuilder( "[2015, 9, 1]", 0.0f, 0.0f, null, null,
* 5000.0f, null, null, null);
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule4 = new
* LoanDisbursementTestBuilder( "[2015, 9, 1]", 800.0f, 800.0f, 34.92f,
* 765.08f, 7727.42f, 765.08f, 765.08f, "[2015, 8, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule5 = new
* LoanDisbursementTestBuilder( "[2015, 10, 1]", 800.0f, 800.0f, 77.27f,
* 722.73f, 7004.69f, 722.73f, 722.73f, "[2015, 9, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule6 = new
* LoanDisbursementTestBuilder( "[2015, 11, 1]", 800.0f, 800.0f, 70.05f,
* 729.95f, 6274.74f, 729.95f, 729.95f, "[2015, 10, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule7 = new
* LoanDisbursementTestBuilder( "[2015, 12, 1]", 800.0f, 800.0f, 62.75f,
* 737.25f, 5537.49f, 737.25f, 737.25f, "[2015, 11, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule8 = new
* LoanDisbursementTestBuilder( "[2016, 1, 1]", 800.0f, 800.0f, 55.37f,
* 744.63f, 4792.86f, 744.63f, 744.63f, "[2015, 12, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule9 = new
* LoanDisbursementTestBuilder( "[2016, 2, 1]", 800.0f, 800.0f, 47.93f,
* 752.07f, 4040.79f, 752.07f, 752.07f, "[2016, 1, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule10 = new
* LoanDisbursementTestBuilder( "[2016, 3, 1]", 800.0f, 800.0f, 40.41f,
* 759.59f, 3281.2f, 759.59f, 759.59f, "[2016, 2, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule11 = new
* LoanDisbursementTestBuilder( "[2016, 4, 1]", 800.0f, 800.0f, 32.81f,
* 767.19f, 2514.01f, 767.19f, 767.19f, "[2016, 3, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule12 = new
* LoanDisbursementTestBuilder( "[2016, 5, 1]", 800.0f, 800.0f, 25.14f,
* 774.86f, 1739.15f, 774.86f, 774.86f, "[2016, 4, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule13 = new
* LoanDisbursementTestBuilder( "[2016, 6, 1]", 800.0f, 800.0f, 17.39f,
* 782.61f, 956.54f, 782.61f, 782.61f, "[2016, 5, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule14 = new
* LoanDisbursementTestBuilder( "[2016, 7, 1]", 966.11f, 966.11f, 9.57f,
* 956.54f, 0.0f, 956.54f, 956.54f, "[2016, 6, 1]");
*
* ArrayList<LoanDisbursementTestBuilder> list = new
* ArrayList<LoanDisbursementTestBuilder>();
* list.add(expectedRepaymentSchedule0);
* list.add(expectedRepaymentSchedule1);
* list.add(expectedRepaymentSchedule2);
* list.add(expectedRepaymentSchedule3);
* list.add(expectedRepaymentSchedule4);
* list.add(expectedRepaymentSchedule5);
* list.add(expectedRepaymentSchedule6);
* list.add(expectedRepaymentSchedule7);
* list.add(expectedRepaymentSchedule8);
* list.add(expectedRepaymentSchedule9);
* list.add(expectedRepaymentSchedule10);
* list.add(expectedRepaymentSchedule11);
* list.add(expectedRepaymentSchedule12);
* list.add(expectedRepaymentSchedule13);
* list.add(expectedRepaymentSchedule14);
*
* for (int i = 0; i < list.size(); i++) {
* this.assertRepaymentScheduleValuesWithoutEMI(periods.get(i), list.get(i),
* i); } }
*
* private void assertRepaymentScheduleValuesWithoutEMI(HashMap period,
* LoanDisbursementTestBuilder expectedRepaymentSchedule, int position) {
*
* assertEquals(period.get("dueDate").toString(),
* expectedRepaymentSchedule.getDueDate());
* assertEquals(period.get("principalLoanBalanceOutstanding"),
* expectedRepaymentSchedule.getPrincipalLoanBalanceOutstanding());
* assertEquals(period.get("totalOriginalDueForPeriod"),
* expectedRepaymentSchedule.getTotalOriginalDueForPeriod());
* assertEquals(period.get("totalOutstandingForPeriod"),
* expectedRepaymentSchedule.getTotalOutstandingForPeriod());
*
* if (position != 0 && position != 3) {
*
* assertEquals(period.get("interestOutstanding"),
* expectedRepaymentSchedule.getInterestOutstanding());
* assertEquals(period.get("principalOutstanding"),
* expectedRepaymentSchedule.getPrincipalOutstanding());
* assertEquals(period.get("principalDue"),
* expectedRepaymentSchedule.getPrincipalDue());
* assertEquals(period.get("principalOriginalDue"),
* expectedRepaymentSchedule.getPrincipalOriginalDue());
* assertEquals(period.get("fromDate").toString(),
* expectedRepaymentSchedule.getFromDate()); } }
*/
private Integer applyForLoanApplicationWithEmiAmount(final Integer clientID, final Integer loanProductID, final String proposedAmount,
List<HashMap> tranches, final String installmentAmount) {
System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
final String loanApplicationJSON = new LoanApplicationTestBuilder()
//
.withPrincipal(proposedAmount)
//
.withLoanTermFrequency("12")
//
.withLoanTermFrequencyAsMonths()
//
.withNumberOfRepayments("12").withRepaymentEveryAfter("1").withRepaymentFrequencyTypeAsMonths() //
.withInterestRatePerPeriod("1") //
.withExpectedDisbursementDate("01 June 2015") //
.withTranches(tranches) //
.withFixedEmiAmount(installmentAmount) //
.withInterestTypeAsDecliningBalance() //
.withSubmittedOnDate("01 June 2015") //
.withAmortizationTypeAsEqualInstallments() //
.build(clientID.toString(), loanProductID.toString(), null);
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
}
@Test
public void createApproveAndValidateMultiDisburseLoan() {
List<HashMap> createTranches = new ArrayList<>();
String id = null;
createTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "01 March 2014", "1000"));
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014");
System.out.println("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------"
+ clientID);
final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder()
.withInterestTypeAsDecliningBalance().withTranches(true).withInterestCalculationPeriodTypeAsRepaymentPeriod(true)
.build(null));
System.out.println("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------"
+ loanProductID);
this.loanID = applyForLoanApplicationWithTranches(clientID, loanProductID, proposedAmount, createTranches);
System.out.println("-----------------------------------LOAN CREATED WITH LOANID-------------------------------------------------"
+ loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------");
loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount(approveDate, expectedDisbursementDate, approvalAmount,
loanID, createTranches);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
System.out
.println("-----------------------------------MULTI DISBURSAL LOAN APPROVED SUCCESSFULLY---------------------------------------");
ArrayList<HashMap> disbursementDetails = (ArrayList<HashMap>) this.loanTransactionHelper.getLoanDetail(this.requestSpec,
this.responseSpec, this.loanID, "disbursementDetails");
this.disbursementId = (Integer) disbursementDetails.get(0).get("id");
this.editLoanDisbursementDetails();
}
private void editLoanDisbursementDetails() {
this.editDateAndPrincipalOfExistingTranche();
this.addNewDisbursementDetails();
this.deleteDisbursmentDetails();
}
private void addNewDisbursementDetails() {
List<HashMap> addTranches = new ArrayList<>();
ArrayList<HashMap> disbursementDetails = (ArrayList<HashMap>) this.loanTransactionHelper.getLoanDetail(this.requestSpec,
this.responseSpec, this.loanID, "disbursementDetails");
ArrayList expectedDisbursementDate = (ArrayList) disbursementDetails.get(0).get("expectedDisbursementDate");
String date = formatExpectedDisbursementDate(expectedDisbursementDate.toString());
String id = null;
addTranches.add(this.loanTransactionHelper.createTrancheDetail(disbursementDetails.get(0).get("id").toString(), date,
disbursementDetails.get(0).get("principal").toString()));
addTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "3 March 2014", "2000"));
addTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "4 March 2014", "500"));
/* Add disbursement detail */
this.loanTransactionHelper.addAndDeleteDisbursementDetail(this.loanID, this.approvalAmount, this.expectedDisbursementDate,
addTranches, "");
}
private void deleteDisbursmentDetails() {
List<HashMap> deleteTranches = new ArrayList<>();
ArrayList<HashMap> disbursementDetails = (ArrayList<HashMap>) this.loanTransactionHelper.getLoanDetail(this.requestSpec,
this.responseSpec, this.loanID, "disbursementDetails");
/* Delete the last tranche */
for (int i = 0; i < disbursementDetails.size() - 1; i++) {
ArrayList expectedDisbursementDate = (ArrayList) disbursementDetails.get(i).get("expectedDisbursementDate");
String disbursementDate = formatExpectedDisbursementDate(expectedDisbursementDate.toString());
deleteTranches.add(this.loanTransactionHelper.createTrancheDetail(disbursementDetails.get(i).get("id").toString(),
disbursementDate, disbursementDetails.get(i).get("principal").toString()));
}
/* Add disbursement detail */
this.loanTransactionHelper.addAndDeleteDisbursementDetail(this.loanID, this.approvalAmount, this.expectedDisbursementDate,
deleteTranches, "");
}
private void editDateAndPrincipalOfExistingTranche() {
String updatedExpectedDisbursementDate = "01 March 2014";
String updatedPrincipal = "900";
/* Update */
this.loanTransactionHelper.editDisbursementDetail(this.loanID, this.disbursementId, this.approvalAmount,
this.expectedDisbursementDate, updatedExpectedDisbursementDate, updatedPrincipal, "");
/* Validate Edit */
ArrayList<HashMap> disbursementDetails = (ArrayList<HashMap>) this.loanTransactionHelper.getLoanDetail(this.requestSpec,
this.responseSpec, this.loanID, "disbursementDetails");
assertEquals(Float.valueOf(updatedPrincipal), disbursementDetails.get(0).get("principal"));
ArrayList expectedDisbursementDate = (ArrayList) disbursementDetails.get(0).get("expectedDisbursementDate");
String date = formatExpectedDisbursementDate(expectedDisbursementDate.toString());
assertEquals(updatedExpectedDisbursementDate, date);
}
private String formatExpectedDisbursementDate(String expectedDisbursementDate) {
SimpleDateFormat source = new SimpleDateFormat("[yyyy, MM, dd]");
SimpleDateFormat target = new SimpleDateFormat("dd MMMM yyyy");
String date = null;
try {
date = target.format(source.parse(expectedDisbursementDate));
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
private Integer applyForLoanApplicationWithTranches(final Integer clientID, final Integer loanProductID, String principal,
List<HashMap> tranches) {
System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
final String loanApplicationJSON = new LoanApplicationTestBuilder()
//
.withPrincipal(principal)
//
.withLoanTermFrequency("5")
//
.withLoanTermFrequencyAsMonths()
//
.withNumberOfRepayments("5").withRepaymentEveryAfter("1").withRepaymentFrequencyTypeAsMonths() //
.withInterestRatePerPeriod("2") //
.withExpectedDisbursementDate("01 March 2014") //
.withTranches(tranches) //
.withInterestTypeAsDecliningBalance() //
.withSubmittedOnDate("01 March 2014") //
.build(clientID.toString(), loanProductID.toString(), null);
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
}
}
@@ -0,0 +1,244 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.accounting.Account;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before;
import org.junit.Test;
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 LoanRepaymentRescheduleAtDisbursementTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
private LoanTransactionHelper loanTransactionHelper;
private LoanApplicationApprovalTest loanApplicationApprovalTest;
private ResponseSpecification generalResponseSpec;
@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.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
this.loanApplicationApprovalTest = new LoanApplicationApprovalTest();
this.generalResponseSpec = new ResponseSpecBuilder().build();
}
@SuppressWarnings("unchecked")
@Test
public void testLoanRepaymentRescheduleAtDisbursement(){
final String approvalAmount = "10000";
final String approveDate = "01 March 2015";
final String expectedDisbursementDate = "01 March 2015";
final String disbursementDate = "01 March 2015";
final String adjustRepaymentDate = "16 March 2015";
// CREATE CLIENT
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014");
System.out.println("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------"
+ clientID);
// CREATE LOAN MULTIDISBURSAL PRODUCT WITH INTEREST RECALCULATION
final Integer loanProductID = createLoanProductWithInterestRecalculation(LoanProductTestBuilder.RBI_INDIA_STRATEGY,
LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_NONE,
LoanProductTestBuilder.RECALCULATION_STRATEGY_REDUCE_NUMBER_OF_INSTALLMENTS,
LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_DAILY, "0",
LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null);
// CREATE TRANCHES
List<HashMap> createTranches = new ArrayList<>();
createTranches.add(this.loanApplicationApprovalTest.createTrancheDetail("01 March 2015", "5000"));
createTranches.add(this.loanApplicationApprovalTest.createTrancheDetail("01 May 2015", "5000"));
// APPROVE TRANCHES
List<HashMap> approveTranches = new ArrayList<>();
approveTranches.add(this.loanApplicationApprovalTest.createTrancheDetail("01 March 2015", "5000"));
approveTranches.add(this.loanApplicationApprovalTest.createTrancheDetail("01 May 2015", "5000"));
// APPLY FOR TRANCHE LOAN WITH INTEREST RECALCULATION
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, disbursementDate,
LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, new ArrayList<HashMap>(0), createTranches);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
// VALIDATE THE LOAN STATUS
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------");
loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount(approveDate, expectedDisbursementDate, approvalAmount,
loanID, approveTranches);
// VALIDATE THE LOAN IS APPROVED
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
// DISBURSE A FIRST TRANCHE
this.loanTransactionHelper.disburseLoanWithRepaymentReschedule(disbursementDate, loanID, adjustRepaymentDate);
loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
ArrayList<HashMap> loanRepaymnetSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec, generalResponseSpec, loanID);
HashMap firstInstallement = loanRepaymnetSchedule.get(1);
Map<String, Object> expectedvalues = new HashMap<>(3);
Calendar date = Calendar.getInstance(Utils.getTimeZoneOfTenant());
date.set(2015, Calendar.MARCH, 16);
expectedvalues.put("dueDate", getDateAsArray(date, 0));
expectedvalues.put("principalDue", "834.71");
expectedvalues.put("interestDue", "49.32");
expectedvalues.put("feeChargesDue", "0");
expectedvalues.put("penaltyChargesDue", "0");
expectedvalues.put("totalDueForPeriod", "884.03");
// VALIDATE REPAYMENT SCHEDULE
verifyLoanRepaymentSchedule(firstInstallement, expectedvalues);
}
private void verifyLoanRepaymentSchedule(final HashMap firstInstallement, final Map<String, Object> expectedvalues) {
assertEquals(expectedvalues.get("dueDate"), firstInstallement.get("dueDate"));
assertEquals(String.valueOf(expectedvalues.get("principalDue")), String.valueOf(firstInstallement.get("principalDue")));
assertEquals(String.valueOf(expectedvalues.get("interestDue")), String.valueOf(firstInstallement.get("interestDue")));
assertEquals(String.valueOf(expectedvalues.get("feeChargesDue")), String.valueOf(firstInstallement.get("feeChargesDue")));
assertEquals(String.valueOf(expectedvalues.get("penaltyChargesDue")), String.valueOf(firstInstallement.get("penaltyChargesDue")));
assertEquals(String.valueOf(expectedvalues.get("totalDueForPeriod")), String.valueOf(firstInstallement.get("totalDueForPeriod")));
}
private Integer createLoanProductWithInterestRecalculation(final String repaymentStrategy,
final String interestRecalculationCompoundingMethod, final String rescheduleStrategyMethod,
final String recalculationRestFrequencyType, final String recalculationRestFrequencyInterval,
final String preCloseInterestCalculationStrategy, final Account[] accounts) {
final String recalculationCompoundingFrequencyType = null;
final String recalculationCompoundingFrequencyInterval = null;
final Integer recalculationCompoundingFrequencyOnDayType = null;
final Integer recalculationCompoundingFrequencyDayOfWeekType = null;
final Integer recalculationRestFrequencyOnDayType = null;
final Integer recalculationRestFrequencyDayOfWeekType = null;
return createLoanProductWithInterestRecalculation(repaymentStrategy, interestRecalculationCompoundingMethod,
rescheduleStrategyMethod, recalculationRestFrequencyType, recalculationRestFrequencyInterval,
recalculationCompoundingFrequencyType, recalculationCompoundingFrequencyInterval, preCloseInterestCalculationStrategy,
accounts, null, false, recalculationCompoundingFrequencyOnDayType, recalculationCompoundingFrequencyDayOfWeekType,
recalculationRestFrequencyOnDayType, recalculationRestFrequencyDayOfWeekType);
}
private Integer createLoanProductWithInterestRecalculation(final String repaymentStrategy,
final String interestRecalculationCompoundingMethod, final String rescheduleStrategyMethod,
final String recalculationRestFrequencyType, final String recalculationRestFrequencyInterval,
final String recalculationCompoundingFrequencyType, final String recalculationCompoundingFrequencyInterval,
final String preCloseInterestCalculationStrategy, final Account[] accounts, final String chargeId,
boolean isArrearsBasedOnOriginalSchedule, final Integer recalculationCompoundingFrequencyOnDayType,
final Integer recalculationCompoundingFrequencyDayOfWeekType, final Integer recalculationRestFrequencyOnDayType,
final Integer recalculationRestFrequencyDayOfWeekType) {
System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
LoanProductTestBuilder builder = new LoanProductTestBuilder()
.withPrincipal("10000.00")
.withNumberOfRepayments("12")
.withRepaymentAfterEvery("2")
.withRepaymentTypeAsWeek()
.withinterestRatePerPeriod("2")
.withInterestRateFrequencyTypeAsMonths()
.withTranches(true)
.withInterestCalculationPeriodTypeAsRepaymentPeriod(true)
.withRepaymentStrategy(repaymentStrategy)
.withInterestTypeAsDecliningBalance()
.withInterestRecalculationDetails(interestRecalculationCompoundingMethod, rescheduleStrategyMethod,
preCloseInterestCalculationStrategy)
.withInterestRecalculationRestFrequencyDetails(recalculationRestFrequencyType, recalculationRestFrequencyInterval,
recalculationRestFrequencyOnDayType, recalculationRestFrequencyDayOfWeekType)
.withInterestRecalculationCompoundingFrequencyDetails(recalculationCompoundingFrequencyType,
recalculationCompoundingFrequencyInterval, recalculationCompoundingFrequencyOnDayType,
recalculationCompoundingFrequencyDayOfWeekType);
if (accounts != null) {
builder = builder.withAccountingRulePeriodicAccrual(accounts);
}
if (isArrearsBasedOnOriginalSchedule) builder = builder.withArrearsConfiguration();
final String loanProductJSON = builder.build(chargeId);
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
}
private Integer applyForLoanApplicationForInterestRecalculation(final Integer clientID, final Integer loanProductID,
final String disbursementDate, final String repaymentStrategy, final List<HashMap> charges, List<HashMap> tranches) {
final String graceOnInterestPayment = null;
final String graceOnPrincipalPayment = null;
return applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, disbursementDate, repaymentStrategy, charges,
graceOnInterestPayment, graceOnPrincipalPayment, tranches);
}
private Integer applyForLoanApplicationForInterestRecalculation(final Integer clientID, final Integer loanProductID,
final String disbursementDate, final String repaymentStrategy, final List<HashMap> charges, final String graceOnInterestPayment,
final String graceOnPrincipalPayment, List<HashMap> tranches) {
System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
final String loanApplicationJSON = new LoanApplicationTestBuilder() //
.withPrincipal("10000.00") //
.withLoanTermFrequency("24") //
.withLoanTermFrequencyAsWeeks() //
.withNumberOfRepayments("12") //
.withRepaymentEveryAfter("2") //
.withRepaymentFrequencyTypeAsWeeks() //
.withInterestRatePerPeriod("2") //
.withAmortizationTypeAsEqualInstallments() //
.withTranches(tranches)
.withFixedEmiAmount("") //
.withInterestTypeAsDecliningBalance() //
.withInterestCalculationPeriodTypeAsDays() //
.withInterestCalculationPeriodTypeAsDays() //
.withExpectedDisbursementDate(disbursementDate) //
.withSubmittedOnDate(disbursementDate) //
.withwithRepaymentStrategy(repaymentStrategy) //
.withCharges(charges)//
.build(clientID.toString(), loanProductID.toString(), null);
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
}
private List getDateAsArray(Calendar date, int addPeriod) {
return getDateAsArray(date, addPeriod, Calendar.DAY_OF_MONTH);
}
private List getDateAsArray(Calendar date, int addvalue, int type) {
date.add(type, addvalue);
return new ArrayList<>(Arrays.asList(date.get(Calendar.YEAR), date.get(Calendar.MONTH) + 1,
date.get(Calendar.DAY_OF_MONTH)));
}
}
@@ -1,24 +1,37 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.LoanRescheduleRequestHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanRescheduleRequestTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.ClientHelper;
import org.mifosplatform.integrationtests.common.LoanRescheduleRequestHelper;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanRescheduleRequestTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -198,7 +211,7 @@ public class LoanRescheduleRequestTest {
final HashMap loanSummary = this.loanTransactionHelper.getLoanSummary(requestSpec, generalResponseSpec, loanId);
final Float totalExpectedRepayment = (Float) loanSummary.get("totalExpectedRepayment");
assertEquals("NUMBER OF REPAYMENTS SHOULD BE 16, NOT 12", "16", numberOfRepayments.toString());
assertEquals("NUMBER OF REPAYMENTS SHOULD BE 16, NOT 12", "12", numberOfRepayments.toString());
assertEquals("TOTAL EXPECTED REPAYMENT MUST BE EQUAL TO 118000.0", "118000.0", totalExpectedRepayment.toString());
System.out.println("Successfully approved loan reschedule request (ID: " + this.loanRescheduleRequestId + ")");
@@ -0,0 +1,406 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
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.apache.fineract.integrationtests.common.CalendarHelper;
import org.apache.fineract.integrationtests.common.CenterDomain;
import org.apache.fineract.integrationtests.common.CenterHelper;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.GroupHelper;
import org.apache.fineract.integrationtests.common.OfficeHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.accounting.Account;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import com.google.gson.Gson;
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;
public class LoanReschedulingWithinCenterTest {
private RequestSpecification requestSpec;
private ResponseSpecification responseSpec;
private LoanTransactionHelper loanTransactionHelper;
private ResponseSpecification generalResponseSpec;
private LoanApplicationApprovalTest loanApplicationApprovalTest;
@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.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
this.loanApplicationApprovalTest = new LoanApplicationApprovalTest();
this.generalResponseSpec = new ResponseSpecBuilder().build();
}
@SuppressWarnings("rawtypes")
@Test
public void testCenterReschedulingLoansWithInterestRecalculationEnabled() {
Integer officeId = new OfficeHelper(requestSpec, responseSpec).createOffice("01 July 2007");
String name = "TestFullCreation" + new Timestamp(new java.util.Date().getTime());
String externalId = Utils.randomStringGenerator("ID_", 7, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
int staffId = StaffHelper.createStaff(requestSpec, responseSpec);
int[] groupMembers = generateGroupMembers(1, officeId);
final String centerActivationDate = "01 July 2007";
Integer centerId = CenterHelper.createCenter(name, officeId, externalId, staffId, groupMembers, centerActivationDate, requestSpec,
responseSpec);
CenterDomain center = CenterHelper.retrieveByID(centerId, requestSpec, responseSpec);
Integer groupId = groupMembers[0];
Assert.assertNotNull(center);
Assert.assertTrue(center.getStaffId() == staffId);
Assert.assertTrue(center.isActive() == true);
Integer calendarId = createCalendarMeeting(centerId);
Integer clientId = createClient(officeId);
associateClientsToGroup(groupId, clientId);
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
dateFormat.setTimeZone(Utils.getTimeZoneOfTenant());
Calendar today = Calendar.getInstance(Utils.getTimeZoneOfTenant());
today.add(Calendar.DAY_OF_MONTH, -14);
// CREATE A LOAN PRODUCT
final String disbursalDate = dateFormat.format(today.getTime());
final String recalculationRestFrequencyDate = "01 January 2012";
final boolean isMultiTrancheLoan = false;
// CREATE LOAN MULTIDISBURSAL PRODUCT WITH INTEREST RECALCULATION
final Integer loanProductID = createLoanProductWithInterestRecalculation(LoanProductTestBuilder.RBI_INDIA_STRATEGY,
LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_NONE,
LoanProductTestBuilder.RECALCULATION_STRATEGY_REDUCE_NUMBER_OF_INSTALLMENTS,
LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_DAILY, "0", recalculationRestFrequencyDate,
LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null, isMultiTrancheLoan,
null, null);
// APPLY FOR TRANCHE LOAN WITH INTEREST RECALCULATION
final Integer loanId = applyForLoanApplicationForInterestRecalculation(clientId, groupId, calendarId, loanProductID, disbursalDate,
recalculationRestFrequencyDate, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, new ArrayList<HashMap>(0), null);
// Test for loan account is created
Assert.assertNotNull(loanId);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanId);
// Test for loan account is created, can be approved
this.loanTransactionHelper.approveLoan(disbursalDate, loanId);
loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanId);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
// Test for loan account approved can be disbursed
this.loanTransactionHelper.disburseLoan(disbursalDate, loanId);
loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanId);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
System.out.println("---------------------------------CHANGING GROUP MEETING DATE ------------------------------------------");
Calendar todaysdate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
todaysdate.add(Calendar.DAY_OF_MONTH, 14);
String oldMeetingDate = dateFormat.format(todaysdate.getTime());
todaysdate.add(Calendar.DAY_OF_MONTH, 1);
final String centerMeetingNewStartDate = dateFormat.format(todaysdate.getTime());
CalendarHelper.updateMeetingCalendarForCenter(this.requestSpec, this.responseSpec, centerId, calendarId.toString(), oldMeetingDate,
centerMeetingNewStartDate);
ArrayList loanRepaymnetSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec, generalResponseSpec, loanId);
// VERIFY RESCHEDULED DATE
ArrayList dueDateLoanSchedule = (ArrayList) ((HashMap) loanRepaymnetSchedule.get(2)).get("dueDate");
assertEquals(getDateAsArray(todaysdate, 0), dueDateLoanSchedule);
// VERIFY THE INTEREST
Float interestDue = (Float) ((HashMap) loanRepaymnetSchedule.get(2)).get("interestDue");
assertEquals(String.valueOf(interestDue), "90.82");
}
private void associateClientsToGroup(Integer groupId, Integer clientId) {
// Associate client to the group
GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupId.toString(), clientId.toString());
GroupHelper.verifyGroupMembers(this.requestSpec, this.responseSpec, groupId, clientId);
}
private Integer createClient(Integer officeId) {
// CREATE CLIENT
final String clientActivationDate = "01 July 2014";
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec, clientActivationDate, officeId.toString());
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientId);
return clientId;
}
private Integer createCalendarMeeting(Integer centerId) {
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
dateFormat.setTimeZone(Utils.getTimeZoneOfTenant());
Calendar today = Calendar.getInstance(Utils.getTimeZoneOfTenant());
final String startDate = dateFormat.format(today.getTime());
final String frequency = "2"; // 2:Weekly
final String interval = "2"; // Every one week
final Integer repeatsOnDay = today.get(Calendar.DAY_OF_WEEK) - 1;
Integer calendarId = CalendarHelper.createMeetingForGroup(this.requestSpec, this.responseSpec, centerId, startDate, frequency,
interval, repeatsOnDay.toString());
System.out.println("calendarId " + calendarId);
return calendarId;
}
@SuppressWarnings("rawtypes")
@Test
public void testCenterReschedulingMultiTrancheLoansWithInterestRecalculationEnabled() {
Integer officeId = new OfficeHelper(requestSpec, responseSpec).createOffice("01 July 2007");
String name = "TestFullCreation" + new Timestamp(new java.util.Date().getTime());
String externalId = Utils.randomStringGenerator("ID_", 7, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
int staffId = StaffHelper.createStaff(requestSpec, responseSpec);
int[] groupMembers = generateGroupMembers(1, officeId);
final String centerActivationDate = "01 July 2007";
Integer centerId = CenterHelper.createCenter(name, officeId, externalId, staffId, groupMembers, centerActivationDate, requestSpec,
responseSpec);
CenterDomain center = CenterHelper.retrieveByID(centerId, requestSpec, responseSpec);
Integer groupId = groupMembers[0];
Assert.assertNotNull(center);
Assert.assertTrue(center.getStaffId() == staffId);
Assert.assertTrue(center.isActive() == true);
Integer calendarId = createCalendarMeeting(centerId);
Integer clientId = createClient(officeId);
associateClientsToGroup(groupId, clientId);
// CREATE A LOAN PRODUCT
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
dateFormat.setTimeZone(Utils.getTimeZoneOfTenant());
Calendar today = Calendar.getInstance(Utils.getTimeZoneOfTenant());
today.add(Calendar.DAY_OF_MONTH, -14);
// CREATE A LOAN PRODUCT
final String approveDate = dateFormat.format(today.getTime());
final String expectedDisbursementDate = dateFormat.format(today.getTime());
final String disbursementDate = dateFormat.format(today.getTime());
final String approvalAmount = "10000";
final String recalculationRestFrequencyDate = "01 January 2012";
final boolean isMultiTrancheLoan = true;
// CREATE LOAN MULTIDISBURSAL PRODUCT WITH INTEREST RECALCULATION
final Integer loanProductID = createLoanProductWithInterestRecalculation(LoanProductTestBuilder.RBI_INDIA_STRATEGY,
LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_NONE,
LoanProductTestBuilder.RECALCULATION_STRATEGY_REDUCE_NUMBER_OF_INSTALLMENTS,
LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_DAILY, "0", recalculationRestFrequencyDate,
LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null, isMultiTrancheLoan,
null, null);
Calendar seondTrancheDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
seondTrancheDate.add(Calendar.MONTH, 1);
String secondDisbursement = dateFormat.format(seondTrancheDate.getTime()) ;
// CREATE TRANCHES
List<HashMap> createTranches = new ArrayList<>();
createTranches.add(this.loanApplicationApprovalTest.createTrancheDetail(disbursementDate, "5000"));
createTranches.add(this.loanApplicationApprovalTest.createTrancheDetail(secondDisbursement, "5000"));
// APPROVE TRANCHES
List<HashMap> approveTranches = new ArrayList<>();
approveTranches.add(this.loanApplicationApprovalTest.createTrancheDetail(disbursementDate, "5000"));
approveTranches.add(this.loanApplicationApprovalTest.createTrancheDetail(secondDisbursement, "5000"));
// APPLY FOR TRANCHE LOAN WITH INTEREST RECALCULATION
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientId, groupId, calendarId, loanProductID,
disbursementDate, recalculationRestFrequencyDate, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, new ArrayList<HashMap>(0),
createTranches);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
// VALIDATE THE LOAN STATUS
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------");
loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount(approveDate, expectedDisbursementDate, approvalAmount,
loanID, approveTranches);
// VALIDATE THE LOAN IS APPROVED
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
// DISBURSE A FIRST TRANCHE
this.loanTransactionHelper.disburseLoan(disbursementDate, loanID);
loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
System.out.println("---------------------------------CHANGING GROUP MEETING DATE ------------------------------------------");
Calendar todaysdate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
todaysdate.add(Calendar.DAY_OF_MONTH, 14);
String oldMeetingDate = dateFormat.format(todaysdate.getTime());
todaysdate.add(Calendar.DAY_OF_MONTH, 1);
final String centerMeetingNewStartDate = dateFormat.format(todaysdate.getTime());
CalendarHelper.updateMeetingCalendarForCenter(this.requestSpec, this.responseSpec, centerId, calendarId.toString(), oldMeetingDate,
centerMeetingNewStartDate);
ArrayList loanRepaymnetSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec, generalResponseSpec, loanID);
// VERIFY RESCHEDULED DATE
ArrayList dueDateLoanSchedule = (ArrayList) ((HashMap) loanRepaymnetSchedule.get(2)).get("dueDate");
assertEquals(getDateAsArray(todaysdate, 0), dueDateLoanSchedule);
// VERIFY THE INTEREST
Float interestDue = (Float) ((HashMap) loanRepaymnetSchedule.get(2)).get("interestDue");
assertEquals(String.valueOf(interestDue), "41.05");
}
private Integer createLoanProductWithInterestRecalculation(final String repaymentStrategy,
final String interestRecalculationCompoundingMethod, final String rescheduleStrategyMethod,
final String recalculationRestFrequencyType, final String recalculationRestFrequencyInterval,
final String recalculationRestFrequencyDate, final String preCloseInterestCalculationStrategy, final Account[] accounts,
final boolean isMultiTrancheLoan, final Integer recalculationRestFrequencyOnDayType, final Integer recalculationRestFrequencyDayOfWeekType) {
final String recalculationCompoundingFrequencyType = null;
final String recalculationCompoundingFrequencyInterval = null;
final String recalculationCompoundingFrequencyDate = null;
final Integer recalculationCompoundingFrequencyOnDayType = null;
final Integer recalculationCompoundingFrequencyDayOfWeekType = null;
return createLoanProductWithInterestRecalculation(repaymentStrategy, interestRecalculationCompoundingMethod,
rescheduleStrategyMethod, recalculationRestFrequencyType, recalculationRestFrequencyInterval,
recalculationRestFrequencyDate, recalculationCompoundingFrequencyType, recalculationCompoundingFrequencyInterval,
recalculationCompoundingFrequencyDate, preCloseInterestCalculationStrategy, accounts, null, false, isMultiTrancheLoan,
recalculationCompoundingFrequencyOnDayType, recalculationCompoundingFrequencyDayOfWeekType, recalculationRestFrequencyOnDayType,
recalculationRestFrequencyDayOfWeekType);
}
private Integer createLoanProductWithInterestRecalculation(final String repaymentStrategy,
final String interestRecalculationCompoundingMethod, final String rescheduleStrategyMethod,
final String recalculationRestFrequencyType, final String recalculationRestFrequencyInterval,
final String recalculationRestFrequencyDate, final String recalculationCompoundingFrequencyType,
final String recalculationCompoundingFrequencyInterval, final String recalculationCompoundingFrequencyDate,
final String preCloseInterestCalculationStrategy, final Account[] accounts, final String chargeId,
boolean isArrearsBasedOnOriginalSchedule, final boolean isMultiTrancheLoan,
final Integer recalculationCompoundingFrequencyOnDayType,
final Integer recalculationCompoundingFrequencyDayOfWeekType, final Integer recalculationRestFrequencyOnDayType,
final Integer recalculationRestFrequencyDayOfWeekType) {
System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
LoanProductTestBuilder builder = new LoanProductTestBuilder()
.withPrincipal("10000.00")
.withNumberOfRepayments("12")
.withRepaymentAfterEvery("2")
.withRepaymentTypeAsWeek()
.withinterestRatePerPeriod("2")
.withInterestRateFrequencyTypeAsMonths()
.withTranches(isMultiTrancheLoan)
.withInterestCalculationPeriodTypeAsRepaymentPeriod(true)
.withRepaymentStrategy(repaymentStrategy)
.withInterestTypeAsDecliningBalance()
.withInterestRecalculationDetails(interestRecalculationCompoundingMethod, rescheduleStrategyMethod,
preCloseInterestCalculationStrategy)
.withInterestRecalculationRestFrequencyDetails(recalculationRestFrequencyType, recalculationRestFrequencyInterval,
recalculationRestFrequencyOnDayType, recalculationRestFrequencyDayOfWeekType)
.withInterestRecalculationCompoundingFrequencyDetails(recalculationCompoundingFrequencyType,
recalculationCompoundingFrequencyInterval, recalculationCompoundingFrequencyOnDayType,
recalculationCompoundingFrequencyDayOfWeekType);
if (accounts != null) {
builder = builder.withAccountingRulePeriodicAccrual(accounts);
}
if (isArrearsBasedOnOriginalSchedule) builder = builder.withArrearsConfiguration();
final String loanProductJSON = builder.build(chargeId);
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
}
@SuppressWarnings("rawtypes")
private Integer applyForLoanApplicationForInterestRecalculation(final Integer clientID, Integer groupId, Integer calendarId,
final Integer loanProductID, final String disbursementDate, final String restStartDate, final String repaymentStrategy,
final List<HashMap> charges, List<HashMap> tranches) {
final String graceOnInterestPayment = null;
final String compoundingStartDate = null;
final String graceOnPrincipalPayment = null;
return applyForLoanApplicationForInterestRecalculation(clientID, groupId, calendarId, loanProductID, disbursementDate,
restStartDate, compoundingStartDate, repaymentStrategy, charges, graceOnInterestPayment, graceOnPrincipalPayment, tranches);
}
@SuppressWarnings({ "rawtypes", "unused" })
private Integer applyForLoanApplicationForInterestRecalculation(final Integer clientID, Integer groupId, Integer calendarId,
final Integer loanProductID, final String disbursementDate, final String restStartDate, final String compoundingStartDate,
final String repaymentStrategy, final List<HashMap> charges, final String graceOnInterestPayment,
final String graceOnPrincipalPayment, List<HashMap> tranches) {
System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
final String loanApplicationJSON = new LoanApplicationTestBuilder() //
.withPrincipal("10000.00") //
.withLoanTermFrequency("24") //
.withLoanTermFrequencyAsWeeks() //
.withNumberOfRepayments("12") //
.withRepaymentEveryAfter("2") //
.withRepaymentFrequencyTypeAsWeeks() //
.withInterestRatePerPeriod("2").withLoanType("jlg") //
.withCalendarID(calendarId.toString()).withAmortizationTypeAsEqualInstallments() //
.withFixedEmiAmount("") //
.withTranches(tranches).withInterestTypeAsDecliningBalance() //
.withInterestCalculationPeriodTypeAsDays() //
.withInterestCalculationPeriodTypeAsDays() //
.withExpectedDisbursementDate(disbursementDate) //
.withSubmittedOnDate(disbursementDate) //
.withwithRepaymentStrategy(repaymentStrategy) //
.withCharges(charges)//
.build(clientID.toString(), groupId.toString(), loanProductID.toString(), null);
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
}
private int[] generateGroupMembers(int size, int officeId) {
int[] groupMembers = new int[size];
for (int i = 0; i < groupMembers.length; i++) {
final HashMap<String, String> map = new HashMap<>();
map.put("officeId", "" + officeId);
map.put("name", Utils.randomStringGenerator("Group_Name_", 5));
map.put("externalId", Utils.randomStringGenerator("ID_", 7, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
map.put("dateFormat", "dd MMMM yyyy");
map.put("locale", "en");
map.put("active", "true");
map.put("activationDate", "04 March 2011");
groupMembers[i] = Utils.performServerPost(requestSpec, responseSpec, "/fineract-provider/api/v1/groups?"
+ Utils.TENANT_IDENTIFIER, new Gson().toJson(map), "groupId");
}
return groupMembers;
}
private List getDateAsArray(Calendar date, int addPeriod) {
return getDateAsArray(date, addPeriod, Calendar.DAY_OF_MONTH);
}
private List getDateAsArray(Calendar date, int addvalue, int type) {
date.add(type, addvalue);
return new ArrayList<>(Arrays.asList(date.get(Calendar.YEAR), date.get(Calendar.MONTH) + 1, date.get(Calendar.DAY_OF_MONTH)));
}
}
@@ -1,21 +1,34 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.ClientHelper;
import org.mifosplatform.integrationtests.common.Utils;
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 com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -0,0 +1,77 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.integrationtests;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before;
import org.junit.Test;
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 LoanWithdrawnByApplicantIntegrationTest {
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();
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
}
@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(null));
final Integer loanID = applyForLoanApplication(clientID, loanProductID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
this.loanTransactionHelper.withdrawLoanApplicationByClient("03 April 2012", loanID);
loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanAccountIsNotActive(loanStatusHashMap);
}
private Integer applyForLoanApplication(final Integer clientID, final Integer loanProductID) {
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(), null);
return this.loanTransactionHelper.getLoanId(loanApplication);
}
}
@@ -1,27 +1,40 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import java.util.HashMap;
import java.util.List;
import org.apache.fineract.integrationtests.common.CalendarHelper;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.GroupHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.CalendarHelper;
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.loans.LoanApplicationTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanStatusChecker;
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -0,0 +1,66 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.integrationtests;
import org.apache.fineract.integrationtests.common.OfficeDomain;
import org.apache.fineract.integrationtests.common.OfficeHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
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;
public class OfficeIntegrationTest {
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 testOfficeModification() {
OfficeHelper oh = new OfficeHelper(requestSpec, responseSpec);
int officeId = oh.createOffice("01 July 2007");
String name = Utils.randomNameGenerator("New_Office_", 4);
String date = "02 July 2007";
String[] dateArr = { "2007", "7", "2" };
oh.updateOffice(officeId, name, date);
OfficeDomain newOffice = oh.retrieveOfficeByID(officeId);
Assert.assertTrue(name.equals(newOffice.getName()));
Assert.assertArrayEquals(dateArr, newOffice.getOpeningDate());
}
}
@@ -0,0 +1,78 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import java.util.HashMap;
import java.util.List;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.PasswordPreferencesHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Before;
import org.junit.Test;
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" })
public class PasswordPreferencesIntegrationTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
private ResponseSpecification generalResponseSpec;
@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();
}
@Test
public void updatePasswordPreferences() {
String validationPolicyId = "2";
PasswordPreferencesHelper.updatePasswordPreferences(requestSpec, responseSpec, validationPolicyId);
this.validateIfThePasswordIsUpdated(validationPolicyId);
}
private void validateIfThePasswordIsUpdated(String validationPolicyId){
Integer id = PasswordPreferencesHelper.getActivePasswordPreference(requestSpec, responseSpec);
assertEquals(validationPolicyId, id.toString());
System.out.println("---------------------------------PASSWORD PREFERENCE VALIDATED SUCCESSFULLY-----------------------------------------");
}
@Test
public void updateWithInvalidPolicyId() {
String invalidValidationPolicyId = "2000";
final List<HashMap> error = (List) PasswordPreferencesHelper.updateWithInvalidValidationPolicyId(requestSpec, generalResponseSpec, invalidValidationPolicyId,
CommonConstants.RESPONSE_ERROR);
assertEquals("Password Validation Policy with identifier 2000 does not exist", "error.msg.password.validation.policy.id.invalid",
error.get(0).get("userMessageGlobalisationCode"));
}
}
@@ -1,18 +1,31 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.PaymentTypeDomain;
import org.apache.fineract.integrationtests.common.PaymentTypeHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.PaymentTypeDomain;
import org.mifosplatform.integrationtests.common.PaymentTypeHelper;
import org.mifosplatform.integrationtests.common.Utils;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -1,9 +1,22 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
@@ -12,38 +25,38 @@ import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import net.sf.ehcache.transaction.xa.EhcacheXAException;
import org.apache.fineract.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
import org.apache.fineract.integrationtests.common.TaxComponentHelper;
import org.apache.fineract.integrationtests.common.TaxGroupHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.accounting.Account;
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
import org.apache.fineract.integrationtests.common.accounting.FinancialActivityAccountHelper;
import org.apache.fineract.integrationtests.common.accounting.JournalEntry;
import org.apache.fineract.integrationtests.common.accounting.JournalEntryHelper;
import org.apache.fineract.integrationtests.common.accounting.Account.AccountType;
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositAccountStatusChecker;
import org.apache.fineract.integrationtests.common.recurringdeposit.RecurringDepositAccountHelper;
import org.apache.fineract.integrationtests.common.recurringdeposit.RecurringDepositAccountStatusChecker;
import org.apache.fineract.integrationtests.common.recurringdeposit.RecurringDepositProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.joda.time.DateTime;
import org.joda.time.Months;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
import org.mifosplatform.integrationtests.common.ClientHelper;
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.accounting.AccountHelper;
import org.mifosplatform.integrationtests.common.accounting.FinancialActivityAccountHelper;
import org.mifosplatform.integrationtests.common.accounting.JournalEntry;
import org.mifosplatform.integrationtests.common.accounting.JournalEntryHelper;
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.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;
@@ -95,7 +108,7 @@ public class RecurringDepositTest {
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.requestSpec.header("Fineract-Platform-TenantId", "default");
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
this.financialActivityAccountHelper = new FinancialActivityAccountHelper(this.requestSpec);
@@ -459,6 +472,384 @@ public class RecurringDepositTest {
}
@Test
public void testRecurringDepositAccountWithPrematureClosureTypeTransferToSavings_WITH_HOLD_TAX() {
this.recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.recurringDepositAccountHelper = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec);
/***
* Create GL Accounts for product account mapping
*/
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 liabilityAccountForTax = this.accountHelper.createLiabilityAccount();
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
DateFormat monthDayFormat = new SimpleDateFormat("dd MMM", Locale.US);
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());
final String MONTH_DAY = monthDayFormat.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 String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
/***
* Create client for applying Deposit and Savings accounts
*/
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
/***
* Create Savings product with CashBased accounting enabled
*/
final String accountingRule = CASH_BASED;
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, accountingRule,
assetAccount, liabilityAccount, incomeAccount, expenseAccount);
Assert.assertNotNull(savingsProductID);
/***
* Create Savings account and verify status is pending
*/
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);
/***
* Approve the savings account and verify account is approved
*/
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
/***
* Activate the savings account and verify account is activated
*/
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
/***
* Create RD product with CashBased accounting enabled
*/
final Integer taxGroupId = createTaxGroup("10", liabilityAccountForTax);
Integer recurringDepositProductId = createRecurringDepositProductWithWithHoldTax(VALID_FROM, VALID_TO,String.valueOf(taxGroupId), accountingRule, assetAccount,
liabilityAccount, incomeAccount, expenseAccount);
Assert.assertNotNull(recurringDepositProductId);
/***
* Apply for RD account with created product and verify status
*/
Integer recurringDepositAccountId = applyForRecurringDepositApplication(clientId.toString(), recurringDepositProductId.toString(),
VALID_FROM, VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, EXPECTED_FIRST_DEPOSIT_ON_DATE);
Assert.assertNotNull(recurringDepositAccountId);
HashMap recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker.getStatusOfRecurringDepositAccount(
this.requestSpec, this.responseSpec, recurringDepositAccountId.toString());
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsPending(recurringDepositAccountStatusHashMap);
/***
* Approve the RD account and verify whether account is approved
*/
recurringDepositAccountStatusHashMap = this.recurringDepositAccountHelper.approveRecurringDeposit(recurringDepositAccountId,
APPROVED_ON_DATE);
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsApproved(recurringDepositAccountStatusHashMap);
/***
* Activate the RD Account and verify whether account is activated
*/
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");
/***
* Perform Deposit transaction and verify journal entries are posted for
* the transaction
*/
Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId,
depositAmount, EXPECTED_FIRST_DEPOSIT_ON_DATE);
Assert.assertNotNull(depositTransactionId);
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, EXPECTED_FIRST_DEPOSIT_ON_DATE, new JournalEntry(
depositAmount, JournalEntry.TransactionType.DEBIT));
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, EXPECTED_FIRST_DEPOSIT_ON_DATE, new JournalEntry(
depositAmount, JournalEntry.TransactionType.CREDIT));
/***
* Update interest earned field for RD account
*/
recurringDepositAccountId = this.recurringDepositAccountHelper.calculateInterestForRecurringDeposit(recurringDepositAccountId);
Assert.assertNotNull(recurringDepositAccountId);
/***
* Post interest and verify journal entries
*/
Integer transactionIdForPostInterest = this.recurringDepositAccountHelper
.postInterestForRecurringDeposit(recurringDepositAccountId);
Assert.assertNotNull(transactionIdForPostInterest);
HashMap accountSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
Assert.assertNull(accountSummary.get("totalWithholdTax"));
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);
/***
* Get saving account balance before preClosing RD account
*/
HashMap savingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
Float balanceBefore = (Float) savingsSummaryBefore.get("accountBalance");
HashMap recurringDepositPrematureData = this.recurringDepositAccountHelper.calculatePrematureAmountForRecurringDeposit(
recurringDepositAccountId, CLOSED_ON_DATE);
/***
* Retrieve mapped financial account for liability transfer
*/
Account financialAccount = getMappedLiabilityFinancialAccount();
/***
* Preclose the RD account verify whether account is preClosed
*/
Integer prematureClosureTransactionId = (Integer) this.recurringDepositAccountHelper.prematureCloseForRecurringDeposit(
recurringDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_TRANSFER_TO_SAVINGS, savingsId,
CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(prematureClosureTransactionId);
recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker.getStatusOfRecurringDepositAccount(this.requestSpec,
this.responseSpec, recurringDepositAccountId.toString());
RecurringDepositAccountStatusChecker.verifyRecurringDepositAccountIsPrematureClosed(recurringDepositAccountStatusHashMap);
recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
this.responseSpec, recurringDepositAccountId);
Float maturityAmount = Float.valueOf(recurringDepositAccountData.get("maturityAmount").toString());
/***
* Verify journal entry transactions for preclosure transaction As this
* transaction is an account transfer you should get financial account
* mapping details and verify amounts
*/
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount,
JournalEntry.TransactionType.CREDIT), new JournalEntry(maturityAmount, JournalEntry.TransactionType.DEBIT));
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(financialAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount,
JournalEntry.TransactionType.DEBIT), new JournalEntry(maturityAmount, JournalEntry.TransactionType.CREDIT));
/***
* Verify rd account maturity amount and savings account balance
*/
HashMap recurringDepositData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
this.responseSpec, recurringDepositAccountId);
Float prematurityAmount = (Float) recurringDepositData.get("maturityAmount");
HashMap summary = (HashMap) recurringDepositData.get("summary");
Assert.assertNotNull(summary.get("totalWithholdTax"));
Float withHoldTax = (Float) summary.get("totalWithholdTax");
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccountForTax, CLOSED_ON_DATE, new JournalEntry(withHoldTax,
JournalEntry.TransactionType.CREDIT));
HashMap savingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
Float balanceAfter = (Float) savingsSummaryAfter.get("accountBalance");
Float expectedSavingsBalance = balanceBefore + prematurityAmount;
DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern(".");
Assert.assertEquals("Verifying Savings Account Balance after Premature Closure", decimalFormat.format(expectedSavingsBalance),
decimalFormat.format(balanceAfter));
}
@Test
public void testRecurringDepositAccountWithClosureTypeTransferToSavings_WITH_HOLD_TAX() throws InterruptedException {
this.recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.recurringDepositAccountHelper = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec);
/***
* Create GL Accounts for product account mapping
*/
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 liabilityAccountForTax = this.accountHelper.createLiabilityAccount();
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
DateFormat monthDayFormat = new SimpleDateFormat("dd MMM", Locale.US);
DateFormat currentDateFormat = new SimpleDateFormat("dd");
Calendar todaysDate = Calendar.getInstance();
todaysDate.add(Calendar.MONTH, -20);
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, -20);
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());
final String MONTH_DAY = monthDayFormat.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());
Calendar closedOn = Calendar.getInstance();
closedOn.add(Calendar.MONTH, -6);
final String CLOSED_ON_DATE = dateFormat.format(closedOn.getTime());
/***
* Create client for applying Deposit and Savings accounts
*/
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
/***
* Create Savings product with CashBased accounting enabled
*/
final String accountingRule = CASH_BASED;
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, accountingRule,
assetAccount, liabilityAccount, incomeAccount, expenseAccount);
Assert.assertNotNull(savingsProductID);
/***
* Create Savings account and verify status is pending
*/
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);
/***
* Approve the savings account and verify account is approved
*/
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
/***
* Activate the savings account and verify account is activated
*/
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
/***
* Create RD product with CashBased accounting enabled
*/
final Integer taxGroupId = createTaxGroup("10", liabilityAccountForTax);
Integer recurringDepositProductId = createRecurringDepositProductWithWithHoldTax(VALID_FROM, VALID_TO,String.valueOf(taxGroupId), accountingRule, assetAccount,
liabilityAccount, incomeAccount, expenseAccount);
Assert.assertNotNull(recurringDepositProductId);
/***
* Apply for RD account with created product and verify status
*/
Integer recurringDepositAccountId = applyForRecurringDepositApplication(clientId.toString(), recurringDepositProductId.toString(),
VALID_FROM, VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, EXPECTED_FIRST_DEPOSIT_ON_DATE);
Assert.assertNotNull(recurringDepositAccountId);
HashMap recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker.getStatusOfRecurringDepositAccount(
this.requestSpec, this.responseSpec, recurringDepositAccountId.toString());
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsPending(recurringDepositAccountStatusHashMap);
/***
* Approve the RD account and verify whether account is approved
*/
recurringDepositAccountStatusHashMap = this.recurringDepositAccountHelper.approveRecurringDeposit(recurringDepositAccountId,
APPROVED_ON_DATE);
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsApproved(recurringDepositAccountStatusHashMap);
/***
* Activate the RD Account and verify whether account is activated
*/
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");
/***
* Perform Deposit transaction and verify journal entries are posted for
* the transaction
*/
todaysDate = Calendar.getInstance();
todaysDate.add(Calendar.MONTH, -20);
for (int i = 0; i < 14; i++) {
Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId,
depositAmount, dateFormat.format(todaysDate.getTime()));
Assert.assertNotNull(depositTransactionId);
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, dateFormat.format(todaysDate.getTime()), new JournalEntry(
depositAmount, JournalEntry.TransactionType.DEBIT));
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, dateFormat.format(todaysDate.getTime()),
new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT));
todaysDate.add(Calendar.MONTH, 1);
}
/***
* FD account verify whether account is matured
*/
SchedulerJobHelper schedulerJobHelper = new SchedulerJobHelper(requestSpec, responseSpec);
String JobName = "Update Deposit Accounts Maturity details";
schedulerJobHelper.executeJob(JobName);
HashMap accountDetails = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
recurringDepositAccountId);
HashMap summary = (HashMap) accountDetails.get("summary");
Assert.assertNotNull(summary.get("totalWithholdTax"));
Float withHoldTax = (Float) summary.get("totalWithholdTax");
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccountForTax, CLOSED_ON_DATE, new JournalEntry(withHoldTax,
JournalEntry.TransactionType.CREDIT));
recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker.getStatusOfRecurringDepositAccount(this.requestSpec,
this.responseSpec, recurringDepositAccountId.toString());
RecurringDepositAccountStatusChecker.verifyRecurringDepositAccountIsMatured(recurringDepositAccountStatusHashMap);
}
/***
* Test case for Recurring Deposit Account premature closure with
* transaction type ReInvest and Cash Based accounting enabled
@@ -2483,6 +2874,169 @@ public class RecurringDepositTest {
}
@Test
public void testRecurringDepositAccountWithPeriodInterestRateChart() {
final String chartToUse = "period";
final String depositAmount = "1000";
final String depositPeriod = "12";
final Float interestRate = new Float(6.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testRecurringDepositAccountWithPeriodInterestRateChart_AMOUNT_VARIATION() {
final String chartToUse = "period";
final String depositAmount = "10000";
final String depositPeriod = "12";
final Float interestRate = new Float(6.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testRecurringDepositAccountWithPeriodInterestRateChart_PERIOD_VARIATION() {
final String chartToUse = "period";
final String depositAmount = "1000";
final String depositPeriod = "18";
final Float interestRate = new Float(7.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testRecurringDepositAccountWithAmountInterestRateChart() {
final String chartToUse = "amount";
final String depositAmount = "1000";
final String depositPeriod = "12";
final Float interestRate = new Float(8.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testRecurringDepositAccountWithAmountInterestRateChart_AMOUNT_VARIATION() {
final String chartToUse = "amount";
final String depositAmount = "500";
final String depositPeriod = "12";
final Float interestRate = new Float(7.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testRecurringDepositAccountWithAmountInterestRateChart_PERIOD_VARIATION() {
final String chartToUse = "amount";
final String depositAmount = "500";
final String depositPeriod = "10";
final Float interestRate = new Float(5.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testRecurringDepositAccountWithPeriodAndAmountInterestRateChart() {
final String chartToUse = "period_amount";
final String depositAmount = "1000";
final String depositPeriod = "12";
final Float interestRate = new Float(7.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testRecurringDepositAccountWithPeriodAndAmountInterestRateChart_AMOUNT_VARIATION() {
final String chartToUse = "period_amount";
final String depositAmount = "400";
final String depositPeriod = "12";
final Float interestRate = new Float(6.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testRecurringDepositAccountWithPeriodAndAmountInterestRateChart_PERIOD_VARIATION() {
final String chartToUse = "period_amount";
final String depositAmount = "1000";
final String depositPeriod = "14";
final Float interestRate = new Float(8.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testRecurringDepositAccountWithAmountAndPeriodInterestRateChart() {
final String chartToUse = "amount_period";
final String depositAmount = "1000";
final String depositPeriod = "12";
final Float interestRate = new Float(8.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testRecurringDepositAccountWithAmountAndPeriodInterestRateChart_AMOUNT_VARIATION() {
final String chartToUse = "amount_period";
final String depositAmount = "100";
final String depositPeriod = "12";
final Float interestRate = new Float(6.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@Test
public void testRecurringDepositAccountWithAmountAndPeriodInterestRateChart_PERIOD_VARIATION() {
final String chartToUse = "amount_period";
final String depositAmount = "1000";
final String depositPeriod = "6";
final Float interestRate = new Float(7.0);
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
private void testFixedDepositAccountForInterestRate(final String chartToUse, final String depositAmount, final String depositPeriod,
final Float interestRate) {
this.recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.recurringDepositAccountHelper = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec);
final String VALID_FROM = "01 March 2014";
final String VALID_TO = "01 March 2016";
final String SUBMITTED_ON_DATE = "01 March 2015";
final String APPROVED_ON_DATE = "01 March 2015";
final String ACTIVATION_DATE = "01 March 2015";
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
/***
* Create FD product with CashBased accounting enabled
*/
final String accountingRule = NONE;
Integer recurringDepositProductId = createRecurringDepositProduct(VALID_FROM, VALID_TO, accountingRule, chartToUse);
Assert.assertNotNull(recurringDepositProductId);
/***
* Apply for FD account with created product and verify status
*/
Integer recurringDepositAccountId = applyForRecurringDepositApplication(clientId.toString(), recurringDepositProductId.toString(),
VALID_FROM, VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, SUBMITTED_ON_DATE, depositAmount, depositPeriod);
Assert.assertNotNull(recurringDepositAccountId);
HashMap recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker.getStatusOfRecurringDepositAccount(
this.requestSpec, this.responseSpec, recurringDepositAccountId.toString());
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsPending(recurringDepositAccountStatusHashMap);
/***
* Approve the RD account and verify whether account is approved
*/
recurringDepositAccountStatusHashMap = this.recurringDepositAccountHelper.approveRecurringDeposit(recurringDepositAccountId,
APPROVED_ON_DATE);
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsApproved(recurringDepositAccountStatusHashMap);
/***
* Activate the RD Account and verify whether account is activated
*/
recurringDepositAccountStatusHashMap = this.recurringDepositAccountHelper.activateRecurringDeposit(recurringDepositAccountId,
ACTIVATION_DATE);
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
this.responseSpec, recurringDepositAccountId);
Assert.assertEquals(interestRate, recurringDepositAccountData.get("nominalAnnualInterestRate"));
}
private Integer createRecurringDepositProduct(final String validFrom, final String validTo, final String accountingRule,
Account... accounts) {
System.out.println("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------");
@@ -2492,6 +3046,51 @@ public class RecurringDepositTest {
} else if (accountingRule.equals(NONE)) {
recurringDepositProductHelper = recurringDepositProductHelper.withAccountingRuleAsNone();
}
final String recurringDepositProductJSON = recurringDepositProductHelper.withPeriodRangeChart().build(validFrom, validTo);
return RecurringDepositProductHelper.createRecurringDepositProduct(recurringDepositProductJSON, requestSpec, responseSpec);
}
private Integer createRecurringDepositProductWithWithHoldTax(final String validFrom, final String validTo,final String taxGroupId, final String accountingRule,
Account... accounts) {
System.out.println("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------");
RecurringDepositProductHelper recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
if (accountingRule.equals(CASH_BASED)) {
recurringDepositProductHelper = recurringDepositProductHelper.withAccountingRuleAsCashBased(accounts);
} else if (accountingRule.equals(NONE)) {
recurringDepositProductHelper = recurringDepositProductHelper.withAccountingRuleAsNone();
}
final String recurringDepositProductJSON = recurringDepositProductHelper.withPeriodRangeChart()
.withWithHoldTax(taxGroupId)//
.build(validFrom, validTo);
return RecurringDepositProductHelper.createRecurringDepositProduct(recurringDepositProductJSON, requestSpec, responseSpec);
}
private Integer createRecurringDepositProduct(final String validFrom, final String validTo, final String accountingRule,
final String chartToBePicked, Account... accounts) {
System.out.println("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------");
RecurringDepositProductHelper recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
if (accountingRule.equals(CASH_BASED)) {
recurringDepositProductHelper = recurringDepositProductHelper.withAccountingRuleAsCashBased(accounts);
} else if (accountingRule.equals(NONE)) {
recurringDepositProductHelper = recurringDepositProductHelper.withAccountingRuleAsNone();
}
switch (chartToBePicked) {
case "period":
recurringDepositProductHelper = recurringDepositProductHelper.withPeriodRangeChart();
break;
case "amount":
recurringDepositProductHelper = recurringDepositProductHelper.withAmountRangeChart();
break;
case "period_amount":
recurringDepositProductHelper = recurringDepositProductHelper.withPeriodAndAmountRangeChart();
break;
case "amount_period":
recurringDepositProductHelper = recurringDepositProductHelper.withAmountAndPeriodRangeChart();
break;
default:
break;
}
final String recurringDepositProductJSON = recurringDepositProductHelper.build(validFrom, validTo);
return RecurringDepositProductHelper.createRecurringDepositProduct(recurringDepositProductJSON, requestSpec, responseSpec);
}
@@ -2501,7 +3100,18 @@ public class RecurringDepositTest {
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);
.build(clientID, productID, penalInterestType);
return this.recurringDepositAccountHelper.applyRecurringDepositApplication(recurringDepositApplicationJSON, this.requestSpec,
this.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,
final String depositAmount, final String depositPeriod) {
System.out.println("--------------------------------APPLYING FOR RECURRING DEPOSIT ACCOUNT --------------------------------");
final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec)
.withSubmittedOnDate(submittedOnDate).withExpectedFirstDepositOnDate(expectedFirstDepositOnDate)
.withDepositPeriod(depositPeriod).withMandatoryDepositAmount(depositAmount).build(clientID, productID, penalInterestType);
return this.recurringDepositAccountHelper.applyRecurringDepositApplication(recurringDepositApplicationJSON, this.requestSpec,
this.responseSpec);
}
@@ -2576,6 +3186,13 @@ public class RecurringDepositTest {
Assert.assertEquals(financialActivityId, ((HashMap) mappingDetails.get("financialActivityData")).get("id"));
Assert.assertEquals(glAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
}
private Integer createTaxGroup(final String percentage, final Account liabilityAccountForTax){
final Integer liabilityAccountId = liabilityAccountForTax.getAccountID();
final Integer taxComponentId = TaxComponentHelper.createTaxComponent(this.requestSpec, this.responseSpec, percentage, liabilityAccountId);
return TaxGroupHelper.createTaxGroup(this.requestSpec, this.responseSpec, Arrays.asList(taxComponentId));
}
/**
* Delete the Liability transfer account
@@ -1,22 +1,35 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.apache.fineract.integrationtests.useradministration.roles.RolesHelper;
import org.apache.fineract.integrationtests.useradministration.users.UserHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.integrationtests.common.Utils;
import org.mifosplatform.integrationtests.common.organisation.StaffHelper;
import org.mifosplatform.integrationtests.useradministration.roles.RolesHelper;
import org.mifosplatform.integrationtests.useradministration.users.UserHelper;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -1,18 +1,31 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import java.util.ArrayList;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
import org.apache.fineract.integrationtests.common.Utils;
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;
@@ -33,7 +46,7 @@ public class SchedulerJobsTest {
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.requestSpec.header("Fineract-Platform-TenantId", "default");
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
this.responseSpecForSchedulerJob = new ResponseSpecBuilder().expectStatusCode(202).build();
}
@@ -1,9 +1,22 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.mifosplatform.integrationtests;
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
@@ -17,32 +30,33 @@ import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
import org.apache.fineract.integrationtests.common.HolidayHelper;
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
import org.apache.fineract.integrationtests.common.StandingInstructionsHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.accounting.Account;
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
import org.apache.fineract.integrationtests.common.accounting.JournalEntry;
import org.apache.fineract.integrationtests.common.accounting.JournalEntryHelper;
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositAccountHelper;
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositAccountStatusChecker;
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositProductHelper;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.apache.fineract.portfolio.account.PortfolioAccountType;
import org.apache.fineract.portfolio.account.domain.AccountTransferType;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
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 org.mifosplatform.portfolio.account.PortfolioAccountType;
import org.mifosplatform.portfolio.account.domain.AccountTransferType;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
@@ -82,7 +96,7 @@ public class SchedulerJobsTestResults {
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.requestSpec.header("Fineract-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);
@@ -112,7 +126,7 @@ public class SchedulerJobsTestResults {
ChargesHelper.getSavingsAnnualFeeJSON());
Assert.assertNotNull(annualFeeChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, annualFeeChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, annualFeeChargeId, true);
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(1, chargesPendingState.size());
@@ -333,7 +347,7 @@ public class SchedulerJobsTestResults {
ChargesHelper.getSavingsSpecifiedDueDateJSON());
Assert.assertNotNull(specifiedDueDateChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, specifiedDueDateChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, specifiedDueDateChargeId, true);
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(1, chargesPendingState.size());
@@ -503,6 +517,9 @@ public class SchedulerJobsTestResults {
}
// Invalid test case as it won't affect summary (Loan summary is properly
// updated before running this job)
@Ignore
@Test
public void testUpdateLoanSummaryJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
@@ -552,7 +569,7 @@ public class SchedulerJobsTestResults {
String JobName = "Update loan Summary";
this.schedulerJobHelper.executeJob(JobName);
Float expectedSummaryAfterJob = (Float) loanSummaryBefore.get("totalExpectedRepayment")
- (Float) loanSummaryBefore.get("feeChargesPaid");
/* - (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"));
@@ -875,6 +892,7 @@ public class SchedulerJobsTestResults {
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
final String fixedDepositProductJSON = fixedDepositProductHelper //
// .withAccountingRuleAsCashBased(accounts)
.withPeriodRangeChart()//
.build(validFrom, validTo);
return FixedDepositProductHelper.createFixedDepositProduct(fixedDepositProductJSON, requestSpec, responseSpec);
}
@@ -887,7 +905,7 @@ public class SchedulerJobsTestResults {
//
.withSubmittedOnDate(submittedOnDate).withSavings(savingsId).transferInterest(true)
.withLockinPeriodFrequency("1", FixedDepositAccountHelper.DAYS)
.build(clientID, productID, validFrom, validTo, penalInterestType);
.build(clientID, productID, penalInterestType);
return fixedDepositAccountHelper.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
}
@@ -0,0 +1,169 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.CalendarHelper;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
import org.apache.fineract.integrationtests.common.GroupHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before;
import org.junit.Test;
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;
import junit.framework.Assert;
@SuppressWarnings({ "static-access", "rawtypes", "unchecked", "deprecation" })
public class SkipRepaymentOnMonthFirstTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
private GlobalConfigurationHelper globalConfigurationHelper;
private LoanTransactionHelper loanTransactionHelper;
private CalendarHelper calendarHelper;
@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 testSkippingRepaymentOnFirstDayOfMonth() {
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 = "skip-repayment-on-first-day-of-month";
boolean newBooleanValue = true;
for (Integer configIndex = 0; configIndex < (globalConfig.size()); configIndex++) {
if (globalConfig.get(configIndex).get("name").equals(configName)) {
String configId = (globalConfig.get(configIndex).get("id")).toString();
Integer updateConfigId = this.globalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(
this.requestSpec, this.responseSpec, configId.toString(), newBooleanValue);
Assert.assertNotNull(updateConfigId);
break;
}
}
}
@Test
public void checkRepaymentSkipOnFirstDayOfMonth() {
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(),
clientID.toString());
final String startDate = "15 September 2011";
final String frequency = "3"; // Monthly
final String interval = "1"; //Every One Moth
Integer calendarID = calendarHelper.createMeetingForGroup(requestSpec, responseSpec, groupID, startDate, frequency,
interval, null);
System.out.println("caladerId --------------------" + calendarID);
final Integer loanProductID = createLoanProduct();
final Integer loanID = applyForLoanApplication(groupID, loanProductID, calendarID, clientID);
System.out.println("loanID----" + loanID);
final ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
this.responseSpec, loanID);
verifyLoanRepaymentSchedule(loanSchedule);
}
private Integer createLoanProduct() {
System.out.println(
"------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
final String loanProductJSON = new LoanProductTestBuilder() //
.withPrincipal("12,000.00") //
.withNumberOfRepayments("4") //
.withRepaymentAfterEvery("1") //
.withRepaymentTypeAsMonth() //
.withinterestRatePerPeriod("1") //
.withInterestRateFrequencyTypeAsMonths() //
.withAmortizationTypeAsEqualInstallments() //
.withInterestTypeAsDecliningBalance() //
.build(null);
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
}
private Integer applyForLoanApplication(final Integer groupID, final Integer loanProductID, Integer calendarID,
Integer clientID) {
System.out.println(
"--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
final String loanApplicationJSON = new LoanApplicationTestBuilder() //
.withPrincipal("12,000.00") //
.withLoanTermFrequency("4") //
.withLoanTermFrequencyAsMonths() //
.withNumberOfRepayments("4") //
.withRepaymentEveryAfter("1") //
.withRepaymentFrequencyTypeAsMonths() //
.withInterestRatePerPeriod("2") //
.withAmortizationTypeAsEqualInstallments() //
.withInterestTypeAsDecliningBalance() //
.withInterestCalculationPeriodTypeSameAsRepaymentPeriod() //
.withExpectedDisbursementDate("01 October 2011") //
.withCalendarID(calendarID.toString()) //
.withSubmittedOnDate("01 October 2011") //
.withLoanType("jlg").build(clientID.toString(), groupID.toString(), loanProductID.toString(), null);
System.out.println(loanApplicationJSON);
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
}
private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule) {
System.out.println("--------------------VERIFYING THE REPAYMENT DATE--------------------------");
assertEquals("Checking for Repayment Date for 1st Month", new ArrayList<>(Arrays.asList(2011, 10, 15)),
loanSchedule.get(1).get("dueDate"));
System.out.println("Repayment Date for 1st Month--" + loanSchedule.get(1).get("dueDate"));
assertEquals("Checking for Repayment Date for 2nd Month", new ArrayList<>(Arrays.asList(2011, 11, 15)),
loanSchedule.get(2).get("dueDate"));
System.out.println("Repayment Date for 2nd Month--" + loanSchedule.get(2).get("dueDate"));
assertEquals("Checking for Repayment Date for 3rd Month", new ArrayList<>(Arrays.asList(2011, 12, 15)),
loanSchedule.get(3).get("dueDate"));
System.out.println("Repayment Date for 3rd Month--" + loanSchedule.get(3).get("dueDate"));
assertEquals("Checking for Repayment Date for 4th Month", new ArrayList<>(Arrays.asList(2012, 1, 15)),
loanSchedule.get(4).get("dueDate"));
System.out.println("Repayment Date for 4th Month--" + loanSchedule.get(4).get("dueDate"));
}
}

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