Compare commits
516
Commits
7bd6ef0b03
...
aa9643429b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa9643429b | ||
|
|
21de2bd5ab | ||
|
|
1f86299cf1 | ||
|
|
38c6702cae | ||
|
|
123a59f2e7 | ||
|
|
84f0aaf32a | ||
|
|
6df2f48bc9 | ||
|
|
d743c3e5f9 | ||
|
|
45e12ac91e | ||
|
|
77e23c8e9d | ||
|
|
8bd0e29ba5 | ||
|
|
59c8671522 | ||
|
|
2d7c828eee | ||
|
|
f9397725cd | ||
|
|
6c52c91dbe | ||
|
|
325c87b121 | ||
|
|
8e61abe4ed | ||
|
|
b63364962d | ||
|
|
10fd3be477 | ||
|
|
941d732cfb | ||
|
|
4e53e3b94d | ||
|
|
d41cea8d46 | ||
|
|
43225c38f6 | ||
|
|
7dcb9913a4 | ||
|
|
03028fc4ee | ||
|
|
19833af1a9 | ||
|
|
4c9ccd2d53 | ||
|
|
75ac5c2d68 | ||
|
|
adc42ddaf1 | ||
|
|
528423ddc2 | ||
|
|
d80e574b3b | ||
|
|
a3a414ff0a | ||
|
|
95e78699d6 | ||
|
|
761c3b1e8d | ||
|
|
d59683c9f8 | ||
|
|
c7e7a00071 | ||
|
|
6fc0c1b4a5 | ||
|
|
00a10a31ac | ||
|
|
45d4eb43d5 | ||
|
|
2f8278331e | ||
|
|
bd8aa4e7ca | ||
|
|
a88bad2a7f | ||
|
|
b2131b52a7 | ||
|
|
1dddcae84a | ||
|
|
1ca510b0ca | ||
|
|
f67b82d0b9 | ||
|
|
de7c25635c | ||
|
|
64c8121362 | ||
|
|
9c9c24060f | ||
|
|
c3cd9aacbf | ||
|
|
a86ef1da2d | ||
|
|
99822a32e2 | ||
|
|
712b5e000c | ||
|
|
0a3e039122 | ||
|
|
b2771704f6 | ||
|
|
ae035ff2c9 | ||
|
|
99025b4eb3 | ||
|
|
38b5047bfe | ||
|
|
ab23a26ab2 | ||
|
|
363ca7dc0e | ||
|
|
b0132db815 | ||
|
|
9e8ead2045 | ||
|
|
0a9de45ced | ||
|
|
7ff989dbe0 | ||
|
|
490512eb35 | ||
|
|
7f25cc3a91 | ||
|
|
a37edf45d8 | ||
|
|
4d2913be8f | ||
|
|
c0a6ed8081 | ||
|
|
c7e21fc39d | ||
|
|
e2a9d8afbc | ||
|
|
7dd49de5af | ||
|
|
00f91c8c6e | ||
|
|
9472ec236c | ||
|
|
cf4bf988a4 | ||
|
|
67ec9163bd | ||
|
|
466f3f8b95 | ||
|
|
37e84789c2 | ||
|
|
6ddacc7cdb | ||
|
|
6b33966b54 | ||
|
|
285cce1bf8 | ||
|
|
a0c26c65d9 | ||
|
|
62e4b6f6e3 | ||
|
|
9c7c81d93b | ||
|
|
9327f1eef0 | ||
|
|
0e93b4a4df | ||
|
|
52d140bb17 | ||
|
|
5343b3c676 | ||
|
|
d57d1c7d88 | ||
|
|
68216e5652 | ||
|
|
29478ca023 | ||
|
|
3677d4eb53 | ||
|
|
78c0761ae5 | ||
|
|
742c357dfb | ||
|
|
31a6e07e87 | ||
|
|
a109a1cee9 | ||
|
|
697a322210 | ||
|
|
1986047ae1 | ||
|
|
1b4e03aa6e | ||
|
|
b69b071ffe | ||
|
|
508fe4b60d | ||
|
|
656fc88aae | ||
|
|
e49f44b811 | ||
|
|
4f3b7f91a1 | ||
|
|
8191ef0211 | ||
|
|
d033ea22ca | ||
|
|
166a381556 | ||
|
|
5cf6b9a34e | ||
|
|
f5e9342446 | ||
|
|
1af5b5043d | ||
|
|
bec0a36644 | ||
|
|
d34dcb1037 | ||
|
|
f0bfec3459 | ||
|
|
dcee94e732 | ||
|
|
e9b8294f80 | ||
|
|
3cc95e3cf1 | ||
|
|
f8416fe714 | ||
|
|
dca28356ba | ||
|
|
b81a3ed502 | ||
|
|
c452340e2e | ||
|
|
a7cee7ee8e | ||
|
|
6069379af9 | ||
|
|
a032ad2133 | ||
|
|
ece7c9a600 | ||
|
|
40c6223d8c | ||
|
|
bf6ffb27eb | ||
|
|
9399314ed4 | ||
|
|
3bca8e3215 | ||
|
|
09cbbcd70d | ||
|
|
d4c897af8b | ||
|
|
84f2ccfb85 | ||
|
|
fdf04dfe0a | ||
|
|
9279446833 | ||
|
|
23751e7017 | ||
|
|
70693283d5 | ||
|
|
a0749d26d1 | ||
|
|
7c399ce653 | ||
|
|
4e3289621c | ||
|
|
e60c4ec40d | ||
|
|
75635b3b6f | ||
|
|
d1e74d72d6 | ||
|
|
131c87c163 | ||
|
|
d10c27bd16 | ||
|
|
9a26ba50ff | ||
|
|
025e727757 | ||
|
|
b85c47ad75 | ||
|
|
e82bffa944 | ||
|
|
b30aa2839e | ||
|
|
739ca7897a | ||
|
|
33ae3b6365 | ||
|
|
ea6842eced | ||
|
|
bf04f97333 | ||
|
|
4a0eae6fa1 | ||
|
|
304fde46bd | ||
|
|
fbc55d5dd1 | ||
|
|
9ddec84740 | ||
|
|
64d27951a3 | ||
|
|
ccde8666e0 | ||
|
|
098060a44b | ||
|
|
506721a5d8 | ||
|
|
a9eb4e4f4d | ||
|
|
f8f3ddc069 | ||
|
|
20b0251a9e | ||
|
|
8dd9bfc087 | ||
|
|
c1acf1baae | ||
|
|
a4ec520853 | ||
|
|
145318c260 | ||
|
|
179e1e087f | ||
|
|
2489997e8b | ||
|
|
594d54f099 | ||
|
|
6638bf87e4 | ||
|
|
209dd48031 | ||
|
|
b59bcbff09 | ||
|
|
b9bfced9c5 | ||
|
|
e385185892 | ||
|
|
d842dee5dd | ||
|
|
23759af6e0 | ||
|
|
bf67700e67 | ||
|
|
1d0b202806 | ||
|
|
1fdbc59e86 | ||
|
|
40efe1c100 | ||
|
|
1bd685e980 | ||
|
|
9c4ef176ec | ||
|
|
c6f4a085db | ||
|
|
25c35b60d5 | ||
|
|
b8668af49c | ||
|
|
0426325e03 | ||
|
|
872074fe8e | ||
|
|
e5316d3559 | ||
|
|
235d4f010c | ||
|
|
155cfce9b2 | ||
|
|
693d75a67c | ||
|
|
a64c31fd76 | ||
|
|
77082ab6a0 | ||
|
|
1c49268e77 | ||
|
|
1091eff2bf | ||
|
|
591080b843 | ||
|
|
bf5b6f695e | ||
|
|
9cd7a9fe0d | ||
|
|
c007785fba | ||
|
|
bed30fcd47 | ||
|
|
2de2bb95c4 | ||
|
|
f1c2c4a519 | ||
|
|
954d65c83a | ||
|
|
b8042daa67 | ||
|
|
a997e0ac5d | ||
|
|
e323fe8fc4 | ||
|
|
7631a00398 | ||
|
|
efb83a8b82 | ||
|
|
a2bc6b61ad | ||
|
|
4ce27ba0f3 | ||
|
|
6d6c7af5fd | ||
|
|
646956ac99 | ||
|
|
dccbec3701 | ||
|
|
10b0baf349 | ||
|
|
67b4442c03 | ||
|
|
fff47689f7 | ||
|
|
d2289689c4 | ||
|
|
7c3d011db0 | ||
|
|
d926822573 | ||
|
|
c9be118c32 | ||
|
|
59b7acee94 | ||
|
|
66178b27a4 | ||
|
|
d8528aa96c | ||
|
|
7319c21890 | ||
|
|
1fdee8aa70 | ||
|
|
25881904f1 | ||
|
|
4f231f2888 | ||
|
|
59429326d1 | ||
|
|
c870e0d26f | ||
|
|
d940c72d61 | ||
|
|
e3637bb2af | ||
|
|
e1917f99a2 | ||
|
|
d3ebc2b4dd | ||
|
|
da2365caa0 | ||
|
|
f28e26c1e4 | ||
|
|
8b86bde18b | ||
|
|
09f26f1213 | ||
|
|
025a18b54a | ||
|
|
598091b1b2 | ||
|
|
33aff878f5 | ||
|
|
d3cc54b738 | ||
|
|
a9cff14e91 | ||
|
|
d8156dc8a0 | ||
|
|
dc377c1d5c | ||
|
|
3681e3af33 | ||
|
|
0ca68e98d5 | ||
|
|
d26b14b85a | ||
|
|
f89a5737a7 | ||
|
|
06785331e1 | ||
|
|
f58dc4b737 | ||
|
|
b25e121f57 | ||
|
|
71a6399d3d | ||
|
|
b7e30f1aa4 | ||
|
|
e2ee6d1f5e | ||
|
|
d079442e0e | ||
|
|
e496ccf02a | ||
|
|
1c0bf0ef3c | ||
|
|
5e9e43e1f4 | ||
|
|
074c0a9fb5 | ||
|
|
b9b5dd1da5 | ||
|
|
412ab773f8 | ||
|
|
783bacbcb5 | ||
|
|
6c1db9f4fb | ||
|
|
71508780a0 | ||
|
|
d05dd0e9b6 | ||
|
|
aede1995c6 | ||
|
|
ac33892bb6 | ||
|
|
e12bd4de32 | ||
|
|
f2766a7e66 | ||
|
|
45fbdadff2 | ||
|
|
85aa76eaa1 | ||
|
|
76c1f83502 | ||
|
|
6b057e5492 | ||
|
|
d92d2f7d8c | ||
|
|
0862c4b7c6 | ||
|
|
41e6154622 | ||
|
|
9746555ceb | ||
|
|
0e9c0f7c8f | ||
|
|
a76e7107b3 | ||
|
|
2dd6dea1a2 | ||
|
|
e81e8edafa | ||
|
|
f7ab111190 | ||
|
|
c67921a014 | ||
|
|
6d11356204 | ||
|
|
e73b5cf365 | ||
|
|
286aaf9ea9 | ||
|
|
3531601ed6 | ||
|
|
34d0d83c7b | ||
|
|
363e448521 | ||
|
|
119a49602c | ||
|
|
52a564c74a | ||
|
|
123ec128c6 | ||
|
|
1d187f7ddf | ||
|
|
cbd09dffcc | ||
|
|
e72734bfd6 | ||
|
|
75dc87cccf | ||
|
|
df88e7d17a | ||
|
|
fb1c158e95 | ||
|
|
cf9a90042a | ||
|
|
1e63957dc9 | ||
|
|
ea232576ba | ||
|
|
b02a357581 | ||
|
|
1c1e83eb5e | ||
|
|
c404dfdeb1 | ||
|
|
975ae07cf7 | ||
|
|
fb6c5440dc | ||
|
|
4fef1d0b48 | ||
|
|
4ae3e99c18 | ||
|
|
85193881b5 | ||
|
|
9a668e6cac | ||
|
|
b9fa92f4e6 | ||
|
|
59b7bcc499 | ||
|
|
e6b2a35f41 | ||
|
|
ca24c402f9 | ||
|
|
85297aaa65 | ||
|
|
fd32d997e7 | ||
|
|
69861ba624 | ||
|
|
7ad240b1af | ||
|
|
cf51a85cdc | ||
|
|
6653dae41b | ||
|
|
219bd33adf | ||
|
|
61236ae249 | ||
|
|
6ef342a486 | ||
|
|
b1201087c2 | ||
|
|
a3a643258a | ||
|
|
bd816e27bd | ||
|
|
4865e2a156 | ||
|
|
3277f84811 | ||
|
|
89e3016fc9 | ||
|
|
63615022df | ||
|
|
2a21eda984 | ||
|
|
5e82d5c320 | ||
|
|
05fa39ac1e | ||
|
|
65eab01daa | ||
|
|
2d44a28607 | ||
|
|
ade1bd38cf | ||
|
|
c548f501de | ||
|
|
0bb6e0d9f4 | ||
|
|
34600936aa | ||
|
|
fd6551bcba | ||
|
|
07b026aee0 | ||
|
|
908de1c849 | ||
|
|
0651468beb | ||
|
|
25a32ea925 | ||
|
|
13f8c6cac8 | ||
|
|
a7b4f77498 | ||
|
|
a889dbdd2f | ||
|
|
4a2ffe5e48 | ||
|
|
289e5309fc | ||
|
|
d23335603f | ||
|
|
57078ecdc4 | ||
|
|
cd42134257 | ||
|
|
ac932974f3 | ||
|
|
fe510e8e1a | ||
|
|
36fcb9c069 | ||
|
|
f0eea29fb2 | ||
|
|
9edb9ae219 | ||
|
|
5004c14752 | ||
|
|
02191d6280 | ||
|
|
103beaf56c | ||
|
|
dc3ec32a43 | ||
|
|
6fed3899c5 | ||
|
|
84c967b674 | ||
|
|
84087a71b8 | ||
|
|
6fccaa82da | ||
|
|
062ae8905e | ||
|
|
133e4e4d90 | ||
|
|
29de32a725 | ||
|
|
064ac6dd39 | ||
|
|
f09cf9a433 | ||
|
|
b78dd9e127 | ||
|
|
d58d2482ce | ||
|
|
d46663c630 | ||
|
|
2b27f5b574 | ||
|
|
2e5c9b6eae | ||
|
|
cb42ff118b | ||
|
|
9f08539e59 | ||
|
|
f523339ca0 | ||
|
|
dfab937527 | ||
|
|
097189621f | ||
|
|
d365545ec1 | ||
|
|
645f2c24aa | ||
|
|
9f9746d404 | ||
|
|
5ae9e5287f | ||
|
|
a32739c1a6 | ||
|
|
b8b488c1be | ||
|
|
bdbe2d2c51 | ||
|
|
74a058a6b1 | ||
|
|
5441f29b84 | ||
|
|
5757cba348 | ||
|
|
8b5eab1d87 | ||
|
|
45785dff42 | ||
|
|
4b36019b98 | ||
|
|
31a8a33ce6 | ||
|
|
99c775790a | ||
|
|
a08f0db277 | ||
|
|
227685402a | ||
|
|
0da887d11b | ||
|
|
c8e007478d | ||
|
|
5e7a259052 | ||
|
|
a86bbc5ebe | ||
|
|
341aefa080 | ||
|
|
a5e9a32c26 | ||
|
|
f32ca69a37 | ||
|
|
d0e5677b4d | ||
|
|
bc55f70301 | ||
|
|
37a039454a | ||
|
|
027b818f27 | ||
|
|
f32225e275 | ||
|
|
570296d10a | ||
|
|
d885e9b28a | ||
|
|
6cb756bab1 | ||
|
|
99340eca74 | ||
|
|
fe36328184 | ||
|
|
e91ee2d1d1 | ||
|
|
14a7e6a067 | ||
|
|
9d47f49e11 | ||
|
|
a354b3e664 | ||
|
|
49a2f30e2c | ||
|
|
fb45948c0d | ||
|
|
b2d8c517e3 | ||
|
|
7e9e3f4857 | ||
|
|
fa293d19ce | ||
|
|
5373263f6c | ||
|
|
66f974720f | ||
|
|
3789ac1f07 | ||
|
|
a9f01477e0 | ||
|
|
1371a3f775 | ||
|
|
e7f0e60555 | ||
|
|
5c30edc710 | ||
|
|
35b489b793 | ||
|
|
8e6ca1f6b5 | ||
|
|
68089e0360 | ||
|
|
cebdc5cfc1 | ||
|
|
74606b424d | ||
|
|
5aa6fecd5c | ||
|
|
584f0fd99f | ||
|
|
3fa2c26897 | ||
|
|
8ffd7c831b | ||
|
|
5fa4423ba5 | ||
|
|
f991075cb7 | ||
|
|
865ce43de0 | ||
|
|
93a39abf75 | ||
|
|
046b9aaf2d | ||
|
|
fa7a917f26 | ||
|
|
2c74e0cdfe | ||
|
|
c11e8d5627 | ||
|
|
9839258135 | ||
|
|
8ffba8a732 | ||
|
|
d86dfe4e66 | ||
|
|
f854e58050 | ||
|
|
96cefdddc5 | ||
|
|
ab1254ab68 | ||
|
|
ab718150ab | ||
|
|
fb3d5c9a0c | ||
|
|
71803b20f5 | ||
|
|
eb75708b66 | ||
|
|
40ec10ef11 | ||
|
|
3b660c1979 | ||
|
|
5149668ab3 | ||
|
|
8bbd028c6a | ||
|
|
bddf120878 | ||
|
|
6df82f820a | ||
|
|
9ffbef4994 | ||
|
|
fe0a519247 | ||
|
|
7f5db0ff00 | ||
|
|
ef628d0997 | ||
|
|
797c44e48c | ||
|
|
1099e73039 | ||
|
|
c2b42df3ab | ||
|
|
f587d83722 | ||
|
|
9bcfea08d0 | ||
|
|
499124b273 | ||
|
|
bd7bdb2e57 | ||
|
|
7d4284261c | ||
|
|
100e096f64 | ||
|
|
37c04828dd | ||
|
|
baec784db4 | ||
|
|
3832c8c2c4 | ||
|
|
f8da9b4072 | ||
|
|
a7632d4fae | ||
|
|
35652b1abd | ||
|
|
e64b502b17 | ||
|
|
23b250bd40 | ||
|
|
3fe1f7f058 | ||
|
|
3b9be1fa1c | ||
|
|
e87daef59a | ||
|
|
32a7323cbb | ||
|
|
c337e34e4c | ||
|
|
f4cb8101e8 | ||
|
|
85395416b3 | ||
|
|
6dc59fac76 | ||
|
|
a8752cb70a | ||
|
|
983378ac59 | ||
|
|
b1fd110c10 | ||
|
|
ffd332e975 | ||
|
|
84674a2b26 | ||
|
|
d7bcf02b24 | ||
|
|
b885296a80 | ||
|
|
4724fa12f7 | ||
|
|
e1c198fdb9 | ||
|
|
69780c0061 | ||
|
|
99371b6314 | ||
|
|
888803baa0 | ||
|
|
98baa38995 | ||
|
|
64b11f8de3 | ||
|
|
392be623c2 | ||
|
|
5e09dce398 | ||
|
|
35fa37818f | ||
|
|
18799ed4a7 | ||
|
|
b188d46fde | ||
|
|
85cd5ff5c0 | ||
|
|
3bbf7538b2 | ||
|
|
ce8f38694a | ||
|
|
4e77b115c3 |
@@ -19,5 +19,6 @@ rebel.xml
|
||||
*.sublime-workspace
|
||||
*.DS_Store
|
||||
*.ini
|
||||
*.gradletasknamecache
|
||||
*~
|
||||
.metadata
|
||||
|
||||
+323
@@ -5,6 +5,20 @@ See VERSIONING (https://github.com/openMF/mifosx/blob/master/VERSIONING.md) for
|
||||
|
||||
Releases
|
||||
===============
|
||||
|
||||
1. 30 Apr 2014 - 1.22.0.RELEASE
|
||||
1. 30 Mar 2014 - 1.21.0.RELEASE
|
||||
1. 18 Mar 2014 - 1.20.1.RELEASE
|
||||
1. 16 Mar 2014 - 1.20.0.RELEASE
|
||||
1. 04 Mar 2014 - 1.19.0.RELEASE
|
||||
1. 23 Feb 2014 - 1.18.0.RELEASE
|
||||
1. 21 Feb 2014 - 1.17.1.RELEASE
|
||||
1. 17 Jan 2014 - 1.17.0.RELEASE
|
||||
1. 29 Dec 2013 - 1.16.1.RELEASE
|
||||
1. 15 Dec 2013 - 1.16.0.RELEASE
|
||||
1. 12 Dec 2013 - 1.15.2.RELEASE
|
||||
1. 04 Dec 2013 - 1.15.1.RELEASE
|
||||
1. 01 Dec 2013 - 1.15.0.RELEASE
|
||||
1. 21 Nov 2013 - 1.14.0.RELEASE
|
||||
1. 03 Nov 2013 - 1.13.4.RELEASE
|
||||
1. 30 Oct 2013 - 1.13.3.RELEASE
|
||||
@@ -49,6 +63,315 @@ Releases
|
||||
1. 05 April 2013 - 0.11.1.beta
|
||||
1. 05 April 2013 - 0.11.0.beta
|
||||
|
||||
|
||||
1.22.0.RELEASE
|
||||
=============
|
||||
This feature release contains work around Fixed deposits with interest slabs , recurring deposits, accrual accounting (upfront and periodic accrual) for loan products including the ability to categorize loans as Non Performing Assets, standing instructions, ability to disburse loans to linked savings accounts and upgrading the community app to Bootstrap 3.
|
||||
|
||||
Important: Table `m_savings_account_transfer` has been dropped as a part of the work around Standing instructions. The database changes may be viewed at https://github.com/openMF/mifosx/blob/master/mifosng-db/migrations/core_db/V160__standing_instruction_changes.sql.
|
||||
|
||||
Platform & API
|
||||
|
||||
New Features & Improvements
|
||||
- [MIFOSX-1111] - Add Support for Term Deposits or Fixed Deposits or Time Deposits
|
||||
- [MIFOSX-1112] - Add Support for Recurring Deposits
|
||||
- [MIFOSX-1049] - Ship sample Data with every stable release
|
||||
- [MIFOSX-1065] - In saving product, need quarterly, biannually, yearly option for interest compounding.
|
||||
- [MIFOSX-1081] - Ability to Categorize Loans as Non Performing Assets (NPA)
|
||||
- [MIFOSX-865] - Accrual Accounting support for Loan Products
|
||||
- [MIFOSX-1055] - Add Standing Instructions for account to account transfer
|
||||
- [MIFOSX-1146] - add support for disbursing loan amount to savings account
|
||||
- [MIFOSX-1094] - Passing Tenant Database host, port and credentials to Pentaho reports
|
||||
- [MIFOSX-1008] - No Interest posting on saving account when Interest is set @ 0%
|
||||
- [MIFOSX-1075] - Add overdue penalty batch job in DB and handle exceptions in batch job
|
||||
- [MIFOSX-1035] - JUnit Integration Test Cases for Charges
|
||||
- [MIFOSX-1046] - JUnit test cases for code and code values API's
|
||||
- [MIFOSX-1047] - JUnit test cases for Scheduler Jobs API's
|
||||
|
||||
|
||||
Bugs
|
||||
- [MIFOSX-886] - In Modify Loan application adding charge on specified due date/Overdue fees results in Unknown data integrity issue
|
||||
- [MIFOSX-998] - Should not be allowed to activate Group/Center and associate clients under group with out permissions.
|
||||
- [MIFOSX-1021] - Not able to view particular charge details attached for savings account
|
||||
- [MIFOSX-1027] - Potential issues with maker-Checker functionality
|
||||
- [MIFOSX-1036] - Not able to generate Pentaho report added for client's Loan and saving transactions page
|
||||
- [MIFOSX-1056] - Improper error message is displayed after clicking on "Repayment info" button while submitting the tranche loan application for a client with insufficient input
|
||||
- [MIFOSX-1076] - In Modify Loan application if the Loan amount is modified, the % Charge on disbusement is not modifying accordingly.
|
||||
- [MIFOSX-1077] - In Client loan page after submitting the Loan application if the %amount charge is edited then it is not getting calculated properly
|
||||
- [MIFOSX-1053] - Not able to pay overdue savings charges through Schedular Job.
|
||||
|
||||
|
||||
Community App
|
||||
- [MIFOSX-962] - Upgrade to Twitter Bootstrap 3
|
||||
- [MIFOSX-1048] - Gmail Like Loading Progress Bar during application load
|
||||
- [MIFOSX-965] - Community app should "respond" to fill entire screen
|
||||
- [MIFOSX-1064] - Remove Gray "frame" around page data so as to match with the background.
|
||||
- [MIFOSX-1072] - Ability to view error log details of individual run in View history page of a particular Schedular Job page
|
||||
- [MIFOSX-1057] - New Collection Sheet UI changes
|
||||
- [MIFOSX-1022] - Improvements In savings account for a client
|
||||
- [MIFOSX-1058] - Not able to create holiday because of issue with the checkbox while selecting the office
|
||||
- [MIFOSX-1073] - Issue with respect to View a particular Charge details in Loan and savings accounts
|
||||
- [MIFOSX-1042] - UI related issues with respect to Datatables
|
||||
- [MIFOSX-1041] - Issue related to Collection sheets
|
||||
- [MIFOSX-1090] - Added overdue penalties is not displaying in loan repayment schedule
|
||||
- [MIFOSX-1095] - Not able to assign Moratorium for Interest in new loan application page for a client
|
||||
- [MIFOSX-1144] - Not able make/edit/read datatable entries even though user have proper permissions
|
||||
|
||||
|
||||
|
||||
1.21.0.RELEASE
|
||||
=============
|
||||
This Feature release adds support for Automated Penalties for loans and externalizes the MySQL connection properties for a tenant along with other major fixes and improvements
|
||||
|
||||
Important: Those updating from an existing installation to 1.21.* release or higher should run the update https://github.com/openMF/mifosx/blob/develop/mifosng-db/migrations/list_db/V2__externalize-connection-properties.sql on `mifosplatform-tenants` schema
|
||||
|
||||
Platform & API
|
||||
|
||||
New Features & Improvements
|
||||
- [MIFOSX-1025] - Implement Overdue Penalties with recurrence and percentage based approach
|
||||
- [MIFOSX-949] - Externalizing the PoolConfiguration of data source per tenant
|
||||
- [MIFOSX-994] - Allow all savings account's(remove constrain for overdraft) as client default account
|
||||
- [MIFOSX-1015] - Need to Add Pentaho report which generates data for client saving transactions transaction and loan repayment schedule
|
||||
- [MIFOSX-1010] - stretchy report converted into Pentaho reports
|
||||
- [MIFOSX-986] - transferring of clients in same group but different loan officer
|
||||
- [MIFOSX-1013] - Add loanId and clientId in makercheckers api return
|
||||
- [MIFOSX-942] - Moving savings products and savings accounts api documentation out of beta
|
||||
- [MIFOSX-993] - JUnit Integration Test Cases for Group Savings
|
||||
- [MIFOSX-1003] - JUnit Integration Test Cases for Accounting with Savings
|
||||
- [MIFOSX-1012] - JUnit Test Cases for Fund Transfer in Savings
|
||||
- [MIFOSX-1026] - JUnit Integration Test Cases for Global Configurations
|
||||
- [MIFOSX-941] - Api Documentation for modify loan application is missing
|
||||
|
||||
|
||||
Bugs
|
||||
- [MIFOSX-835] - For a Client (member of 2 Groups) taken JLG loan from 1 group, repayment amount is displaying in collection sheet of other Group
|
||||
- [MIFOSX-880] - In new JLG Loan application interest on first repayment is not getting calculated as per Disbursement date
|
||||
- [MIFOSX-909] - For the Loan under pending approval stage - modifications in the charges is not getting updated in "outstanding" column
|
||||
- [MIFOSX-996] - Not able to modify Loan application through API
|
||||
- [MIFOSX-1014] - approving maker checker for repayment and adjustments for work throws a 500 error
|
||||
|
||||
Community App
|
||||
- [MIFOSX-1002] - Issues with Angular JS and Require JS load on the community app
|
||||
- [MIFOSX-957] - Dashboard reports wont work when connected to MIfos X backend other than https://demo.openmf.org
|
||||
- [MIFOSX-1018] - User with all permission not able to change password of his own
|
||||
- [MIFOSX-956] - Ability to print Repayment Schedule in active loan
|
||||
- [MIFOSX-1005] - Improvement with respect to Accounting pages
|
||||
- [MIFOSX-1016] - Cleaning XBRL reports ui(inline styles)
|
||||
- [MIFOSX-990] - Navigation page is not working as expected
|
||||
- [MIFOSX-999] - Issues with User Generated Documents
|
||||
- [MIFOSX-953] - Associating checkbox to jobs are not working as expected.
|
||||
- [MIFOSX-972] - Log in screen freezing problem
|
||||
|
||||
|
||||
1.20.1.RELEASE
|
||||
=============
|
||||
Bug Release
|
||||
|
||||
Bugs
|
||||
- [MIFOSX-995] - Grace periods not working when actualDisbursementDate != expectedDisbursementDate
|
||||
|
||||
1.20.0.RELEASE
|
||||
=============
|
||||
Feature Release
|
||||
|
||||
Platform & API
|
||||
|
||||
New Features & Improvements
|
||||
- [MIFOSX-216] - No. of days overdue before In Arrears Not in Mifos X
|
||||
- [MIFOSX-992] - Password Expiry and Idle user Logout
|
||||
- [MIFOSX-974] - Integration test cases for Savings functionality
|
||||
|
||||
Bugs
|
||||
- [MIFOSX-814] - Not able to create user with the current API parameters
|
||||
- [MIFOSX-877] - Retrieve Loan by external ID results in 500 error in API
|
||||
- [MIFOSX-879] - Sorting and Ordering not working on Loan as per API Documentation
|
||||
- [MIFOSX-930] - In modify loan application (Undo disbursal - Undo approval) not able to delete the charges added before.
|
||||
- [MIFOSX-945] - Not able to adjust the minimum opening balance amount in transactions page of savings account results in "Null point exception"
|
||||
- [MIFOSX-955] - Error in Aging Detail stretchy report
|
||||
- [MIFOSX-948] - No links to User Generated Documents in the api docs (called templates)
|
||||
|
||||
|
||||
Community App
|
||||
- [MIFOSX-979] - show hide elements on user interface based on user permissions
|
||||
- [MIFOSX-975] - Clearly represent Loans In Arrears in the Community app
|
||||
- [MIFOSX-976] - Support editing values for global configurations
|
||||
- [MIFOSX-985] - Implementing user permissions for scheduler job
|
||||
- [MIFOSX-989] - Make easy to select particular entity in a table
|
||||
- [MIFOSX-947] - Issue with checkboxes because of upgradation in Angular JS
|
||||
- [MIFOSX-973] - Templates functionality is broken after Angular upgrade
|
||||
- [MIFOSX-977] - Not able to view data in stretchy reports if duplicate values present in JSON array
|
||||
- [MIFOSX-980] - issue with first repayment on the same day of disbursement
|
||||
- [MIFOSX-981] - Not able to enter data into data tables for code values
|
||||
- [MIFOSX-983] - Stretchy reports export csv including old results
|
||||
- [MIFOSX-987] - Not able to add member under Group with the backdated.
|
||||
- [MIFOSX-991] - Submit button is not working in currency configuration page
|
||||
- [MIFOSX-907] - In Edit Datatable page "new name" is not working as expected
|
||||
- [MIFOSX-909] - For the Loan under pending approval stage - modifications in the charges is not getting updated in "outstanding" column
|
||||
- [MIFOSX-915] - Not able to submit the JLG loan application if "Interest charged from" field is attached
|
||||
- [MIFOSX-919] - Charge on specified due date, added while submitting the loan application is not reflecting in preview repayments page
|
||||
- [MIFOSX-952] - Not able to assign Moratorium for Interest in new loan application page for a client
|
||||
|
||||
1.19.0.RELEASE
|
||||
=============
|
||||
Feature Release
|
||||
|
||||
This feature release adds the ability to associate current accounts with clients along with other improvements and enhancements
|
||||
|
||||
Platform & API
|
||||
|
||||
New Features & Improvements
|
||||
- [MIFOSX-931] - Add current account support (overdrafts) for savings
|
||||
- [MIFOSX-932] - Basic Savings reports
|
||||
- [MIFOSX-939] - Order of Saving transactions
|
||||
|
||||
Bugs
|
||||
- [MIFOSX-884] - Charges removed in Modify loan application is not getting deleted after saving the application.
|
||||
- [MIFOSX-911] - Not able to edit client without passing name details
|
||||
- [MIFOSX-929] - User with no permission to activate the client is able to activate successfully while creating the client.
|
||||
|
||||
|
||||
Community App
|
||||
- [MIFOSX-933] - Update to latest version of Angular and fix all observed issues
|
||||
- [MIFOSX-946] - Loan purpose is not captured for Group and JLG loans
|
||||
- [MIFOSX-864] - Improvements with respect to Closed Loans/Closed Savings
|
||||
- [MIFOSX-935] - Improvements to view particular transaction details in transaction page (Loan/savings)
|
||||
- [MIFOSX-937] - Ability to display Loan status in Client loan page
|
||||
|
||||
1.18.0.RELEASE
|
||||
=============
|
||||
Feature Release
|
||||
|
||||
This feature release ships the first implementation of Tranche Loans functionality along with various bug fixes and minor improvements
|
||||
|
||||
Platform & API
|
||||
|
||||
New Features & Improvements
|
||||
- [MIFOSX-92] - Tranche Loans
|
||||
- [MIFOSX-869] - Correct spelling mistakes observed in MifosX schema
|
||||
- [MIFOSX-902] - Generate Productive Collection sheet based on office, meeting date, loan officera search parameter
|
||||
- [MIFOSX-872] - Capture Payment Type while creating a journal entry
|
||||
- [MIFOSX-888] - Early Payment repayment strategy
|
||||
- [MIFOSX-923] - Missing entity status in search resultset
|
||||
|
||||
Bugs
|
||||
- [MIFOSX-847] - For a Client - 2nd loan(with same product) is not getting incremented as per Borrower Cycle.
|
||||
- [MIFOSX-867] - If a loan is created with first repayment on date, upon approving if loan is disbursed on other than expected disb date, schedule is not updated
|
||||
- [MIFOSX-870] - For Disbursed Loan - charge collected on disbursement is not reflecting in Loan summary page.(After running "Update Loan Summary" in schedular job)
|
||||
- [MIFOSX-895] - Checkbox for "Terms vary based on loan cycle" only controls display and not the desired principal definition
|
||||
- [MIFOSX-896] - Missing permission for "savingsaccountcharge" endpoint
|
||||
- [MIFOSX-897] - Missing _CHECKER permission for CREATE_JOURNALENTRY
|
||||
- [MIFOSX-900] - Deactivating a charge with assigned products causing integrity issues in product mapping
|
||||
- [MIFOSX-901] - "BIT" datatype/columntype missing displaytype, throws "error.msg.invalid.lookup.type" error message
|
||||
- [MIFOSX-904] - Loan disbursement checks cause corrupted schedule
|
||||
- [MIFOSX-906] - Scheduler job exception for post interest for savings
|
||||
- [MIFOSX-914] - Global configuration page is not working as exptected
|
||||
- [MIFOSX-920] - Not able to submit the Tranche Loan application for the higher amounts (in Crores)
|
||||
- [MIFOSX-921] - While submitting the Tranche Loan for a client Improper error message is displaying rather displaying for proper inputs
|
||||
- [MIFOSX-922] - In Modify application page for Tranche Loans if the Installment amount is modified then Last repayment amount is more than defined.
|
||||
|
||||
1.17.1.RELEASE
|
||||
=============
|
||||
Bug Release
|
||||
|
||||
Bugs
|
||||
- [MIFOSX-827] - Not able to disburse loan with the percentage charges applied while submitting the loan application.
|
||||
- [MIFOSX-860] - NOt able to reject the loan application with status "Submitted and pending for approval"
|
||||
- [MIFOSX-873] - Get clients by office id API is returing HTTP Status 500
|
||||
- [MIFOSX-875] - Attach duplicate mobile number while creating Client results in Unknown Data Integrity Issue
|
||||
- [MIFOSX-876] - Retrieve Loan by Loan account number returns all loan account in API
|
||||
- [MIFOSX-878] - Not able to use created datatable for a client results in Forbidden error
|
||||
- [MIFOSX-882] - API doccument related Issues
|
||||
- [MIFOSX-883] - Additional fields added in Edit datatables (for client) page is not woking as expected
|
||||
- [MIFOSX-912] - Client Loan amount is not getting rounded off even if "Currency in Multiples Of" is set as 100 in loan product.
|
||||
|
||||
1.17.0.RELEASE
|
||||
=============
|
||||
Feature Release
|
||||
|
||||
This feature release contains some API breaking changes around charges, loans and savings products (introducing mandatory short names) along with improvements around Collection Sheet, introducing the ability to activate/inactivate Staff and other Bug fixes
|
||||
|
||||
Platform & API
|
||||
|
||||
New Features & Improvements
|
||||
- [MIFOSX-831] - Collectionsheet improvements to make data entry easy
|
||||
- [MIFOSX-832] - Options to set short name for loan, charge and saving products
|
||||
- [MIFOSX-845] - Option to activate or inactivate a staff
|
||||
- [MIFOSX-849] - Update search API to include group external Id as a search parameter
|
||||
- [MIFOSX-866] - Return Transaction Type of loan or savings transaction associated with a journal entry
|
||||
|
||||
Bugs
|
||||
- [MIFOSX-720] - In modify loan application (Undo disbursal - Undo approval) if charge to be collected from savings is deleted then not able to save the application.
|
||||
- [MIFOSX-819] - Not able to modify Loan application after undo disburse once one of the charge paid.
|
||||
|
||||
1.16.1.RELEASE
|
||||
=============
|
||||
Bug Release
|
||||
|
||||
Bugs
|
||||
- [MIFOSX-802] - Loan life cycle is not considered in validations for loan operations
|
||||
- [MIFOSX-812] - Journalentries Api is not returning currency while retrieving transactions
|
||||
- [MIFOSX-825] - Timeline is not displaying while fetching the details of created centers
|
||||
- [MIFOSX-830] - APIs are returning invalid commandId for all actions when maker-checker is enabled.
|
||||
- [MIFOSX-834] - Reports-Loan products are not listing for currency ALL(Active Loans - Summary)
|
||||
|
||||
1.16.0.RELEASE
|
||||
=============
|
||||
Feature Release
|
||||
|
||||
This feature release adds support for undoing loan write-offs along with a couple other improvements
|
||||
|
||||
Platform & API
|
||||
|
||||
New Features & Improvements
|
||||
- [MIFOSX-796] - Allow undo of write off transaction (disallow undo or change of any other transaction when loan is written off)
|
||||
- [MIFOSX-824] - Add pagination to Audits endpoints
|
||||
- [MIFOSX-826] - Add holiday status in response data
|
||||
|
||||
1.15.2.RELEASE
|
||||
=============
|
||||
Bug Release
|
||||
|
||||
Bugs
|
||||
- [MIFOSX-816] - Future loan amounts should be with respect to Loan cycle (not to be confused with borrower cycle)
|
||||
- [MIFOSX-818] - Not able to retrieve Global Configurations through API
|
||||
- [MIFOSX-820] - Fix spelling mistakes in permissions for better Display on community app
|
||||
- [MIFOSX-821] - Null pointer exception while disbursing the loan
|
||||
- [MIFOSX-822] - Backdated transaction that results in transaction reversals does not create journal entries for new transactions
|
||||
|
||||
|
||||
1.15.1.RELEASE
|
||||
=============
|
||||
Bug Release
|
||||
|
||||
Bugs
|
||||
- [MIFOSX-801] - Clean up implementation of [MIFOSX-765]
|
||||
- [MIFOSX-805] - Terms vary based on loan cycle is not getting updated in Edit Loan Product page.
|
||||
- [MIFOSX-810] - Unhandled API error while creating multiple users with same name
|
||||
- [MIFOSX-811] - Repayment schedule dates for Loan disbursement after undo disbursal is not proper
|
||||
- [MIFOSX-744] - Implementation of mifosx-735 should be optional
|
||||
|
||||
1.15.0.RELEASE
|
||||
=============
|
||||
Feature Release
|
||||
|
||||
This feature release contains some API breaking changes around loan and savings products in relation to the accounting section of their respective APIs. Some small improvements are also bundled into this release.
|
||||
|
||||
Platform & API
|
||||
|
||||
New Features & Improvements
|
||||
- [MIFOSX-569] - Calculate future loan amounts or installments based on previous loan cycle.
|
||||
- [MIFOSX-744] - Implementation of mifosx-735 should be optional
|
||||
- [MIFOSX-790] - Need ability to be able to link accounting journal entries with the additional payment details captured in m_payment_detail table
|
||||
- [MIFOSX-792] - Improve penalties introducing a redemption periods for MFIs that dont input data same day.
|
||||
- [MIFOSX-794] - Add roles list to /users endpoint
|
||||
- [MIFOSX-795] - Clean up API around Loan/ Savings product creation for consistency and better usability
|
||||
|
||||
|
||||
Bug
|
||||
- [MIFOSX-798] - Read not working for holidays and API documentation not updated
|
||||
- [MIFOSX-800] - Scheduler job is failed, if no accounting data is available.
|
||||
|
||||
|
||||
1.14.0.RELEASE
|
||||
=============
|
||||
Feature Release
|
||||
|
||||
+18
-5
@@ -10,9 +10,9 @@ The release artifact (.zip file) has the following structure:
|
||||
+ mifosplatform-X.Y.Z.RELEASE ... parent folder which will have the release number on it
|
||||
|
|
||||
+ api-docs ... folder contains html based documentation on the platform API for this release
|
||||
+ database ... folder contains database setup and upgrade scripts required for installation
|
||||
+ database ... folder contains database setup and upgrade scripts along with sample data required for installation
|
||||
+ pentahoReports ... folder contains any out-of-the-box reports provided through pentaho
|
||||
+ apps ... folder contains apps like reference app that speak to the platform
|
||||
+ apps ... folder contains apps like community app that speak to the platform
|
||||
|
|
||||
-- CHANGELOG.MD ... file documents changelog of project up to this release
|
||||
-- CONTRIBUTORS.MD ... file provides details on contributors to project
|
||||
@@ -110,9 +110,22 @@ The two ways to get up and running with mifos platform is:
|
||||
|
||||
#### 2.2.2 Upgrade existing database(s)
|
||||
|
||||
Those updating an existing MifosX installation to version 1.21.* or higher would need to upgrade the *mifosplatform-tenants* database with patch ```database/migrations/list_db/V2__externalize-connection-properties.sql```
|
||||
```
|
||||
mysql -uroot -pmysql mifosplatform-tenants < database/migrations/list_db/V2__externalize-connection-properties.sql
|
||||
```
|
||||
|
||||
Any *tenant* databases will be upgraded automatically when the application starts if the *auto_update* field of the *tenants* database table is enabled(=1). This is the default setting.
|
||||
|
||||
Upgrading your database in this way is the recomended way as it will upgrade any *tenants* setup in the *mifosplatform-tenants* database but can be disabled by setting the *auto_update* field of the tenant to zero.
|
||||
Upgrading your database in this way is the recommended way as it will upgrade any *tenants* setup in the *mifosplatform-tenants* database but can be disabled by setting the *auto_update* field of the tenant to zero.
|
||||
|
||||
#### 2.2.3 Load *mifostenant-default* schema with sample data (optional)
|
||||
Every release ships with sample data (offices, users, customers, loan products, savings products and a chart of accounts). The same can be restored by running the following command
|
||||
|
||||
```
|
||||
mysql -uroot -pmysql mifostenant-default < database/migrations/sample_data/load_sample_data.sql
|
||||
```
|
||||
|
||||
|
||||
### 2.3 Tomcat 7 Setup
|
||||
|
||||
@@ -220,11 +233,11 @@ The two ways to get up and running with mifos platform is:
|
||||
- mifosng-provider.war
|
||||
|
||||
Drop the following from the release artifact into [TOMCAT_HOME]/webapps/ROOT folder:
|
||||
- The entire ```apps/IndividualLendingGeneralJavaScript``` folder
|
||||
- The entire ```apps/community-app``` folder.
|
||||
- The entire api-docs folder
|
||||
|
||||
#### 2.3.7 Startup tomcat
|
||||
Startup tomcat:
|
||||
- Platform application should be available @ https://[server ip address]:8443/mifosng-provider/api/v1/offices?tenantIdentifier=default&pretty=true
|
||||
- Reference application should be available @ https://[server ip address]:8443/IndividualLendingGeneralJavaScript/IndivLendHome.html?baseApiUrl=https://[server ip address]:8443/mifosng-provider/api/v1/
|
||||
- Community application should be available @ https://[server ip address]:8443/community-app?baseApiUrl=https://[server ip address]:8443/mifosng-provider/api/v1/
|
||||
- API docs should be available @ https://[server ip address]:8443/api-docs/apiLive.htm
|
||||
|
||||
@@ -22,9 +22,8 @@ Status](https://openmf.ci.cloudbees.com/job/MIFOSX%20INTEGRATION%20TEST/badge/ic
|
||||
Version
|
||||
==========
|
||||
|
||||
The mifos-platform (project named 'Mifos X') has reached <b>public release version</b>.
|
||||
|
||||
That means there is a published and stable API. This API is documented in the api-docs under <b>Full API Matrix</b>.
|
||||
The API for the mifos-platform (project named 'Mifos X')is documented in the api-docs under <b>Full API Matrix</b> and can be viewed <a target="_blank" href="https://demo.openmf.org/api-docs/apiLive.htm" title="API Documentation"> here
|
||||
</a>
|
||||
|
||||
Latest stable release can always been viewed on master branch: <a target="_blank" href="https://github.com/openMF/mifosx/tree/master" title="Latest Release">Latest Release on Master</a>, <a target="_blank" href="https://github.com/openMF/mifosx/blob/master/CHANGELOG.md" title="Latest release change log">View change log</a>
|
||||
|
||||
@@ -42,7 +41,8 @@ Mifos Platform API
|
||||
Online Demos
|
||||
=============================
|
||||
|
||||
<a target="_blank" href="https://demo.openmf.org" title="Reference Client App">Reference Client App</a>
|
||||
* <a target="_blank" href="https://demo.openmf.org" title="Reference Client App">Community App</a>
|
||||
* ~~<a target="_blank" href="https://demo.openmf.org/old/" title="Community App">Reference Client App (Deprecated)</a>~~
|
||||
|
||||
Developers
|
||||
==========
|
||||
|
||||
+10646
-745
File diff suppressed because it is too large
Load Diff
+16
-7
@@ -43,16 +43,24 @@
|
||||
padding-right:5px;
|
||||
|
||||
vertical-align:text-top;
|
||||
}
|
||||
.matrixHeading tr.alt
|
||||
{
|
||||
color:#000;
|
||||
background-color: rgb(240, 240, 255);
|
||||
}
|
||||
|
||||
.matrixHeading tr:not(:first-child):nth-child(even) {
|
||||
color: #000;
|
||||
background-color: rgb(240, 240, 255);
|
||||
}
|
||||
|
||||
.matrixHeading tr:not(:first-child):nth-child(odd) {
|
||||
color: #000;
|
||||
background-color: rgba(255, 248, 218, 0.13);
|
||||
}
|
||||
|
||||
.matrixHeading tr:first-child td table tr {
|
||||
background-color: #6eb4db !important;
|
||||
}
|
||||
|
||||
.matrixHeadingBG {
|
||||
background-color: #6eb4db;
|
||||
background-color: #6eb4db;
|
||||
}
|
||||
|
||||
.matrixHeadingVerbs {
|
||||
@@ -62,7 +70,8 @@
|
||||
}
|
||||
|
||||
.matrixHeadingCommands {
|
||||
color: rgb(240, 240, 255);
|
||||
color: rgb(240, 240, 255) !important;
|
||||
background-color: #6eb4db !important;
|
||||
}
|
||||
|
||||
.mifosXHeading2 {
|
||||
|
||||
+6
-5
@@ -1,16 +1,17 @@
|
||||
Mifos Platform Apps
|
||||
======
|
||||
|
||||
Some community created apps built on top of mifosplatform are stored in source control repository @ https://github.com/openMF/mifosx-community-apps
|
||||
Community created apps built on top of mifosplatform are stored in source control repository @ https://github.com/openMF/
|
||||
|
||||
The new Community App (AngularJS-based)
|
||||
The Community App (AngularJS-based)
|
||||
===============
|
||||
|
||||
https://github.com/openMF/community-app
|
||||
|
||||
The original Reference App
|
||||
The Default app shipped which is a core part of every community release.
|
||||
|
||||
The original Reference App (Now Deprecated)
|
||||
===============
|
||||
|
||||
https://github.com/openMF/mifosx-community-apps/tree/master/IndividualLendingGeneralJavaScript
|
||||
|
||||
The reference app is a core part of community release. It is presently used to showcase platform API capabilities and is also used in production by MFIs.
|
||||
The reference app was used to showcase platform API capabilities and is also used in production by MFIs.
|
||||
|
||||
Binary file not shown.
@@ -73,6 +73,19 @@ CREATE TABLE `tenants` (
|
||||
`schema_username` varchar(100) NOT NULL DEFAULT 'root',
|
||||
`schema_password` varchar(100) NOT NULL DEFAULT 'mysql',
|
||||
`auto_update` tinyint(1) NOT NULL DEFAULT '1',
|
||||
`pool_initial_size` int(5) DEFAULT 5,
|
||||
`pool_validation_interval` int(11) DEFAULT 30000,
|
||||
`pool_remove_abandoned` tinyint(1) DEFAULT 1,
|
||||
`pool_remove_abandoned_timeout` int(5) DEFAULT 60,
|
||||
`pool_log_abandoned` tinyint(1) DEFAULT 1,
|
||||
`pool_abandon_when_percentage_full` int(5) DEFAULT 50,
|
||||
`pool_test_on_borrow` tinyint(1) DEFAULT 1,
|
||||
`pool_max_active` int(5) DEFAULT 40,
|
||||
`pool_min_idle` int(5) DEFAULT 20,
|
||||
`pool_max_idle` int(5) DEFAULT 10,
|
||||
`pool_suspect_timeout` int(5) DEFAULT 60,
|
||||
`pool_time_between_eviction_runs_millis` int(11) DEFAULT 34000,
|
||||
`pool_min_evictable_idle_time_millis` int(11) DEFAULT 60000,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
@@ -84,7 +97,7 @@ CREATE TABLE `tenants` (
|
||||
LOCK TABLES `tenants` WRITE;
|
||||
/*!40000 ALTER TABLE `tenants` DISABLE KEYS */;
|
||||
INSERT INTO `tenants` VALUES
|
||||
(1,'default','default','mifostenant-default','Asia/Kolkata',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1);
|
||||
(1,'default','default','mifostenant-default','Asia/Kolkata',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1,5,30000,1,60,1,50,1,40,20,10,60,34000,60000);
|
||||
/*!40000 ALTER TABLE `tenants` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
CREATE TABLE `m_product_loan_variations_borrower_cycle` (
|
||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
|
||||
`loan_product_id` BIGINT(20) NOT NULL DEFAULT '0',
|
||||
`borrower_cycle_number` INT(3) NOT NULL DEFAULT '0',
|
||||
`value_condition` INT(1) NOT NULL DEFAULT '0',
|
||||
`param_type` INT(1) NOT NULL DEFAULT '0',
|
||||
`default_value` DECIMAL(19,6) NOT NULL DEFAULT '0.000000',
|
||||
`max_value` DECIMAL(19,6) NULL DEFAULT NULL,
|
||||
`min_value` DECIMAL(19,6) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `borrower_cycle_loan_product_FK` (`loan_product_id`),
|
||||
CONSTRAINT `borrower_cycle_loan_product_FK` FOREIGN KEY (`loan_product_id`) REFERENCES `m_product_loan` (`id`)
|
||||
)
|
||||
COLLATE='utf8_general_ci'
|
||||
ENGINE=InnoDB;
|
||||
|
||||
|
||||
ALTER TABLE `m_product_loan`
|
||||
ADD COLUMN `use_borrower_cycle` TINYINT(1) NOT NULL DEFAULT '0' AFTER `include_in_borrower_cycle`;
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
ALTER TABLE `acc_gl_journal_entry`
|
||||
ADD COLUMN `loan_transaction_id` BIGINT(20) NULL AFTER `transaction_id`,
|
||||
ADD COLUMN `savings_transaction_id` BIGINT(20) NULL AFTER `loan_transaction_id`,
|
||||
ADD CONSTRAINT `FK_acc_gl_journal_entry_m_loan_transaction` FOREIGN KEY (`loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`),
|
||||
ADD CONSTRAINT `FK_acc_gl_journal_entry_m_savings_account_transaction` FOREIGN KEY (`savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`);
|
||||
|
||||
UPDATE acc_gl_journal_entry je SET je.savings_transaction_id=je.transaction_id,je.transaction_id=Concat('S',je.transaction_id) WHERE je.entity_type_enum=2;
|
||||
|
||||
UPDATE acc_gl_journal_entry je SET je.loan_transaction_id=je.transaction_id,je.transaction_id=Concat('L',je.transaction_id) WHERE je.entity_type_enum=1;
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
UPDATE m_client mc SET mc.submittedon_date=mc.activation_date where mc.submittedon_date is NULL;
|
||||
UPDATE m_client mc SET mc.submittedon_date=now() where mc.submittedon_date is NULL;
|
||||
|
||||
UPDATE m_group mg SET mg.submittedon_date=mg.activation_date where mg.submittedon_date is NULL;
|
||||
UPDATE m_group mg SET mg.submittedon_date=now() where mg.submittedon_date is NULL;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
update m_permission set grouping="organisation" where grouping = "organistion";
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
ALTER TABLE `c_configuration`
|
||||
ADD COLUMN `value` INT NULL AFTER `name`;
|
||||
|
||||
INSERT INTO `c_configuration` (
|
||||
`id` ,
|
||||
`name` ,
|
||||
`value` ,
|
||||
`enabled`
|
||||
)
|
||||
VALUES (
|
||||
NULL , 'penalty-wait-period', '2', '1'
|
||||
);
|
||||
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_loan', 'UNDOWRITEOFF_LOAN', 'LOAN', 'UNDOWRITEOFF', 0);
|
||||
@@ -0,0 +1 @@
|
||||
UPDATE stretchy_parameter SET `parameter_sql`='select p.id, p.`name`\r\nfrom m_product_loan p\r\nwhere (p.currency_code = \'${currencyId}\' or \'-1\'= \'${currencyId}\')\r\norder by 2' WHERE parameter_name='loanProductIdSelectAll';
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TABLE `m_staff` ADD COLUMN `is_active` TINYINT(1) DEFAULT '0' AFTER `organisational_role_parent_staff_id`;
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
ALTER TABLE `m_product_loan`
|
||||
ADD COLUMN `short_name` VARCHAR(4) NULL DEFAULT NULL AFTER `id`;
|
||||
update m_product_loan set short_name=concat(LEFT(name,2), RIGHT(id,2)) where short_name is null;
|
||||
ALTER TABLE `m_product_loan`
|
||||
ALTER `short_name` DROP DEFAULT;
|
||||
ALTER TABLE `m_product_loan`
|
||||
CHANGE COLUMN `short_name` `short_name` VARCHAR(4) NOT NULL AFTER `id`;
|
||||
ALTER TABLE `m_product_loan`
|
||||
ADD UNIQUE INDEX `unq_short_name` (`short_name`);
|
||||
|
||||
ALTER TABLE `m_savings_product`
|
||||
ADD COLUMN `short_name` VARCHAR(4) NULL DEFAULT NULL AFTER `name`;
|
||||
update m_savings_product set short_name=concat(LEFT(name,2), RIGHT(id,2)) where short_name is null;
|
||||
ALTER TABLE `m_savings_product`
|
||||
ALTER `short_name` DROP DEFAULT;
|
||||
ALTER TABLE `m_savings_product`
|
||||
CHANGE COLUMN `short_name` `short_name` VARCHAR(4) NOT NULL AFTER `name`,
|
||||
ADD UNIQUE INDEX `sp_unq_short_name` (`short_name`);
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
ALTER TABLE `m_staff`
|
||||
CHANGE COLUMN `is_active` `is_active` TINYINT(1) NOT NULL DEFAULT '1' AFTER `organisational_role_parent_staff_id`;
|
||||
UPDATE `m_staff` SET `is_active`=1;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
ALTER TABLE `acc_gl_journal_entry`
|
||||
ADD COLUMN `payment_details_id` BIGINT(20) NULL AFTER `organization_running_balance`,
|
||||
ADD CONSTRAINT `FK_acc_gl_journal_entry_m_payment_detail` FOREIGN KEY (`payment_details_id`) REFERENCES `m_payment_detail` (`id`);
|
||||
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE `m_loan_charge`
|
||||
ADD COLUMN `is_active` TINYINT(1) NOT NULL DEFAULT '1' AFTER `max_cap`;
|
||||
@@ -0,0 +1,3 @@
|
||||
INSERT INTO `ref_loan_transaction_processing_strategy` ( `code`, `name`)
|
||||
VALUES
|
||||
( 'early-repayment-strategy', 'Early Repayment Strategy');
|
||||
@@ -0,0 +1 @@
|
||||
insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'READ_SAVINGSACCOUNTCHARGE', 'SAVINGSACCOUNTCHARGE', 'READ', 0);
|
||||
@@ -0,0 +1 @@
|
||||
insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'CREATE_JOURNALENTRY_CHECKER', 'JOURNALENTRY', 'CREATE', 0);
|
||||
@@ -0,0 +1,4 @@
|
||||
RENAME TABLE `x_table_cloumn_code_mappings` TO `x_table_column_code_mappings`;
|
||||
|
||||
ALTER TABLE `acc_gl_journal_entry`
|
||||
CHANGE COLUMN `is_running_balance_caculated` `is_running_balance_calculated` TINYINT(4) NOT NULL DEFAULT '0' AFTER `lastmodified_date`;
|
||||
@@ -0,0 +1,17 @@
|
||||
INSERT INTO `c_configuration` (`id`, `name`, `value`, `enabled`) VALUES (NULL, 'force-password-reset-days', '0', '0');
|
||||
|
||||
ALTER TABLE `m_appuser` ADD `last_time_password_updated` DATE NOT NULL ,
|
||||
ADD INDEX ( `last_time_password_updated` ) ;
|
||||
|
||||
UPDATE `m_appuser` SET `last_time_password_updated` = NOW() WHERE `m_appuser`.`last_time_password_updated` ='0000-00-00';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `m_appuser_previous_password` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`user_id` bigint(20) NOT NULL,
|
||||
`password` varchar(255) NOT NULL,
|
||||
`removal_date` date NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
|
||||
|
||||
ALTER TABLE m_appuser_previous_password
|
||||
ADD FOREIGN KEY (user_id) REFERENCES m_appuser(id);
|
||||
@@ -0,0 +1,38 @@
|
||||
ALTER TABLE `m_product_loan`
|
||||
ADD COLUMN `multi_disburse_loan` TINYINT(1) NOT NULL DEFAULT '0' AFTER `close_date`,
|
||||
ADD COLUMN `max_tranche_count` INT(2) NULL DEFAULT NULL AFTER `multi_disburse_loan`,
|
||||
ADD COLUMN `outstanding_loan_balance` DECIMAL(19,6) NULL DEFAULT NULL AFTER `max_tranche_count`;
|
||||
|
||||
CREATE TABLE `m_loan_disbursement_detail` (
|
||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
|
||||
`loan_id` BIGINT(20) NOT NULL,
|
||||
`expected_disburse_date` DATETIME NOT NULL,
|
||||
`disbursedon_date` DATETIME NULL,
|
||||
`principal` DECIMAL(19,6) NOT NULL,
|
||||
`approved_principal` DECIMAL(19,6) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `FK_loan_disbursement_detail_loan_id` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
|
||||
)
|
||||
COLLATE='utf8_general_ci'
|
||||
ENGINE=InnoDB;
|
||||
|
||||
ALTER TABLE `m_loan`
|
||||
ADD COLUMN `fixed_emi_amount` DECIMAL(19,6) NULL AFTER `loan_product_counter`,
|
||||
ADD COLUMN `approved_principal` DECIMAL(19,6) NOT NULL AFTER `principal_amount`,
|
||||
ADD COLUMN `max_outstanding_loan_balance` DECIMAL(19,6) NULL DEFAULT NULL AFTER `fixed_emi_amount`;
|
||||
|
||||
UPDATE m_loan ml SET ml.approved_principal = ml.principal_amount;
|
||||
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_DISBURSEMENTDETAIL', 'DISBURSEMENTDETAIL', 'UPDATE', 0);
|
||||
|
||||
CREATE TABLE `m_loan_term_variations` (
|
||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
|
||||
`loan_id` BIGINT(20) NOT NULL,
|
||||
`term_type` SMALLINT(2) NOT NULL,
|
||||
`applicable_from` DATE NOT NULL,
|
||||
`term_value` DECIMAL(19,6) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `FK_loan_id_m_loan_id` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
|
||||
)
|
||||
COLLATE='utf8_general_ci'
|
||||
ENGINE=InnoDB;
|
||||
@@ -0,0 +1,4 @@
|
||||
ALTER TABLE `m_product_loan`
|
||||
CHANGE COLUMN `multi_disburse_loan` `allow_multiple_disbursals` TINYINT(1) NOT NULL DEFAULT '0' AFTER `close_date`,
|
||||
CHANGE COLUMN `max_tranche_count` `max_disbursals` INT(2) NULL DEFAULT NULL AFTER `allow_multiple_disbursals`,
|
||||
CHANGE COLUMN `outstanding_loan_balance` `max_outstanding_loan_balance` DECIMAL(19,6) NULL DEFAULT NULL AFTER `max_disbursals`;
|
||||
@@ -0,0 +1,14 @@
|
||||
ALTER TABLE `m_savings_product`
|
||||
ADD COLUMN `allow_overdraft` TINYINT(1) NOT NULL DEFAULT '0' AFTER `withdrawal_fee_for_transfer`,
|
||||
ADD COLUMN `overdraft_limit` DECIMAL(19,6) NULL DEFAULT NULL AFTER `allow_overdraft`;
|
||||
|
||||
ALTER TABLE `m_savings_account`
|
||||
ADD COLUMN `allow_overdraft` TINYINT(1) NOT NULL DEFAULT '0' AFTER `withdrawal_fee_for_transfer`,
|
||||
ADD COLUMN `overdraft_limit` DECIMAL(19,6) NULL DEFAULT NULL AFTER `allow_overdraft`;
|
||||
|
||||
ALTER TABLE `m_savings_account_transaction`
|
||||
ADD COLUMN `overdraft_amount_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `amount`;
|
||||
|
||||
ALTER TABLE `m_client`
|
||||
ADD COLUMN `default_savings_product` BIGINT(20) NULL DEFAULT NULL AFTER `closedon_userid`,
|
||||
ADD CONSTRAINT `FK_m_client_m_savings_product` FOREIGN KEY (`default_savings_product`) REFERENCES `m_savings_product` (`id`);
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
ALTER TABLE `m_savings_account_transaction`
|
||||
ADD COLUMN `created_date` DATETIME NOT NULL AFTER `cumulative_balance_derived`;
|
||||
|
||||
update m_savings_account_transaction sat set sat.created_date=sat.transaction_date;
|
||||
@@ -0,0 +1,32 @@
|
||||
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Savings Transactions', 'Pentaho', NULL, 'Savings', NULL, NULL, 0, 1);
|
||||
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Client Savings Summary', 'Pentaho', NULL, 'Savings', NULL, NULL, 0, 1);
|
||||
|
||||
INSERT INTO `stretchy_parameter` (`parameter_name`, `parameter_variable`, `parameter_label`, `parameter_displayType`, `parameter_FormatType`, `parameter_default`, `special`, `selectOne`, `selectAll`, `parameter_sql`, `parent_id`) VALUES ( 'selectAccount', 'accountNo', 'Enter Account No', 'text', 'string', 'n/a', NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `stretchy_parameter` (`parameter_name`, `parameter_variable`, `parameter_label`, `parameter_displayType`, `parameter_FormatType`, `parameter_default`, `special`, `selectOne`, `selectAll`, `parameter_sql`, `parent_id`) VALUES ('savingsProductIdSelectAll', 'savingsProductId', 'Product', 'select', 'number', '0', NULL, NULL, 'Y', 'select p.id, p.`name`\r\nfrom m_savings_product p\r\norder by 2', NULL);
|
||||
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Savings Transactions'), (select id from stretchy_parameter where parameter_name='startDateSelect'), 'fromDate');
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Savings Transactions'), (select id from stretchy_parameter where parameter_name='endDateSelect'), 'toDate');
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Savings Transactions'), (select id from stretchy_parameter where parameter_name='selectAccount'), 'accountNo');
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Savings Summary'), (select id from stretchy_parameter where parameter_name='startDateSelect'), 'fromDate');
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Savings Summary'), (select id from stretchy_parameter where parameter_name='endDateSelect'), 'toDate');
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Savings Summary'), (select id from stretchy_parameter where parameter_name='OfficeIdSelectOne'), 'selectOffice');
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Savings Summary'), (select id from stretchy_parameter where parameter_name='savingsProductIdSelectAll'), 'selectProduct');
|
||||
|
||||
ALTER TABLE `r_enum_value`
|
||||
ADD COLUMN `enum_type` TINYINT(1) NOT NULL AFTER `enum_value`;
|
||||
|
||||
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 1, 'deposit', 'deposit', 0);
|
||||
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 2, 'withdrawal', 'withdrawal', 1);
|
||||
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 3, 'Interest Posting', 'Interest Posting', 0);
|
||||
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 4, 'Withdrawal Fee', 'Withdrawal Fee', 1);
|
||||
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 5, 'Annual Fee', 'Annual Fee', 1);
|
||||
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 6, 'Waive Charge', 'Waive Charge', 0);
|
||||
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 7, 'Pay Charge', 'Pay Charge', 1);
|
||||
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 12, 'Initiate Transfer', 'Initiate Transfer', 0);
|
||||
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 13, 'Approve Transfer', 'Approve Transfer', 0);
|
||||
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 14, 'Withdraw Transfer', 'Withdraw Transfer', 0);
|
||||
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 15, 'Reject Transfer', 'Reject Transfer', 0);
|
||||
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 16, 'Written-Off', 'Written-Off', 0);
|
||||
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 17, 'Overdraft Interest', 'Overdraft Interest', 0);
|
||||
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE `m_client`
|
||||
ADD COLUMN `default_savings_account` BIGINT(20) NULL DEFAULT NULL AFTER `default_savings_product`,
|
||||
ADD CONSTRAINT `FK_m_client_m_savings_account` FOREIGN KEY (`default_savings_account`) REFERENCES `m_savings_account` (`id`);
|
||||
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATESAVINGSACCOUNT_CLIENT', 'CLIENT', 'UPDATESAVINGSACCOUNT', 0);
|
||||
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE `m_product_loan`
|
||||
ADD COLUMN `grace_on_arrears_ageing` SMALLINT(5) NULL DEFAULT NULL AFTER `max_outstanding_loan_balance`;
|
||||
|
||||
ALTER TABLE `m_loan`
|
||||
ADD COLUMN `grace_on_arrears_ageing` SMALLINT(5) NULL DEFAULT NULL AFTER `max_outstanding_loan_balance`;
|
||||
@@ -0,0 +1,9 @@
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'READ_ACCOUNTINGRULE', 'ACCOUNTINGRULE', 'READ', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'READ_JOURNALENTRY', 'JOURNALENTRY', 'READ', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'READ_GLACCOUNT', 'GLACCOUNT', 'READ', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'READ_GLCLOSURE', 'GLCLOSURE', 'READ', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'READ_HOLIDAY', 'HOLIDAY', 'READ', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('jobs', 'READ_SCHEDULER', 'SCHEDULER', 'READ', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'READ_PRODUCTMIX', 'PRODUCTMIX', 'READ', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'READ_MEETING', 'MEETING', 'READ', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('jobs', 'EXECUTEJOB_SCHEDULER', 'SCHEDULER', 'EXECUTEJOB', 0);
|
||||
@@ -0,0 +1 @@
|
||||
UPDATE `stretchy_report` SET `report_sql`='\r\nSELECT \r\nconcat(repeat("..", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as "Office/Branch",\r\nifnull(cur.display_symbol, ml.currency_code) as Currency, \r\nmc.account_no as "Client Account No.",\r\n mc.display_name AS "Client Name",\r\n ml.account_no AS "Account Number",\r\n ml.principal_amount AS "Loan Amount",\r\n ml.principal_disbursed_derived AS "Original Principal",\r\n ml.interest_charged_derived AS "Original Interest",\r\n ml.principal_repaid_derived AS "Principal Paid",\r\n ml.interest_repaid_derived AS "Interest Paid",\r\n laa.principal_overdue_derived AS "Principal Overdue",\r\n laa.interest_overdue_derived AS "Interest Overdue",\r\nDATEDIFF(CURDATE(), laa.overdue_since_date_derived) as "Days in Arrears",\r\n\r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<7, \'<1\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<8, \' 1\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<15, \'2\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<22, \' 3\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<29, \' 4\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<36, \' 5\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<43, \' 6\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<50, \' 7\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<57, \' 8\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<64, \' 9\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<71, \'10\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<78, \'11\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<85, \'12\', \'12+\')))))))))))) )AS "Weeks In Arrears Band",\r\n\r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<31, \'0 - 30\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<61, \'30 - 60\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<91, \'60 - 90\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<181, \'90 - 180\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<361, \'180 - 360\', \r\n \'> 360\'))))) AS "Days in Arrears Band"\r\n\r\n FROM m_office mo \r\n JOIN m_office ounder ON ounder.hierarchy like concat(mo.hierarchy, \'%\')\r\n AND ounder.hierarchy like CONCAT(\'${currentUserHierarchy}\', \'%\')\r\n INNER JOIN m_client mc ON mc.office_id=ounder.id\r\n INNER JOIN m_loan ml ON ml.client_id = mc.id\r\n INNER JOIN r_enum_value rev ON rev.enum_id=ml.loan_status_id AND rev.enum_name = \'loan_status_id\'\r\n INNER JOIN m_loan_arrears_aging laa ON laa.loan_id=ml.id\r\n left join m_currency cur on cur.code = ml.currency_code\r\n WHERE ml.loan_status_id=300\r\n AND mo.id=${officeId}\r\nORDER BY ounder.hierarchy, ifnull(cur.display_symbol, ml.currency_code), ml.account_no\r\n' WHERE `report_name`='Aging Detail';
|
||||
@@ -0,0 +1,719 @@
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report)VALUES ("Active Loans - Details(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Active Loans - Summary(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Active Loans by Disbursal Period(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Active Loans in last installment Summary(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report)VALUES ("Active Loans in last installment(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Active Loans Passed Final Maturity Summary(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Active Loans Passed Final Maturity(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Aging Detail(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Aging Summary (Arrears in Months)(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Aging Summary (Arrears in Weeks)(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Client Listing(Pentaho)", 'Pentaho', 'Client', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Client Loans Listing(Pentaho)", 'Pentaho', 'Client', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Expected Payments By Date - Basic(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Funds Disbursed Between Dates Summary by Office(Pentaho)", 'Pentaho', 'Fund', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Funds Disbursed Between Dates Summary(Pentaho)", 'Pentaho', 'Fund', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Loans Awaiting Disbursal Summary by Month(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Loans Awaiting Disbursal Summary(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Loans Awaiting Disbursal(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Loans Pending Approval(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Obligation Met Loans Details(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Obligation Met Loans Summary(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Portfolio at Risk by Branch(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Portfolio at Risk(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Rescheduled Loans(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("TxnRunningBalances(Pentaho)", 'Pentaho', 'Transaction', '(NULL)', '(NULL)', 1, 1);
|
||||
INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Written-Off Loans(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1);
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),'branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'loanOfficer');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'currencyId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),'fundId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),'loanPurposeId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'loanOfficer');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
|
||||
'fundId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
|
||||
'loanPurposeId');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='parTypeSelect'),
|
||||
'parType');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'loanOfficer');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
|
||||
'fundId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
|
||||
'loanPurposeId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
|
||||
'startDate');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
|
||||
'endDate');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'Loan Officer');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
|
||||
'fundId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
|
||||
'loanPurposeId');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='parTypeSelect'),
|
||||
'parType');
|
||||
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'Loan Officer');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
|
||||
'fundId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
|
||||
'loanPurposeId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'Loan Officer');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
|
||||
'fundId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
|
||||
'loanPurposeId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='parTypeSelect'),
|
||||
'parType');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'Loan Officer');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
|
||||
'fundId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
|
||||
'loanPurposeId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Aging Detail(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Aging Summary (Arrears in Months)(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Aging Summary (Arrears in Months)(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Aging Summary (Arrears in Weeks)(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Aging Summary (Arrears in Weeks)(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Listing(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'selectOffice');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'Loan Officer');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
|
||||
'fundId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
|
||||
'loanPurposeId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Expected Payments By Date - Basic(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Expected Payments By Date - Basic(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'Loan Officer');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Expected Payments By Date - Basic(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
|
||||
'startDate');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Expected Payments By Date - Basic(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
|
||||
'endDate');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary by Office(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary by Office(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary by Office(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
|
||||
'fundId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary by Office(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
|
||||
'startDate');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary by Office(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
|
||||
'endDate');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
|
||||
'fundId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
|
||||
'startDate');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
|
||||
'endDate');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'Loan Officer');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
|
||||
'fundId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
|
||||
'loanPurposeId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'Loan Officer');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
|
||||
'fundId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
|
||||
'loanPurposeId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'Loan Officer');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
|
||||
'fundId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
|
||||
'loanPurposeId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'Loan Officer');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
|
||||
'fundId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
|
||||
'loanPurposeId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'Loan Officer');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
|
||||
'fundId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
|
||||
'loanPurposeId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
|
||||
'startDate');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
|
||||
'endDate');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='obligDateTypeSelect'),
|
||||
'obligDateType');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'Loan Officer');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
|
||||
'fundId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
|
||||
'loanPurposeId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
|
||||
'Startdate');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
|
||||
'Enddate');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='obligDateTypeSelect'),
|
||||
'obligDateType');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'Loan Officer');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
|
||||
'fundId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
|
||||
'loanPurposeId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='parTypeSelect'),
|
||||
'parType');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'loanOfficer');
|
||||
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),
|
||||
'fundId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),
|
||||
'loanPurposeId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='parTypeSelect'),
|
||||
'parType');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Rescheduled Loans(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Rescheduled Loans(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Rescheduled Loans(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Rescheduled Loans(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
|
||||
'startDate');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Rescheduled Loans(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
|
||||
'endDate');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='TxnRunningBalances(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='TxnRunningBalances(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'),
|
||||
'Loan Officer');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='TxnRunningBalances(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
|
||||
'startDate');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='TxnRunningBalances(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
|
||||
'endDate');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Written-Off Loans(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),
|
||||
'Branch');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Written-Off Loans(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'),
|
||||
'CurrencyId');
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Written-Off Loans(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'),
|
||||
'loanProductId');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Written-Off Loans(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'),
|
||||
'startDate');
|
||||
|
||||
INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name)
|
||||
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Written-Off Loans(Pentaho)'),
|
||||
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
|
||||
'endDate');
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Client Saving Transactions', 'Pentaho', NULL, 'Savings', NULL, NULL, 0, 0);
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Saving Transactions'), (select id from stretchy_parameter where parameter_name='startDateSelect'), 'startDate');
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Saving Transactions'), (select id from stretchy_parameter where parameter_name='endDateSelect'), 'endDate');
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Saving Transactions'), (select id from stretchy_parameter where parameter_name='selectAccount'), 'accountNo');
|
||||
|
||||
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Client Loan Account Schedule', 'Pentaho', NULL, 'Loans', NULL, NULL, 0, 0);
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Loan Account Schedule'), (select id from stretchy_parameter where parameter_name='startDateSelect'), 'startDate');
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Loan Account Schedule'), (select id from stretchy_parameter where parameter_name='endDateSelect'), 'endDate');
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Loan Account Schedule'), (select id from stretchy_parameter where parameter_name='selectAccount'), 'accountNo');
|
||||
@@ -0,0 +1,18 @@
|
||||
ALTER TABLE `m_charge`
|
||||
ADD COLUMN `fee_frequency` SMALLINT(5) NULL DEFAULT NULL AFTER `max_cap`;
|
||||
|
||||
CREATE TABLE `m_loan_overdue_installment_charge` (
|
||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
|
||||
`loan_charge_id` BIGINT(20) NOT NULL,
|
||||
`loan_schedule_id` BIGINT(20) NOT NULL,
|
||||
`frequency_number` INT(10) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `FK_m_loan_overdue_installment_charge_m_loan_charge` FOREIGN KEY (`loan_charge_id`) REFERENCES `m_loan_charge` (`id`),
|
||||
CONSTRAINT `FK_m_loan_overdue_installment_charge_m_loan_repayment_schedule` FOREIGN KEY (`loan_schedule_id`) REFERENCES `m_loan_repayment_schedule` (`id`)
|
||||
)
|
||||
COLLATE='utf8_general_ci'
|
||||
ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO `c_configuration` (`name`, `value`, `enabled`) VALUES ('grace-on-penalty-posting', 0, 1);
|
||||
|
||||
INSERT INTO m_loan_overdue_installment_charge (`loan_charge_id`, `loan_schedule_id`, `frequency_number`) SELECT mlc.id ,ls.id ,1 from m_loan_charge as mlc inner join m_charge mc on mc.id = mlc.charge_id inner join m_loan_repayment_schedule ls on ls.loan_id = mlc.loan_id and ls.duedate = mlc.due_for_collection_as_of_date where mc.charge_time_enum = 9 and mlc.is_active = 1;
|
||||
@@ -0,0 +1,17 @@
|
||||
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('GroupNamesByStaff', 'Table', '', '', 'Select gr.id as id, gr.display_name as name from m_group gr where gr.level_id=1 and gr.staff_id = ${staffId}', '', 0, 1);
|
||||
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('ClientTrendsByDay', 'Table', '', 'Client', 'SELECT COUNT(cl.id) AS count, \n cl.activation_date AS days\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (cl.activation_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 DAY) AND DATE(NOW()- INTERVAL 1 DAY))\nGROUP BY days', 'Retrieves the number of clients joined in last 12 days', 0, 1);
|
||||
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('ClientTrendsByWeek', 'Table', '', 'Client', 'SELECT COUNT(cl.id) AS count, \n WEEK(cl.activation_date) AS Weeks\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (cl.activation_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 WEEK) AND DATE(NOW()))\nGROUP BY Weeks', '', 0, 1);
|
||||
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('ClientTrendsByMonth', 'Table', '', 'Client', 'SELECT COUNT(cl.id) AS count, \n MONTHNAME(cl.activation_date) AS Months\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (cl.activation_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 MONTH) AND DATE(NOW()))\nGROUP BY Months', '', 0, 1);
|
||||
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('LoanTrendsByDay', 'Table', '', 'Loan', 'SELECT COUNT(ln.id) AS lcount, \n ln.disbursedon_date AS days\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\n LEFT JOIN m_loan ln on cl.id = ln.client_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (ln.disbursedon_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 DAY) AND DATE(NOW()- INTERVAL 1 DAY))\nGROUP BY days', 'Retrieves Number of loans disbursed for last 12 days', 0, 1);
|
||||
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('LoanTrendsByWeek', 'Table', '', 'Loan', 'SELECT COUNT(ln.id) AS lcount, \n WEEK(ln.disbursedon_date) AS Weeks\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\n LEFT JOIN m_loan ln on cl.id = ln.client_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (ln.disbursedon_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 WEEK) AND DATE(NOW()))\nGROUP BY Weeks', '', 0, 1);
|
||||
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('LoanTrendsByMonth', 'Table', '', 'Loan', 'SELECT COUNT(ln.id) AS lcount, \n MONTHNAME(ln.disbursedon_date) AS Months\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\n LEFT JOIN m_loan ln on cl.id = ln.client_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (ln.disbursedon_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 MONTH) AND DATE(NOW()))\nGROUP BY Months', '', 0, 1);
|
||||
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Demand_Vs_Collection', 'Table', '', 'Loan', 'select amount.AmountDue-amount.AmountPaid as AmountDue, amount.AmountPaid as AmountPaid from\n(SELECT \n(IFNULL(SUM(ls.principal_amount),0) - IFNULL(SUM(ls.principal_writtenoff_derived),0)\n + IFNULL(SUM(ls.interest_amount),0) - IFNULL(SUM(ls.interest_writtenoff_derived),0) \n - IFNULL(SUM(ls.interest_waived_derived),0)\n + IFNULL(SUM(ls.fee_charges_amount),0) - IFNULL(SUM(ls.fee_charges_writtenoff_derived),0) \n - IFNULL(SUM(ls.fee_charges_waived_derived),0)\n + IFNULL(SUM(ls.penalty_charges_amount),0) - IFNULL(SUM(ls.penalty_charges_writtenoff_derived),0) \n - IFNULL(SUM(ls.penalty_charges_waived_derived),0)\n) AS AmountDue, \n\n(IFNULL(SUM(ls.principal_completed_derived),0) - IFNULL(SUM(ls.principal_writtenoff_derived),0) + IFNULL(SUM(ls.interest_completed_derived),0) - IFNULL(SUM(ls.interest_writtenoff_derived),0) \n - IFNULL(SUM(ls.interest_waived_derived),0)\n + IFNULL(SUM(ls.fee_charges_completed_derived),0) - IFNULL(SUM(ls.fee_charges_writtenoff_derived),0) \n - IFNULL(SUM(ls.fee_charges_waived_derived),0)\n + IFNULL(SUM(ls.penalty_charges_completed_derived),0) - IFNULL(SUM(ls.penalty_charges_writtenoff_derived),0) \n - IFNULL(SUM(ls.penalty_charges_waived_derived),0)\n) AS AmountPaid\nFROM m_office of\nLEFT JOIN m_client cl ON of.id = cl.office_id\nLEFT JOIN m_loan ln ON cl.id = ln.client_id\nLEFT JOIN m_loan_repayment_schedule ls ON ln.id = ls.loan_id\nWHERE ls.duedate = DATE(NOW()) AND \n (of.hierarchy LIKE CONCAT((\nSELECT ino.hierarchy\nFROM m_office ino\nWHERE ino.id = ${officeId}),"%"))) as amount', 'Demand Vs Collection', 0, 1);
|
||||
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Disbursal_Vs_Awaitingdisbursal', 'Table', '', 'Loan', 'select awaitinddisbursal.amount-disbursedAmount.amount as amountToBeDisburse, disbursedAmount.amount as disbursedAmount from \n(\nSELECT COUNT(ln.id) AS noOfLoans, \n IFNULL(SUM(ln.principal_amount),0) AS amount\nFROM \nm_office of\nLEFT JOIN m_client cl ON cl.office_id = of.id\nLEFT JOIN m_loan ln ON cl.id = ln.client_id\nWHERE \nln.expected_disbursedon_date = DATE(NOW()) AND \n(ln.loan_status_id=200 OR ln.loan_status_id=300) AND\n of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" )\n) awaitinddisbursal,\n(\nSELECT COUNT(ltrxn.id) as count, \n IFNULL(SUM(ltrxn.amount),0) as amount \nFROM \nm_office of\nLEFT JOIN m_client cl ON cl.office_id = of.id\nLEFT JOIN m_loan ln ON cl.id = ln.client_id\nLEFT JOIN m_loan_transaction ltrxn ON ln.id = ltrxn.loan_id\nWHERE \nltrxn.transaction_date = DATE(NOW()) AND \nltrxn.transaction_type_enum=1 AND\n of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n) disbursedAmount', 'Disbursal_Vs_Awaitingdisbursal', 0, 1);
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'ClientTrendsByDay'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), '');
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'ClientTrendsByWeek'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), '');
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'ClientTrendsByMonth'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), '');
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'LoanTrendsByDay'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), '');
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'LoanTrendsByWeek'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), '');
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'LoanTrendsByMonth'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), '');
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'Demand_Vs_Collection'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), '');
|
||||
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'Disbursal_Vs_Awaitingdisbursal'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), '');
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE `m_portfolio_command_source`
|
||||
ADD COLUMN `transaction_id` VARCHAR(100) NULL DEFAULT NULL AFTER `product_id`;
|
||||
@@ -0,0 +1,126 @@
|
||||
CREATE TABLE `m_account_transfer_details` (
|
||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
|
||||
`from_office_id` BIGINT(20) NOT NULL,
|
||||
`to_office_id` BIGINT(20) NOT NULL,
|
||||
`from_client_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
`to_client_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
`from_savings_account_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
`to_savings_account_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
`from_loan_account_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
`to_loan_account_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
`transfer_type` SMALLINT(2) NULL DEFAULT NULL,
|
||||
`from_savings_transaction_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
`from_loan_transaction_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
`to_savings_transaction_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
`to_loan_transaction_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
`is_reversed` TINYINT(1) NOT NULL,
|
||||
`transaction_date` DATE NOT NULL,
|
||||
`currency_code` VARCHAR(3) NOT NULL,
|
||||
`currency_digits` SMALLINT(5) NOT NULL,
|
||||
`currency_multiplesof` SMALLINT(5) NULL DEFAULT NULL,
|
||||
`amount` DECIMAL(19,6) NOT NULL,
|
||||
`description` VARCHAR(200) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FK_m_account_transfer_details_from_office` (`from_office_id`),
|
||||
INDEX `FK_m_account_transfer_details_to_office` (`to_office_id`),
|
||||
INDEX `FK_m_account_transfer_details_from_client` (`from_client_id`),
|
||||
INDEX `FK_m_account_transfer_details_to_client` (`to_client_id`),
|
||||
INDEX `FK_m_account_transfer_details_from_savings_account` (`from_savings_account_id`),
|
||||
INDEX `FK_m_account_transfer_details_to_savings_account` (`to_savings_account_id`),
|
||||
INDEX `FK_m_account_transfer_details_from_loan_account` (`from_loan_account_id`),
|
||||
INDEX `FK_m_account_transfer_details_to_loan_account` (`to_loan_account_id`),
|
||||
CONSTRAINT `FK_m_account_transfer_details_from_client` FOREIGN KEY (`from_client_id`) REFERENCES `m_client` (`id`),
|
||||
CONSTRAINT `FK_m_account_transfer_details_from_loan_account` FOREIGN KEY (`from_loan_account_id`) REFERENCES `m_loan` (`id`),
|
||||
CONSTRAINT `FK_m_account_transfer_details_from_office` FOREIGN KEY (`from_office_id`) REFERENCES `m_office` (`id`),
|
||||
CONSTRAINT `FK_m_account_transfer_details_from_savings_account` FOREIGN KEY (`from_savings_account_id`) REFERENCES `m_savings_account` (`id`),
|
||||
CONSTRAINT `FK_m_account_transfer_details_to_client` FOREIGN KEY (`to_client_id`) REFERENCES `m_client` (`id`),
|
||||
CONSTRAINT `FK_m_account_transfer_details_to_loan_account` FOREIGN KEY (`to_loan_account_id`) REFERENCES `m_loan` (`id`),
|
||||
CONSTRAINT `FK_m_account_transfer_details_to_office` FOREIGN KEY (`to_office_id`) REFERENCES `m_office` (`id`),
|
||||
CONSTRAINT `FK_m_account_transfer_details_to_savings_account` FOREIGN KEY (`to_savings_account_id`) REFERENCES `m_savings_account` (`id`)
|
||||
)
|
||||
COLLATE='utf8_general_ci'
|
||||
ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE `m_account_transfer_standing_instructions` (
|
||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` VARCHAR(250) NOT NULL,
|
||||
`account_transfer_details_id` BIGINT(20) NOT NULL,
|
||||
`priority` TINYINT(2) NOT NULL,
|
||||
`status` TINYINT(2) NOT NULL,
|
||||
`instruction_type` TINYINT(2) NOT NULL,
|
||||
`amount` DECIMAL(19,6) NULL DEFAULT NULL,
|
||||
`valid_from` DATE NOT NULL,
|
||||
`valid_till` DATE NULL DEFAULT NULL,
|
||||
`recurrence_type` TINYINT(1) NOT NULL,
|
||||
`recurrence_frequency` SMALLINT(5) NULL DEFAULT NULL,
|
||||
`recurrence_interval` SMALLINT(5) NULL DEFAULT NULL,
|
||||
`recurrence_on_day` SMALLINT(2) NULL DEFAULT NULL,
|
||||
`recurrence_on_month` SMALLINT(2) NULL DEFAULT NULL,
|
||||
`last_run_date` DATE NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE INDEX `name` (`name`),
|
||||
INDEX `FK_m_standing_instructions_account_transfer_details` (`account_transfer_details_id`),
|
||||
CONSTRAINT `FK_m_standing_instructions_account_transfer_details` FOREIGN KEY (`account_transfer_details_id`) REFERENCES `m_account_transfer_details` (`id`)
|
||||
)
|
||||
COLLATE='utf8_general_ci'
|
||||
ENGINE=InnoDB;
|
||||
|
||||
|
||||
CREATE TABLE `m_account_transfer_transaction` (
|
||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
|
||||
`account_transfer_details_id` BIGINT(20) NOT NULL,
|
||||
`from_savings_transaction_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
`from_loan_transaction_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
`to_savings_transaction_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
`to_loan_transaction_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
`is_reversed` TINYINT(1) NOT NULL,
|
||||
`transaction_date` DATE NOT NULL,
|
||||
`currency_code` VARCHAR(3) NOT NULL,
|
||||
`currency_digits` SMALLINT(5) NOT NULL,
|
||||
`currency_multiplesof` SMALLINT(5) NULL DEFAULT NULL,
|
||||
`amount` DECIMAL(19,6) NOT NULL,
|
||||
`description` VARCHAR(200) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FK_m_account_transfer_transaction_from_m_savings_transaction` (`from_savings_transaction_id`),
|
||||
INDEX `FK_m_account_transfer_transaction_to_m_savings_transaction` (`to_savings_transaction_id`),
|
||||
INDEX `FK_m_account_transfer_transaction_to_m_loan_transaction` (`to_loan_transaction_id`),
|
||||
INDEX `FK_m_account_transfer_transaction_from_m_loan_transaction` (`from_loan_transaction_id`),
|
||||
INDEX `FK_m_account_transfer_transaction_account_detail` (`account_transfer_details_id`),
|
||||
CONSTRAINT `FK_m_account_transfer_transaction_account_detail` FOREIGN KEY (`account_transfer_details_id`) REFERENCES `m_account_transfer_details` (`id`),
|
||||
CONSTRAINT `FK_m_account_transfer_transaction_from_m_loan_transaction` FOREIGN KEY (`from_loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`),
|
||||
CONSTRAINT `FK_m_account_transfer_transaction_from_m_savings_transaction` FOREIGN KEY (`from_savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`),
|
||||
CONSTRAINT `FK_m_account_transfer_transaction_to_m_loan_transaction` FOREIGN KEY (`to_loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`),
|
||||
CONSTRAINT `FK_m_account_transfer_transaction_to_m_savings_transaction` FOREIGN KEY (`to_savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`)
|
||||
)
|
||||
COLLATE='utf8_general_ci'
|
||||
ENGINE=InnoDB;
|
||||
|
||||
|
||||
|
||||
INSERT INTO `m_account_transfer_details` (`from_office_id`, `to_office_id`, `from_client_id`, `to_client_id`, `from_savings_account_id`, `to_savings_account_id`, `from_loan_account_id`, `to_loan_account_id`, `from_savings_transaction_id`, `from_loan_transaction_id`, `to_savings_transaction_id`, `to_loan_transaction_id`, `is_reversed`, `transaction_date`, `currency_code`, `currency_digits`, `currency_multiplesof`, `amount`, `description`) select at.from_office_id,at.to_office_id,at.from_client_id,at.to_client_id,at.from_savings_account_id,at.to_savings_account_id,at.from_loan_account_id,at.to_loan_account_id,at.from_savings_transaction_id,at.from_loan_transaction_id,at.to_savings_transaction_id,at.to_loan_transaction_id,at.is_reversed,at.transaction_date,at.currency_code,at.currency_digits,at.currency_multiplesof,at.amount,at.description from m_savings_account_transfer at;
|
||||
|
||||
INSERT INTO `m_account_transfer_transaction` (`account_transfer_details_id`, `from_savings_transaction_id`, `from_loan_transaction_id`, `to_savings_transaction_id`, `to_loan_transaction_id`, `is_reversed`, `transaction_date`, `currency_code`, `currency_digits`, `currency_multiplesof`, `amount`, `description`) select ad.id,ad.from_savings_transaction_id,ad.from_loan_transaction_id,ad.to_savings_transaction_id,ad.to_loan_transaction_id,ad.is_reversed,ad.transaction_date,ad.currency_code,ad.currency_digits,ad.currency_multiplesof,ad.amount,ad.description from m_account_transfer_details ad;
|
||||
|
||||
ALTER TABLE `m_account_transfer_details`
|
||||
DROP COLUMN `from_savings_transaction_id`,
|
||||
DROP COLUMN `from_loan_transaction_id`,
|
||||
DROP COLUMN `to_savings_transaction_id`,
|
||||
DROP COLUMN `to_loan_transaction_id`,
|
||||
DROP COLUMN `is_reversed`,
|
||||
DROP COLUMN `transaction_date`,
|
||||
DROP COLUMN `currency_code`,
|
||||
DROP COLUMN `currency_digits`,
|
||||
DROP COLUMN `currency_multiplesof`,
|
||||
DROP COLUMN `amount`,
|
||||
DROP COLUMN `description`;
|
||||
|
||||
DROP TABLE `m_savings_account_transfer`;
|
||||
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('account_transfer', 'READ_STANDINGINSTRUCTION ', 'STANDINGINSTRUCTION ', 'READ', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('account_transfer', 'CREATE_STANDINGINSTRUCTION ', 'STANDINGINSTRUCTION ', 'CREATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('account_transfer', 'UPDATE_STANDINGINSTRUCTION ', 'STANDINGINSTRUCTION ', 'UPDATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('account_transfer', 'DELETE_STANDINGINSTRUCTION ', 'STANDINGINSTRUCTION ', 'DELETE', 0);
|
||||
|
||||
|
||||
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Execute Standing Instruction', 'Execute Standing Instruction', '0 0 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0);
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
ALTER TABLE `m_loan_repayment_schedule`
|
||||
ADD COLUMN `accrual_interest_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `interest_waived_derived`,
|
||||
ADD COLUMN `accrual_fee_charges_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `fee_charges_waived_derived`,
|
||||
ADD COLUMN `accrual_penalty_charges_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `penalty_charges_waived_derived`;
|
||||
|
||||
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Add Accrual Transactions', 'Add Accrual Transactions', '0 1 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0);
|
||||
@@ -0,0 +1 @@
|
||||
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Apply penalty to overdue loans', 'Apply penalty to overdue loans', '0 0 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0);
|
||||
@@ -0,0 +1,7 @@
|
||||
ALTER TABLE `m_product_loan`
|
||||
ADD COLUMN `overdue_days_for_npa` SMALLINT(5) NULL DEFAULT NULL AFTER `grace_on_arrears_ageing`;
|
||||
|
||||
ALTER TABLE `m_loan`
|
||||
ADD COLUMN `is_npa` TINYINT(1) NOT NULL DEFAULT '0' AFTER `grace_on_arrears_ageing`;
|
||||
|
||||
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`) VALUES ('Update Non Performing Assets', 'Update Non Performing Assets', '0 0 0 1/1 * ? *', now());
|
||||
@@ -0,0 +1,237 @@
|
||||
CREATE TABLE IF NOT EXISTS `m_interest_rate_chart` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) DEFAULT NULL,
|
||||
`description` varchar(200) DEFAULT NULL,
|
||||
`from_date` date NOT NULL,
|
||||
`end_date` date DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `m_interest_rate_slab` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`interest_rate_chart_id` bigint(20) NOT NULL,
|
||||
`description` varchar(200) DEFAULT NULL,
|
||||
`period_type_enum` smallint(5) NOT NULL DEFAULT '1',
|
||||
`from_period` int(11) NOT NULL DEFAULT '0',
|
||||
`to_period` int(11) DEFAULT NULL,
|
||||
`amount_range_from` decimal(19,6) DEFAULT NULL,
|
||||
`amount_range_to` decimal(19,6) DEFAULT NULL,
|
||||
`annual_interest_rate` decimal(19,6) NOT NULL,
|
||||
`currency_code` varchar(3) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `FKIRS00000000000001` (`interest_rate_chart_id`),
|
||||
CONSTRAINT `FKIRS00000000000001` FOREIGN KEY (`interest_rate_chart_id`) REFERENCES `m_interest_rate_chart` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `m_deposit_product_interest_rate_chart` (
|
||||
`deposit_product_id` bigint(20) NOT NULL,
|
||||
`interest_rate_chart_id` bigint(20) NOT NULL,
|
||||
UNIQUE KEY `deposit_product_id_interest_rate_chart_id` (`deposit_product_id`,`interest_rate_chart_id`),
|
||||
KEY `FKDPIRC00000000000002` (`interest_rate_chart_id`),
|
||||
CONSTRAINT `FKDPIRC00000000000001` FOREIGN KEY (`deposit_product_id`) REFERENCES `m_savings_product` (`id`),
|
||||
CONSTRAINT `FKDPIRC00000000000002` FOREIGN KEY (`interest_rate_chart_id`) REFERENCES `m_interest_rate_chart` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `m_deposit_product_term_and_preclosure` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`savings_product_id` bigint(20) NOT NULL DEFAULT '0',
|
||||
`min_deposit_term` int(11) DEFAULT NULL,
|
||||
`max_deposit_term` int(11) DEFAULT NULL,
|
||||
`min_deposit_term_type_enum` smallint(5) DEFAULT NULL,
|
||||
`max_deposit_term_type_enum` smallint(5) DEFAULT NULL,
|
||||
`in_multiples_of_deposit_term` int(11) DEFAULT NULL,
|
||||
`in_multiples_of_deposit_term_type_enum` smallint(5) DEFAULT NULL,
|
||||
`interest_free_period_applicable` smallint(5) DEFAULT NULL,
|
||||
`interest_free_from_period` int(11) DEFAULT NULL,
|
||||
`interest_free_to_period` int(11) DEFAULT NULL,
|
||||
`interest_free_period_frequency_enum` smallint(5) DEFAULT NULL,
|
||||
`pre_closure_penal_applicable` smallint(5) DEFAULT NULL,
|
||||
`pre_closure_penal_interest` decimal(19,6) DEFAULT NULL,
|
||||
`pre_closure_penal_interest_on_enum` smallint(5) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `FKDPTP00000000000001` (`savings_product_id`),
|
||||
CONSTRAINT `FKDPTP00000000000001` FOREIGN KEY (`savings_product_id`) REFERENCES `m_savings_product` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `m_deposit_product_recurring_detail` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`savings_product_id` bigint(20) NOT NULL DEFAULT '0',
|
||||
`recurring_deposit_type_enum` smallint(5) DEFAULT NULL,
|
||||
`recurring_deposit_frequency` int(11) DEFAULT NULL,
|
||||
`recurring_deposit_frequency_type_enum` smallint(5) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `FKDPRD00000000000001` (`savings_product_id`),
|
||||
CONSTRAINT `FKDPRD00000000000001` FOREIGN KEY (`savings_product_id`) REFERENCES `m_savings_product` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `m_savings_account_interest_rate_chart` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`savings_account_id` bigint(20) NOT NULL,
|
||||
`name` varchar(100) DEFAULT NULL,
|
||||
`description` varchar(200) DEFAULT NULL,
|
||||
`from_date` date NOT NULL,
|
||||
`end_date` date DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `FKSAIRC00000000000001` (`savings_account_id`),
|
||||
CONSTRAINT `FKSAIRC00000000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `m_savings_account_interest_rate_slab` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`savings_account_interest_rate_chart_id` bigint(20) NOT NULL,
|
||||
`description` varchar(200) DEFAULT NULL,
|
||||
`period_type_enum` smallint(5) NOT NULL DEFAULT '1',
|
||||
`from_period` int(11) NOT NULL DEFAULT '0',
|
||||
`to_period` int(11) DEFAULT NULL,
|
||||
`amount_range_from` decimal(19,6) DEFAULT NULL,
|
||||
`amount_range_to` decimal(19,6) DEFAULT NULL,
|
||||
`annual_interest_rate` decimal(19,6) NOT NULL,
|
||||
`currency_code` varchar(3) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `FKSAIRS00000000000001` (`savings_account_interest_rate_chart_id`),
|
||||
CONSTRAINT `FKSAIRS00000000000001` FOREIGN KEY (`savings_account_interest_rate_chart_id`) REFERENCES `m_savings_account_interest_rate_chart` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `m_deposit_account_recurring_detail` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`savings_account_id` bigint(20) NOT NULL DEFAULT '0',
|
||||
`recurring_deposit_amount` decimal(19,6) DEFAULT NULL,
|
||||
`recurring_deposit_type_enum` smallint(5) DEFAULT NULL,
|
||||
`recurring_deposit_frequency` int(11) DEFAULT NULL,
|
||||
`recurring_deposit_frequency_type_enum` smallint(5) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `FKDARD00000000000001` (`savings_account_id`),
|
||||
CONSTRAINT `FKDARD00000000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `m_deposit_account_term_and_preclosure` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`savings_account_id` bigint(20) NOT NULL DEFAULT '0',
|
||||
`min_deposit_term` int(11) DEFAULT NULL,
|
||||
`max_deposit_term` int(11) DEFAULT NULL,
|
||||
`min_deposit_term_type_enum` smallint(5) DEFAULT NULL,
|
||||
`max_deposit_term_type_enum` smallint(5) DEFAULT NULL,
|
||||
`in_multiples_of_deposit_term` int(11) DEFAULT NULL,
|
||||
`in_multiples_of_deposit_term_type_enum` smallint(5) DEFAULT NULL,
|
||||
`interest_free_period_applicable` smallint(5) DEFAULT NULL,
|
||||
`interest_free_from_period` int(11) DEFAULT NULL,
|
||||
`interest_free_to_period` int(11) DEFAULT NULL,
|
||||
`interest_free_period_frequency_enum` smallint(5) DEFAULT NULL,
|
||||
`pre_closure_penal_applicable` smallint(5) DEFAULT NULL,
|
||||
`pre_closure_penal_interest` decimal(19,6) DEFAULT NULL,
|
||||
`pre_closure_penal_interest_on_enum` smallint(5) DEFAULT NULL,
|
||||
`deposit_period` int(11) DEFAULT NULL,
|
||||
`deposit_period_frequency_enum` smallint(5) DEFAULT NULL,
|
||||
`deposit_amount` decimal(19,6) DEFAULT NULL,
|
||||
`maturity_amount` decimal(19,6) DEFAULT NULL,
|
||||
`maturity_date` date DEFAULT NULL,
|
||||
`on_account_closure_enum` smallint(5) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `FKDATP00000000000001` (`savings_account_id`),
|
||||
CONSTRAINT `FKDATP00000000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
ALTER TABLE `m_savings_product`
|
||||
ADD COLUMN `deposit_type_enum` SMALLINT(5) NOT NULL DEFAULT '100' AFTER `description`;
|
||||
|
||||
ALTER TABLE `m_savings_account`
|
||||
ADD COLUMN `deposit_type_enum` SMALLINT(5) NOT NULL DEFAULT '100' AFTER `account_type_enum`;
|
||||
|
||||
ALTER TABLE `m_client`
|
||||
ADD COLUMN `gender_cv_id` INT(11) NULL DEFAULT NULL AFTER `mobile_no`,
|
||||
ADD COLUMN `date_of_birth` DATE NULL DEFAULT NULL AFTER `gender_cv_id`;
|
||||
|
||||
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_INTERESTRATECHART', 'INTERESTRATECHART', 'CREATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_INTERESTRATECHART_CHECKER', 'INTERESTRATECHART', 'CREATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_INTERESTRATECHART', 'INTERESTRATECHART', 'UPDATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_INTERESTRATECHART', 'INTERESTRATECHART', 'DELETE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_INTERESTRATECHART_CHECKER', 'INTERESTRATECHART', 'UPDATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_INTERESTRATECHART_CHECKER', 'INTERESTRATECHART', 'DELETE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_CHARTSLAB', 'CHARTSLAB', 'CREATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_CHARTSLAB_CHECKER', 'CHARTSLAB', 'CREATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_CHARTSLAB', 'CHARTSLAB', 'UPDATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_CHARTSLAB', 'CHARTSLAB', 'DELETE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_CHARTSLAB_CHECKER', 'CHARTSLAB', 'UPDATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_CHARTSLAB_CHECKER', 'CHARTSLAB', 'DELETE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_FIXEDDEPOSITPRODUCT', 'FIXEDDEPOSITPRODUCT', 'CREATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_FIXEDDEPOSITPRODUCT_CHECKER', 'FIXEDDEPOSITPRODUCT', 'CREATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_FIXEDDEPOSITPRODUCT', 'FIXEDDEPOSITPRODUCT', 'UPDATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_FIXEDDEPOSITPRODUCT', 'FIXEDDEPOSITPRODUCT', 'DELETE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_FIXEDDEPOSITPRODUCT_CHECKER', 'FIXEDDEPOSITPRODUCT', 'UPDATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_FIXEDDEPOSITPRODUCT_CHECKER', 'FIXEDDEPOSITPRODUCT', 'DELETE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_RECURRINGDEPOSITPRODUCT', 'RECURRINGDEPOSITPRODUCT', 'CREATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_RECURRINGDEPOSITPRODUCT_CHECKER', 'RECURRINGDEPOSITPRODUCT', 'CREATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_RECURRINGDEPOSITPRODUCT', 'RECURRINGDEPOSITPRODUCT', 'UPDATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_RECURRINGDEPOSITPRODUCT', 'RECURRINGDEPOSITPRODUCT', 'DELETE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_RECURRINGDEPOSITPRODUCT_CHECKER', 'RECURRINGDEPOSITPRODUCT', 'UPDATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_RECURRINGDEPOSITPRODUCT_CHECKER', 'RECURRINGDEPOSITPRODUCT', 'DELETE', 0);
|
||||
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'READ_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'READ', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'CREATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'CREATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'UPDATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'UPDATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'DELETE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'DELETE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'DEPOSIT_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'DEPOSIT', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'DEPOSIT_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'DEPOSIT', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAWAL_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'WITHDRAWAL', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAWAL_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'WITHDRAWAL', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ACTIVATE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'ACTIVATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ACTIVATE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'ACTIVATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CALCULATEINTEREST_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'CALCULATEINTEREST', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CALCULATEINTEREST_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'CALCULATEINTEREST', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'POSTINTEREST_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'POSTINTEREST', 1);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'POSTINTEREST_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'POSTINTEREST', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'APPROVE', 1);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'REJECT_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'REJECT', 1);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAW_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'WITHDRAW', 1);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVALUNDO_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'APPROVALUNDO', 1);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CLOSE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'CLOSE', 1);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'APPROVE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'REJECT_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'REJECT', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAW_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'WITHDRAW', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVALUNDO_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'APPROVALUNDO', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CLOSE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'CLOSE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'UNDOTRANSACTION_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'UNDOTRANSACTION', 1);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'UNDOTRANSACTION_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'UNDOTRANSACTION', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ADJUSTTRANSACTION_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'ADJUSTTRANSACTION', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'READ_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'READ', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'CREATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'CREATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'UPDATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'UPDATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'DELETE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'DELETE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'DEPOSIT_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'DEPOSIT', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'DEPOSIT_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'DEPOSIT', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAWAL_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'WITHDRAWAL', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAWAL_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'WITHDRAWAL', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ACTIVATE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'ACTIVATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ACTIVATE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'ACTIVATE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CALCULATEINTEREST_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'CALCULATEINTEREST', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CALCULATEINTEREST_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'CALCULATEINTEREST', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'POSTINTEREST_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'POSTINTEREST', 1);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'POSTINTEREST_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'POSTINTEREST', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'APPROVE', 1);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'REJECT_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'REJECT', 1);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAW_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'WITHDRAW', 1);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVALUNDO_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'APPROVALUNDO', 1);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CLOSE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'CLOSE', 1);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'APPROVE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'REJECT_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'REJECT', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAW_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'WITHDRAW', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVALUNDO_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'APPROVALUNDO', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CLOSE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'CLOSE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'UNDOTRANSACTION_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'UNDOTRANSACTION', 1);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'UNDOTRANSACTION_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'UNDOTRANSACTION', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ADJUSTTRANSACTION_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'ADJUSTTRANSACTION', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_savings', 'PREMATURECLOSE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'PREMATURECLOSE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`) VALUES ('transaction_savings', 'PREMATURECLOSE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'PREMATURECLOSE');
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_savings', 'PREMATURECLOSE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'PREMATURECLOSE', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`) VALUES ('transaction_savings', 'PREMATURECLOSE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'PREMATURECLOSE');
|
||||
+1
@@ -0,0 +1 @@
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_loan', 'DISBURSETOSAVINGS_LOAN', 'LOAN', 'DISBURSETOSAVINGS', 0);
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
ALTER TABLE `m_deposit_product_term_and_preclosure`
|
||||
ADD COLUMN `min_deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL,
|
||||
ADD COLUMN `max_deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL,
|
||||
ADD COLUMN `deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL;
|
||||
|
||||
ALTER TABLE m_deposit_account_term_and_preclosure
|
||||
ADD COLUMN `expected_firstdepositon_date` DATE NULL DEFAULT NULL;
|
||||
@@ -0,0 +1,28 @@
|
||||
INSERT INTO `m_permission` (
|
||||
`id` ,
|
||||
`grouping` ,
|
||||
`code` ,
|
||||
`entity_name` ,
|
||||
`action_name` ,
|
||||
`can_maker_checker`
|
||||
)
|
||||
VALUES (
|
||||
NULL , 'transaction_loan', 'RECOVERYPAYMENT_LOAN', 'LOAN', 'RECOVERYPAYMENT', '0'
|
||||
);
|
||||
|
||||
|
||||
Alter table m_loan
|
||||
add column total_recovered_derived Decimal(19,6);
|
||||
|
||||
|
||||
INSERT INTO `acc_gl_account` (`name`, `hierarchy`, `gl_code`,`account_usage`, `classification_enum`,`description`)
|
||||
select 'Loan Recovery (Temp)', '.', '220002-Temp', 1, 4,'Temporary account to track income from Loan recovery'
|
||||
FROM m_product_loan WHERE accounting_type != 1
|
||||
limit 1;
|
||||
|
||||
INSERT INTO `acc_product_mapping` (`gl_account_id`,`product_id`,`product_type`,`financial_account_type`)
|
||||
select (select max(id) from acc_gl_account where classification_enum=4 and account_usage=1 LIMIT 1), mapping.product_id, mapping.product_type, 12
|
||||
from acc_product_mapping mapping
|
||||
where mapping.financial_account_type = 4 and mapping.product_type=1
|
||||
group by mapping.product_id;
|
||||
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
ALTER TABLE `job_run_history`
|
||||
CHANGE COLUMN `error_message` `error_message` TEXT NULL DEFAULT NULL AFTER `status`;
|
||||
|
||||
ALTER TABLE `m_deposit_account_term_and_preclosure`
|
||||
ADD COLUMN `transfer_interest_to_linked_account` TINYINT(1) NOT NULL DEFAULT '0' AFTER `expected_firstdepositon_date`;
|
||||
|
||||
UPDATE `job` SET `scheduler_group`=1 WHERE `name`='Post Interest For Savings';
|
||||
|
||||
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Transfer Interest To Savings', 'Transfer Interest To Savings', '0 2 0 1/1 * ? *', now(), 4, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 1, 0);
|
||||
+1
@@ -0,0 +1 @@
|
||||
UPDATE stretchy_report SET core_report=1, use_report=0 WHERE report_name in ('ClientTrendsByDay','ClientTrendsByWeek','ClientTrendsByMonth','LoanTrendsByDay','LoanTrendsByWeek','LoanTrendsByMonth','Demand_Vs_Collection','Disbursal_Vs_Awaitingdisbursal');
|
||||
@@ -0,0 +1 @@
|
||||
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Update Deposit Accounts Maturity details', 'Update Deposit Accounts Maturity details', '0 0 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0);
|
||||
@@ -0,0 +1,71 @@
|
||||
INSERT INTO `c_configuration` (`name`, `value`, `enabled`) VALUES ('age_limit_for_senior_citizen', 65, 1);
|
||||
INSERT INTO `c_configuration` (`name`, `value`, `enabled`) VALUES ('age_limit_for_children', 15, 1);
|
||||
|
||||
|
||||
ALTER TABLE `m_interest_rate_slab`
|
||||
ADD COLUMN `interest_rate_for_female` DECIMAL(19,6) NULL AFTER `annual_interest_rate`,
|
||||
ADD COLUMN `interest_rate_for_children` DECIMAL(19,6) NULL AFTER `interest_rate_for_female`,
|
||||
ADD COLUMN `interest_rate_for_senior_citizen` DECIMAL(19,6) NULL AFTER `interest_rate_for_children`;
|
||||
|
||||
ALTER TABLE `m_savings_account_interest_rate_slab`
|
||||
ADD COLUMN `interest_rate_for_female` DECIMAL(19,6) NULL AFTER `annual_interest_rate`,
|
||||
ADD COLUMN `interest_rate_for_children` DECIMAL(19,6) NULL AFTER `interest_rate_for_female`,
|
||||
ADD COLUMN `interest_rate_for_senior_citizen` DECIMAL(19,6) NULL AFTER `interest_rate_for_children`;
|
||||
|
||||
ALTER TABLE `m_deposit_account_recurring_detail`
|
||||
CHANGE COLUMN `recurring_deposit_amount` `mandatory_recommended_deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL,
|
||||
ADD COLUMN `is_mandatory` TINYINT NOT NULL DEFAULT '0',
|
||||
ADD COLUMN `allow_withdrawal` TINYINT NOT NULL DEFAULT '0',
|
||||
ADD COLUMN `adjust_advance_towards_future_payments` TINYINT NOT NULL DEFAULT '1',
|
||||
ADD COLUMN `is_calendar_inherited` TINYINT NOT NULL DEFAULT '0',
|
||||
ADD COLUMN `total_overdue_amount` DECIMAL(19,6) NULL DEFAULT NULL,
|
||||
ADD COLUMN `no_of_overdue_installments` INT(11) NULL DEFAULT NULL,
|
||||
DROP COLUMN `recurring_deposit_type_enum`,
|
||||
DROP COLUMN `recurring_deposit_frequency`,
|
||||
DROP COLUMN `recurring_deposit_frequency_type_enum`;
|
||||
|
||||
|
||||
ALTER TABLE `m_deposit_product_term_and_preclosure`
|
||||
DROP COLUMN `interest_free_period_applicable`,
|
||||
DROP COLUMN `interest_free_from_period`,
|
||||
DROP COLUMN `interest_free_to_period`,
|
||||
DROP COLUMN `interest_free_period_frequency_enum`;
|
||||
|
||||
ALTER TABLE `m_deposit_product_recurring_detail`
|
||||
ADD COLUMN `is_mandatory` TINYINT(1) NOT NULL DEFAULT '1',
|
||||
ADD COLUMN `allow_withdrawal` TINYINT(1) NOT NULL DEFAULT '0',
|
||||
ADD COLUMN `adjust_advance_towards_future_payments` TINYINT(1) NOT NULL DEFAULT '1',
|
||||
DROP COLUMN `recurring_deposit_type_enum`,
|
||||
DROP COLUMN `recurring_deposit_frequency`,
|
||||
DROP COLUMN `recurring_deposit_frequency_type_enum`;
|
||||
|
||||
ALTER TABLE `m_deposit_account_term_and_preclosure`
|
||||
DROP COLUMN `interest_free_period_applicable`,
|
||||
DROP COLUMN `interest_free_from_period`,
|
||||
DROP COLUMN `interest_free_to_period`,
|
||||
DROP COLUMN `interest_free_period_frequency_enum`;
|
||||
|
||||
CREATE TABLE `m_mandatory_savings_schedule` (
|
||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
|
||||
`savings_account_id` BIGINT(20) NOT NULL,
|
||||
`fromdate` DATE NULL DEFAULT NULL,
|
||||
`duedate` DATE NOT NULL,
|
||||
`installment` SMALLINT(5) NOT NULL,
|
||||
`deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL,
|
||||
`deposit_amount_completed_derived` DECIMAL(19,6) NULL DEFAULT NULL,
|
||||
`total_paid_in_advance_derived` DECIMAL(19,6) NULL DEFAULT NULL,
|
||||
`total_paid_late_derived` DECIMAL(19,6) NULL DEFAULT NULL,
|
||||
`completed_derived` BIT(1) NOT NULL,
|
||||
`obligations_met_on_date` DATE NULL DEFAULT NULL,
|
||||
`createdby_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
`created_date` DATETIME NULL DEFAULT NULL,
|
||||
`lastmodified_date` DATETIME NULL DEFAULT NULL,
|
||||
`lastmodifiedby_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FKMSS0000000001` (`savings_account_id`),
|
||||
CONSTRAINT `FKMSS0000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`)
|
||||
);
|
||||
|
||||
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'READ_RECURRINGDEPOSITPRODUCT', 'RECURRINGDEPOSITPRODUCT', 'READ', 0);
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'READ_FIXEDDEPOSITPRODUCT', 'FIXEDDEPOSITPRODUCT', 'READ', 0);
|
||||
@@ -0,0 +1,21 @@
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'READ_OFFICEGLACCOUNT', 'OFFICEGLACCOUNT', 'READ', 0);
|
||||
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'CREATE_OFFICEGLACCOUNT', 'OFFICEGLACCOUNT', 'CREATE', 0);
|
||||
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'DELETE_OFFICEGLACCOUNT', 'OFFICEGLACCOUNT', 'DELETE', 0);
|
||||
|
||||
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'UPDATE_OFFICEGLACCOUNT', 'OFFICEGLACCOUNT', 'UPDATE', 0);
|
||||
|
||||
CREATE TABLE `acc_gl_office_mapping` (
|
||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
|
||||
`gl_account_id` BIGINT(20) NOT NULL DEFAULT '0',
|
||||
`office_id` BIGINT(20) NOT NULL,
|
||||
`financial_account_type` SMALLINT(5) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FK_office_mapping_acc_gl_account` (`gl_account_id`),
|
||||
INDEX `FK_office_mapping_office` (`office_id`),
|
||||
CONSTRAINT `FK_office_mapping_acc_gl_account` FOREIGN KEY (`gl_account_id`) REFERENCES `acc_gl_account` (`id`),
|
||||
CONSTRAINT `FK_office_mapping_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)
|
||||
)
|
||||
COLLATE='utf8_general_ci'
|
||||
ENGINE=InnoDB;
|
||||
@@ -0,0 +1,103 @@
|
||||
ALTER TABLE `m_code_value`
|
||||
ADD COLUMN `code_score` INT(11) NULL AFTER `order_position`;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ppi_scores` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`score_from` int(11) NOT NULL,
|
||||
`score_to` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) COLLATE='utf8_general_ci'
|
||||
ENGINE=InnoDB;
|
||||
|
||||
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(0, 4);
|
||||
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(5, 9);
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(10, 14);
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(15, 19);
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(20, 24);
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(25,29 );
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(30, 34);
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(35, 39);
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(40, 44);
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(45, 49);
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(50, 54);
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(55, 59);
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(60,64);
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(65, 69);
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(70, 74);
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(75, 79);
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(80,84);
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(85, 89);
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(90, 94);
|
||||
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
|
||||
VALUES
|
||||
(95, 100);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ppi_likelihoods` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(100) NOT NULL,
|
||||
`name` varchar(250) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) COLLATE='utf8_general_ci'
|
||||
ENGINE=InnoDB ;
|
||||
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ppi_likelihoods_ppi` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`likelihood_id` bigint(20) NOT NULL,
|
||||
`ppi_name` varchar(250) NOT NULL,
|
||||
`enabled` int(11) NOT NULL DEFAULT '100',
|
||||
PRIMARY KEY (`id`)
|
||||
) COLLATE='utf8_general_ci'
|
||||
ENGINE=InnoDB;
|
||||
|
||||
/**PPI permission**/
|
||||
INSERT INTO `m_permission` (`id`, `grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES (NULL, 'datatable', 'UPDATE_LIKELIHOOD', 'likelihood', 'UPDATE', '0');
|
||||
|
||||
INSERT INTO `m_permission` (`id`, `grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES (NULL, 'survey', 'REGISTER_SURVEY', 'survey', 'CREATE', '0');
|
||||
|
||||
/**Registered table category**/
|
||||
ALTER TABLE `x_registered_table` ADD `category` INT NOT NULL DEFAULT 100;
|
||||
@@ -0,0 +1,5 @@
|
||||
/**Remove all existing apply interest transaction Types**/
|
||||
update m_loan_transaction set interest_portion_derived=amount where transaction_type_enum=11;
|
||||
update m_loan_transaction set transaction_type_enum=10 where transaction_type_enum=11;
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
ALTER TABLE `m_client`
|
||||
ADD COLUMN `client_type_cv_id` INT(11) NULL DEFAULT NULL AFTER `default_savings_account`,
|
||||
ADD COLUMN `client_classification_cv_id` INT(11) NULL DEFAULT NULL AFTER `client_type_cv_id`,
|
||||
ADD CONSTRAINT `FK_m_client_type_m_code_value` FOREIGN KEY (`client_type_cv_id`) REFERENCES `m_code_value` (`id`),
|
||||
ADD CONSTRAINT `FK_m_client_classification_m_code_value` FOREIGN KEY (`client_classification_cv_id`) REFERENCES `m_code_value` (`id`),
|
||||
ADD CONSTRAINT `FK1_m_client_gender_m_code_value` FOREIGN KEY (`gender_cv_id`) REFERENCES `m_code_value` (`id`);
|
||||
|
||||
INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('ClientType', 1);
|
||||
INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('ClientClassification', 1);
|
||||
|
||||
|
||||
CREATE TABLE `m_interest_incentives` (
|
||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
|
||||
`interest_rate_slab_id` BIGINT(20) NOT NULL,
|
||||
`entiry_type` SMALLINT(2) NOT NULL,
|
||||
`attribute_name` SMALLINT(2) NOT NULL,
|
||||
`condition_type` SMALLINT(2) NOT NULL,
|
||||
`attribute_value` VARCHAR(50) NOT NULL,
|
||||
`incentive_type` SMALLINT(2) NOT NULL,
|
||||
`amount` DECIMAL(19,6) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FK_m_interest_incentives_m_interest_rate_slab` (`interest_rate_slab_id`),
|
||||
CONSTRAINT `FK_m_interest_incentives_m_interest_rate_slab` FOREIGN KEY (`interest_rate_slab_id`) REFERENCES `m_interest_rate_slab` (`id`)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE `m_savings_interest_incentives` (
|
||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
|
||||
`deposit_account_interest_rate_slab_id` BIGINT(20) NOT NULL,
|
||||
`entiry_type` SMALLINT(2) NOT NULL,
|
||||
`attribute_name` SMALLINT(2) NOT NULL,
|
||||
`condition_type` SMALLINT(2) NOT NULL,
|
||||
`attribute_value` VARCHAR(50) NOT NULL,
|
||||
`incentive_type` SMALLINT(2) NOT NULL,
|
||||
`amount` DECIMAL(19,6) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FK_m_savings_interest_incentives_m_savings_interest_rate_slab` (`deposit_account_interest_rate_slab_id`),
|
||||
CONSTRAINT `FK_m_savings_interest_incentives_m_savings_interest_rate_slab` FOREIGN KEY (`deposit_account_interest_rate_slab_id`) REFERENCES `m_savings_account_interest_rate_slab` (`id`)
|
||||
);
|
||||
|
||||
ALTER TABLE `m_interest_rate_slab`
|
||||
DROP COLUMN `interest_rate_for_female`,
|
||||
DROP COLUMN `interest_rate_for_children`,
|
||||
DROP COLUMN `interest_rate_for_senior_citizen`;
|
||||
|
||||
ALTER TABLE `m_savings_account_interest_rate_slab`
|
||||
DROP COLUMN `interest_rate_for_female`,
|
||||
DROP COLUMN `interest_rate_for_children`,
|
||||
DROP COLUMN `interest_rate_for_senior_citizen`;
|
||||
@@ -0,0 +1,14 @@
|
||||
ALTER TABLE `tenants`
|
||||
ADD COLUMN `pool_initial_size` int(5) DEFAULT 5 AFTER `auto_update`,
|
||||
ADD COLUMN `pool_validation_interval` int(11) DEFAULT 30000,
|
||||
ADD COLUMN `pool_remove_abandoned` tinyint(1) DEFAULT 1,
|
||||
ADD COLUMN `pool_remove_abandoned_timeout` int(5) DEFAULT 60,
|
||||
ADD COLUMN `pool_log_abandoned` tinyint(1) DEFAULT 1,
|
||||
ADD COLUMN `pool_abandon_when_percentage_full` int(5) DEFAULT 50,
|
||||
ADD COLUMN `pool_test_on_borrow` tinyint(1) DEFAULT 1,
|
||||
ADD COLUMN `pool_max_active` int(5) DEFAULT 40,
|
||||
ADD COLUMN `pool_min_idle` int(5) DEFAULT 20,
|
||||
ADD COLUMN `pool_max_idle` int(5) DEFAULT 10,
|
||||
ADD COLUMN `pool_suspect_timeout` int(5) DEFAULT 60,
|
||||
ADD COLUMN `pool_time_between_eviction_runs_millis` int(11) DEFAULT 34000,
|
||||
ADD COLUMN `pool_min_evictable_idle_time_millis` int(11) DEFAULT 60000;
|
||||
File diff suppressed because one or more lines are too long
@@ -28,7 +28,7 @@ sourceCompatibility = JavaVersion.VERSION_1_6
|
||||
/* define binary compatiblity version */
|
||||
targetCompatibility = JavaVersion.VERSION_1_6
|
||||
|
||||
project.ext.springVersion = '3.2.4.RELEASE'
|
||||
project.ext.springVersion = '3.2.5.RELEASE'
|
||||
project.ext.springSecurityVersion = '3.1.4.RELEASE'
|
||||
project.ext.hibernateCoreVersion = '4.1.9.Final'
|
||||
project.ext.jerseyVersion = '1.17'
|
||||
@@ -55,7 +55,7 @@ configurations {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
def tomcatVersion = '7.0.42'
|
||||
def tomcatVersion = '7.0.47'
|
||||
tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
|
||||
"org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}"
|
||||
tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") {
|
||||
@@ -105,8 +105,8 @@ dependencies {
|
||||
[group: 'ch.qos.logback', name: 'logback-core', version: '1.0.13'],
|
||||
[group: 'ch.qos.logback', name: 'logback-classic', version: '1.0.13'],
|
||||
|
||||
[group: 'mysql', name: 'mysql-connector-java', version: '5.1.26'],
|
||||
[group: 'org.apache.tomcat', name: 'tomcat-jdbc', version: '7.0.42'],
|
||||
[group: 'mysql', name: 'mysql-connector-java', version: '5.1.27'],
|
||||
[group: 'org.apache.tomcat', name: 'tomcat-jdbc', version: '7.0.47'],
|
||||
|
||||
[group: 'pentaho-reporting-engine', name: 'pentaho-reporting-engine-classic-core', version: '3.9.1.1'],
|
||||
[group: 'pentaho-reporting-engine', name: 'pentaho-reporting-engine-classic-extensions', version: '3.9.1-GA'],
|
||||
@@ -230,6 +230,8 @@ tomcatRunWar {
|
||||
|
||||
sourceSets {
|
||||
integrationTest {
|
||||
compileClasspath += main.output + test.output
|
||||
runtimeClasspath += main.output + test.output
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
releaseVersion=1.14.0.RELEASE
|
||||
releaseVersion=1.22.0.RELEASE
|
||||
|
||||
|
||||
|
||||
|
||||
+482
@@ -0,0 +1,482 @@
|
||||
package org.mifosplatform.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.OfficeHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.accounting.Account;
|
||||
import org.mifosplatform.integrationtests.common.accounting.AccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.accounting.JournalEntry;
|
||||
import org.mifosplatform.integrationtests.common.accounting.JournalEntryHelper;
|
||||
import org.mifosplatform.integrationtests.common.accounting.OfficeAccountMappingHelper;
|
||||
import org.mifosplatform.integrationtests.common.charges.ChargesHelper;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.AccountTransferHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsStatusChecker;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
/**
|
||||
* JUnit Test Cases for Account Transfer for.
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unused" })
|
||||
public class AccountTransferTest {
|
||||
|
||||
public static final String MINIMUM_OPENING_BALANCE = "30000.0";
|
||||
public static final String ACCOUNT_TYPE_INDIVIDUAL = "INDIVIDUAL";
|
||||
public static final String ACCOUNT_TRANSFER_AMOUNT = "15000.0";
|
||||
public static final String ACCOUNT_TRANSFER_AMOUNT_ADJUST = "3000.0";
|
||||
public static final String FROM_LOAN_ACCOUNT_TYPE = "1";
|
||||
public static final String FROM_SAVINGS_ACCOUNT_TYPE = "2";
|
||||
public static final String TO_LOAN_ACCOUNT_TYPE = "1";
|
||||
public static final String TO_SAVINGS_ACCOUNT_TYPE = "2";
|
||||
|
||||
public static final String LOAN_APPROVAL_DATE = "01 March 2013";
|
||||
public static final String LOAN_APPROVAL_DATE_PLUS_ONE = "02 March 2013";
|
||||
public static final String LOAN_DISBURSAL_DATE = "01 March 2013";
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private SavingsAccountHelper savingsAccountHelper;
|
||||
private AccountTransferHelper accountTransferHelper;
|
||||
private LoanTransactionHelper loanTransactionHelper;
|
||||
private AccountHelper accountHelper;
|
||||
private JournalEntryHelper journalEntryHelper;
|
||||
|
||||
Float TRANSFER_AMOUNT = new Float(ACCOUNT_TRANSFER_AMOUNT);
|
||||
Float TRANSFER_AMOUNT_ADJUST = new Float(ACCOUNT_TRANSFER_AMOUNT_ADJUST);
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFromSavingsToSavingsAccountTransfer() {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.accountTransferHelper = new AccountTransferHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||
final Account expenseAccount = this.accountHelper.createExpenseAccount();
|
||||
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
|
||||
|
||||
OfficeHelper officeHelper = new OfficeHelper(this.requestSpec, this.responseSpec);
|
||||
Integer toOfficeId = officeHelper.createOffice("01 January 2011");
|
||||
Assert.assertNotNull(toOfficeId);
|
||||
|
||||
// Creating Savings Account to which fund to be Transferred
|
||||
final Integer toClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
|
||||
String.valueOf(toOfficeId));
|
||||
Assert.assertNotNull(toClientID);
|
||||
|
||||
Account toTransferAccount = accountHelper.createLiabilityAccount();
|
||||
Assert.assertNotNull(toTransferAccount);
|
||||
|
||||
OfficeAccountMappingHelper accountMappingHelper = new OfficeAccountMappingHelper(this.requestSpec,
|
||||
new ResponseSpecBuilder().build());
|
||||
Integer toTransferAccountMappingId = (Integer) accountMappingHelper.createOfficeAccountMapping(toOfficeId,
|
||||
toTransferAccount.getAccountID(), CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
Assert.assertNotNull(toTransferAccountMappingId);
|
||||
|
||||
final Integer toSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, assetAccount,
|
||||
incomeAccount, expenseAccount, liabilityAccount);
|
||||
Assert.assertNotNull(toSavingsProductID);
|
||||
|
||||
final Integer toSavingsID = this.savingsAccountHelper.applyForSavingsApplication(toClientID, toSavingsProductID,
|
||||
ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(toSavingsProductID);
|
||||
|
||||
HashMap toSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, toSavingsID);
|
||||
SavingsStatusChecker.verifySavingsIsPending(toSavingsStatusHashMap);
|
||||
|
||||
toSavingsStatusHashMap = this.savingsAccountHelper.approveSavings(toSavingsID);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(toSavingsStatusHashMap);
|
||||
|
||||
toSavingsStatusHashMap = this.savingsAccountHelper.activateSavings(toSavingsID);
|
||||
SavingsStatusChecker.verifySavingsIsActive(toSavingsStatusHashMap);
|
||||
|
||||
final HashMap toSavingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(toSavingsID);
|
||||
|
||||
Integer fromOfficeId = officeHelper.createOffice("01 January 2011");
|
||||
Assert.assertNotNull(fromOfficeId);
|
||||
|
||||
// Creating Savings Account from which the Fund has to be Transferred
|
||||
final Integer fromClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
|
||||
String.valueOf(fromOfficeId));
|
||||
Assert.assertNotNull(fromClientID);
|
||||
|
||||
Account fromTransferAccount = accountHelper.createLiabilityAccount();
|
||||
Assert.assertNotNull(fromTransferAccount);
|
||||
|
||||
Integer fromTransferAccountMappingId = (Integer) accountMappingHelper.createOfficeAccountMapping(fromOfficeId,
|
||||
fromTransferAccount.getAccountID(), CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
Assert.assertNotNull(fromTransferAccountMappingId);
|
||||
|
||||
final Integer fromSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
|
||||
assetAccount, incomeAccount, expenseAccount, liabilityAccount);
|
||||
Assert.assertNotNull(fromSavingsProductID);
|
||||
|
||||
final Integer fromSavingsID = this.savingsAccountHelper.applyForSavingsApplication(fromClientID, fromSavingsProductID,
|
||||
ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(fromSavingsID);
|
||||
|
||||
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsID);
|
||||
SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap);
|
||||
|
||||
fromSavingsStatusHashMap = this.savingsAccountHelper.approveSavings(fromSavingsID);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(fromSavingsStatusHashMap);
|
||||
|
||||
fromSavingsStatusHashMap = this.savingsAccountHelper.activateSavings(fromSavingsID);
|
||||
SavingsStatusChecker.verifySavingsIsActive(fromSavingsStatusHashMap);
|
||||
|
||||
final HashMap fromSavingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(fromSavingsID);
|
||||
|
||||
Float fromSavingsBalance = new Float(MINIMUM_OPENING_BALANCE);
|
||||
Float toSavingsBalance = new Float(MINIMUM_OPENING_BALANCE);
|
||||
|
||||
this.accountTransferHelper.accountTransfer(fromClientID, fromSavingsID, fromClientID, toSavingsID, FROM_SAVINGS_ACCOUNT_TYPE,
|
||||
TO_SAVINGS_ACCOUNT_TYPE, ACCOUNT_TRANSFER_AMOUNT);
|
||||
|
||||
fromSavingsBalance -= new Float(ACCOUNT_TRANSFER_AMOUNT);
|
||||
toSavingsBalance += new Float(ACCOUNT_TRANSFER_AMOUNT);
|
||||
|
||||
HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsID);
|
||||
assertEquals("Verifying From Savings Account Balance after Account Transfer", fromSavingsBalance,
|
||||
fromSavingsSummaryAfter.get("accountBalance"));
|
||||
|
||||
HashMap toSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(toSavingsID);
|
||||
assertEquals("Verifying To Savings Account Balance after Account Transfer", toSavingsBalance,
|
||||
toSavingsSummaryAfter.get("accountBalance"));
|
||||
final JournalEntry[] office1LiabilityEntries = { new JournalEntry(new Float(ACCOUNT_TRANSFER_AMOUNT),
|
||||
JournalEntry.TransactionType.CREDIT) };
|
||||
final JournalEntry[] office2LiabilityEntries = { new JournalEntry(new Float(ACCOUNT_TRANSFER_AMOUNT),
|
||||
JournalEntry.TransactionType.DEBIT) };
|
||||
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(fromTransferAccount, AccountTransferHelper.ACCOUNT_TRANSFER_DATE,
|
||||
office1LiabilityEntries);
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(toTransferAccount, AccountTransferHelper.ACCOUNT_TRANSFER_DATE,
|
||||
office2LiabilityEntries);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFromSavingsToLoanAccountTransfer() {
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||
final Account expenseAccount = this.accountHelper.createExpenseAccount();
|
||||
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
|
||||
|
||||
final Account loanAssetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account loanIncomeAccount = this.accountHelper.createIncomeAccount();
|
||||
final Account loanExpenseAccount = this.accountHelper.createExpenseAccount();
|
||||
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
||||
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
this.accountTransferHelper = new AccountTransferHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
OfficeHelper officeHelper = new OfficeHelper(this.requestSpec, this.responseSpec);
|
||||
Integer toOfficeId = officeHelper.createOffice("01 January 2011");
|
||||
Assert.assertNotNull(toOfficeId);
|
||||
|
||||
// Creating Loan Account to which fund to be Transferred
|
||||
final Integer toClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
|
||||
String.valueOf(toOfficeId));
|
||||
Assert.assertNotNull(toClientID);
|
||||
|
||||
Account toTransferAccount = accountHelper.createLiabilityAccount();
|
||||
Assert.assertNotNull(toTransferAccount);
|
||||
|
||||
OfficeAccountMappingHelper accountMappingHelper = new OfficeAccountMappingHelper(this.requestSpec,
|
||||
new ResponseSpecBuilder().build());
|
||||
Integer toTransferAccountMappingId = (Integer) accountMappingHelper.createOfficeAccountMapping(toOfficeId,
|
||||
toTransferAccount.getAccountID(), CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
Assert.assertNotNull(toTransferAccountMappingId);
|
||||
|
||||
final Integer toLoanProductID = createLoanProduct(loanAssetAccount, loanIncomeAccount, loanExpenseAccount, overpaymentAccount);
|
||||
Assert.assertNotNull(toLoanProductID);
|
||||
|
||||
final Integer toLoanID = applyForLoanApplication(toClientID, toLoanProductID);
|
||||
Assert.assertNotNull(toLoanID);
|
||||
|
||||
HashMap toLoanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, toLoanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(toLoanStatusHashMap);
|
||||
|
||||
toLoanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_APPROVAL_DATE, toLoanID);
|
||||
LoanStatusChecker.verifyLoanIsApproved(toLoanStatusHashMap);
|
||||
|
||||
toLoanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSAL_DATE, toLoanID);
|
||||
LoanStatusChecker.verifyLoanIsActive(toLoanStatusHashMap);
|
||||
|
||||
Integer fromOfficeId = officeHelper.createOffice("01 January 2011");
|
||||
Assert.assertNotNull(fromOfficeId);
|
||||
|
||||
// Creating Savings Account from which the Fund has to be Transferred
|
||||
final Integer fromClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
|
||||
String.valueOf(fromOfficeId));
|
||||
Assert.assertNotNull(fromClientID);
|
||||
|
||||
Account fromTransferAccount = accountHelper.createLiabilityAccount();
|
||||
Assert.assertNotNull(fromTransferAccount);
|
||||
|
||||
Integer fromTransferAccountMappingId = (Integer) accountMappingHelper.createOfficeAccountMapping(fromOfficeId,
|
||||
fromTransferAccount.getAccountID(), CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
Assert.assertNotNull(fromTransferAccountMappingId);
|
||||
|
||||
final Integer fromSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
|
||||
assetAccount, incomeAccount, expenseAccount, liabilityAccount);
|
||||
Assert.assertNotNull(fromSavingsProductID);
|
||||
|
||||
final Integer fromSavingsID = this.savingsAccountHelper.applyForSavingsApplication(fromClientID, fromSavingsProductID,
|
||||
ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(fromSavingsID);
|
||||
|
||||
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsID);
|
||||
SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap);
|
||||
|
||||
fromSavingsStatusHashMap = this.savingsAccountHelper.approveSavings(fromSavingsID);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(fromSavingsStatusHashMap);
|
||||
|
||||
fromSavingsStatusHashMap = this.savingsAccountHelper.activateSavings(fromSavingsID);
|
||||
SavingsStatusChecker.verifySavingsIsActive(fromSavingsStatusHashMap);
|
||||
|
||||
final HashMap fromSavingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(fromSavingsID);
|
||||
|
||||
Float fromSavingsBalance = new Float(MINIMUM_OPENING_BALANCE);
|
||||
|
||||
this.accountTransferHelper.accountTransfer(fromClientID, fromSavingsID, toClientID, toLoanID, FROM_SAVINGS_ACCOUNT_TYPE,
|
||||
TO_LOAN_ACCOUNT_TYPE, ACCOUNT_TRANSFER_AMOUNT_ADJUST);
|
||||
|
||||
fromSavingsBalance -= TRANSFER_AMOUNT_ADJUST;
|
||||
|
||||
HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsID);
|
||||
assertEquals("Verifying From Savings Account Balance after Account Transfer", fromSavingsBalance,
|
||||
fromSavingsSummaryAfter.get("accountBalance"));
|
||||
|
||||
HashMap toLoanSummaryAfter = this.loanTransactionHelper.getLoanSummary(requestSpec, responseSpec, toLoanID);
|
||||
assertEquals("Verifying To Loan Repayment Amount after Account Transfer", TRANSFER_AMOUNT_ADJUST,
|
||||
toLoanSummaryAfter.get("totalRepayment"));
|
||||
|
||||
final JournalEntry[] office1LiabilityEntries = { new JournalEntry(new Float(ACCOUNT_TRANSFER_AMOUNT_ADJUST),
|
||||
JournalEntry.TransactionType.CREDIT) };
|
||||
final JournalEntry[] office2LiabilityEntries = { new JournalEntry(new Float(ACCOUNT_TRANSFER_AMOUNT_ADJUST),
|
||||
JournalEntry.TransactionType.DEBIT) };
|
||||
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(fromTransferAccount, AccountTransferHelper.ACCOUNT_TRANSFER_DATE,
|
||||
office1LiabilityEntries);
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(toTransferAccount, AccountTransferHelper.ACCOUNT_TRANSFER_DATE,
|
||||
office2LiabilityEntries);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFromLoanToSavingsAccountTransfer() {
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||
final Account expenseAccount = this.accountHelper.createExpenseAccount();
|
||||
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
|
||||
|
||||
final Account loanAssetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account loanIncomeAccount = this.accountHelper.createIncomeAccount();
|
||||
final Account loanExpenseAccount = this.accountHelper.createExpenseAccount();
|
||||
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
||||
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
this.accountTransferHelper = new AccountTransferHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
OfficeHelper officeHelper = new OfficeHelper(this.requestSpec, this.responseSpec);
|
||||
Integer toOfficeId = officeHelper.createOffice("01 January 2011");
|
||||
Assert.assertNotNull(toOfficeId);
|
||||
|
||||
// Creating Loan Account to which fund to be Transferred
|
||||
final Integer toClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
|
||||
String.valueOf(toOfficeId));
|
||||
Assert.assertNotNull(toClientID);
|
||||
|
||||
Account toTransferAccount = accountHelper.createLiabilityAccount();
|
||||
Assert.assertNotNull(toTransferAccount);
|
||||
|
||||
OfficeAccountMappingHelper accountMappingHelper = new OfficeAccountMappingHelper(this.requestSpec,
|
||||
new ResponseSpecBuilder().build());
|
||||
Integer toTransferAccountMappingId = (Integer) accountMappingHelper.createOfficeAccountMapping(toOfficeId,
|
||||
toTransferAccount.getAccountID(), CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
Assert.assertNotNull(toTransferAccountMappingId);
|
||||
|
||||
final Integer toSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, assetAccount,
|
||||
incomeAccount, expenseAccount, liabilityAccount);
|
||||
Assert.assertNotNull(toSavingsProductID);
|
||||
|
||||
final Integer toSavingsID = this.savingsAccountHelper.applyForSavingsApplication(toClientID, toSavingsProductID,
|
||||
ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(toSavingsID);
|
||||
|
||||
HashMap toSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, toSavingsID);
|
||||
SavingsStatusChecker.verifySavingsIsPending(toSavingsStatusHashMap);
|
||||
|
||||
toSavingsStatusHashMap = this.savingsAccountHelper.approveSavings(toSavingsID);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(toSavingsStatusHashMap);
|
||||
|
||||
toSavingsStatusHashMap = this.savingsAccountHelper.activateSavings(toSavingsID);
|
||||
SavingsStatusChecker.verifySavingsIsActive(toSavingsStatusHashMap);
|
||||
|
||||
Integer fromOfficeId = officeHelper.createOffice("01 January 2011");
|
||||
Assert.assertNotNull(fromOfficeId);
|
||||
|
||||
// Creating Savings Account from which the Fund has to be Transferred
|
||||
final Integer fromClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
|
||||
String.valueOf(fromOfficeId));
|
||||
Assert.assertNotNull(fromClientID);
|
||||
|
||||
Account fromTransferAccount = accountHelper.createLiabilityAccount();
|
||||
Assert.assertNotNull(fromTransferAccount);
|
||||
|
||||
Integer fromTransferAccountMappingId = (Integer) accountMappingHelper.createOfficeAccountMapping(fromOfficeId,
|
||||
fromTransferAccount.getAccountID(), CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
Assert.assertNotNull(fromTransferAccountMappingId);
|
||||
|
||||
final Integer loanProductID = createLoanProduct(loanAssetAccount, loanIncomeAccount, loanExpenseAccount, overpaymentAccount);
|
||||
Assert.assertNotNull(loanProductID);
|
||||
|
||||
final Integer loanID = applyForLoanApplication(fromClientID, loanProductID);
|
||||
Assert.assertNotNull(loanID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_APPROVAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
|
||||
final Integer fromSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
|
||||
assetAccount, incomeAccount, expenseAccount, liabilityAccount);
|
||||
Assert.assertNotNull(fromSavingsProductID);
|
||||
|
||||
final Integer fromSavingsID = this.savingsAccountHelper.applyForSavingsApplication(fromClientID, fromSavingsProductID,
|
||||
ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(fromSavingsID);
|
||||
|
||||
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsID);
|
||||
SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap);
|
||||
|
||||
fromSavingsStatusHashMap = this.savingsAccountHelper.approveSavings(fromSavingsID);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(fromSavingsStatusHashMap);
|
||||
|
||||
fromSavingsStatusHashMap = this.savingsAccountHelper.activateSavings(fromSavingsID);
|
||||
SavingsStatusChecker.verifySavingsIsActive(fromSavingsStatusHashMap);
|
||||
|
||||
final HashMap toSavingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(toSavingsID);
|
||||
|
||||
Float fromSavingsBalance = new Float(MINIMUM_OPENING_BALANCE);
|
||||
|
||||
this.accountTransferHelper.accountTransfer(fromClientID, fromSavingsID, fromClientID, loanID, FROM_SAVINGS_ACCOUNT_TYPE,
|
||||
TO_LOAN_ACCOUNT_TYPE, ACCOUNT_TRANSFER_AMOUNT);
|
||||
|
||||
fromSavingsBalance -= TRANSFER_AMOUNT;
|
||||
|
||||
HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsID);
|
||||
|
||||
// Verifying fromSavings Account Balance after Account Transfer
|
||||
assertEquals("Verifying From Savings Account Balance after Account Transfer", fromSavingsBalance,
|
||||
fromSavingsSummaryAfter.get("accountBalance"));
|
||||
|
||||
Float toSavingsBalance = new Float(MINIMUM_OPENING_BALANCE);
|
||||
|
||||
this.accountTransferHelper.accountTransfer(fromClientID, loanID, toClientID, toSavingsID, FROM_LOAN_ACCOUNT_TYPE,
|
||||
TO_SAVINGS_ACCOUNT_TYPE, ACCOUNT_TRANSFER_AMOUNT_ADJUST);
|
||||
|
||||
toSavingsBalance += TRANSFER_AMOUNT_ADJUST;
|
||||
|
||||
HashMap toSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(toSavingsID);
|
||||
|
||||
// Verifying toSavings Account Balance after Account Transfer
|
||||
assertEquals("Verifying From Savings Account Balance after Account Transfer", toSavingsBalance,
|
||||
toSavingsSummaryAfter.get("accountBalance"));
|
||||
|
||||
final JournalEntry[] office1LiabilityEntries = { new JournalEntry(new Float(ACCOUNT_TRANSFER_AMOUNT_ADJUST),
|
||||
JournalEntry.TransactionType.CREDIT) };
|
||||
final JournalEntry[] office2LiabilityEntries = { new JournalEntry(new Float(ACCOUNT_TRANSFER_AMOUNT_ADJUST),
|
||||
JournalEntry.TransactionType.DEBIT) };
|
||||
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(fromTransferAccount, AccountTransferHelper.ACCOUNT_TRANSFER_DATE,
|
||||
office1LiabilityEntries);
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(toTransferAccount, AccountTransferHelper.ACCOUNT_TRANSFER_DATE,
|
||||
office2LiabilityEntries);
|
||||
|
||||
}
|
||||
|
||||
private Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final String minOpenningBalance, final Account... accounts) {
|
||||
System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------");
|
||||
SavingsProductHelper savingsProductHelper = new SavingsProductHelper();
|
||||
final String savingsProductJSON = savingsProductHelper //
|
||||
.withInterestCompoundingPeriodTypeAsDaily() //
|
||||
.withInterestPostingPeriodTypeAsMonthly() //
|
||||
.withInterestCalculationPeriodTypeAsDailyBalance() //
|
||||
.withMinimumOpenningBalance(minOpenningBalance).withAccountingRuleAsCashBased(accounts).build();
|
||||
return SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
private Integer createLoanProduct(final Account... accounts) {
|
||||
System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
|
||||
final String loanProductJSON = new LoanProductTestBuilder() //
|
||||
.withPrincipal("8,000.00") //
|
||||
.withNumberOfRepayments("4") //
|
||||
.withRepaymentAfterEvery("1") //
|
||||
.withRepaymentTypeAsMonth() //
|
||||
.withinterestRatePerPeriod("1") //
|
||||
.withInterestRateFrequencyTypeAsMonths() //
|
||||
.withAmortizationTypeAsEqualInstallments() //
|
||||
.withInterestTypeAsDecliningBalance() //
|
||||
.withAccountingRuleAsCashBased(accounts)//
|
||||
.build(null);
|
||||
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
|
||||
}
|
||||
|
||||
private Integer applyForLoanApplication(final Integer clientID, final Integer loanProductID) {
|
||||
System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
|
||||
final String loanApplicationJSON = new LoanApplicationTestBuilder() //
|
||||
.withPrincipal("8,000.00") //
|
||||
.withLoanTermFrequency("4") //
|
||||
.withLoanTermFrequencyAsMonths() //
|
||||
.withNumberOfRepayments("4") //
|
||||
.withRepaymentEveryAfter("1") //
|
||||
.withRepaymentFrequencyTypeAsMonths() //
|
||||
.withInterestRatePerPeriod("2") //
|
||||
.withAmortizationTypeAsEqualInstallments() //
|
||||
.withInterestTypeAsDecliningBalance() //
|
||||
.withInterestCalculationPeriodTypeSameAsRepaymentPeriod() //
|
||||
.withExpectedDisbursementDate("10 January 2013") //
|
||||
.withSubmittedOnDate("10 January 2013") //
|
||||
.build(clientID.toString(), loanProductID.toString(), null);
|
||||
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
|
||||
}
|
||||
}
|
||||
+595
-8
@@ -1,19 +1,40 @@
|
||||
package org.mifosplatform.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.SchedulerJobHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.accounting.Account;
|
||||
import org.mifosplatform.integrationtests.common.accounting.AccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.accounting.JournalEntry;
|
||||
import org.mifosplatform.integrationtests.common.accounting.JournalEntryHelper;
|
||||
import org.mifosplatform.integrationtests.common.charges.ChargesHelper;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositAccountStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.mifosplatform.integrationtests.common.recurringdeposit.RecurringDepositAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.recurringdeposit.RecurringDepositAccountStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.recurringdeposit.RecurringDepositProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsStatusChecker;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
@@ -21,11 +42,11 @@ import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SuppressWarnings({ "unused", "rawtypes", "unchecked", "static-access" })
|
||||
public class AccountingScenarioIntegrationTest {
|
||||
|
||||
private RequestSpecification requestSpec;
|
||||
private ResponseSpecification responseSpec;
|
||||
private static RequestSpecification requestSpec;
|
||||
private static ResponseSpecification responseSpec;
|
||||
|
||||
private final String DATE_OF_JOINING = "01 January 2011";
|
||||
|
||||
@@ -35,8 +56,19 @@ public class AccountingScenarioIntegrationTest {
|
||||
private final String LP_INTEREST_RATE = "1";
|
||||
private final String EXPECTED_DISBURSAL_DATE = "04 March 2011";
|
||||
private final String LOAN_APPLICATION_SUBMISSION_DATE = "3 March 2011";
|
||||
private final String TRANSACTION_DATE = "01 March 2013";
|
||||
private final String LOAN_TERM_FREQUENCY = "10";
|
||||
private final String INDIVIDUAL_LOAN = "individual";
|
||||
public static final String ACCOUNT_TYPE_INDIVIDUAL = "INDIVIDUAL";
|
||||
public static final String MINIMUM_OPENING_BALANCE = "1000.0";
|
||||
public static final String DEPOSIT_AMOUNT = "7000";
|
||||
public static final String WITHDRAWAL_AMOUNT = "3000";
|
||||
public static final String WITHDRAWAL_AMOUNT_ADJUSTED = "2000";
|
||||
|
||||
Float SP_BALANCE = new Float(MINIMUM_OPENING_BALANCE);
|
||||
Float SP_DEPOSIT_AMOUNT = new Float(DEPOSIT_AMOUNT);
|
||||
Float SP_WITHDRAWAL_AMOUNT = new Float(WITHDRAWAL_AMOUNT);
|
||||
Float SP_WITHDRAWAL_AMOUNT_ADJUSTED = new Float(WITHDRAWAL_AMOUNT_ADJUSTED);
|
||||
|
||||
private final String REPAYMENT_DATE[] = { "", "04 May 2011", "04 July 2011", "04 September 2011", "04 November 2011", "04 January 2012" };
|
||||
private final Float REPAYMENT_AMOUNT[] = { .0f, 2200.0f, 3000.0f, 900.0f, 2000.0f, 2500.0f };
|
||||
@@ -45,6 +77,12 @@ public class AccountingScenarioIntegrationTest {
|
||||
private LoanTransactionHelper loanTransactionHelper;
|
||||
private AccountHelper accountHelper;
|
||||
private JournalEntryHelper journalEntryHelper;
|
||||
private SavingsAccountHelper savingsAccountHelper;
|
||||
private FixedDepositProductHelper fixedDepositProductHelper;
|
||||
private FixedDepositAccountHelper fixedDepositAccountHelper;
|
||||
private RecurringDepositProductHelper recurringDepositProductHelper;
|
||||
private RecurringDepositAccountHelper recurringDepositAccountHelper;
|
||||
private SchedulerJobHelper schedulerJobHelper;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
@@ -56,16 +94,18 @@ public class AccountingScenarioIntegrationTest {
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void checkAccountingFlow() {
|
||||
public void checkUpfrontAccrualAccountingFlow() {
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||
final Account expenseAccount = this.accountHelper.createExpenseAccount();
|
||||
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
||||
|
||||
final Integer loanProductID = createLoanProduct(assetAccount, incomeAccount, expenseAccount, overpaymentAccount);
|
||||
final Integer loanProductID = createLoanProductWithUpfrontAccrualAccountingEnabled(assetAccount, incomeAccount, expenseAccount,
|
||||
overpaymentAccount);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer loanID = applyForLoanApplication(clientID, loanProductID);
|
||||
@@ -160,12 +200,13 @@ public class AccountingScenarioIntegrationTest {
|
||||
System.out.println("Repayment 5 Done ......");
|
||||
}
|
||||
|
||||
private Integer createLoanProduct(final Account... accounts) {
|
||||
private Integer createLoanProductWithUpfrontAccrualAccountingEnabled(final Account... accounts) {
|
||||
System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
|
||||
final String loanProductJSON = new LoanProductTestBuilder().withPrincipal(this.LP_PRINCIPAL.toString()).withRepaymentTypeAsMonth()
|
||||
.withRepaymentAfterEvery(this.LP_REPAYMENT_PERIOD).withNumberOfRepayments(this.LP_REPAYMENTS).withRepaymentTypeAsMonth()
|
||||
.withinterestRatePerPeriod(this.LP_INTEREST_RATE).withInterestRateFrequencyTypeAsMonths()
|
||||
.withAmortizationTypeAsEqualPrincipalPayment().withInterestTypeAsFlat().withAccountingRuleAsAccrualBased(accounts).build();
|
||||
.withAmortizationTypeAsEqualPrincipalPayment().withInterestTypeAsFlat().withAccountingRuleUpfrontAccrual(accounts)
|
||||
.build(null);
|
||||
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
|
||||
}
|
||||
|
||||
@@ -177,7 +218,553 @@ public class AccountingScenarioIntegrationTest {
|
||||
.withInterestRatePerPeriod(this.LP_INTEREST_RATE).withInterestTypeAsFlatBalance()
|
||||
.withAmortizationTypeAsEqualPrincipalPayments().withInterestCalculationPeriodTypeSameAsRepaymentPeriod()
|
||||
.withExpectedDisbursementDate(this.EXPECTED_DISBURSAL_DATE).withSubmittedOnDate(this.LOAN_APPLICATION_SUBMISSION_DATE)
|
||||
.withLoanType(this.INDIVIDUAL_LOAN).build(clientID.toString(), loanProductID.toString());
|
||||
.withLoanType(this.INDIVIDUAL_LOAN).build(clientID.toString(), loanProductID.toString(), null);
|
||||
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void checkAccountingWithSavingsFlow() {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||
final Account expenseAccount = this.accountHelper.createExpenseAccount();
|
||||
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(MINIMUM_OPENING_BALANCE, assetAccount, incomeAccount, expenseAccount,
|
||||
liabilityAccount);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer savingsID = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsID);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsID);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsID);
|
||||
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
|
||||
|
||||
// Checking initial Account entries.
|
||||
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(this.SP_BALANCE, JournalEntry.TransactionType.DEBIT) };
|
||||
final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(this.SP_BALANCE, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.TRANSACTION_DATE, assetAccountInitialEntry);
|
||||
this.journalEntryHelper
|
||||
.checkJournalEntryForLiabilityAccount(liabilityAccount, this.TRANSACTION_DATE, liablilityAccountInitialEntry);
|
||||
|
||||
// First Transaction-Deposit
|
||||
this.savingsAccountHelper.depositToSavingsAccount(savingsID, DEPOSIT_AMOUNT, SavingsAccountHelper.TRANSACTION_DATE,
|
||||
CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
Float balance = SP_BALANCE + SP_DEPOSIT_AMOUNT;
|
||||
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsID);
|
||||
assertEquals("Verifying Balance after Deposit", balance, summary.get("accountBalance"));
|
||||
|
||||
System.out.println("----------------------Verifying Journal Entry after the Transaction Deposit----------------------------");
|
||||
final JournalEntry[] assetAccountFirstTransactionEntry = { new JournalEntry(this.SP_DEPOSIT_AMOUNT,
|
||||
JournalEntry.TransactionType.DEBIT) };
|
||||
final JournalEntry[] liabililityAccountFirstTransactionEntry = { new JournalEntry(this.SP_DEPOSIT_AMOUNT,
|
||||
JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.TRANSACTION_DATE, assetAccountFirstTransactionEntry);
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, this.TRANSACTION_DATE,
|
||||
liabililityAccountFirstTransactionEntry);
|
||||
|
||||
// Second Transaction-Withdrawal
|
||||
this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsID, WITHDRAWAL_AMOUNT, SavingsAccountHelper.TRANSACTION_DATE,
|
||||
CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
balance -= SP_WITHDRAWAL_AMOUNT;
|
||||
summary = this.savingsAccountHelper.getSavingsSummary(savingsID);
|
||||
assertEquals("Verifying Balance after Withdrawal", balance, summary.get("accountBalance"));
|
||||
|
||||
System.out.println("-------------------Verifying Journal Entry after the Transaction Withdrawal----------------------");
|
||||
final JournalEntry[] assetAccountSecondTransactionEntry = { new JournalEntry(this.SP_WITHDRAWAL_AMOUNT,
|
||||
JournalEntry.TransactionType.CREDIT) };
|
||||
final JournalEntry[] liabililityAccountSecondTransactionEntry = { new JournalEntry(this.SP_WITHDRAWAL_AMOUNT,
|
||||
JournalEntry.TransactionType.DEBIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.TRANSACTION_DATE, assetAccountSecondTransactionEntry);
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, this.TRANSACTION_DATE,
|
||||
liabililityAccountSecondTransactionEntry);
|
||||
|
||||
// Third Transaction-Add Charges for Withdrawal Fee
|
||||
final Integer withdrawalChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getSavingsWithdrawalFeeJSON());
|
||||
Assert.assertNotNull(withdrawalChargeId);
|
||||
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsID, withdrawalChargeId);
|
||||
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsID);
|
||||
Assert.assertEquals(1, chargesPendingState.size());
|
||||
HashMap savingsChargeForPay = chargesPendingState.get(0);
|
||||
HashMap paidCharge = this.savingsAccountHelper.getSavingsCharge(savingsID, (Integer) savingsChargeForPay.get("id"));
|
||||
Float chargeAmount = (Float) paidCharge.get("amount");
|
||||
|
||||
// Withdrawal after adding Charge of type Withdrawal Fee
|
||||
this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsID, WITHDRAWAL_AMOUNT_ADJUSTED,
|
||||
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
summary = this.savingsAccountHelper.getSavingsSummary(savingsID);
|
||||
balance = balance - SP_WITHDRAWAL_AMOUNT_ADJUSTED - chargeAmount;
|
||||
|
||||
final JournalEntry[] liabililityAccountThirdTransactionEntry = {
|
||||
new JournalEntry(chargeAmount, JournalEntry.TransactionType.DEBIT),
|
||||
new JournalEntry(this.SP_WITHDRAWAL_AMOUNT_ADJUSTED, JournalEntry.TransactionType.DEBIT) };
|
||||
final JournalEntry[] assetAccountThirdTransactionEntry = { new JournalEntry(this.SP_WITHDRAWAL_AMOUNT_ADJUSTED,
|
||||
JournalEntry.TransactionType.CREDIT) };
|
||||
final JournalEntry[] incomeAccountThirdTransactionEntry = { new JournalEntry(chargeAmount, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.TRANSACTION_DATE, assetAccountThirdTransactionEntry);
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, this.TRANSACTION_DATE,
|
||||
liabililityAccountThirdTransactionEntry);
|
||||
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, this.TRANSACTION_DATE, incomeAccountThirdTransactionEntry);
|
||||
|
||||
// Verifying Balance after applying Charge for Withdrawal Fee
|
||||
assertEquals("Verifying Balance", balance, summary.get("accountBalance"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFixedDepositAccountingFlow() {
|
||||
this.fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.fixedDepositAccountHelper = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
|
||||
DateFormat currentDateFormat = new SimpleDateFormat("dd");
|
||||
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -3);
|
||||
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
|
||||
todaysDate.add(Calendar.YEAR, 10);
|
||||
final String VALID_TO = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||
final Account expenseAccount = this.accountHelper.createExpenseAccount();
|
||||
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
|
||||
|
||||
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, assetAccount, incomeAccount, expenseAccount,
|
||||
liabilityAccount);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, FixedDepositTest.WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
this.responseSpec, fixedDepositAccountId.toString());
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsPending(fixedDepositAccountStatusHashMap);
|
||||
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
|
||||
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
|
||||
|
||||
Float depositAmount = (Float) accountSummary.get("totalDeposits");
|
||||
|
||||
// Checking initial Journal entries after Activation.
|
||||
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) };
|
||||
final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, ACTIVATION_DATE, assetAccountInitialEntry);
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, ACTIVATION_DATE, liablilityAccountInitialEntry);
|
||||
|
||||
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
|
||||
Assert.assertNotNull(transactionIdForPostInterest);
|
||||
|
||||
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
|
||||
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
|
||||
|
||||
// Checking initial Journal entries after Interest Posting.
|
||||
final JournalEntry[] expenseAccountEntry = { new JournalEntry(totalInterestPosted, JournalEntry.TransactionType.DEBIT) };
|
||||
final JournalEntry[] liablilityAccountEntry = { new JournalEntry(totalInterestPosted, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(expenseAccount, INTEREST_POSTED_DATE, expenseAccountEntry);
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, INTEREST_POSTED_DATE, liablilityAccountEntry);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecurringDepositAccountingFlow() {
|
||||
this.recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.recurringDepositAccountHelper = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||
final Account expenseAccount = this.accountHelper.createExpenseAccount();
|
||||
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
|
||||
DateFormat currentDateFormat = new SimpleDateFormat("dd");
|
||||
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -3);
|
||||
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
|
||||
todaysDate.add(Calendar.YEAR, 10);
|
||||
final String VALID_TO = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
Integer recurringDepositProductId = createRecurringDepositProduct(VALID_FROM, VALID_TO, assetAccount, liabilityAccount, incomeAccount, expenseAccount);
|
||||
Assert.assertNotNull(recurringDepositProductId);
|
||||
|
||||
Integer recurringDepositAccountId = applyForRecurringDepositApplication(clientId.toString(), recurringDepositProductId.toString(),
|
||||
VALID_FROM, VALID_TO, SUBMITTED_ON_DATE, RecurringDepositTest.WHOLE_TERM, EXPECTED_FIRST_DEPOSIT_ON_DATE);
|
||||
Assert.assertNotNull(recurringDepositAccountId);
|
||||
|
||||
HashMap recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker.getStatusOfRecurringDepositAccount(
|
||||
this.requestSpec, this.responseSpec, recurringDepositAccountId.toString());
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsPending(recurringDepositAccountStatusHashMap);
|
||||
|
||||
recurringDepositAccountStatusHashMap = this.recurringDepositAccountHelper.approveRecurringDeposit(recurringDepositAccountId,
|
||||
APPROVED_ON_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsApproved(recurringDepositAccountStatusHashMap);
|
||||
|
||||
recurringDepositAccountStatusHashMap = this.recurringDepositAccountHelper.activateRecurringDeposit(recurringDepositAccountId,
|
||||
ACTIVATION_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId);
|
||||
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
|
||||
|
||||
Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId, depositAmount, EXPECTED_FIRST_DEPOSIT_ON_DATE);
|
||||
Assert.assertNotNull(depositTransactionId);
|
||||
|
||||
// Checking initial Journal entries after Activation.
|
||||
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) };
|
||||
final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, EXPECTED_FIRST_DEPOSIT_ON_DATE, assetAccountInitialEntry);
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, EXPECTED_FIRST_DEPOSIT_ON_DATE, liablilityAccountInitialEntry);
|
||||
|
||||
Integer interestPostingTransactionId = this.recurringDepositAccountHelper
|
||||
.postInterestForRecurringDeposit(recurringDepositAccountId);
|
||||
Assert.assertNotNull(interestPostingTransactionId);
|
||||
|
||||
HashMap accountSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
|
||||
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
|
||||
|
||||
// Checking initial Journal entries after Interest Posting.
|
||||
final JournalEntry[] expenseAccountEntry = { new JournalEntry(totalInterestPosted, JournalEntry.TransactionType.DEBIT) };
|
||||
final JournalEntry[] liablilityAccountEntry = { new JournalEntry(totalInterestPosted, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(expenseAccount, INTEREST_POSTED_DATE, expenseAccountEntry);
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, INTEREST_POSTED_DATE, liablilityAccountEntry);
|
||||
|
||||
}
|
||||
|
||||
public static Integer createSavingsProduct(final String minOpenningBalance, final Account... accounts) {
|
||||
System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------");
|
||||
final String savingsProductJSON = new SavingsProductHelper().withInterestCompoundingPeriodTypeAsDaily() //
|
||||
.withInterestPostingPeriodTypeAsQuarterly() //
|
||||
.withInterestCalculationPeriodTypeAsDailyBalance() //
|
||||
.withMinimumOpenningBalance(minOpenningBalance).withAccountingRuleAsCashBased(accounts).build();
|
||||
return SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
private Integer createFixedDepositProduct(final String validFrom, final String validTo, Account... accounts) {
|
||||
System.out.println("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------");
|
||||
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
final String fixedDepositProductJSON = fixedDepositProductHelper //
|
||||
.withAccountingRuleAsCashBased(accounts).build(validFrom, validTo);
|
||||
return FixedDepositProductHelper.createFixedDepositProduct(fixedDepositProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
private Integer applyForFixedDepositApplication(final String clientID, final String productID, final String validFrom,
|
||||
final String validTo, final String submittedOnDate, final String penalInterestType) {
|
||||
System.out.println("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------");
|
||||
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) //
|
||||
.withSubmittedOnDate(submittedOnDate).build(clientID, productID, validFrom, validTo, penalInterestType);
|
||||
return this.fixedDepositAccountHelper
|
||||
.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
|
||||
}
|
||||
|
||||
private Integer createRecurringDepositProduct(final String validFrom, final String validTo, Account... accounts) {
|
||||
System.out.println("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------");
|
||||
RecurringDepositProductHelper recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
final String recurringDepositProductJSON = recurringDepositProductHelper //
|
||||
.withAccountingRuleAsCashBased(accounts)
|
||||
.build(validFrom, validTo);
|
||||
return RecurringDepositProductHelper.createRecurringDepositProduct(recurringDepositProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
private Integer applyForRecurringDepositApplication(final String clientID, final String productID, final String validFrom,
|
||||
final String validTo, final String submittedOnDate, final String penalInterestType, final String expectedFirstDepositOnDate) {
|
||||
System.out.println("--------------------------------APPLYING FOR RECURRING DEPOSIT ACCOUNT --------------------------------");
|
||||
final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec)
|
||||
//
|
||||
.withSubmittedOnDate(submittedOnDate).withExpectedFirstDepositOnDate(expectedFirstDepositOnDate)
|
||||
.build(clientID, productID, validFrom, validTo, penalInterestType);
|
||||
return this.recurringDepositAccountHelper.applyRecurringDepositApplication(recurringDepositApplicationJSON, this.requestSpec,
|
||||
this.responseSpec);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void checkPeriodicAccrualAccountingFlow() {
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||
final Account expenseAccount = this.accountHelper.createExpenseAccount();
|
||||
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
||||
|
||||
final Integer loanProductID = createLoanProductWithPeriodicAccrualAccountingEnabled(assetAccount, incomeAccount, expenseAccount,
|
||||
overpaymentAccount);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer loanID = applyForLoanApplication(clientID, loanProductID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(this.EXPECTED_DISBURSAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(this.EXPECTED_DISBURSAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
// CHECK ACCOUNT ENTRIES
|
||||
System.out.println("Entries ......");
|
||||
final float PRINCIPAL_VALUE_FOR_EACH_PERIOD = 2000.0f;
|
||||
final float TOTAL_INTEREST = 1000.0f;
|
||||
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(this.LP_PRINCIPAL, JournalEntry.TransactionType.CREDIT),
|
||||
new JournalEntry(this.LP_PRINCIPAL, JournalEntry.TransactionType.DEBIT), };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.EXPECTED_DISBURSAL_DATE, assetAccountInitialEntry);
|
||||
|
||||
final String jobName = "Add Accrual Transactions";
|
||||
try {
|
||||
this.schedulerJobHelper.excuteJob(jobName);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// MAKE 1
|
||||
System.out.println("Repayment 1 ......");
|
||||
final float FIRST_INTEREST = 200.0f;
|
||||
final float FIRST_PRINCIPAL = 2000.0f;
|
||||
final float FEE_PORTION = 0.0f;
|
||||
final float PENALTY_PORTION = 0.0f;
|
||||
this.loanTransactionHelper.checkAccrualTransactionForRepayment(getDateAsLocalDate(this.REPAYMENT_DATE[1]), FIRST_INTEREST, FEE_PORTION, PENALTY_PORTION, loanID);
|
||||
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[1], this.REPAYMENT_AMOUNT[1], loanID);
|
||||
float expected_value = this.LP_PRINCIPAL - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
|
||||
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(1, expected_value, loanID);
|
||||
final JournalEntry[] assetAccountFirstEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[1], JournalEntry.TransactionType.DEBIT),
|
||||
new JournalEntry(FIRST_INTEREST, JournalEntry.TransactionType.CREDIT),
|
||||
new JournalEntry(FIRST_PRINCIPAL, JournalEntry.TransactionType.CREDIT), };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[1], assetAccountFirstEntry);
|
||||
System.out.println("Repayment 1 Done......");
|
||||
|
||||
// REPAYMENT 2
|
||||
System.out.println("Repayment 2 ......");
|
||||
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[2], this.REPAYMENT_AMOUNT[2], loanID);
|
||||
final float SECOND_AND_THIRD_INTEREST = 400.0f;
|
||||
final float SECOND_PRINCIPAL = this.REPAYMENT_AMOUNT[2] - SECOND_AND_THIRD_INTEREST;
|
||||
expected_value = expected_value - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
|
||||
this.loanTransactionHelper.checkAccrualTransactionForRepayment(getDateAsLocalDate(this.REPAYMENT_DATE[2]), FIRST_INTEREST, FEE_PORTION, PENALTY_PORTION, loanID);
|
||||
this.loanTransactionHelper.checkAccrualTransactionForRepayment(getDateAsLocalDate(this.REPAYMENT_DATE[3]), FIRST_INTEREST, FEE_PORTION, PENALTY_PORTION, loanID);
|
||||
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(2, expected_value, loanID);
|
||||
final JournalEntry[] assetAccountSecondEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[2], JournalEntry.TransactionType.DEBIT),
|
||||
new JournalEntry(SECOND_AND_THIRD_INTEREST, JournalEntry.TransactionType.CREDIT),
|
||||
new JournalEntry(SECOND_PRINCIPAL, JournalEntry.TransactionType.CREDIT), };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[2], assetAccountSecondEntry);
|
||||
System.out.println("Repayment 2 Done ......");
|
||||
|
||||
// WAIVE INTEREST
|
||||
System.out.println("Waive Interest ......");
|
||||
this.loanTransactionHelper.checkAccrualTransactionForRepayment(getDateAsLocalDate(this.REPAYMENT_DATE[4]), FIRST_INTEREST, FEE_PORTION, PENALTY_PORTION, loanID);
|
||||
this.loanTransactionHelper.checkAccrualTransactionForRepayment(getDateAsLocalDate(this.REPAYMENT_DATE[5]), FIRST_INTEREST, FEE_PORTION, PENALTY_PORTION, loanID);
|
||||
this.loanTransactionHelper.waiveInterest(this.REPAYMENT_DATE[4], this.AMOUNT_TO_BE_WAIVE.toString(), loanID);
|
||||
|
||||
final JournalEntry waivedEntry = new JournalEntry(this.AMOUNT_TO_BE_WAIVE, JournalEntry.TransactionType.CREDIT);
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[4], waivedEntry);
|
||||
|
||||
final JournalEntry expenseJournalEntry = new JournalEntry(this.AMOUNT_TO_BE_WAIVE, JournalEntry.TransactionType.DEBIT);
|
||||
this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, this.REPAYMENT_DATE[4], expenseJournalEntry);
|
||||
System.out.println("Waive Interest Done......");
|
||||
|
||||
// REPAYMENT 3
|
||||
System.out.println("Repayment 3 ......");
|
||||
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[3], this.REPAYMENT_AMOUNT[3], loanID);
|
||||
expected_value = expected_value - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
|
||||
final JournalEntry[] assetAccountThirdEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[3], JournalEntry.TransactionType.DEBIT),
|
||||
new JournalEntry(this.REPAYMENT_AMOUNT[3], JournalEntry.TransactionType.CREDIT) };
|
||||
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(3, expected_value, loanID);
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[3], assetAccountThirdEntry);
|
||||
System.out.println("Repayment 3 Done ......");
|
||||
|
||||
// REPAYMENT 4
|
||||
System.out.println("Repayment 4 ......");
|
||||
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[4], this.REPAYMENT_AMOUNT[4], loanID);
|
||||
expected_value = expected_value - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
|
||||
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(4, expected_value, loanID);
|
||||
final JournalEntry[] assetAccountFourthEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[4], JournalEntry.TransactionType.DEBIT),
|
||||
new JournalEntry(this.REPAYMENT_AMOUNT[4], JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[4], assetAccountFourthEntry);
|
||||
System.out.println("Repayment 4 Done ......");
|
||||
|
||||
// Repayment 5
|
||||
System.out.println("Repayment 5 ......");
|
||||
final JournalEntry[] assetAccountFifthEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[5], JournalEntry.TransactionType.DEBIT),
|
||||
new JournalEntry(this.REPAYMENT_AMOUNT[5], JournalEntry.TransactionType.CREDIT) };
|
||||
expected_value = expected_value - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
|
||||
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[5], this.REPAYMENT_AMOUNT[5], loanID);
|
||||
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(5, expected_value, loanID);
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[5], assetAccountFifthEntry);
|
||||
System.out.println("Repayment 5 Done ......");
|
||||
}
|
||||
|
||||
private Integer createLoanProductWithPeriodicAccrualAccountingEnabled(final Account... accounts) {
|
||||
System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
|
||||
final String loanProductJSON = new LoanProductTestBuilder().withPrincipal(this.LP_PRINCIPAL.toString()).withRepaymentTypeAsMonth()
|
||||
.withRepaymentAfterEvery(this.LP_REPAYMENT_PERIOD).withNumberOfRepayments(this.LP_REPAYMENTS).withRepaymentTypeAsMonth()
|
||||
.withinterestRatePerPeriod(this.LP_INTEREST_RATE).withInterestRateFrequencyTypeAsMonths()
|
||||
.withAmortizationTypeAsEqualPrincipalPayment().withInterestTypeAsFlat().withAccountingRulePeriodicAccrual(accounts)
|
||||
.build(null);
|
||||
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void checkCashBasedAccountingFlow() {
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||
final Account expenseAccount = this.accountHelper.createExpenseAccount();
|
||||
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
||||
|
||||
final Integer loanProductID = createLoanProductWithCashBasedAccountingEnabled(assetAccount, incomeAccount, expenseAccount,
|
||||
overpaymentAccount);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer loanID = applyForLoanApplication(clientID, loanProductID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(this.EXPECTED_DISBURSAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(this.EXPECTED_DISBURSAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
// CHECK ACCOUNT ENTRIES
|
||||
System.out.println("Entries ......");
|
||||
final float PRINCIPAL_VALUE_FOR_EACH_PERIOD = 2000.0f;
|
||||
final float TOTAL_INTEREST = 1000.0f;
|
||||
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(this.LP_PRINCIPAL, JournalEntry.TransactionType.CREDIT),
|
||||
new JournalEntry(this.LP_PRINCIPAL, JournalEntry.TransactionType.DEBIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.EXPECTED_DISBURSAL_DATE, assetAccountInitialEntry);
|
||||
|
||||
// MAKE 1
|
||||
System.out.println("Repayment 1 ......");
|
||||
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[1], this.REPAYMENT_AMOUNT[1], loanID);
|
||||
final float FIRST_INTEREST = 200.0f;
|
||||
final float FIRST_PRINCIPAL = 2000.0f;
|
||||
float expected_value = this.LP_PRINCIPAL - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
|
||||
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(1, expected_value, loanID);
|
||||
final JournalEntry[] assetAccountFirstEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[1], JournalEntry.TransactionType.DEBIT),
|
||||
new JournalEntry(FIRST_PRINCIPAL, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[1], assetAccountFirstEntry);
|
||||
System.out.println("CHECKING INCOME: ******************************************");
|
||||
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, this.REPAYMENT_DATE[1], new JournalEntry(FIRST_INTEREST,
|
||||
JournalEntry.TransactionType.CREDIT));
|
||||
System.out.println("Repayment 1 Done......");
|
||||
|
||||
// REPAYMENT 2
|
||||
System.out.println("Repayment 2 ......");
|
||||
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[2], this.REPAYMENT_AMOUNT[2], loanID);
|
||||
final float SECOND_AND_THIRD_INTEREST = 400.0f;
|
||||
final float SECOND_PRINCIPAL = this.REPAYMENT_AMOUNT[2] - SECOND_AND_THIRD_INTEREST;
|
||||
expected_value = expected_value - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
|
||||
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(2, expected_value, loanID);
|
||||
final JournalEntry[] assetAccountSecondEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[2], JournalEntry.TransactionType.DEBIT),
|
||||
new JournalEntry(SECOND_PRINCIPAL, JournalEntry.TransactionType.CREDIT), };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[2], assetAccountSecondEntry);
|
||||
System.out.println("CHECKING INCOME: ******************************************");
|
||||
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, this.REPAYMENT_DATE[2], new JournalEntry(
|
||||
SECOND_AND_THIRD_INTEREST, JournalEntry.TransactionType.CREDIT));
|
||||
System.out.println("Repayment 2 Done ......");
|
||||
|
||||
// WAIVE INTEREST
|
||||
System.out.println("Waive Interest ......");
|
||||
Integer transactionId = this.loanTransactionHelper.waiveInterestAndReturnTransactionId(this.REPAYMENT_DATE[4], this.AMOUNT_TO_BE_WAIVE.toString(), loanID);
|
||||
// waive of fees and interest are not considered in cash based accounting,
|
||||
this.journalEntryHelper.ensureNoAccountingTransactionsWithTransactionId("L"+transactionId);
|
||||
|
||||
|
||||
|
||||
// REPAYMENT 3
|
||||
System.out.println("Repayment 3 ......");
|
||||
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[3], this.REPAYMENT_AMOUNT[3], loanID);
|
||||
expected_value = expected_value - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
|
||||
final JournalEntry[] assetAccountThirdEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[3], JournalEntry.TransactionType.DEBIT),
|
||||
new JournalEntry(this.REPAYMENT_AMOUNT[3], JournalEntry.TransactionType.CREDIT) };
|
||||
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(3, expected_value, loanID);
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[3], assetAccountThirdEntry);
|
||||
System.out.println("Repayment 3 Done ......");
|
||||
|
||||
// REPAYMENT 4
|
||||
System.out.println("Repayment 4 ......");
|
||||
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[4], this.REPAYMENT_AMOUNT[4], loanID);
|
||||
expected_value = expected_value - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
|
||||
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(4, expected_value, loanID);
|
||||
final JournalEntry[] assetAccountFourthEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[4], JournalEntry.TransactionType.DEBIT),
|
||||
new JournalEntry(this.REPAYMENT_AMOUNT[4], JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[4], assetAccountFourthEntry);
|
||||
System.out.println("Repayment 4 Done ......");
|
||||
|
||||
// Repayment 5
|
||||
System.out.println("Repayment 5 ......");
|
||||
final JournalEntry[] assetAccountFifthEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[5], JournalEntry.TransactionType.DEBIT),
|
||||
new JournalEntry(this.REPAYMENT_AMOUNT[5], JournalEntry.TransactionType.CREDIT) };
|
||||
expected_value = expected_value - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
|
||||
this.loanTransactionHelper.makeRepayment(this.REPAYMENT_DATE[5], this.REPAYMENT_AMOUNT[5], loanID);
|
||||
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(5, expected_value, loanID);
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[5], assetAccountFifthEntry);
|
||||
System.out.println("Repayment 5 Done ......");
|
||||
}
|
||||
|
||||
private Integer createLoanProductWithCashBasedAccountingEnabled(final Account... accounts) {
|
||||
System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
|
||||
final String loanProductJSON = new LoanProductTestBuilder().withPrincipal(this.LP_PRINCIPAL.toString()).withRepaymentTypeAsMonth()
|
||||
.withRepaymentAfterEvery(this.LP_REPAYMENT_PERIOD).withNumberOfRepayments(this.LP_REPAYMENTS).withRepaymentTypeAsMonth()
|
||||
.withinterestRatePerPeriod(this.LP_INTEREST_RATE).withInterestRateFrequencyTypeAsMonths()
|
||||
.withAmortizationTypeAsEqualPrincipalPayment().withInterestTypeAsFlat().withAccountingRuleAsCashBased(accounts)
|
||||
.build(null);
|
||||
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
|
||||
}
|
||||
|
||||
private LocalDate getDateAsLocalDate(String dateAsString) {
|
||||
LocalDate date = null;
|
||||
try {
|
||||
DateFormat df = new SimpleDateFormat("dd MMMM yyyy");
|
||||
date = new LocalDate(df.parse(dateAsString));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return date;
|
||||
}
|
||||
}
|
||||
|
||||
+308
@@ -0,0 +1,308 @@
|
||||
package org.mifosplatform.integrationtests;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.charges.ChargesHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings({ "rawtypes" })
|
||||
public class ChargesTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testChargesForLoans() {
|
||||
|
||||
// Retrieving all Charges
|
||||
ArrayList<HashMap> allChargesData = ChargesHelper.getCharges(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(allChargesData);
|
||||
|
||||
// Testing Creation, Updation and Deletion of Disbursement Charge
|
||||
final Integer disbursementChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getLoanDisbursementJSON());
|
||||
Assert.assertNotNull(disbursementChargeId);
|
||||
|
||||
// Updating Charge Amount
|
||||
HashMap changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, disbursementChargeId,
|
||||
ChargesHelper.getModifyChargeJSON());
|
||||
|
||||
HashMap chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId);
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
|
||||
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, disbursementChargeId,
|
||||
ChargesHelper.getModifyChargeAsPecentageAmountJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId);
|
||||
|
||||
HashMap chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargePaymentMode");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargePaymentMode"));
|
||||
|
||||
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
|
||||
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, disbursementChargeId,
|
||||
ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId);
|
||||
|
||||
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
|
||||
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, disbursementChargeId,
|
||||
ChargesHelper.getModifyChargeAsPercentageInterestJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId);
|
||||
|
||||
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
|
||||
|
||||
Integer chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, disbursementChargeId);
|
||||
Assert.assertEquals("Verifying Charge ID after deletion", disbursementChargeId, chargeIdAfterDeletion);
|
||||
|
||||
// Testing Creation, Updation and Deletion of Specified due date Charge
|
||||
final Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getLoanSpecifiedDueDateJSON());
|
||||
Assert.assertNotNull(specifiedDueDateChargeId);
|
||||
|
||||
// Updating Charge Amount
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
|
||||
ChargesHelper.getModifyChargeJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
|
||||
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
|
||||
ChargesHelper.getModifyChargeAsPecentageAmountJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
|
||||
|
||||
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargePaymentMode");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargePaymentMode"));
|
||||
|
||||
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
|
||||
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
|
||||
ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
|
||||
|
||||
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
|
||||
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
|
||||
ChargesHelper.getModifyChargeAsPercentageInterestJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
|
||||
|
||||
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
|
||||
|
||||
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, specifiedDueDateChargeId);
|
||||
Assert.assertEquals("Verifying Charge ID after deletion", specifiedDueDateChargeId, chargeIdAfterDeletion);
|
||||
|
||||
// Testing Creation, Updation and Deletion of Installment Fee Charge
|
||||
final Integer installmentFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getLoanInstallmentFeeJSON());
|
||||
|
||||
// Updating Charge Amount
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, installmentFeeChargeId,
|
||||
ChargesHelper.getModifyChargeJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId);
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
|
||||
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, installmentFeeChargeId,
|
||||
ChargesHelper.getModifyChargeAsPecentageAmountJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId);
|
||||
|
||||
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargePaymentMode");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargePaymentMode"));
|
||||
|
||||
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
|
||||
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, installmentFeeChargeId,
|
||||
ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId);
|
||||
|
||||
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
|
||||
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, installmentFeeChargeId,
|
||||
ChargesHelper.getModifyChargeAsPercentageInterestJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId);
|
||||
|
||||
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
|
||||
|
||||
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, installmentFeeChargeId);
|
||||
Assert.assertEquals("Verifying Charge ID after deletion", installmentFeeChargeId, chargeIdAfterDeletion);
|
||||
|
||||
// Testing Creation, Updation and Deletion of Overdue Installment Fee
|
||||
// Charge
|
||||
final Integer overdueFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getLoanOverdueFeeJSON());
|
||||
Assert.assertNotNull(overdueFeeChargeId);
|
||||
|
||||
// Updating Charge Amount
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId, ChargesHelper.getModifyChargeJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
|
||||
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId,
|
||||
ChargesHelper.getModifyChargeAsPecentageAmountJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
|
||||
|
||||
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargePaymentMode");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargePaymentMode"));
|
||||
|
||||
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
|
||||
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId,
|
||||
ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
|
||||
|
||||
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
|
||||
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId,
|
||||
ChargesHelper.getModifyChargeAsPercentageInterestJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
|
||||
|
||||
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
|
||||
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId,
|
||||
ChargesHelper.getModifyChargeFeeFrequencyAsYearsJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
|
||||
|
||||
chargeChangedData = (HashMap) chargeDataAfterChanges.get("feeFrequency");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("feeFrequency"));
|
||||
|
||||
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, overdueFeeChargeId);
|
||||
Assert.assertEquals("Verifying Charge ID after deletion", overdueFeeChargeId, chargeIdAfterDeletion);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testChargesForSavings() {
|
||||
|
||||
// Testing Creation, Updation and Deletion of Specified due date Charge
|
||||
final Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getSavingsSpecifiedDueDateJSON());
|
||||
Assert.assertNotNull(specifiedDueDateChargeId);
|
||||
|
||||
// Updating Charge Amount
|
||||
HashMap changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
|
||||
ChargesHelper.getModifyChargeJSON());
|
||||
|
||||
HashMap chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
|
||||
|
||||
Integer chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, specifiedDueDateChargeId);
|
||||
Assert.assertEquals("Verifying Charge ID after deletion", specifiedDueDateChargeId, chargeIdAfterDeletion);
|
||||
|
||||
// Testing Creation, Updation and Deletion of Savings Activation Charge
|
||||
final Integer savingsActivationChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getSavingsActivationFeeJSON());
|
||||
Assert.assertNotNull(savingsActivationChargeId);
|
||||
|
||||
// Updating Charge Amount
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, savingsActivationChargeId,
|
||||
ChargesHelper.getModifyChargeJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, savingsActivationChargeId);
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
|
||||
|
||||
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, savingsActivationChargeId);
|
||||
Assert.assertEquals("Verifying Charge ID after deletion", savingsActivationChargeId, chargeIdAfterDeletion);
|
||||
|
||||
// Testing Creation, Updation and Deletion of Charge for Withdrawal Fee
|
||||
final Integer withdrawalFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getSavingsWithdrawalFeeJSON());
|
||||
Assert.assertNotNull(withdrawalFeeChargeId);
|
||||
|
||||
// Updating Charge-Calculation-Type to Withdrawal-Fee
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, withdrawalFeeChargeId,
|
||||
ChargesHelper.getModifyWithdrawalFeeSavingsChargeJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, withdrawalFeeChargeId);
|
||||
|
||||
HashMap chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
|
||||
|
||||
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, withdrawalFeeChargeId);
|
||||
Assert.assertEquals("Verifying Charge ID after deletion", withdrawalFeeChargeId, chargeIdAfterDeletion);
|
||||
|
||||
// Testing Creation, Updation and Deletion of Charge for Annual Fee
|
||||
final Integer annualFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getSavingsAnnualFeeJSON());
|
||||
Assert.assertNotNull(annualFeeChargeId);
|
||||
|
||||
// Updating Charge Amount
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, annualFeeChargeId, ChargesHelper.getModifyChargeJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, annualFeeChargeId);
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
|
||||
|
||||
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, annualFeeChargeId);
|
||||
Assert.assertEquals("Verifying Charge ID after deletion", annualFeeChargeId, chargeIdAfterDeletion);
|
||||
|
||||
// Testing Creation, Updation and Deletion of Charge for Monthly Fee
|
||||
final Integer monthlyFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getSavingsMonthlyFeeJSON());
|
||||
Assert.assertNotNull(monthlyFeeChargeId);
|
||||
|
||||
// Updating Charge Amount
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, monthlyFeeChargeId, ChargesHelper.getModifyChargeJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, monthlyFeeChargeId);
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
|
||||
|
||||
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, monthlyFeeChargeId);
|
||||
Assert.assertEquals("Verifying Charge ID after deletion", monthlyFeeChargeId, chargeIdAfterDeletion);
|
||||
|
||||
// Testing Creation, Updation and Deletion of Charge for Overdraft Fee
|
||||
final Integer overdraftFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getSavingsOverdraftFeeJSON());
|
||||
Assert.assertNotNull(overdraftFeeChargeId);
|
||||
|
||||
// Updating Charge Amount
|
||||
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdraftFeeChargeId,
|
||||
ChargesHelper.getModifyChargeJSON());
|
||||
|
||||
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdraftFeeChargeId);
|
||||
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
|
||||
|
||||
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, overdraftFeeChargeId);
|
||||
Assert.assertEquals("Verifying Charge ID after deletion", overdraftFeeChargeId, chargeIdAfterDeletion);
|
||||
}
|
||||
}
|
||||
+2651
-9
File diff suppressed because it is too large
Load Diff
+418
@@ -0,0 +1,418 @@
|
||||
package org.mifosplatform.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.charges.ChargesHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsStatusChecker;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
/**
|
||||
* Client Savings Integration Test for checking Savings Application.
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unused" })
|
||||
public class ClientSavingsIntegrationTest {
|
||||
|
||||
public static final String DEPOSIT_AMOUNT = "2000";
|
||||
public static final String WITHDRAW_AMOUNT = "1000";
|
||||
public static final String WITHDRAW_AMOUNT_ADJUSTED = "500";
|
||||
public static final String MINIMUM_OPENING_BALANCE = "1000.0";
|
||||
public static final String ACCOUNT_TYPE_INDIVIDUAL = "INDIVIDUAL";
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private SavingsAccountHelper savingsAccountHelper;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSavingsAccount() {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap modifications = this.savingsAccountHelper.updateSavingsAccount(clientID, savingsProductID, savingsId,
|
||||
ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertTrue(modifications.containsKey("submittedOnDate"));
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
|
||||
|
||||
final HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
this.savingsAccountHelper.calculateInterestForSavings(savingsId);
|
||||
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
assertEquals(summaryBefore, summary);
|
||||
|
||||
this.savingsAccountHelper.postInterestForSavings(savingsId);
|
||||
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
Assert.assertFalse(summaryBefore.equals(summary));
|
||||
|
||||
final Object savingsInterest = this.savingsAccountHelper.getSavingsInterest(savingsId);
|
||||
// verifySavingsInterest(savingsInterest);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSavingsAccount_CLOSE_APPLICATION() {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, null);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.closeSavingsAccount(savingsId);
|
||||
SavingsStatusChecker.verifySavingsAccountIsClosed(savingsStatusHashMap);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testSavingsAccount_DELETE_APPLICATION() {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
SavingsAccountHelper savingsAccountHelperValidationError = new SavingsAccountHelper(this.requestSpec,
|
||||
new ResponseSpecBuilder().build());
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, null);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
List<HashMap> error1 = (List<HashMap>) savingsAccountHelperValidationError.deleteSavingsApplication(savingsId,
|
||||
CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("validation.msg.savingsaccount.delete.not.in.submittedandpendingapproval.state",
|
||||
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.undoApproval(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
this.savingsAccountHelper.deleteSavingsApplication(savingsId, CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
|
||||
List<HashMap> error = savingsAccountHelperValidationError.getSavingsCollectionAttribute(savingsId, CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.saving.account.id.invalid", error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testSavingsAccount_REJECT_APPLICATION() {
|
||||
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
SavingsAccountHelper savingsAccountHelperValidationError = new SavingsAccountHelper(this.requestSpec,
|
||||
new ResponseSpecBuilder().build());
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
List<HashMap> error1 = savingsAccountHelperValidationError.rejectApplicationWithErrorCode(savingsId,
|
||||
SavingsAccountHelper.CREATED_DATE_PLUS_ONE);
|
||||
assertEquals("validation.msg.savingsaccount.reject.not.in.submittedandpendingapproval.state",
|
||||
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.undoApproval(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
error1 = savingsAccountHelperValidationError.rejectApplicationWithErrorCode(savingsId, SavingsAccountHelper.getFutureDate());
|
||||
assertEquals("validation.msg.savingsaccount.reject.cannot.be.a.future.date",
|
||||
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
error1 = savingsAccountHelperValidationError.rejectApplicationWithErrorCode(savingsId, SavingsAccountHelper.CREATED_DATE_MINUS_ONE);
|
||||
assertEquals("validation.msg.savingsaccount.reject.cannot.be.before.submittal.date",
|
||||
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.rejectApplication(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsRejected(savingsStatusHashMap);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSavingsAccount_WITHDRAW_APPLICATION() {
|
||||
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.withdrawApplication(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsWithdrawn(savingsStatusHashMap);
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testSavingsAccountTransactions() {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
SavingsAccountHelper savingsAccountHelperValidationError = new SavingsAccountHelper(this.requestSpec,
|
||||
new ResponseSpecBuilder().build());
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
List<HashMap> error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "100",
|
||||
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.savingsaccount.transaction.account.is.not.active",
|
||||
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
error = (List) savingsAccountHelperValidationError.depositToSavingsAccount(savingsId, "100", SavingsAccountHelper.TRANSACTION_DATE,
|
||||
CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.savingsaccount.transaction.account.is.not.active",
|
||||
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
|
||||
|
||||
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
Float balance = new Float(MINIMUM_OPENING_BALANCE);
|
||||
assertEquals("Verifying opening Balance", balance, summary.get("accountBalance"));
|
||||
|
||||
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
|
||||
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
HashMap depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
|
||||
balance += new Float(DEPOSIT_AMOUNT);
|
||||
assertEquals("Verifying Deposit Amount", new Float(DEPOSIT_AMOUNT), depositTransaction.get("amount"));
|
||||
assertEquals("Verifying Balance after Deposit", balance, depositTransaction.get("runningBalance"));
|
||||
|
||||
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
|
||||
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
HashMap withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
|
||||
balance -= new Float(WITHDRAW_AMOUNT);
|
||||
assertEquals("Verifying Withdrawal Amount", new Float(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"));
|
||||
assertEquals("Verifying Balance after Withdrawal", balance, withdrawTransaction.get("runningBalance"));
|
||||
|
||||
Integer newWithdrawTransactionId = this.savingsAccountHelper.updateSavingsAccountTransaction(savingsId, withdrawTransactionId,
|
||||
WITHDRAW_AMOUNT_ADJUSTED);
|
||||
HashMap newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, newWithdrawTransactionId);
|
||||
balance = balance + new Float(WITHDRAW_AMOUNT) - new Float(WITHDRAW_AMOUNT_ADJUSTED);
|
||||
assertEquals("Verifying adjusted Amount", new Float(WITHDRAW_AMOUNT_ADJUSTED), newWithdrawTransaction.get("amount"));
|
||||
assertEquals("Verifying Balance after adjust", balance, newWithdrawTransaction.get("runningBalance"));
|
||||
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
assertEquals("Verifying Adjusted Balance", balance, summary.get("accountBalance"));
|
||||
withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
|
||||
Assert.assertTrue((Boolean) withdrawTransaction.get("reversed"));
|
||||
|
||||
this.savingsAccountHelper.undoSavingsAccountTransaction(savingsId, newWithdrawTransactionId);
|
||||
newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
|
||||
Assert.assertTrue((Boolean) newWithdrawTransaction.get("reversed"));
|
||||
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
balance += new Float(WITHDRAW_AMOUNT_ADJUSTED);
|
||||
assertEquals("Verifying Balance After Undo Transaction", balance, summary.get("accountBalance"));
|
||||
|
||||
error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "5000",
|
||||
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.savingsaccount.transaction.insufficient.account.balance",
|
||||
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "5000",
|
||||
SavingsAccountHelper.getFutureDate(), CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.savingsaccount.transaction.in.the.future", error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
error = (List) savingsAccountHelperValidationError.depositToSavingsAccount(savingsId, "5000", SavingsAccountHelper.getFutureDate(),
|
||||
CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.savingsaccount.transaction.in.the.future", error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "5000",
|
||||
SavingsAccountHelper.CREATED_DATE_MINUS_ONE, CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.savingsaccount.transaction.before.activation.date",
|
||||
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
error = (List) savingsAccountHelperValidationError.depositToSavingsAccount(savingsId, "5000",
|
||||
SavingsAccountHelper.CREATED_DATE_MINUS_ONE, CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.savingsaccount.transaction.before.activation.date",
|
||||
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testSavingsAccountCharges() {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
final Integer withdrawalChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getSavingsWithdrawalFeeJSON());
|
||||
Assert.assertNotNull(withdrawalChargeId);
|
||||
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, withdrawalChargeId);
|
||||
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertEquals(1, chargesPendingState.size());
|
||||
|
||||
Integer savingsChargeId = (Integer) chargesPendingState.get(0).get("id");
|
||||
HashMap chargeChanges = this.savingsAccountHelper.updateCharges(savingsChargeId, savingsId);
|
||||
Assert.assertTrue(chargeChanges.containsKey("amount"));
|
||||
|
||||
Integer deletedChargeId = this.savingsAccountHelper.deleteCharge(savingsChargeId, savingsId);
|
||||
assertEquals(savingsChargeId, deletedChargeId);
|
||||
|
||||
chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertTrue(chargesPendingState == null || chargesPendingState.size() == 0);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
|
||||
|
||||
final Integer chargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, ChargesHelper.getSavingsAnnualFeeJSON());
|
||||
Assert.assertNotNull(chargeId);
|
||||
|
||||
ArrayList<HashMap> charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertTrue(charges == null || charges.size() == 0);
|
||||
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, chargeId);
|
||||
charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertEquals(1, charges.size());
|
||||
|
||||
HashMap savingsChargeForPay = charges.get(0);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(CommonConstants.dateFormat);
|
||||
Calendar cal = Calendar.getInstance();
|
||||
List dates = (List) savingsChargeForPay.get("dueDate");
|
||||
cal.set(Calendar.YEAR, (Integer) dates.get(0));
|
||||
cal.set(Calendar.MONTH, (Integer) dates.get(1) - 1);
|
||||
cal.set(Calendar.DAY_OF_MONTH, (Integer) dates.get(2));
|
||||
|
||||
this.savingsAccountHelper.payCharge((Integer) savingsChargeForPay.get("id"), savingsId,
|
||||
((Float) savingsChargeForPay.get("amount")).toString(), sdf.format(cal.getTime()));
|
||||
HashMap paidCharge = this.savingsAccountHelper.getSavingsCharge(savingsId, (Integer) savingsChargeForPay.get("id"));
|
||||
assertEquals(savingsChargeForPay.get("amount"), paidCharge.get("amountPaid"));
|
||||
|
||||
final Integer monthlyFeechargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getSavingsMonthlyFeeJSON());
|
||||
Assert.assertNotNull(monthlyFeechargeId);
|
||||
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, monthlyFeechargeId);
|
||||
charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertEquals(2, charges.size());
|
||||
|
||||
HashMap savingsChargeForWaive = charges.get(1);
|
||||
this.savingsAccountHelper.waiveCharge((Integer) savingsChargeForWaive.get("id"), savingsId);
|
||||
HashMap waiveCharge = this.savingsAccountHelper.getSavingsCharge(savingsId, (Integer) savingsChargeForWaive.get("id"));
|
||||
assertEquals(savingsChargeForWaive.get("amount"), waiveCharge.get("amountWaived"));
|
||||
}
|
||||
|
||||
private Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final String minOpenningBalance) {
|
||||
System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------");
|
||||
SavingsProductHelper savingsProductHelper = new SavingsProductHelper();
|
||||
final String savingsProductJSON = savingsProductHelper //
|
||||
.withInterestCompoundingPeriodTypeAsDaily() //
|
||||
.withInterestPostingPeriodTypeAsMonthly() //
|
||||
.withInterestCalculationPeriodTypeAsDailyBalance() //
|
||||
.withMinimumOpenningBalance(minOpenningBalance).build();
|
||||
return SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
/*
|
||||
* private void verifySavingsInterest(final Object savingsInterest) {
|
||||
* System.out.println(
|
||||
* "--------------------VERIFYING THE BALANCE, INTEREST --------------------------"
|
||||
* );
|
||||
*
|
||||
* assertEquals("Verifying Interest Calculation", new Float("238.3399"),
|
||||
* savingsInterest); }
|
||||
*/
|
||||
}
|
||||
+1733
File diff suppressed because it is too large
Load Diff
+119
@@ -0,0 +1,119 @@
|
||||
package org.mifosplatform.integrationtests;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.GlobalConfigurationHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked", "static-access" })
|
||||
public class GlobalConfigurationTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGlobalConfigurations() {
|
||||
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
// Retrieving All Global Configuration details
|
||||
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec,
|
||||
this.responseSpec);
|
||||
Assert.assertNotNull(globalConfig);
|
||||
|
||||
String configName = "penalty-wait-period";
|
||||
for (Integer configIndex = 0; configIndex < (globalConfig.size() - 1); configIndex++) {
|
||||
if (globalConfig.get(configIndex).get("name").equals(configName)) {
|
||||
Integer configId = (Integer) globalConfig.get(configIndex).get("id");
|
||||
Assert.assertNotNull(configId);
|
||||
|
||||
HashMap configDataBefore = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
||||
configId.toString());
|
||||
Assert.assertNotNull(configDataBefore);
|
||||
|
||||
Integer value = (Integer) configDataBefore.get("value") + 1;
|
||||
|
||||
// Updating Value for penalty-wait-period Global Configuration
|
||||
configId = this.globalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
||||
configId.toString(), value.toString());
|
||||
Assert.assertNotNull(configId);
|
||||
|
||||
HashMap configDataAfter = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
||||
configId.toString());
|
||||
|
||||
// Verifying Value for penalty-wait-period after Updation
|
||||
Assert.assertEquals("Verifying Global Config Value after Updation", value, configDataAfter.get("value"));
|
||||
|
||||
// Updating Enabled Flag for penalty-wait-period Global
|
||||
// Configuration
|
||||
Boolean enabled = (Boolean) globalConfig.get(configIndex).get("enabled");
|
||||
|
||||
if (enabled == true) {
|
||||
enabled = false;
|
||||
} else {
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
configId = this.globalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
||||
configId.toString(), enabled);
|
||||
|
||||
configDataAfter = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
||||
configId.toString());
|
||||
|
||||
// Verifying Enabled Flag for penalty-wait-period after Updation
|
||||
Assert.assertEquals("Verifying Enabled Flag Global Config after Updation", enabled, configDataAfter.get("enabled"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGlobalConfigurationIsCacheEnabled() {
|
||||
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
// Retrieving Is Cache Enabled Global Configuration details
|
||||
ArrayList<HashMap> isCacheGlobalConfig = this.globalConfigurationHelper.getGlobalConfigurationIsCacheEnabled(this.requestSpec,
|
||||
this.responseSpec);
|
||||
Assert.assertNotNull(isCacheGlobalConfig);
|
||||
|
||||
for (Integer cacheType = 0; cacheType <= ((isCacheGlobalConfig.size()) - 1); cacheType++) {
|
||||
|
||||
// Retrieving Is Cache Enabled Global Configuration details
|
||||
isCacheGlobalConfig = this.globalConfigurationHelper.getGlobalConfigurationIsCacheEnabled(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(isCacheGlobalConfig);
|
||||
|
||||
HashMap cacheTypeAsHashMap = (HashMap) isCacheGlobalConfig.get(cacheType).get("cacheType");
|
||||
Integer cacheTypeId = (Integer) cacheTypeAsHashMap.get("id");
|
||||
String cacheTypeValue = (String) cacheTypeAsHashMap.get("value");
|
||||
Boolean enabled = (Boolean) isCacheGlobalConfig.get(cacheType).get("enabled");
|
||||
|
||||
if (cacheTypeValue.compareTo("No cache") == 0 && enabled == true) {
|
||||
cacheTypeId += 1;
|
||||
} else if (cacheTypeValue.compareTo("Single node") == 0 && enabled == true) {
|
||||
cacheTypeId -= 1;
|
||||
}
|
||||
|
||||
HashMap changes = this.globalConfigurationHelper.updateIsCacheEnabledForGlobalConfiguration(this.requestSpec,
|
||||
this.responseSpec, cacheTypeId.toString());
|
||||
Assert.assertEquals("Verifying Is Cache Enabled Global Config after Updation", cacheTypeId, changes.get("cacheType"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -66,7 +66,7 @@ public class GroupLoanIntegrationTest {
|
||||
.withInterestRateFrequencyTypeAsMonths() //
|
||||
.withAmortizationTypeAsEqualInstallments() //
|
||||
.withInterestTypeAsDecliningBalance() //
|
||||
.build();
|
||||
.build(null);
|
||||
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ public class GroupLoanIntegrationTest {
|
||||
.withInterestCalculationPeriodTypeSameAsRepaymentPeriod() //
|
||||
.withExpectedDisbursementDate("20 September 2011") //
|
||||
.withSubmittedOnDate("20 September 2011") //
|
||||
.withLoanType("group").build(groupID.toString(), loanProductID.toString());
|
||||
.withLoanType("group").build(groupID.toString(), loanProductID.toString(), null);
|
||||
System.out.println(loanApplicationJSON);
|
||||
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
|
||||
}
|
||||
|
||||
+447
@@ -0,0 +1,447 @@
|
||||
package org.mifosplatform.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.GroupHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.charges.ChargesHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsStatusChecker;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
/**
|
||||
* Group Savings Integration Test for checking Savings Application.
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unused" })
|
||||
public class GroupSavingsIntegrationTest {
|
||||
|
||||
public static final String DEPOSIT_AMOUNT = "2000";
|
||||
public static final String WITHDRAW_AMOUNT = "1000";
|
||||
public static final String WITHDRAW_AMOUNT_ADJUSTED = "500";
|
||||
public static final String MINIMUM_OPENING_BALANCE = "1000.0";
|
||||
public static final String ACCOUNT_TYPE_GROUP = "GROUP";
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private SavingsAccountHelper savingsAccountHelper;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSavingsAccount() {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
|
||||
Assert.assertNotNull(groupID);
|
||||
|
||||
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
|
||||
Assert.assertNotNull(groupID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
|
||||
Assert.assertNotNull(savingsId);
|
||||
|
||||
HashMap modifications = this.savingsAccountHelper.updateSavingsAccount(groupID, savingsProductID, savingsId, ACCOUNT_TYPE_GROUP);
|
||||
Assert.assertTrue(modifications.containsKey("submittedOnDate"));
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
|
||||
|
||||
final HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
this.savingsAccountHelper.calculateInterestForSavings(savingsId);
|
||||
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
assertEquals(summaryBefore, summary);
|
||||
|
||||
this.savingsAccountHelper.postInterestForSavings(savingsId);
|
||||
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
Assert.assertFalse(summaryBefore.equals(summary));
|
||||
|
||||
final Object savingsInterest = this.savingsAccountHelper.getSavingsInterest(savingsId);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSavingsAccount_CLOSE_APPLICATION() {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
|
||||
Assert.assertNotNull(groupID);
|
||||
|
||||
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
|
||||
Assert.assertNotNull(groupID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, null);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
|
||||
Assert.assertNotNull(savingsId);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.closeSavingsAccount(savingsId);
|
||||
SavingsStatusChecker.verifySavingsAccountIsClosed(savingsStatusHashMap);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testSavingsAccount_DELETE_APPLICATION() {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
SavingsAccountHelper savingsAccountHelperValidationError = new SavingsAccountHelper(this.requestSpec,
|
||||
new ResponseSpecBuilder().build());
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
|
||||
Assert.assertNotNull(groupID);
|
||||
|
||||
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
|
||||
Assert.assertNotNull(groupID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, null);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
|
||||
Assert.assertNotNull(savingsId);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
List<HashMap> error1 = (List<HashMap>) savingsAccountHelperValidationError.deleteSavingsApplication(savingsId,
|
||||
CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("validation.msg.savingsaccount.delete.not.in.submittedandpendingapproval.state",
|
||||
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.undoApproval(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
this.savingsAccountHelper.deleteSavingsApplication(savingsId, CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
|
||||
List<HashMap> error = savingsAccountHelperValidationError.getSavingsCollectionAttribute(savingsId, CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.saving.account.id.invalid", error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testSavingsAccount_REJECT_APPLICATION() {
|
||||
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
SavingsAccountHelper savingsAccountHelperValidationError = new SavingsAccountHelper(this.requestSpec,
|
||||
new ResponseSpecBuilder().build());
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
|
||||
Assert.assertNotNull(groupID);
|
||||
|
||||
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
|
||||
Assert.assertNotNull(groupID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
|
||||
Assert.assertNotNull(savingsId);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
List<HashMap> error1 = savingsAccountHelperValidationError.rejectApplicationWithErrorCode(savingsId,
|
||||
SavingsAccountHelper.CREATED_DATE_PLUS_ONE);
|
||||
assertEquals("validation.msg.savingsaccount.reject.not.in.submittedandpendingapproval.state",
|
||||
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.undoApproval(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
error1 = savingsAccountHelperValidationError.rejectApplicationWithErrorCode(savingsId, SavingsAccountHelper.getFutureDate());
|
||||
assertEquals("validation.msg.savingsaccount.reject.cannot.be.a.future.date",
|
||||
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
error1 = savingsAccountHelperValidationError.rejectApplicationWithErrorCode(savingsId, SavingsAccountHelper.CREATED_DATE_MINUS_ONE);
|
||||
assertEquals("validation.msg.savingsaccount.reject.cannot.be.before.submittal.date",
|
||||
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.rejectApplication(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsRejected(savingsStatusHashMap);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSavingsAccount_WITHDRAW_APPLICATION() {
|
||||
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
|
||||
Assert.assertNotNull(groupID);
|
||||
|
||||
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
|
||||
Assert.assertNotNull(groupID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
|
||||
Assert.assertNotNull(savingsId);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.withdrawApplication(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsWithdrawn(savingsStatusHashMap);
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testSavingsAccountTransactions() {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
SavingsAccountHelper savingsAccountHelperValidationError = new SavingsAccountHelper(this.requestSpec,
|
||||
new ResponseSpecBuilder().build());
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
|
||||
Assert.assertNotNull(groupID);
|
||||
|
||||
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
|
||||
Assert.assertNotNull(groupID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
|
||||
Assert.assertNotNull(savingsId);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
List<HashMap> error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "100",
|
||||
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.savingsaccount.transaction.account.is.not.active",
|
||||
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
error = (List) savingsAccountHelperValidationError.depositToSavingsAccount(savingsId, "100", SavingsAccountHelper.TRANSACTION_DATE,
|
||||
CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.savingsaccount.transaction.account.is.not.active",
|
||||
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
|
||||
|
||||
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
Float balance = new Float(MINIMUM_OPENING_BALANCE);
|
||||
assertEquals("Verifying opening Balance", balance, summary.get("accountBalance"));
|
||||
|
||||
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
|
||||
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
HashMap depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
|
||||
balance += new Float(DEPOSIT_AMOUNT);
|
||||
assertEquals("Verifying Deposit Amount", new Float(DEPOSIT_AMOUNT), depositTransaction.get("amount"));
|
||||
assertEquals("Verifying Balance after Deposit", balance, depositTransaction.get("runningBalance"));
|
||||
|
||||
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
|
||||
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
HashMap withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
|
||||
balance -= new Float(WITHDRAW_AMOUNT);
|
||||
assertEquals("Verifying Withdrawal Amount", new Float(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"));
|
||||
assertEquals("Verifying Balance after Withdrawal", balance, withdrawTransaction.get("runningBalance"));
|
||||
|
||||
Integer newWithdrawTransactionId = this.savingsAccountHelper.updateSavingsAccountTransaction(savingsId, withdrawTransactionId,
|
||||
WITHDRAW_AMOUNT_ADJUSTED);
|
||||
HashMap newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, newWithdrawTransactionId);
|
||||
balance = balance + new Float(WITHDRAW_AMOUNT) - new Float(WITHDRAW_AMOUNT_ADJUSTED);
|
||||
assertEquals("Verifying adjusted Amount", new Float(WITHDRAW_AMOUNT_ADJUSTED), newWithdrawTransaction.get("amount"));
|
||||
assertEquals("Verifying Balance after adjust", balance, newWithdrawTransaction.get("runningBalance"));
|
||||
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
assertEquals("Verifying Adjusted Balance", balance, summary.get("accountBalance"));
|
||||
withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
|
||||
Assert.assertTrue((Boolean) withdrawTransaction.get("reversed"));
|
||||
|
||||
this.savingsAccountHelper.undoSavingsAccountTransaction(savingsId, newWithdrawTransactionId);
|
||||
newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
|
||||
Assert.assertTrue((Boolean) newWithdrawTransaction.get("reversed"));
|
||||
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
balance += new Float(WITHDRAW_AMOUNT_ADJUSTED);
|
||||
assertEquals("Verifying Balance After Undo Transaction", balance, summary.get("accountBalance"));
|
||||
|
||||
error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "5000",
|
||||
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.savingsaccount.transaction.insufficient.account.balance",
|
||||
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "5000",
|
||||
SavingsAccountHelper.getFutureDate(), CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.savingsaccount.transaction.in.the.future", error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
error = (List) savingsAccountHelperValidationError.depositToSavingsAccount(savingsId, "5000", SavingsAccountHelper.getFutureDate(),
|
||||
CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.savingsaccount.transaction.in.the.future", error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "5000",
|
||||
SavingsAccountHelper.CREATED_DATE_MINUS_ONE, CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.savingsaccount.transaction.before.activation.date",
|
||||
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
error = (List) savingsAccountHelperValidationError.depositToSavingsAccount(savingsId, "5000",
|
||||
SavingsAccountHelper.CREATED_DATE_MINUS_ONE, CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.savingsaccount.transaction.before.activation.date",
|
||||
error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testSavingsAccountCharges() {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
|
||||
Assert.assertNotNull(groupID);
|
||||
|
||||
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
|
||||
Assert.assertNotNull(groupID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
|
||||
Assert.assertNotNull(savingsId);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
final Integer withdrawalChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getSavingsWithdrawalFeeJSON());
|
||||
Assert.assertNotNull(withdrawalChargeId);
|
||||
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, withdrawalChargeId);
|
||||
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertEquals(1, chargesPendingState.size());
|
||||
|
||||
Integer savingsChargeId = (Integer) chargesPendingState.get(0).get("id");
|
||||
HashMap chargeChanges = this.savingsAccountHelper.updateCharges(savingsChargeId, savingsId);
|
||||
Assert.assertTrue(chargeChanges.containsKey("amount"));
|
||||
|
||||
Integer deletedChargeId = this.savingsAccountHelper.deleteCharge(savingsChargeId, savingsId);
|
||||
assertEquals(savingsChargeId, deletedChargeId);
|
||||
|
||||
chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertTrue(chargesPendingState == null || chargesPendingState.size() == 0);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
|
||||
|
||||
final Integer chargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, ChargesHelper.getSavingsAnnualFeeJSON());
|
||||
Assert.assertNotNull(chargeId);
|
||||
|
||||
ArrayList<HashMap> charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertTrue(charges == null || charges.size() == 0);
|
||||
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, chargeId);
|
||||
charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertEquals(1, charges.size());
|
||||
|
||||
HashMap savingsChargeForPay = charges.get(0);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(CommonConstants.dateFormat);
|
||||
Calendar cal = Calendar.getInstance();
|
||||
List dates = (List) savingsChargeForPay.get("dueDate");
|
||||
cal.set(Calendar.YEAR, (Integer) dates.get(0));
|
||||
cal.set(Calendar.MONTH, (Integer) dates.get(1) - 1);
|
||||
cal.set(Calendar.DAY_OF_MONTH, (Integer) dates.get(2));
|
||||
|
||||
this.savingsAccountHelper.payCharge((Integer) savingsChargeForPay.get("id"), savingsId,
|
||||
((Float) savingsChargeForPay.get("amount")).toString(), sdf.format(cal.getTime()));
|
||||
HashMap paidCharge = this.savingsAccountHelper.getSavingsCharge(savingsId, (Integer) savingsChargeForPay.get("id"));
|
||||
assertEquals(savingsChargeForPay.get("amount"), paidCharge.get("amountPaid"));
|
||||
|
||||
final Integer monthlyFeechargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getSavingsMonthlyFeeJSON());
|
||||
Assert.assertNotNull(monthlyFeechargeId);
|
||||
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, monthlyFeechargeId);
|
||||
charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertEquals(2, charges.size());
|
||||
|
||||
HashMap savingsChargeForWaive = charges.get(1);
|
||||
this.savingsAccountHelper.waiveCharge((Integer) savingsChargeForWaive.get("id"), savingsId);
|
||||
HashMap waiveCharge = this.savingsAccountHelper.getSavingsCharge(savingsId, (Integer) savingsChargeForWaive.get("id"));
|
||||
assertEquals(savingsChargeForWaive.get("amount"), waiveCharge.get("amountWaived"));
|
||||
}
|
||||
|
||||
public static Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final String minOpenningBalance) {
|
||||
System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------");
|
||||
SavingsProductHelper savingsProductHelper = new SavingsProductHelper();
|
||||
final String savingsProductJSON = savingsProductHelper //
|
||||
.withInterestCompoundingPeriodTypeAsDaily() //
|
||||
.withInterestPostingPeriodTypeAsMonthly() //
|
||||
.withInterestCalculationPeriodTypeAsDailyBalance() //
|
||||
.withMinimumOpenningBalance(minOpenningBalance).build();
|
||||
return SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
}
|
||||
+4
-3
@@ -48,8 +48,9 @@ public class GroupTest {
|
||||
groupID = GroupHelper.updateGroup(this.requestSpec, this.responseSpec, updatedGroupName, groupID.toString());
|
||||
GroupHelper.verifyGroupDetails(this.requestSpec, this.responseSpec, groupID, "name", updatedGroupName);
|
||||
|
||||
groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec);
|
||||
GroupHelper.deleteGroup(this.requestSpec, this.responseSpec, groupID.toString());
|
||||
GroupHelper.verifyGroupDeleted(this.requestSpec, this.responseSpec, groupID);
|
||||
// NOTE: removed as consistently provides false positive result on cloudbees server.
|
||||
// groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec);
|
||||
// GroupHelper.deleteGroup(this.requestSpec, this.responseSpec, groupID.toString());
|
||||
// GroupHelper.verifyGroupDeleted(this.requestSpec, this.responseSpec, groupID);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -116,7 +116,7 @@ public class LoanWithWaiveInterestAndWriteOffIntegrationTest {
|
||||
final String loanProductJSON = new LoanProductTestBuilder().withPrincipal(this.LP_PRINCIPAL).withRepaymentTypeAsMonth()
|
||||
.withRepaymentAfterEvery(this.LP_REPAYMENT_PERIOD).withNumberOfRepayments(this.LP_REPAYMENTS).withRepaymentTypeAsMonth()
|
||||
.withinterestRatePerPeriod(this.LP_INTEREST_RATE).withInterestRateFrequencyTypeAsMonths()
|
||||
.withAmortizationTypeAsEqualPrincipalPayment().withInterestTypeAsFlat().build();
|
||||
.withAmortizationTypeAsEqualPrincipalPayment().withInterestTypeAsFlat().build(null);
|
||||
|
||||
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
|
||||
}
|
||||
@@ -129,7 +129,7 @@ public class LoanWithWaiveInterestAndWriteOffIntegrationTest {
|
||||
.withRepaymentFrequencyTypeAsMonths().withInterestRatePerPeriod(this.RATE_OF_INTEREST_PER_PERIOD)
|
||||
.withInterestTypeAsFlatBalance().withAmortizationTypeAsEqualInstallments()
|
||||
.withInterestCalculationPeriodTypeSameAsRepaymentPeriod().withExpectedDisbursementDate(this.EXPECTED_DISBURSAL_DATE)
|
||||
.withSubmittedOnDate(this.LOAN_APPLICATION_SUBMISSION_DATE).build(clientID.toString(), loanProductID.toString());
|
||||
.withSubmittedOnDate(this.LOAN_APPLICATION_SUBMISSION_DATE).build(clientID.toString(), loanProductID.toString(), null);
|
||||
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -37,7 +37,7 @@ public class LoanWithdrawnByApplicantIntegrationTest {
|
||||
@Test
|
||||
public void loanWithdrawnByApplicant() {
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2012");
|
||||
final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder().build());
|
||||
final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder().build(null));
|
||||
final Integer loanID = applyForLoanApplication(clientID, loanProductID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
@@ -53,7 +53,7 @@ public class LoanWithdrawnByApplicantIntegrationTest {
|
||||
final String loanApplication = new LoanApplicationTestBuilder().withPrincipal("5000").withLoanTermFrequency("5")
|
||||
.withLoanTermFrequencyAsMonths().withNumberOfRepayments("5").withRepaymentEveryAfter("1")
|
||||
.withRepaymentFrequencyTypeAsMonths().withInterestRatePerPeriod("2").withExpectedDisbursementDate("04 April 2012")
|
||||
.withSubmittedOnDate("02 April 2012").build(clientID.toString(), loanProductID.toString());
|
||||
.withSubmittedOnDate("02 April 2012").build(clientID.toString(), loanProductID.toString(), null);
|
||||
return this.loanTransactionHelper.getLoanId(loanApplication);
|
||||
}
|
||||
}
|
||||
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
package org.mifosplatform.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.OfficeHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.accounting.Account;
|
||||
import org.mifosplatform.integrationtests.common.accounting.AccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.accounting.OfficeAccountMappingHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class OfficeAccountingMappingsTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testOfficeAccountingMappings() {
|
||||
|
||||
OfficeHelper officeHelper = new OfficeHelper(this.requestSpec, this.responseSpec);
|
||||
Integer officeId = officeHelper.createOffice("01 January 2014");
|
||||
Assert.assertNotNull(officeId);
|
||||
|
||||
Integer officeId2 = officeHelper.createOffice("01 January 2014");
|
||||
Assert.assertNotNull(officeId2);
|
||||
|
||||
AccountHelper accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
Account transferAccount = accountHelper.createLiabilityAccount();
|
||||
Assert.assertNotNull(transferAccount);
|
||||
|
||||
OfficeAccountMappingHelper accountMappingHelper = new OfficeAccountMappingHelper(this.requestSpec,
|
||||
new ResponseSpecBuilder().build());
|
||||
Integer transferAccountMappingId = (Integer) accountMappingHelper.createOfficeAccountMapping(officeId,
|
||||
transferAccount.getAccountID(), CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
Assert.assertNotNull(transferAccountMappingId);
|
||||
|
||||
HashMap mappingDetails = accountMappingHelper.getOfficeAccountMapping(transferAccountMappingId);
|
||||
Assert.assertEquals(officeId, ((HashMap) mappingDetails.get("officeData")).get("id"));
|
||||
Assert.assertEquals(transferAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
|
||||
|
||||
Account transferAccount2 = accountHelper.createLiabilityAccount();
|
||||
Assert.assertNotNull(transferAccount2);
|
||||
|
||||
HashMap changes = (HashMap) accountMappingHelper.updateOfficeAccountMapping(transferAccountMappingId, officeId,
|
||||
transferAccount2.getAccountID(), CommonConstants.RESPONSE_CHANGES);
|
||||
Assert.assertEquals(transferAccount2.getAccountID(), changes.get("liabilityTransferInSuspenseAccountId"));
|
||||
|
||||
mappingDetails = accountMappingHelper.getOfficeAccountMapping(transferAccountMappingId);
|
||||
Assert.assertEquals(officeId, ((HashMap) mappingDetails.get("officeData")).get("id"));
|
||||
Assert.assertEquals(transferAccount2.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
|
||||
|
||||
List<HashMap> error1 = (List<HashMap>) accountMappingHelper.updateOfficeAccountMapping(transferAccountMappingId, officeId2,
|
||||
transferAccount2.getAccountID(), CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.officeToAccountMapping.update.of.officeId.is.not.supported",
|
||||
error1.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
List<HashMap> error2 = (List<HashMap>) accountMappingHelper.createOfficeAccountMapping(officeId, transferAccount.getAccountID(),
|
||||
CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.officeToAccountMapping.exists.for.office", error2.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
Account fundAccount = accountHelper.createAssetAccount();
|
||||
Assert.assertNotNull(fundAccount);
|
||||
|
||||
List<HashMap> error3 = (List<HashMap>) accountMappingHelper.createOfficeAccountMapping(officeId2, fundAccount.getAccountID(),
|
||||
CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.liabilityTransferInSuspenseAccountId.invalid.account.type", error3.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+2104
File diff suppressed because it is too large
Load Diff
+105
@@ -0,0 +1,105 @@
|
||||
package org.mifosplatform.integrationtests;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.SchedulerJobHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked", "static-access" })
|
||||
public class SchedulerJobsTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private ResponseSpecification responseSpecForSchedulerJob;
|
||||
private SchedulerJobHelper schedulerJobHelper;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.requestSpec.header("X-Mifos-Platform-TenantId", "default");
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
this.responseSpecForSchedulerJob = new ResponseSpecBuilder().expectStatusCode(202).build();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSchedulerJobs() throws InterruptedException {
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
// Retrieving Status of Scheduler
|
||||
HashMap schedulerStatus = this.schedulerJobHelper.getSchedulerStatus(this.requestSpec, this.responseSpec);
|
||||
Boolean status = (Boolean) schedulerStatus.get("active");
|
||||
if (status == true) {
|
||||
this.schedulerJobHelper.updateSchedulerStatus(this.requestSpec, this.responseSpecForSchedulerJob, "stop");
|
||||
schedulerStatus = this.schedulerJobHelper.getSchedulerStatus(this.requestSpec, this.responseSpec);
|
||||
// Verifying Status of the Scheduler after updation
|
||||
Assert.assertEquals("Verifying Scheduler Job Status", false, schedulerStatus.get("active"));
|
||||
} else {
|
||||
this.schedulerJobHelper.updateSchedulerStatus(this.requestSpec, this.responseSpecForSchedulerJob, "start");
|
||||
schedulerStatus = this.schedulerJobHelper.getSchedulerStatus(this.requestSpec, this.responseSpec);
|
||||
// Verifying Status of the Scheduler after updation
|
||||
Assert.assertEquals("Verifying Scheduler Job Status", true, schedulerStatus.get("active"));
|
||||
}
|
||||
|
||||
// Retrieving All Scheduler Jobs
|
||||
ArrayList<HashMap> allSchedulerJobsData = this.schedulerJobHelper.getAllSchedulerJobs(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(allSchedulerJobsData);
|
||||
|
||||
for (Integer jobIndex = 0; jobIndex < allSchedulerJobsData.size(); jobIndex++) {
|
||||
|
||||
Integer jobId = (Integer) allSchedulerJobsData.get(jobIndex).get("jobId");
|
||||
|
||||
// Retrieving Scheduler Job by ID
|
||||
HashMap schedulerJob = this.schedulerJobHelper.getSchedulerJobById(this.requestSpec, this.responseSpec, jobId.toString());
|
||||
Assert.assertNotNull(schedulerJob);
|
||||
|
||||
Boolean active = (Boolean) schedulerJob.get("active");
|
||||
|
||||
if (active == true) {
|
||||
active = false;
|
||||
} else {
|
||||
active = true;
|
||||
}
|
||||
|
||||
// Updating Scheduler Job
|
||||
HashMap changes = this.schedulerJobHelper.updateSchedulerJob(this.requestSpec, this.responseSpec, jobId.toString(),
|
||||
active.toString());
|
||||
// Verifying Scheduler Job updation
|
||||
Assert.assertEquals("Verifying Scheduler Job Updation", active, changes.get("active"));
|
||||
|
||||
// Executing Scheduler Job
|
||||
this.schedulerJobHelper.runSchedulerJob(this.requestSpec, jobId.toString());
|
||||
|
||||
// Retrieving Scheduler Job by ID
|
||||
schedulerJob = this.schedulerJobHelper.getSchedulerJobById(this.requestSpec, this.responseSpec, jobId.toString());
|
||||
Assert.assertNotNull(schedulerJob);
|
||||
|
||||
// Waiting for Job to complete
|
||||
while ((Boolean) schedulerJob.get("currentlyRunning") == true) {
|
||||
Thread.sleep(15000);
|
||||
schedulerJob = this.schedulerJobHelper.getSchedulerJobById(this.requestSpec, this.responseSpec, jobId.toString());
|
||||
Assert.assertNotNull(schedulerJob);
|
||||
System.out.println("Job is Still Running");
|
||||
}
|
||||
ArrayList<HashMap> jobHistoryData = this.schedulerJobHelper.getSchedulerJobHistory(this.requestSpec, this.responseSpec,
|
||||
jobId.toString());
|
||||
|
||||
// Verifying the Status of the Recently executed Scheduler Job
|
||||
Assert.assertEquals("Verifying Last Scheduler Job Status", "success",
|
||||
jobHistoryData.get(jobHistoryData.size() - 1).get("status"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+878
@@ -0,0 +1,878 @@
|
||||
package org.mifosplatform.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.GlobalConfigurationHelper;
|
||||
import org.mifosplatform.integrationtests.common.HolidayHelper;
|
||||
import org.mifosplatform.integrationtests.common.SchedulerJobHelper;
|
||||
import org.mifosplatform.integrationtests.common.StandingInstructionsHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.accounting.Account;
|
||||
import org.mifosplatform.integrationtests.common.accounting.AccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.accounting.JournalEntry;
|
||||
import org.mifosplatform.integrationtests.common.accounting.JournalEntryHelper;
|
||||
import org.mifosplatform.integrationtests.common.charges.ChargesHelper;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositAccountStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsStatusChecker;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings({ "unused", "unchecked", "rawtypes", "static-access", "cast" })
|
||||
public class SchedulerJobsTestResults {
|
||||
|
||||
private static final String FROM_ACCOUNT_TYPE_LOAN = "1";
|
||||
private static final String FROM_ACCOUNT_TYPE_SAVINGS = "2";
|
||||
private static final String TO_ACCOUNT_TYPE_LOAN = "1";
|
||||
private static final String TO_ACCOUNT_TYPE_SAVINGS = "2";
|
||||
private final String DATE_OF_JOINING = "01 January 2011";
|
||||
|
||||
private final String TRANSACTION_DATE = "01 March 2013";
|
||||
public static final String ACCOUNT_TYPE_INDIVIDUAL = "INDIVIDUAL";
|
||||
public static final String MINIMUM_OPENING_BALANCE = "1000";
|
||||
|
||||
Float SP_BALANCE = new Float(MINIMUM_OPENING_BALANCE);
|
||||
|
||||
private static ResponseSpecification responseSpec;
|
||||
private static RequestSpecification requestSpec;
|
||||
private ResponseSpecification responseSpecForSchedulerJob;
|
||||
private SchedulerJobHelper schedulerJobHelper;
|
||||
private SavingsAccountHelper savingsAccountHelper;
|
||||
private LoanTransactionHelper loanTransactionHelper;
|
||||
private HolidayHelper holidayHelper;
|
||||
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||
private AccountHelper accountHelper;
|
||||
private JournalEntryHelper journalEntryHelper;
|
||||
private StandingInstructionsHelper standingInstructionsHelper;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.requestSpec.header("X-Mifos-Platform-TenantId", "default");
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
this.responseSpecForSchedulerJob = new ResponseSpecBuilder().expectStatusCode(202).build();
|
||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyAnnualFeeForSavingsJobOutcome() throws InterruptedException {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
|
||||
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID,
|
||||
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
final Integer annualFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getSavingsAnnualFeeJSON());
|
||||
Assert.assertNotNull(annualFeeChargeId);
|
||||
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, annualFeeChargeId);
|
||||
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertEquals(1, chargesPendingState.size());
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
|
||||
|
||||
HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
String JobName = "Apply Annual Fee For Savings";
|
||||
|
||||
this.schedulerJobHelper.excuteJob(JobName);
|
||||
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, annualFeeChargeId);
|
||||
|
||||
Float chargeAmount = (Float) chargeData.get("amount");
|
||||
|
||||
final HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
Assert.assertEquals("Verifying Annual Fee after Running Scheduler Job for Apply Anual Fee", chargeAmount,
|
||||
(Float) summaryAfter.get("totalAnnualFees"));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInterestPostingForSavingsJobOutcome() throws InterruptedException {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
|
||||
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID,
|
||||
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
|
||||
|
||||
final HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
|
||||
String JobName = "Post Interest For Savings";
|
||||
|
||||
this.schedulerJobHelper.excuteJob(JobName);
|
||||
final HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
|
||||
Assert.assertNotSame("Verifying the Balance after running Post Interest for Savings Job", summaryBefore.get("accountBalance"),
|
||||
summaryAfter.get("accountBalance"));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTransferFeeForLoansFromSavingsJobOutcome() throws InterruptedException {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
|
||||
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID,
|
||||
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
|
||||
|
||||
final Integer loanProductID = createLoanProduct(null);
|
||||
Assert.assertNotNull(loanProductID);
|
||||
|
||||
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), savingsId.toString());
|
||||
Assert.assertNotNull(loanID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
|
||||
Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getLoanSpecifiedDueDateWithAccountTransferJSON());
|
||||
Assert.assertNotNull(specifiedDueDateChargeId);
|
||||
|
||||
this.loanTransactionHelper.addChargesForLoan(loanID,
|
||||
LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(specifiedDueDateChargeId.toString()));
|
||||
ArrayList<HashMap> chargesPendingState = this.loanTransactionHelper.getLoanCharges(loanID);
|
||||
Assert.assertEquals(1, chargesPendingState.size());
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(AccountTransferTest.LOAN_DISBURSAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
final HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
|
||||
String JobName = "Transfer Fee For Loans From Savings";
|
||||
this.schedulerJobHelper.excuteJob(JobName);
|
||||
final HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
|
||||
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
|
||||
|
||||
Float chargeAmount = (Float) chargeData.get("amount");
|
||||
|
||||
final Float balance = (Float) summaryBefore.get("accountBalance") - chargeAmount;
|
||||
|
||||
Assert.assertEquals("Verifying the Balance after running Transfer Fee for Loans from Savings", balance,
|
||||
(Float) summaryAfter.get("accountBalance"));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyHolidaysToLoansJobOutcome() throws InterruptedException {
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
this.holidayHelper = new HolidayHelper(this.requestSpec, this.responseSpec);
|
||||
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
Integer holidayId = this.holidayHelper.createHolidays(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(holidayId);
|
||||
|
||||
final Integer loanProductID = createLoanProduct(null);
|
||||
Assert.assertNotNull(loanProductID);
|
||||
|
||||
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
|
||||
Assert.assertNotNull(loanID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(AccountTransferTest.LOAN_DISBURSAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
// Retrieving All Global Configuration details
|
||||
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec,
|
||||
this.responseSpec);
|
||||
Assert.assertNotNull(globalConfig);
|
||||
|
||||
// Updating Value for reschedule-repayments-on-holidays Global
|
||||
// Configuration
|
||||
Integer configId = (Integer) globalConfig.get(3).get("id");
|
||||
Assert.assertNotNull(configId);
|
||||
|
||||
HashMap configData = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
||||
configId.toString());
|
||||
Assert.assertNotNull(configData);
|
||||
|
||||
Boolean enabled = (Boolean) globalConfig.get(3).get("enabled");
|
||||
|
||||
if (enabled == false) {
|
||||
enabled = true;
|
||||
configId = this.globalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
||||
configId.toString(), enabled);
|
||||
}
|
||||
final ArrayList<HashMap> repaymentScheduleDataBeforeJob = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
|
||||
this.responseSpec, loanID);
|
||||
|
||||
holidayId = this.holidayHelper.activateHolidays(this.requestSpec, this.responseSpec, holidayId.toString());
|
||||
Assert.assertNotNull(holidayId);
|
||||
|
||||
String JobName = "Apply Holidays To Loans";
|
||||
|
||||
this.schedulerJobHelper.excuteJob(JobName);
|
||||
final ArrayList<HashMap> repaymentScheduleDataAfterJob = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
|
||||
this.responseSpec, loanID);
|
||||
|
||||
HashMap holidayData = this.holidayHelper.getHolidayById(this.requestSpec, this.responseSpec, holidayId.toString());
|
||||
ArrayList<Integer> repaymentsRescheduledDate = (ArrayList<Integer>) holidayData.get("repaymentsRescheduledTo");
|
||||
|
||||
ArrayList<Integer> rescheduleDateAfter = (ArrayList<Integer>) repaymentScheduleDataAfterJob.get(2).get("fromDate");
|
||||
|
||||
Assert.assertEquals("Verifying Repayment Rescheduled Date after Running Apply Holidays to Loans Scheduler Job",
|
||||
repaymentsRescheduledDate, repaymentsRescheduledDate);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyDueFeeChargesForSavingsJobOutcome() throws InterruptedException {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
|
||||
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID,
|
||||
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
final Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getSavingsSpecifiedDueDateJSON());
|
||||
Assert.assertNotNull(specifiedDueDateChargeId);
|
||||
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, specifiedDueDateChargeId);
|
||||
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertEquals(1, chargesPendingState.size());
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
|
||||
|
||||
HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
|
||||
String JobName = "Pay Due Savings Charges";
|
||||
|
||||
this.schedulerJobHelper.excuteJob(JobName);
|
||||
HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
|
||||
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
|
||||
|
||||
Float chargeAmount = (Float) chargeData.get("amount");
|
||||
|
||||
final Float balance = (Float) summaryBefore.get("accountBalance") - chargeAmount;
|
||||
|
||||
Assert.assertEquals("Verifying the Balance after running Pay due Savings Charges", balance,
|
||||
(Float) summaryAfter.get("accountBalance"));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateAccountingRunningBalancesJobOutcome() throws InterruptedException {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||
final Account expenseAccount = this.accountHelper.createExpenseAccount();
|
||||
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
|
||||
|
||||
final Integer accountID = assetAccount.getAccountID();
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(MINIMUM_OPENING_BALANCE, assetAccount, incomeAccount, expenseAccount,
|
||||
liabilityAccount);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer savingsID = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsID);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsID);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsID);
|
||||
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
|
||||
|
||||
// Checking initial Account entries.
|
||||
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(this.SP_BALANCE, JournalEntry.TransactionType.DEBIT) };
|
||||
final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(this.SP_BALANCE, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.TRANSACTION_DATE, assetAccountInitialEntry);
|
||||
this.journalEntryHelper
|
||||
.checkJournalEntryForLiabilityAccount(liabilityAccount, this.TRANSACTION_DATE, liablilityAccountInitialEntry);
|
||||
|
||||
String JobName = "Update Accounting Running Balances";
|
||||
|
||||
this.schedulerJobHelper.excuteJob(JobName);
|
||||
final HashMap runningBalanceAfter = this.accountHelper.getAccountingWithRunningBalanceById(accountID.toString());
|
||||
|
||||
final Integer INT_BALANCE = new Integer(MINIMUM_OPENING_BALANCE);
|
||||
|
||||
Assert.assertEquals("Verifying Account Running Balance after running Update Accounting Running Balances Scheduler Job",
|
||||
INT_BALANCE, runningBalanceAfter.get("organizationRunningBalance"));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateLoanArrearsAgingJobOutcome() throws InterruptedException {
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
final Integer loanProductID = createLoanProduct(null);
|
||||
Assert.assertNotNull(loanProductID);
|
||||
|
||||
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
|
||||
Assert.assertNotNull(loanID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(AccountTransferTest.LOAN_DISBURSAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
String JobName = "Update Loan Arrears Ageing";
|
||||
|
||||
this.schedulerJobHelper.excuteJob(JobName);
|
||||
HashMap loanSummaryData = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
|
||||
|
||||
Float totalLoanArrearsAging = (Float) loanSummaryData.get("principalOverdue") + (Float) loanSummaryData.get("interestOverdue");
|
||||
|
||||
Assert.assertEquals("Verifying Arrears Aging after Running Update Loan Arrears Aging Scheduler Job", totalLoanArrearsAging,
|
||||
loanSummaryData.get("totalOverdue"));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateLoanPaidInAdvanceJobOutcome() throws InterruptedException {
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
|
||||
|
||||
Calendar todayDate = Calendar.getInstance();
|
||||
final String currentDate = dateFormat.format(todayDate.getTime());
|
||||
|
||||
todayDate.add(Calendar.MONTH, -1);
|
||||
final String LOAN_DISBURSEMENT_DATE = dateFormat.format(todayDate.getTime());
|
||||
|
||||
todayDate = Calendar.getInstance();
|
||||
todayDate.add(Calendar.DATE, -5);
|
||||
final String LOAN_FIRST_REPAYMENT_DATE = dateFormat.format(todayDate.getTime());
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
final Integer loanProductID = createLoanProduct(null);
|
||||
Assert.assertNotNull(loanProductID);
|
||||
|
||||
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
|
||||
Assert.assertNotNull(loanID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSEMENT_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
ArrayList<HashMap> loanScheduleBefore = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec,
|
||||
loanID);
|
||||
|
||||
Float totalDueForCurrentPeriod = (Float) loanScheduleBefore.get(1).get("totalDueForPeriod");
|
||||
|
||||
this.loanTransactionHelper.makeRepayment(LOAN_FIRST_REPAYMENT_DATE, totalDueForCurrentPeriod, loanID);
|
||||
|
||||
HashMap loanSummary = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
|
||||
|
||||
String JobName = "Update Loan Paid In Advance";
|
||||
this.schedulerJobHelper.excuteJob(JobName);
|
||||
// Retrieving Loan Repayment Schedule after the successful
|
||||
// completion of
|
||||
// Update Loan Paid in Advance Scheduler Job
|
||||
ArrayList<HashMap> loanScheduleAfter = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec,
|
||||
loanID);
|
||||
|
||||
loanSummary = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
|
||||
|
||||
Float totalPaidInAdvance = (Float) loanScheduleAfter.get(1).get("totalPaidInAdvanceForPeriod");
|
||||
|
||||
Assert.assertEquals("Verifying Loan Repayment in Advance after Running Update Loan Paid in Advance Scheduler Job",
|
||||
totalDueForCurrentPeriod, totalPaidInAdvance);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateLoanSummaryJobOutcome() throws InterruptedException {
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
|
||||
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
final String currentDate = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
final String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.DATE, -5);
|
||||
final String LOAN_FIRST_REPAYMENT_DATE = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
final Integer loanProductID = createLoanProduct(null);
|
||||
Assert.assertNotNull(loanProductID);
|
||||
|
||||
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
|
||||
Assert.assertNotNull(loanID);
|
||||
|
||||
Integer disburseChargeId = ChargesHelper
|
||||
.createCharges(this.requestSpec, this.responseSpec, ChargesHelper.getLoanDisbursementJSON());
|
||||
Assert.assertNotNull(disburseChargeId);
|
||||
|
||||
this.loanTransactionHelper.addChargesForLoan(loanID,
|
||||
LoanTransactionHelper.getDisbursementChargesForLoanAsJSON(disburseChargeId.toString()));
|
||||
ArrayList<HashMap> chargesPendingState = this.loanTransactionHelper.getLoanCharges(loanID);
|
||||
Assert.assertEquals(1, chargesPendingState.size());
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSEMENT_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
HashMap loanSummaryBefore = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
|
||||
|
||||
String JobName = "Update loan Summary";
|
||||
this.schedulerJobHelper.excuteJob(JobName);
|
||||
Float expectedSummaryAfterJob = (Float) loanSummaryBefore.get("totalExpectedRepayment")
|
||||
- (Float) loanSummaryBefore.get("feeChargesPaid");
|
||||
HashMap loanSummaryAfter = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
|
||||
Assert.assertEquals("Verifying Loan Summary after Running Update Loan Summary Scheduler Job", expectedSummaryAfterJob,
|
||||
(Float) loanSummaryAfter.get("totalExpectedRepayment"));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExecuteStandingInstructionsJobOutcome() throws InterruptedException {
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.standingInstructionsHelper = new StandingInstructionsHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
|
||||
DateFormat monthDayFormat = new SimpleDateFormat("dd MMMM");
|
||||
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
|
||||
|
||||
todaysDate.add(Calendar.YEAR, 1);
|
||||
final String VALID_TO = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
|
||||
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer fromSavingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID,
|
||||
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap);
|
||||
|
||||
fromSavingsStatusHashMap = this.savingsAccountHelper.approveSavings(fromSavingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(fromSavingsStatusHashMap);
|
||||
|
||||
fromSavingsStatusHashMap = this.savingsAccountHelper.activateSavings(fromSavingsId);
|
||||
SavingsStatusChecker.verifySavingsIsActive(fromSavingsStatusHashMap);
|
||||
|
||||
final Integer toSavingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID,
|
||||
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap toSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, toSavingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(toSavingsStatusHashMap);
|
||||
|
||||
toSavingsStatusHashMap = this.savingsAccountHelper.approveSavings(toSavingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(toSavingsStatusHashMap);
|
||||
|
||||
toSavingsStatusHashMap = this.savingsAccountHelper.activateSavings(toSavingsId);
|
||||
SavingsStatusChecker.verifySavingsIsActive(toSavingsStatusHashMap);
|
||||
|
||||
HashMap fromSavingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(fromSavingsId);
|
||||
Float fromSavingsBalanceBefore = (Float) fromSavingsSummaryBefore.get("accountBalance");
|
||||
|
||||
HashMap toSavingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(toSavingsId);
|
||||
Float toSavingsBalanceBefore = (Float) toSavingsSummaryBefore.get("accountBalance");
|
||||
|
||||
Integer standingInstructionId = this.standingInstructionsHelper.createStandingInstruction(clientID.toString(),
|
||||
fromSavingsId.toString(), toSavingsId.toString(), FROM_ACCOUNT_TYPE_SAVINGS, TO_ACCOUNT_TYPE_SAVINGS, VALID_FROM, VALID_TO,
|
||||
MONTH_DAY);
|
||||
Assert.assertNotNull(standingInstructionId);
|
||||
|
||||
String JobName = "Execute Standing Instruction";
|
||||
this.schedulerJobHelper.excuteJob(JobName);
|
||||
HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsId);
|
||||
Float fromSavingsBalanceAfter = (Float) fromSavingsSummaryAfter.get("accountBalance");
|
||||
|
||||
HashMap toSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(toSavingsId);
|
||||
Float toSavingsBalanceAfter = (Float) toSavingsSummaryAfter.get("accountBalance");
|
||||
|
||||
final HashMap standingInstructionData = this.standingInstructionsHelper
|
||||
.getStandingInstructionById(standingInstructionId.toString());
|
||||
Float expectedFromSavingsBalance = fromSavingsBalanceBefore - (Float) standingInstructionData.get("amount");
|
||||
Float expectedToSavingsBalance = toSavingsBalanceBefore + (Float) standingInstructionData.get("amount");
|
||||
|
||||
Assert.assertEquals("Verifying From Savings Balance after Successful completion of Scheduler Job", expectedFromSavingsBalance,
|
||||
fromSavingsBalanceAfter);
|
||||
Assert.assertEquals("Verifying To Savings Balance after Successful completion of Scheduler Job", expectedToSavingsBalance,
|
||||
toSavingsBalanceAfter);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyPenaltyForOverdueLoansJobOutcome() throws InterruptedException {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
Integer overdueFeeChargeId = ChargesHelper
|
||||
.createCharges(this.requestSpec, this.responseSpec, ChargesHelper.getLoanOverdueFeeJSON());
|
||||
Assert.assertNotNull(overdueFeeChargeId);
|
||||
|
||||
final Integer loanProductID = createLoanProduct(overdueFeeChargeId.toString());
|
||||
Assert.assertNotNull(loanProductID);
|
||||
|
||||
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
|
||||
Assert.assertNotNull(loanID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(AccountTransferTest.LOAN_APPROVAL_DATE_PLUS_ONE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
ArrayList<HashMap> repaymentScheduleDataBefore = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
|
||||
this.responseSpec, loanID);
|
||||
|
||||
String JobName = "Apply penalty to overdue loans";
|
||||
this.schedulerJobHelper.excuteJob(JobName);
|
||||
|
||||
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
|
||||
|
||||
Float chargeAmount = (Float) chargeData.get("amount");
|
||||
|
||||
ArrayList<HashMap> repaymentScheduleDataAfter = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
|
||||
this.responseSpec, loanID);
|
||||
|
||||
Assert.assertEquals("Verifying From Penalty Charges due fot first Repayment after Successful completion of Scheduler Job",
|
||||
chargeAmount, (Float) repaymentScheduleDataAfter.get(1).get("penaltyChargesDue"));
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.undoDisbursal(loanID);
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateOverdueDaysForNPA() throws InterruptedException {
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientID);
|
||||
|
||||
final Integer loanProductID = createLoanProduct(null);
|
||||
Assert.assertNotNull(loanProductID);
|
||||
|
||||
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
|
||||
Assert.assertNotNull(loanID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(AccountTransferTest.LOAN_DISBURSAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
final Boolean isNPABefore = (Boolean) this.loanTransactionHelper.getLoanDetail(requestSpec, responseSpec, loanID, "isNPA");
|
||||
Assert.assertFalse(isNPABefore);
|
||||
// Integer jobId = (Integer) allSchedulerJobsData.get(1).get("jobId");
|
||||
String JobName = "Update Non Performing Assets";
|
||||
this.schedulerJobHelper.excuteJob(JobName);
|
||||
final Boolean isNPAAfter = (Boolean) this.loanTransactionHelper.getLoanDetail(requestSpec, responseSpec, loanID, "isNPA");
|
||||
Assert.assertTrue(isNPAAfter);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInterestTransferForSavings() throws InterruptedException {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
|
||||
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
AccountHelper accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
FixedDepositAccountHelper fixedDepositAccountHelper = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
|
||||
DateFormat monthDayFormat = new SimpleDateFormat("dd MMM");
|
||||
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -3);
|
||||
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
|
||||
todaysDate.add(Calendar.YEAR, 10);
|
||||
final String VALID_TO = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -2);
|
||||
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
|
||||
todaysDate.add(Calendar.MONTH, 1);
|
||||
final String WHOLE_TERM = "1";
|
||||
|
||||
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
Float balance = new Float(MINIMUM_OPENING_BALANCE) + new Float(FixedDepositAccountHelper.depositAmount);
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, String.valueOf(balance));
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientId, savingsProductID,
|
||||
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(savingsId);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
|
||||
HashMap summary = savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
assertEquals("Verifying opening Balance", balance, summary.get("accountBalance"));
|
||||
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, savingsId.toString(), true, fixedDepositAccountHelper);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
this.responseSpec, fixedDepositAccountId.toString());
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsPending(fixedDepositAccountStatusHashMap);
|
||||
|
||||
fixedDepositAccountStatusHashMap = fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
|
||||
|
||||
fixedDepositAccountStatusHashMap = fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
|
||||
summary = savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
balance = new Float(MINIMUM_OPENING_BALANCE);
|
||||
assertEquals("Verifying Balance", balance, summary.get("accountBalance"));
|
||||
|
||||
fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositSummary = savingsAccountHelper.getSavingsSummary(fixedDepositAccountId);
|
||||
Float interestPosted = (Float) fixedDepositSummary.get("accountBalance") - new Float(FixedDepositAccountHelper.depositAmount);
|
||||
|
||||
String JobName = "Transfer Interest To Savings";
|
||||
this.schedulerJobHelper.excuteJob(JobName);
|
||||
fixedDepositSummary = savingsAccountHelper.getSavingsSummary(fixedDepositAccountId);
|
||||
assertEquals("Verifying opening Balance", new Float(FixedDepositAccountHelper.depositAmount),
|
||||
fixedDepositSummary.get("accountBalance"));
|
||||
|
||||
summary = savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
balance = new Float(MINIMUM_OPENING_BALANCE) + interestPosted;
|
||||
validateNumberForEqualExcludePrecission(String.valueOf(balance), String.valueOf(summary.get("accountBalance")));
|
||||
}
|
||||
|
||||
private Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final String minOpenningBalance) {
|
||||
System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------");
|
||||
SavingsProductHelper savingsProductHelper = new SavingsProductHelper();
|
||||
final String savingsProductJSON = savingsProductHelper //
|
||||
.withInterestCompoundingPeriodTypeAsDaily() //
|
||||
.withInterestPostingPeriodTypeAsMonthly() //
|
||||
.withInterestCalculationPeriodTypeAsDailyBalance() //
|
||||
.withMinimumOpenningBalance(minOpenningBalance).build();
|
||||
return SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
private static Integer createSavingsProduct(final String minOpenningBalance, final Account... accounts) {
|
||||
System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------");
|
||||
final String savingsProductJSON = new SavingsProductHelper().withInterestCompoundingPeriodTypeAsDaily() //
|
||||
.withInterestPostingPeriodTypeAsQuarterly() //
|
||||
.withInterestCalculationPeriodTypeAsDailyBalance() //
|
||||
.withMinimumOpenningBalance(minOpenningBalance).withAccountingRuleAsCashBased(accounts).build();
|
||||
return SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
private Integer createLoanProduct(final String chargeId) {
|
||||
System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
|
||||
final String loanProductJSON = new LoanProductTestBuilder() //
|
||||
.withPrincipal("15,000.00") //
|
||||
.withNumberOfRepayments("4") //
|
||||
.withRepaymentAfterEvery("1") //
|
||||
.withRepaymentTypeAsMonth() //
|
||||
.withinterestRatePerPeriod("1") //
|
||||
.withInterestRateFrequencyTypeAsMonths() //
|
||||
.withAmortizationTypeAsEqualInstallments() //
|
||||
.withInterestTypeAsDecliningBalance() //
|
||||
.build(chargeId);
|
||||
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
|
||||
}
|
||||
|
||||
private Integer applyForLoanApplication(final String clientID, final String loanProductID, final String savingsID) {
|
||||
System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
|
||||
final String loanApplicationJSON = new LoanApplicationTestBuilder() //
|
||||
.withPrincipal("15,000.00") //
|
||||
.withLoanTermFrequency("4") //
|
||||
.withLoanTermFrequencyAsMonths() //
|
||||
.withNumberOfRepayments("4") //
|
||||
.withRepaymentEveryAfter("1") //
|
||||
.withRepaymentFrequencyTypeAsMonths() //
|
||||
.withInterestRatePerPeriod("2") //
|
||||
.withAmortizationTypeAsEqualInstallments() //
|
||||
.withInterestTypeAsDecliningBalance() //
|
||||
.withInterestCalculationPeriodTypeSameAsRepaymentPeriod() //
|
||||
.withExpectedDisbursementDate("10 January 2013") //
|
||||
.withSubmittedOnDate("10 January 2013") //
|
||||
.build(clientID, loanProductID, savingsID);
|
||||
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
|
||||
}
|
||||
|
||||
private Integer createFixedDepositProduct(final String validFrom, final String validTo, Account... accounts) {
|
||||
System.out.println("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------");
|
||||
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
final String fixedDepositProductJSON = fixedDepositProductHelper //
|
||||
// .withAccountingRuleAsCashBased(accounts)
|
||||
.build(validFrom, validTo);
|
||||
return FixedDepositProductHelper.createFixedDepositProduct(fixedDepositProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
private Integer applyForFixedDepositApplication(final String clientID, final String productID, final String validFrom,
|
||||
final String validTo, final String submittedOnDate, final String penalInterestType, String savingsId,
|
||||
final boolean transferInterest, final FixedDepositAccountHelper fixedDepositAccountHelper) {
|
||||
System.out.println("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------");
|
||||
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec)
|
||||
//
|
||||
.withSubmittedOnDate(submittedOnDate).withSavings(savingsId).transferInterest(true)
|
||||
.withLockinPeriodFrequency("1", FixedDepositAccountHelper.DAYS)
|
||||
.build(clientID, productID, validFrom, validTo, penalInterestType);
|
||||
return fixedDepositAccountHelper.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
|
||||
}
|
||||
|
||||
public void validateNumberForEqualExcludePrecission(String val, String val2) {
|
||||
DecimalFormat twoDForm = new DecimalFormat("#");
|
||||
Assert.assertTrue(new Float(twoDForm.format(new Float(val))).compareTo(new Float(twoDForm.format(new Float(val2)))) == 0);
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package org.mifosplatform.integrationtests;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
/**
|
||||
* Client Loan Integration Test for checking Loan Application Repayment
|
||||
* Schedule.
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public class SurveyIntegrationTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private LoanTransactionHelper loanTransactionHelper;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
}
|
||||
|
||||
}
|
||||
+359
@@ -0,0 +1,359 @@
|
||||
package org.mifosplatform.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.system.CodeHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
/**
|
||||
* Test for creating, updating, deleting codes and code values
|
||||
*
|
||||
*/
|
||||
public class SystemCodeTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private ResponseSpecification generalResponseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(
|
||||
ContentType.JSON).build();
|
||||
this.requestSpec
|
||||
.header("Authorization",
|
||||
"Basic "
|
||||
+ Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200)
|
||||
.build();
|
||||
|
||||
this.generalResponseSpec = new ResponseSpecBuilder().build();
|
||||
|
||||
}
|
||||
|
||||
// @Ignore()
|
||||
@Test
|
||||
// scenario 57, 58, 59, 60
|
||||
public void testCreateCode() {
|
||||
final String codeName = "Client Marital Status";
|
||||
|
||||
final Integer createResponseId = (Integer) CodeHelper.createCode(
|
||||
this.requestSpec, this.responseSpec, codeName,
|
||||
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
|
||||
|
||||
// verify code created
|
||||
final HashMap newCodeAttributes = (HashMap) CodeHelper.getCodeById(
|
||||
this.requestSpec, this.responseSpec, createResponseId, "");
|
||||
|
||||
Assert.assertNotNull(newCodeAttributes);
|
||||
assertEquals("Verify value of codeId", createResponseId,
|
||||
newCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME));
|
||||
|
||||
assertEquals("Verify code name", codeName,
|
||||
newCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME));
|
||||
assertEquals("Verify system defined is false", false,
|
||||
newCodeAttributes
|
||||
.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME));
|
||||
|
||||
// update code
|
||||
final HashMap updateChangeResponse = (HashMap) CodeHelper.updateCode(
|
||||
this.requestSpec, this.responseSpec, createResponseId, codeName
|
||||
+ "(CHANGE)", "changes");
|
||||
|
||||
assertEquals("Verify code name updated", codeName + "(CHANGE)",
|
||||
updateChangeResponse.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME));
|
||||
|
||||
// delete code
|
||||
final Integer deleteResponseId = (Integer) CodeHelper.deleteCodeById(
|
||||
this.requestSpec, this.responseSpec, createResponseId,
|
||||
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
|
||||
assertEquals("Verify code deleted", createResponseId, deleteResponseId);
|
||||
|
||||
// verify code deleted
|
||||
final HashMap deletedCodeValues = (HashMap) CodeHelper.getCodeById(
|
||||
this.requestSpec, this.generalResponseSpec, deleteResponseId,
|
||||
"");
|
||||
|
||||
Assert.assertNotNull(deletedCodeValues);
|
||||
assertNull("Verify value of codeId",
|
||||
deletedCodeValues.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME));
|
||||
|
||||
assertNull("Verify code name",
|
||||
deletedCodeValues.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME));
|
||||
assertNull("Verify system defined is false",
|
||||
deletedCodeValues
|
||||
.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME));
|
||||
}
|
||||
|
||||
// @Ignore()
|
||||
@Test
|
||||
// scenario 57, 60
|
||||
public void testPreventCreateDuplicateCode() {
|
||||
final String codeName = "Client Marital Status";
|
||||
|
||||
// create code
|
||||
final Integer createResponseId = (Integer) CodeHelper.createCode(
|
||||
this.requestSpec, this.responseSpec, codeName,
|
||||
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
|
||||
|
||||
// verify code created
|
||||
final HashMap newCodeAttributes = (HashMap) CodeHelper.getCodeById(
|
||||
this.requestSpec, this.responseSpec, createResponseId, "");
|
||||
|
||||
Assert.assertNotNull(newCodeAttributes);
|
||||
assertEquals("Verify value of codeId", createResponseId,
|
||||
newCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME));
|
||||
|
||||
assertEquals("Verify code name", codeName,
|
||||
newCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME));
|
||||
assertEquals("Verify system defined is false", false,
|
||||
newCodeAttributes
|
||||
.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME));
|
||||
|
||||
// try to create duplicate-- should fail
|
||||
final List<HashMap> error = (List) CodeHelper.createCode(
|
||||
this.requestSpec, this.generalResponseSpec, codeName,
|
||||
CommonConstants.RESPONSE_ERROR);
|
||||
|
||||
assertEquals("Verify duplication error",
|
||||
"error.msg.code.duplicate.name",
|
||||
error.get(0).get("userMessageGlobalisationCode"));
|
||||
|
||||
// delete code that was just created
|
||||
|
||||
final Integer deleteResponseId = (Integer) CodeHelper.deleteCodeById(
|
||||
this.requestSpec, this.responseSpec, createResponseId,
|
||||
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
|
||||
assertEquals("Verify code deleted", createResponseId, deleteResponseId);
|
||||
|
||||
// verify code deleted
|
||||
final HashMap deletedCodeAttributes = (HashMap) CodeHelper.getCodeById(
|
||||
this.requestSpec, this.generalResponseSpec, deleteResponseId,
|
||||
"");
|
||||
|
||||
Assert.assertNotNull(deletedCodeAttributes);
|
||||
assertNull("Verify value of codeId",
|
||||
deletedCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME));
|
||||
|
||||
assertNull("Verify code name",
|
||||
deletedCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME));
|
||||
assertNull("Verify system defined is false",
|
||||
deletedCodeAttributes
|
||||
.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME));
|
||||
|
||||
}
|
||||
|
||||
// @Ignore
|
||||
@Test
|
||||
public void testUpdateDeleteSystemDefinedCode() {
|
||||
|
||||
// get any systemDefined code
|
||||
final HashMap systemDefinedCode = (HashMap) CodeHelper
|
||||
.getSystemDefinedCodes(this.requestSpec, this.responseSpec);
|
||||
|
||||
// delete system-defined code should fail
|
||||
final List<HashMap> error = (List) CodeHelper.deleteCodeById(
|
||||
this.requestSpec, this.generalResponseSpec,
|
||||
(Integer) systemDefinedCode
|
||||
.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME),
|
||||
CommonConstants.RESPONSE_ERROR);
|
||||
|
||||
assertEquals("Cannot delete system-defined code",
|
||||
"error.msg.code.systemdefined",
|
||||
error.get(0).get("userMessageGlobalisationCode"));
|
||||
|
||||
// update system-defined code should fail
|
||||
final List<HashMap> updateError = (List) CodeHelper.updateCode(
|
||||
this.requestSpec, this.generalResponseSpec,
|
||||
(Integer) systemDefinedCode
|
||||
.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME),
|
||||
systemDefinedCode.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME)
|
||||
+ "CHANGE", CommonConstants.RESPONSE_ERROR);
|
||||
|
||||
assertEquals("Cannot update system-defined code",
|
||||
"error.msg.code.systemdefined",
|
||||
error.get(0).get("userMessageGlobalisationCode"));
|
||||
|
||||
}
|
||||
|
||||
// @Ignore
|
||||
@Test
|
||||
public void testCodeValuesNotAssignedToTable() {
|
||||
|
||||
final String codeName = "Client Marital Status";
|
||||
|
||||
final String codeValue1 = "Married";
|
||||
final String codeValue2 = "Unmarried";
|
||||
|
||||
final int codeValue1Position = 1;
|
||||
final int codeValue2Position = 2;
|
||||
|
||||
// create code
|
||||
final Integer createCodeResponseId = (Integer) CodeHelper.createCode(
|
||||
this.requestSpec, this.responseSpec, codeName,
|
||||
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
|
||||
|
||||
// create first code value
|
||||
final Integer createCodeValueResponseId1 = (Integer) CodeHelper
|
||||
.createCodeValue(this.requestSpec, this.responseSpec,
|
||||
createCodeResponseId, codeValue1, codeValue1Position,
|
||||
CodeHelper.SUBRESPONSE_ID_ATTRIBUTE_NAME);
|
||||
|
||||
// create second code value
|
||||
final Integer createCodeValueResponseId2 = (Integer) CodeHelper
|
||||
.createCodeValue(this.requestSpec, this.responseSpec,
|
||||
createCodeResponseId, codeValue2, codeValue2Position,
|
||||
CodeHelper.SUBRESPONSE_ID_ATTRIBUTE_NAME);
|
||||
|
||||
// verify two code values created
|
||||
|
||||
final List<HashMap> codeValuesList = (List) CodeHelper
|
||||
.getCodeValuesForCode(this.requestSpec, this.responseSpec,
|
||||
createCodeResponseId, "");
|
||||
|
||||
assertEquals("Number of code values returned matches number created",
|
||||
2, codeValuesList.size());
|
||||
|
||||
// verify values of first code value
|
||||
final HashMap codeValuesAttributes1 = (HashMap) CodeHelper
|
||||
.getCodeValueById(this.requestSpec, this.responseSpec,
|
||||
createCodeResponseId, createCodeValueResponseId1, "");
|
||||
|
||||
Assert.assertNotNull(codeValuesAttributes1);
|
||||
assertEquals("Verify value of codeValueId", createCodeValueResponseId1,
|
||||
codeValuesAttributes1
|
||||
.get(CodeHelper.CODE_VALUE_ID_ATTRIBUTE_NAME));
|
||||
|
||||
assertEquals("Verify value of code name", codeValue1,
|
||||
codeValuesAttributes1
|
||||
.get(CodeHelper.CODE_VALUE_NAME_ATTRIBUTE_NAME));
|
||||
|
||||
assertEquals("Verify position of code value", codeValue1Position,
|
||||
codeValuesAttributes1
|
||||
.get(CodeHelper.CODE_VALUE_POSITION_ATTRIBUTE_NAME));
|
||||
|
||||
// verify values of second code value
|
||||
final HashMap codeValuesAttributes2 = (HashMap) CodeHelper
|
||||
.getCodeValueById(this.requestSpec, this.responseSpec,
|
||||
createCodeResponseId, createCodeValueResponseId2, "");
|
||||
|
||||
Assert.assertNotNull(codeValuesAttributes2);
|
||||
assertEquals("Verify value of codeValueId", createCodeValueResponseId2,
|
||||
codeValuesAttributes2
|
||||
.get(CodeHelper.CODE_VALUE_ID_ATTRIBUTE_NAME));
|
||||
|
||||
assertEquals("Verify value of code name", codeValue2,
|
||||
codeValuesAttributes2
|
||||
.get(CodeHelper.CODE_VALUE_NAME_ATTRIBUTE_NAME));
|
||||
|
||||
assertEquals("Verify position of code value", codeValue2Position,
|
||||
codeValuesAttributes2
|
||||
.get(CodeHelper.CODE_VALUE_POSITION_ATTRIBUTE_NAME));
|
||||
|
||||
// update code value 1
|
||||
|
||||
final HashMap codeValueChanges = (HashMap) CodeHelper
|
||||
.updateCodeValue(this.requestSpec, this.responseSpec,
|
||||
createCodeResponseId, createCodeValueResponseId1,
|
||||
codeValue1 + "CHANGE", 4, "changes");
|
||||
|
||||
assertEquals("Verify changed code value name",
|
||||
codeValueChanges.get("name"), codeValue1 + "CHANGE");
|
||||
|
||||
// delete code value
|
||||
final Integer deletedCodeValueResponseId1 = (Integer) CodeHelper
|
||||
.deleteCodeValueById(this.requestSpec,
|
||||
this.generalResponseSpec, createCodeResponseId,
|
||||
createCodeValueResponseId1,
|
||||
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
|
||||
|
||||
// Verify code value deleted
|
||||
|
||||
final HashMap deletedCodeValueAttributes1 = (HashMap) CodeHelper
|
||||
.getCodeValueById(this.requestSpec, this.generalResponseSpec,
|
||||
createCodeResponseId, deletedCodeValueResponseId1, "");
|
||||
|
||||
// Assert.assertNotNull(deletedCodeValueAttributes1);
|
||||
assertNull("Verify value of codeValueId",
|
||||
deletedCodeValueAttributes1
|
||||
.get(CodeHelper.CODE_VALUE_ID_ATTRIBUTE_NAME));
|
||||
|
||||
assertNull("Verify value of code name",
|
||||
deletedCodeValueAttributes1
|
||||
.get(CodeHelper.CODE_VALUE_NAME_ATTRIBUTE_NAME));
|
||||
|
||||
assertNull("Verify position of code value",
|
||||
deletedCodeValueAttributes1
|
||||
.get(CodeHelper.CODE_VALUE_POSITION_ATTRIBUTE_NAME));
|
||||
|
||||
final List<HashMap> deletedCodeValuesList = (List) CodeHelper
|
||||
.getCodeValuesForCode(this.requestSpec, this.responseSpec,
|
||||
createCodeResponseId, "");
|
||||
|
||||
assertEquals("Number of code values is 1", 1,
|
||||
deletedCodeValuesList.size());
|
||||
|
||||
// delete code, remaining code values automatically deleted
|
||||
|
||||
final Integer deleteCodeResponseId = (Integer) CodeHelper
|
||||
.deleteCodeById(this.requestSpec, this.generalResponseSpec,
|
||||
createCodeResponseId,
|
||||
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
|
||||
assertEquals("Verify code deleted", createCodeResponseId,
|
||||
deleteCodeResponseId);
|
||||
|
||||
// verify code deleted
|
||||
final HashMap deletedCodeAttributes = (HashMap) CodeHelper.getCodeById(
|
||||
this.requestSpec, this.generalResponseSpec,
|
||||
createCodeResponseId, "");
|
||||
|
||||
Assert.assertNotNull(deletedCodeAttributes);
|
||||
assertNull("Verify value of codeId is null",
|
||||
deletedCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME));
|
||||
|
||||
assertNull("Verify code name is null",
|
||||
deletedCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME));
|
||||
assertNull("Verify system defined is null",
|
||||
deletedCodeAttributes
|
||||
.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME));
|
||||
|
||||
// Verify remaining code value deleted
|
||||
final HashMap deletedCodeValues2 = (HashMap) CodeHelper
|
||||
.getCodeValueById(this.requestSpec, this.generalResponseSpec,
|
||||
createCodeResponseId, createCodeValueResponseId2, "");
|
||||
|
||||
assertNull("Verify value of codeValueId is null",
|
||||
deletedCodeValues2.get(CodeHelper.CODE_VALUE_ID_ATTRIBUTE_NAME));
|
||||
|
||||
assertNull("Verify value of code name is null",
|
||||
deletedCodeValues2
|
||||
.get(CodeHelper.CODE_VALUE_NAME_ATTRIBUTE_NAME));
|
||||
|
||||
assertNull("Verify position of code value null",
|
||||
deletedCodeValues2
|
||||
.get(CodeHelper.CODE_VALUE_POSITION_ATTRIBUTE_NAME));
|
||||
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
public void testCodeValuesAssignedToTable() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+12
-10
@@ -18,15 +18,21 @@ public class ClientHelper {
|
||||
|
||||
public static Integer createClient(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final String activationDate) {
|
||||
System.out.println("---------------------------------CREATING A CLIENT---------------------------------------------");
|
||||
return Utils.performServerPost(requestSpec, responseSpec, CREATE_CLIENT_URL, getTestClientAsJSON(activationDate), "clientId");
|
||||
return createClient(requestSpec, responseSpec, activationDate, "1");
|
||||
}
|
||||
|
||||
public static String getTestClientAsJSON(final String dateOfJoining) {
|
||||
public static Integer createClient(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final String activationDate, final String officeId) {
|
||||
System.out.println("---------------------------------CREATING A CLIENT---------------------------------------------");
|
||||
return Utils.performServerPost(requestSpec, responseSpec, CREATE_CLIENT_URL, getTestClientAsJSON(activationDate, officeId),
|
||||
"clientId");
|
||||
}
|
||||
|
||||
public static String getTestClientAsJSON(final String dateOfJoining, final String officeId) {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
map.put("officeId", "1");
|
||||
map.put("firstname", randomNameGenerator("Client_FirstName_", 5));
|
||||
map.put("lastname", randomNameGenerator("Client_LastName_", 4));
|
||||
map.put("officeId", officeId);
|
||||
map.put("firstname", Utils.randomNameGenerator("Client_FirstName_", 5));
|
||||
map.put("lastname", Utils.randomNameGenerator("Client_LastName_", 4));
|
||||
map.put("externalId", randomIDGenerator("ID_", 7));
|
||||
map.put("dateFormat", "dd MMMM yyyy");
|
||||
map.put("locale", "en");
|
||||
@@ -44,10 +50,6 @@ public class ClientHelper {
|
||||
assertEquals("ERROR IN CREATING THE CLIENT", generatedClientID, responseClientID);
|
||||
}
|
||||
|
||||
public static String randomNameGenerator(final String prefix, final int lenOfRandomSuffix) {
|
||||
return Utils.randomStringGenerator(prefix, lenOfRandomSuffix);
|
||||
}
|
||||
|
||||
private static String randomIDGenerator(final String prefix, final int lenOfRandomSuffix) {
|
||||
return Utils.randomStringGenerator(prefix, lenOfRandomSuffix, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
}
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package org.mifosplatform.integrationtests.common;
|
||||
|
||||
|
||||
public interface CommonConstants {
|
||||
|
||||
public final static String locale = "en";
|
||||
public static final String dateFormat = "dd MMMM yyyy";
|
||||
public static final String RESPONSE_RESOURCE_ID = "resourceId";
|
||||
public static final String RESPONSE_CHANGES = "changes";
|
||||
public static final String RESPONSE_ERROR = "errors";
|
||||
public static final String RESPONSE_ERROR_MESSAGE_CODE = "userMessageGlobalisationCode";
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
package org.mifosplatform.integrationtests.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings({ "unused", "rawtypes" })
|
||||
public class GlobalConfigurationHelper {
|
||||
|
||||
private final RequestSpecification requestSpec;
|
||||
private final ResponseSpecification responseSpec;
|
||||
|
||||
public GlobalConfigurationHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
|
||||
this.requestSpec = requestSpec;
|
||||
this.responseSpec = responseSpec;
|
||||
}
|
||||
|
||||
public static ArrayList getAllGlobalConfigurations(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
|
||||
final String GET_ALL_GLOBAL_CONFIG_URL = "/mifosng-provider/api/v1/configurations?tenantIdentifier=default";
|
||||
System.out.println("------------------------ RETRIEVING ALL GLOBAL CONFIGURATIONS -------------------------");
|
||||
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_ALL_GLOBAL_CONFIG_URL, "");
|
||||
return (ArrayList) response.get("globalConfiguration");
|
||||
}
|
||||
|
||||
public static HashMap getGlobalConfigurationById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final String configId) {
|
||||
final String GET_GLOBAL_CONFIG_BY_ID_URL = "/mifosng-provider/api/v1/configurations/" + configId + "?tenantIdentifier=default";
|
||||
System.out.println("------------------------ RETRIEVING GLOBAL CONFIGURATION BY ID -------------------------");
|
||||
return Utils.performServerGet(requestSpec, responseSpec, GET_GLOBAL_CONFIG_BY_ID_URL, "");
|
||||
}
|
||||
|
||||
public static Integer updateValueForGlobalConfiguration(final RequestSpecification requestSpec,
|
||||
final ResponseSpecification responseSpec, final String configId, final String value) {
|
||||
final String GLOBAL_CONFIG_UPDATE_URL = "/mifosng-provider/api/v1/configurations/" + configId + "?tenantIdentifier=default";
|
||||
System.out.println("---------------------------------UPDATE VALUE FOR GLOBAL CONFIG---------------------------------------------");
|
||||
return Utils.performServerPut(requestSpec, responseSpec, GLOBAL_CONFIG_UPDATE_URL, updateGlobalConfigUpdateValueAsJSON(value),
|
||||
"resourceId");
|
||||
}
|
||||
|
||||
public static Integer updateEnabledFlagForGlobalConfiguration(final RequestSpecification requestSpec,
|
||||
final ResponseSpecification responseSpec, final String configId, final Boolean enabled) {
|
||||
final String GLOBAL_CONFIG_UPDATE_URL = "/mifosng-provider/api/v1/configurations/" + configId + "?tenantIdentifier=default";
|
||||
System.out
|
||||
.println("---------------------------------UPDATE GLOBAL CONFIG FOR ENABLED FLAG---------------------------------------------");
|
||||
return Utils.performServerPut(requestSpec, responseSpec, GLOBAL_CONFIG_UPDATE_URL,
|
||||
updateGlobalConfigUpdateEnabledFlagAsJSON(enabled), "resourceId");
|
||||
}
|
||||
|
||||
public static ArrayList getGlobalConfigurationIsCacheEnabled(final RequestSpecification requestSpec,
|
||||
final ResponseSpecification responseSpec) {
|
||||
final String GET_IS_CACHE_GLOBAL_CONFIG_URL = "/mifosng-provider/api/v1/caches?tenantIdentifier=default";
|
||||
System.out.println("------------------------ RETRIEVING IS CACHE ENABLED GLOBAL CONFIGURATION -------------------------");
|
||||
final ArrayList<HashMap> response = Utils.performServerGet(requestSpec, responseSpec, GET_IS_CACHE_GLOBAL_CONFIG_URL, "");
|
||||
return response;
|
||||
}
|
||||
|
||||
public static HashMap updateIsCacheEnabledForGlobalConfiguration(final RequestSpecification requestSpec,
|
||||
final ResponseSpecification responseSpec, final String cacheType) {
|
||||
final String IS_CACHE_GLOBAL_CONFIG_UPDATE_URL = "/mifosng-provider/api/v1/caches?tenantIdentifier=default";
|
||||
System.out.println("------------------UPDATE GLOBAL CONFIG FOR IS CACHE ENABLED----------------------");
|
||||
return Utils.performServerPut(requestSpec, responseSpec, IS_CACHE_GLOBAL_CONFIG_UPDATE_URL,
|
||||
updateIsCacheEnabledGlobalConfigUpdateAsJSON(cacheType), "changes");
|
||||
}
|
||||
|
||||
public static String updateGlobalConfigUpdateValueAsJSON(final String value) {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
map.put("value", value);
|
||||
System.out.println("map : " + map);
|
||||
return new Gson().toJson(map);
|
||||
}
|
||||
|
||||
public static String updateGlobalConfigUpdateEnabledFlagAsJSON(final Boolean enabled) {
|
||||
final HashMap<String, Boolean> map = new HashMap<String, Boolean>();
|
||||
map.put("enabled", enabled);
|
||||
System.out.println("map : " + map);
|
||||
return new Gson().toJson(map);
|
||||
}
|
||||
|
||||
public static String updateIsCacheEnabledGlobalConfigUpdateAsJSON(final String cacheType) {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
map.put("cacheType", cacheType);
|
||||
System.out.println("map : " + map);
|
||||
return new Gson().toJson(map);
|
||||
}
|
||||
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
package org.mifosplatform.integrationtests.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jayway.restassured.specification.RequestSender;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings({ "unused", "rawtypes" })
|
||||
public class HolidayHelper {
|
||||
|
||||
private static final String HOLIDAYS_URL = "/mifosng-provider/api/v1/holidays";
|
||||
private static final String CREATE_HOLIDAY_URL = HOLIDAYS_URL + "?" + Utils.TENANT_IDENTIFIER;
|
||||
|
||||
private static final String OFFICE_ID = "1";
|
||||
|
||||
private final RequestSpecification requestSpec;
|
||||
private final ResponseSpecification responseSpec;
|
||||
|
||||
public HolidayHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
|
||||
this.requestSpec = requestSpec;
|
||||
this.responseSpec = responseSpec;
|
||||
}
|
||||
|
||||
public static String getCreateHolidayDataAsJSON() {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
List<HashMap<String, String>> offices = new ArrayList<HashMap<String, String>>();
|
||||
HashMap<String, String> officeMap = new HashMap<String, String>();
|
||||
officeMap.put("officeId", OFFICE_ID);
|
||||
offices.add(officeMap);
|
||||
|
||||
map.put("offices", offices);
|
||||
map.put("locale", "en");
|
||||
map.put("dateFormat", "dd MMMM yyyy");
|
||||
map.put("name", Utils.randomNameGenerator("HOLIDAY_", 5));
|
||||
map.put("fromDate", "01 April 2013");
|
||||
map.put("toDate", "01 April 2013");
|
||||
map.put("repaymentsRescheduledTo", "08 April 2013");
|
||||
|
||||
String HolidayCreateJson = new Gson().toJson(map);
|
||||
System.out.println(HolidayCreateJson);
|
||||
return HolidayCreateJson;
|
||||
}
|
||||
|
||||
public static String getActivateHolidayDataAsJSON() {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
String activateHoliday = new Gson().toJson(map);
|
||||
System.out.println(activateHoliday);
|
||||
return activateHoliday;
|
||||
}
|
||||
|
||||
public static Integer createHolidays(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
|
||||
return Utils.performServerPost(requestSpec, responseSpec, CREATE_HOLIDAY_URL, getCreateHolidayDataAsJSON(), "resourceId");
|
||||
}
|
||||
|
||||
public static Integer activateHolidays(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String holidayID) {
|
||||
final String ACTIVATE_HOLIDAY_URL = HOLIDAYS_URL + "/" + holidayID + "?command=activate";
|
||||
return Utils.performServerPost(requestSpec, responseSpec, ACTIVATE_HOLIDAY_URL, getActivateHolidayDataAsJSON(), "resourceId");
|
||||
}
|
||||
|
||||
public static HashMap getHolidayById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final String holidayID) {
|
||||
final String GET_HOLIDAY_BY_ID_URL = HOLIDAYS_URL + "/" + holidayID + "?tenantIdentifier=default";
|
||||
System.out.println("------------------------ RETRIEVING HOLIDAY BY ID -------------------------");
|
||||
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_HOLIDAY_BY_ID_URL, "");
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package org.mifosplatform.integrationtests.common;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
|
||||
public class OfficeHelper {
|
||||
|
||||
private static final String OFFICE_URL = "/mifosng-provider/api/v1/offices";
|
||||
private final RequestSpecification requestSpec;
|
||||
private final ResponseSpecification responseSpec;
|
||||
|
||||
public OfficeHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
|
||||
this.requestSpec = requestSpec;
|
||||
this.responseSpec = responseSpec;
|
||||
}
|
||||
|
||||
public Integer createOffice(final String openingDate) {
|
||||
String json = getAsJSON(openingDate);
|
||||
return Utils.performServerPost(this.requestSpec, this.responseSpec, OFFICE_URL + "?" + Utils.TENANT_IDENTIFIER, json,
|
||||
CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
}
|
||||
|
||||
|
||||
public static String getAsJSON(final String openingDate) {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
map.put("parentId", "1");
|
||||
map.put("name", Utils.randomNameGenerator("Office_", 4));
|
||||
map.put("dateFormat", "dd MMMM yyyy");
|
||||
map.put("locale", "en");
|
||||
map.put("openingDate", openingDate);
|
||||
System.out.println("map : " + map);
|
||||
return new Gson().toJson(map);
|
||||
}
|
||||
}
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
package org.mifosplatform.integrationtests.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
|
||||
import org.junit.Assert;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings({ "unused", "rawtypes", "unchecked" })
|
||||
public class SchedulerJobHelper {
|
||||
|
||||
private final RequestSpecification requestSpec;
|
||||
private final ResponseSpecification responseSpec;
|
||||
|
||||
public SchedulerJobHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
|
||||
this.requestSpec = requestSpec;
|
||||
this.responseSpec = responseSpec;
|
||||
}
|
||||
|
||||
public static ArrayList getAllSchedulerJobs(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
|
||||
final String GET_ALL_SCHEDULER_JOBS_URL = "/mifosng-provider/api/v1/jobs?tenantIdentifier=default";
|
||||
System.out.println("------------------------ RETRIEVING ALL SCHEDULER JOBS -------------------------");
|
||||
final ArrayList response = Utils.performServerGet(requestSpec, responseSpec, GET_ALL_SCHEDULER_JOBS_URL, "");
|
||||
return response;
|
||||
}
|
||||
|
||||
public static HashMap getSchedulerJobById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final String jobId) {
|
||||
final String GET_SCHEDULER_JOB_BY_ID_URL = "/mifosng-provider/api/v1/jobs/" + jobId + "?tenantIdentifier=default";
|
||||
System.out.println("------------------------ RETRIEVING SCHEDULER JOB BY ID -------------------------");
|
||||
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_SCHEDULER_JOB_BY_ID_URL, "");
|
||||
return response;
|
||||
}
|
||||
|
||||
public static HashMap getSchedulerStatus(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
|
||||
final String GET_SCHEDULER_STATUS_URL = "/mifosng-provider/api/v1/scheduler?tenantIdentifier=default";
|
||||
System.out.println("------------------------ RETRIEVING SCHEDULER STATUS -------------------------");
|
||||
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_SCHEDULER_STATUS_URL, "");
|
||||
return response;
|
||||
}
|
||||
|
||||
public static void updateSchedulerStatus(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String command) {
|
||||
final String UPDATE_SCHEDULER_STATUS_URL = "/mifosng-provider/api/v1/scheduler?command=" + command +"&tenantIdentifier=default";
|
||||
System.out.println("------------------------ UPDATING SCHEDULER STATUS -------------------------");
|
||||
Utils.performServerPost(requestSpec, responseSpec, UPDATE_SCHEDULER_STATUS_URL, runSchedulerJobAsJSON(), null);
|
||||
}
|
||||
|
||||
public static HashMap updateSchedulerJob(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final String jobId, final String active) {
|
||||
final String UPDATE_SCHEDULER_JOB_URL = "/mifosng-provider/api/v1/jobs/" + jobId + "?tenantIdentifier=default";
|
||||
System.out.println("------------------------ UPDATING SCHEDULER JOB -------------------------");
|
||||
final HashMap response = Utils.performServerPut(requestSpec, responseSpec, UPDATE_SCHEDULER_JOB_URL,
|
||||
updateSchedulerJobAsJSON(active), "changes");
|
||||
return response;
|
||||
}
|
||||
|
||||
public static String updateSchedulerJobAsJSON(final String active) {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
map.put("active", active);
|
||||
System.out.println("map : " + map);
|
||||
return new Gson().toJson(map);
|
||||
}
|
||||
|
||||
public static ArrayList getSchedulerJobHistory(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final String jobId) {
|
||||
final String GET_SCHEDULER_STATUS_URL = "/mifosng-provider/api/v1/jobs/" + jobId + "/runhistory?tenantIdentifier=default";
|
||||
System.out.println("------------------------ RETRIEVING SCHEDULER JOB HISTORY -------------------------");
|
||||
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_SCHEDULER_STATUS_URL, "");
|
||||
return (ArrayList) response.get("pageItems");
|
||||
}
|
||||
|
||||
public static void runSchedulerJob(final RequestSpecification requestSpec, final String jobId) {
|
||||
final ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(202).build();
|
||||
final String RUN_SCHEDULER_JOB_URL = "/mifosng-provider/api/v1/jobs/" + jobId + "?command=executeJob&tenantIdentifier=default";
|
||||
System.out.println("------------------------ RUN SCHEDULER JOB -------------------------");
|
||||
Utils.performServerPost(requestSpec, responseSpec, RUN_SCHEDULER_JOB_URL, runSchedulerJobAsJSON(), null);
|
||||
}
|
||||
|
||||
public static String runSchedulerJobAsJSON() {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
String runSchedulerJob = new Gson().toJson(map);
|
||||
System.out.println(runSchedulerJob);
|
||||
return runSchedulerJob;
|
||||
}
|
||||
|
||||
public void excuteJob(String JobName) throws InterruptedException {
|
||||
ArrayList<HashMap> allSchedulerJobsData = getAllSchedulerJobs(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(allSchedulerJobsData);
|
||||
|
||||
for (Integer jobIndex = 0; jobIndex < allSchedulerJobsData.size(); jobIndex++) {
|
||||
if (allSchedulerJobsData.get(jobIndex).get("displayName").equals(JobName)) {
|
||||
Integer jobId = (Integer) allSchedulerJobsData.get(jobIndex).get("jobId");
|
||||
|
||||
// Executing Scheduler Job
|
||||
runSchedulerJob(this.requestSpec, jobId.toString());
|
||||
|
||||
// Retrieving Scheduler Job by ID
|
||||
HashMap schedulerJob = getSchedulerJobById(this.requestSpec, this.responseSpec, jobId.toString());
|
||||
Assert.assertNotNull(schedulerJob);
|
||||
|
||||
// Waiting for Job to complete
|
||||
while ((Boolean) schedulerJob.get("currentlyRunning") == true) {
|
||||
Thread.sleep(15000);
|
||||
schedulerJob = getSchedulerJobById(this.requestSpec, this.responseSpec, jobId.toString());
|
||||
Assert.assertNotNull(schedulerJob);
|
||||
System.out.println("Job is Still Running");
|
||||
}
|
||||
|
||||
ArrayList<HashMap> jobHistoryData = getSchedulerJobHistory(this.requestSpec, this.responseSpec, jobId.toString());
|
||||
|
||||
// Verifying the Status of the Recently executed Scheduler Job
|
||||
Assert.assertEquals("Verifying Last Scheduler Job Status", "success",
|
||||
jobHistoryData.get(jobHistoryData.size() - 1).get("status"));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
package org.mifosplatform.integrationtests.common;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
|
||||
import ch.qos.logback.classic.pattern.Util;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings({ "unused", "rawtypes" })
|
||||
public class StandingInstructionsHelper {
|
||||
|
||||
private static final String STANDING_INSTRUCTIONS_URL = "/mifosng-provider/api/v1/standinginstructions";
|
||||
private static final String LOCALE = "en_GB";
|
||||
private static final String OFFICE_ID = "1";
|
||||
private static final String INSTRUCTION_TYPE_FIXED = "1";
|
||||
private static final String INSTRUCTION_TYPE_DUES = "2";
|
||||
private static final String PRIORITY_URGENT = "1";
|
||||
private static final String PRIORITY_HIGH = "2";
|
||||
private static final String PRIORITY_MEDIUM = "3";
|
||||
private static final String PRIORITY_LOW = "4";
|
||||
private static final String RECURRENCE_FREQUENCY_DAYS = "0";
|
||||
private static final String RECURRENCE_FREQUENCY_WEEKS = "1";
|
||||
private static final String RECURRENCE_FREQUENCY_MONTHS = "2";
|
||||
private static final String RECURRENCE_FREQUENCY_YEARS = "3";
|
||||
private static final String RECURRENCE_TYPE_PERIODIC = "1";
|
||||
private static final String RECURRENCE_TYPE_AS_PER_DUES = "2";
|
||||
private static final String STATUS_ACTIVE = "1";
|
||||
private static final String STATUS_DISABLED = "2";
|
||||
private static final String TRANSFER_TYPE_ACCOUNT_TRANSFER = "1";
|
||||
private static final String TRANSFER_TYPE_LOAN_REPAYMENT = "2";
|
||||
private static final String ACCOUNT_TRANSFER_DATE = "01 March 2013";
|
||||
|
||||
private String transferDate = "";
|
||||
private String officeId = OFFICE_ID;
|
||||
|
||||
private RequestSpecification requestSpec;
|
||||
private ResponseSpecification responseSpec;
|
||||
|
||||
public StandingInstructionsHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
|
||||
this.requestSpec = requestSpec;
|
||||
this.responseSpec = responseSpec;
|
||||
}
|
||||
|
||||
public String build(final String clientId, final String fromAccountId, final String toAccountId, final String fromAccountType,
|
||||
final String toAccountType, final String validFrom, final String validTo, final String monthDay) {
|
||||
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
map.put("name", Utils.randomNameGenerator("STANDING_INSTRUCTION_", 5));
|
||||
map.put("dateFormat", "dd MMMM yyyy");
|
||||
map.put("monthDayFormat", "dd MMMM");
|
||||
map.put("locale", LOCALE);
|
||||
map.put("fromClientId", clientId);
|
||||
map.put("fromAccountId", fromAccountId);
|
||||
map.put("fromAccountType", fromAccountType);
|
||||
map.put("fromOfficeId", this.officeId);
|
||||
map.put("toClientId", clientId);
|
||||
map.put("toAccountId", toAccountId);
|
||||
map.put("toAccountType", toAccountType);
|
||||
map.put("toOfficeId", this.officeId);
|
||||
map.put("amount", "500");
|
||||
map.put("transferType", TRANSFER_TYPE_ACCOUNT_TRANSFER);
|
||||
map.put("priority", PRIORITY_URGENT);
|
||||
map.put("status", STATUS_ACTIVE);
|
||||
map.put("instructionType", INSTRUCTION_TYPE_FIXED);
|
||||
map.put("validFrom", validFrom);
|
||||
map.put("validTill", validTo);
|
||||
map.put("recurrenceType", RECURRENCE_TYPE_PERIODIC);
|
||||
map.put("recurrenceInterval", "1");
|
||||
map.put("recurrenceFrequency", RECURRENCE_FREQUENCY_MONTHS);
|
||||
map.put("recurrenceOnMonthDay", monthDay);
|
||||
String savingsApplicationJSON = new Gson().toJson(map);
|
||||
System.out.println(savingsApplicationJSON);
|
||||
return savingsApplicationJSON;
|
||||
}
|
||||
|
||||
public Integer createStandingInstruction(final String clientId, final String fromAccountId, final String toAccountId,
|
||||
final String fromAccountType, final String toAccountType, final String validFrom, final String validTo, final String monthDay) {
|
||||
System.out.println("-------------------------------- CREATE STANDING INSTRUCTIONS --------------------------------");
|
||||
final String standingInstructionAsJSON = new StandingInstructionsHelper(this.requestSpec, this.responseSpec) //
|
||||
.build(clientId.toString(), fromAccountId.toString(), toAccountId.toString(), fromAccountType, toAccountType, validFrom,
|
||||
validTo, monthDay);
|
||||
return Utils.performServerPost(this.requestSpec, this.responseSpec, STANDING_INSTRUCTIONS_URL + "?" + Utils.TENANT_IDENTIFIER,
|
||||
standingInstructionAsJSON, "resourceId");
|
||||
}
|
||||
|
||||
public HashMap getStandingInstructionById(final String standingInstructionId) {
|
||||
|
||||
System.out.println("----------------------------- RETRIEVING STANDING INSTRUCTION BY ID---------------------------");
|
||||
final String GET_STANDING_INSTRUCTION_BY_ID_URL = STANDING_INSTRUCTIONS_URL + "/" + standingInstructionId + "?"
|
||||
+ Utils.TENANT_IDENTIFIER;
|
||||
final HashMap response = Utils.performServerGet(this.requestSpec, this.responseSpec, GET_STANDING_INSTRUCTION_BY_ID_URL, "");
|
||||
return response;
|
||||
}
|
||||
}
|
||||
+9
-1
@@ -21,7 +21,9 @@ import com.jayway.restassured.specification.ResponseSpecification;
|
||||
@SuppressWarnings("unchecked")
|
||||
public class Utils {
|
||||
|
||||
private static final String LOGIN_URL = "/mifosng-provider/api/v1/authentication?username=mifos&password=password&tenantIdentifier=default";
|
||||
public static final String TENANT_IDENTIFIER = "tenantIdentifier=default";
|
||||
|
||||
private static final String LOGIN_URL = "/mifosng-provider/api/v1/authentication?username=mifos&password=password&" + TENANT_IDENTIFIER;
|
||||
|
||||
public static void initializeRESTAssured() {
|
||||
RestAssured.baseURI = "https://localhost";
|
||||
@@ -55,6 +57,7 @@ public class Utils {
|
||||
final String postURL, final String jsonBodyToSend, final String jsonAttributeToGetBack) {
|
||||
final String json = given().spec(requestSpec).body(jsonBodyToSend).expect().spec(responseSpec).log().ifError().when().post(postURL)
|
||||
.andReturn().asString();
|
||||
if (jsonAttributeToGetBack == null) { return (T) json; }
|
||||
return (T) from(json).get(jsonAttributeToGetBack);
|
||||
}
|
||||
|
||||
@@ -97,4 +100,9 @@ public class Utils {
|
||||
public static String randomStringGenerator(final String prefix, final int len) {
|
||||
return randomStringGenerator(prefix, len, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
}
|
||||
|
||||
public static String randomNameGenerator(final String prefix, final int lenOfRandomSuffix) {
|
||||
return randomStringGenerator(prefix, lenOfRandomSuffix);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+16
@@ -1,10 +1,14 @@
|
||||
package org.mifosplatform.integrationtests.common.accounting;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class AccountHelper {
|
||||
|
||||
private final String CREATE_GL_ACCOUNT_URL = "/mifosng-provider/api/v1/glaccounts?tenantIdentifier=default";
|
||||
@@ -45,5 +49,17 @@ public class AccountHelper {
|
||||
assetAccountJSON, this.GL_ACCOUNT_ID_RESPONSE);
|
||||
return new Account(accountID, Account.AccountType.LIABILITY);
|
||||
}
|
||||
|
||||
public ArrayList getAccountingWithRunningBalances() {
|
||||
final String GET_RUNNING_BALANCE_URL = "/mifosng-provider/api/v1/glaccounts?fetchRunningBalance=true";
|
||||
final ArrayList<HashMap> accountRunningBalance = Utils.performServerGet(this.requestSpec, this.responseSpec, GET_RUNNING_BALANCE_URL, "");
|
||||
return accountRunningBalance;
|
||||
}
|
||||
|
||||
public HashMap getAccountingWithRunningBalanceById(final String accountId) {
|
||||
final String GET_RUNNING_BALANCE_URL = "/mifosng-provider/api/v1/glaccounts/" + accountId + "?fetchRunningBalance=true";
|
||||
final HashMap accountRunningBalance = Utils.performServerGet(this.requestSpec, this.responseSpec, GET_RUNNING_BALANCE_URL, "");
|
||||
return accountRunningBalance;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+24
-2
@@ -2,6 +2,7 @@ package org.mifosplatform.integrationtests.common.accounting;
|
||||
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -22,7 +23,7 @@ public class JournalEntryHelper {
|
||||
this.responseSpec = responseSpec;
|
||||
}
|
||||
|
||||
public void checkJournalEntryForExpenseAccount(final Account expenseAccount, final String date, final JournalEntry accountEntries) {
|
||||
public void checkJournalEntryForExpenseAccount(final Account expenseAccount, final String date, final JournalEntry... accountEntries) {
|
||||
checkJournalEntry(expenseAccount, date, accountEntries);
|
||||
}
|
||||
|
||||
@@ -30,9 +31,19 @@ public class JournalEntryHelper {
|
||||
checkJournalEntry(assetAccount, date, accountEntries);
|
||||
}
|
||||
|
||||
public void checkJournalEntryForIncomeAccount(final Account incomeAccount, final String date, final JournalEntry accountEntries) {
|
||||
public void checkJournalEntryForIncomeAccount(final Account incomeAccount, final String date, final JournalEntry... accountEntries) {
|
||||
checkJournalEntry(incomeAccount, date, accountEntries);
|
||||
}
|
||||
|
||||
public void checkJournalEntryForLiabilityAccount(final Account liabilityAccount, final String date, final JournalEntry... accountEntries) {
|
||||
checkJournalEntry(liabilityAccount, date, accountEntries);
|
||||
}
|
||||
|
||||
public void ensureNoAccountingTransactionsWithTransactionId(final String transactionId) {
|
||||
ArrayList<HashMap> transactions = getJournalEntriesByTransactionId(transactionId);
|
||||
assertTrue("Tranasactions are is not empty", transactions.isEmpty());
|
||||
|
||||
}
|
||||
|
||||
private String getEntryValueFromJournalEntry(final ArrayList<HashMap> entryResponse, final int entryNumber) {
|
||||
final HashMap map = (HashMap) entryResponse.get(entryNumber).get("entryType");
|
||||
@@ -58,4 +69,15 @@ public class JournalEntryHelper {
|
||||
+ "&orderBy=id&sortOrder=desc&locale=en&dateFormat=dd MMMM yyyy");
|
||||
}
|
||||
|
||||
private ArrayList<HashMap> getJournalEntriesByTransactionId(final String transactionId) {
|
||||
final String url = createURLForGettingAccountEntriesByTransactionId(transactionId);
|
||||
final ArrayList<HashMap> response = Utils.performServerGet(this.requestSpec, this.responseSpec, url, "pageItems");
|
||||
return response;
|
||||
}
|
||||
|
||||
private String createURLForGettingAccountEntriesByTransactionId(final String transactionId) {
|
||||
return new String("/mifosng-provider/api/v1/journalentries?transactionId=" + transactionId + "&tenantIdentifier=default"
|
||||
+ "&orderBy=id&sortOrder=desc&locale=en&dateFormat=dd MMMM yyyy");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package org.mifosplatform.integrationtests.common.accounting;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
public class OfficeAccountMappingBuilder {
|
||||
|
||||
public static String build(Integer officeId, Integer glAccountId) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("officeId", officeId);
|
||||
map.put("liabilityTransferInSuspenseAccountId", glAccountId);
|
||||
return new Gson().toJson(map);
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package org.mifosplatform.integrationtests.common.accounting;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class OfficeAccountMappingHelper {
|
||||
|
||||
private static final String ACCOUNT_MAPPING_URL = "/mifosng-provider/api/v1/officeglaccounts";
|
||||
private final RequestSpecification requestSpec;
|
||||
private final ResponseSpecification responseSpec;
|
||||
|
||||
public OfficeAccountMappingHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
|
||||
this.requestSpec = requestSpec;
|
||||
this.responseSpec = responseSpec;
|
||||
}
|
||||
|
||||
public Object createOfficeAccountMapping(Integer officeId, Integer glAccountId, String jsonBack) {
|
||||
String json = OfficeAccountMappingBuilder.build(officeId, glAccountId);
|
||||
return Utils.performServerPost(this.requestSpec, this.responseSpec, ACCOUNT_MAPPING_URL + "?" + Utils.TENANT_IDENTIFIER, json,
|
||||
jsonBack);
|
||||
}
|
||||
|
||||
public Object updateOfficeAccountMapping(Integer mappingId, Integer officeId, Integer glAccountId, String jsonBack) {
|
||||
String json = OfficeAccountMappingBuilder.build(officeId, glAccountId);
|
||||
return Utils.performServerPut(this.requestSpec, this.responseSpec, ACCOUNT_MAPPING_URL + "/" + mappingId + "?"
|
||||
+ Utils.TENANT_IDENTIFIER, json, jsonBack);
|
||||
}
|
||||
|
||||
public HashMap getOfficeAccountMapping(final Integer mappingId) {
|
||||
final String URL = ACCOUNT_MAPPING_URL + "/" + mappingId + "?" + Utils.TENANT_IDENTIFIER;
|
||||
return Utils.performServerGet(requestSpec, responseSpec, URL, "");
|
||||
}
|
||||
|
||||
public HashMap getOfficeAccountMappings() {
|
||||
final String URL = ACCOUNT_MAPPING_URL + "?" + Utils.TENANT_IDENTIFIER;
|
||||
return Utils.performServerGet(requestSpec, responseSpec, URL, "");
|
||||
}
|
||||
|
||||
}
|
||||
+344
@@ -0,0 +1,344 @@
|
||||
package org.mifosplatform.integrationtests.common.charges;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public class ChargesHelper {
|
||||
|
||||
private static final String CHARGES_URL = "/mifosng-provider/api/v1/charges";
|
||||
private static final String CREATE_CHARGES_URL = CHARGES_URL + "?" + Utils.TENANT_IDENTIFIER;
|
||||
|
||||
private static final Integer CHARGE_APPLIES_TO_LOAN = 1;
|
||||
private static final Integer CHARGE_APPLIES_TO_SAVINGS = 2;
|
||||
|
||||
private static final Integer CHARGE_DISBURSEMENT_FEE = 1;
|
||||
private static final Integer CHARGE_SPECIFIED_DUE_DATE = 2;
|
||||
private static final Integer CHARGE_SAVINGS_ACTIVATION_FEE = 3;
|
||||
private static final Integer CHARGE_WITHDRAWAL_FEE = 5;
|
||||
private static final Integer CHARGE_ANNUAL_FEE = 6;
|
||||
private static final Integer CHARGE_MONTHLY_FEE = 7;
|
||||
private static final Integer CHARGE_INSTALLMENT_FEE = 8;
|
||||
private static final Integer CHARGE_OVERDUE_INSTALLMENT_FEE = 9;
|
||||
private static final Integer CHARGE_OVERDRAFT_FEE = 10;
|
||||
|
||||
public static final Integer CHARGE_CALCULATION_TYPE_FLAT = 1;
|
||||
public static final Integer CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT = 2;
|
||||
public static final Integer CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST = 3;
|
||||
public static final Integer CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST = 4;
|
||||
|
||||
private static final Integer CHARGE_PAYMENT_MODE_REGULAR = 0;
|
||||
private static final Integer CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER = 1;
|
||||
|
||||
private static final Integer CHARGE_FEE_FREQUENCY_DAYS = 0;
|
||||
private static final Integer CHARGE_FEE_FREQUENCY_WEEKS = 1;
|
||||
private static final Integer CHARGE_FEE_FREQUENCY_MONTHS = 2;
|
||||
private static final Integer CHARGE_FEE_FREQUENCY_YEARS = 3;
|
||||
|
||||
private final static boolean active = true;
|
||||
private final static boolean penalty = true;
|
||||
private final static String amount = "100";
|
||||
private final static String currencyCode = "USD";
|
||||
public final static String feeOnMonthDay = "04 March";
|
||||
private final static String monthDayFormat = "dd MMM";
|
||||
|
||||
public static String getSavingsSpecifiedDueDateJSON() {
|
||||
final HashMap<String, Object> map = populateDefaultsForSavings();
|
||||
map.put("chargeTimeType", CHARGE_SPECIFIED_DUE_DATE);
|
||||
map.put("feeInterval", 2);
|
||||
String chargesCreateJson = new Gson().toJson(map);
|
||||
System.out.println(chargesCreateJson);
|
||||
return chargesCreateJson;
|
||||
}
|
||||
|
||||
public static String getSavingsActivationFeeJSON() {
|
||||
final HashMap<String, Object> map = populateDefaultsForSavings();
|
||||
map.put("chargeTimeType", CHARGE_SAVINGS_ACTIVATION_FEE);
|
||||
String chargesCreateJson = new Gson().toJson(map);
|
||||
System.out.println(chargesCreateJson);
|
||||
return chargesCreateJson;
|
||||
}
|
||||
|
||||
public static String getSavingsWithdrawalFeeJSON() {
|
||||
final HashMap<String, Object> map = populateDefaultsForSavings();
|
||||
map.put("chargeTimeType", CHARGE_WITHDRAWAL_FEE);
|
||||
String chargesCreateJson = new Gson().toJson(map);
|
||||
System.out.println(chargesCreateJson);
|
||||
return chargesCreateJson;
|
||||
}
|
||||
|
||||
public static String getSavingsAnnualFeeJSON() {
|
||||
final HashMap<String, Object> map = populateDefaultsForSavings();
|
||||
map.put("feeOnMonthDay", ChargesHelper.feeOnMonthDay);
|
||||
map.put("chargeTimeType", CHARGE_ANNUAL_FEE);
|
||||
String chargesCreateJson = new Gson().toJson(map);
|
||||
System.out.println(chargesCreateJson);
|
||||
return chargesCreateJson;
|
||||
}
|
||||
|
||||
public static String getSavingsMonthlyFeeJSON() {
|
||||
final HashMap<String, Object> map = populateDefaultsForSavings();
|
||||
map.put("feeOnMonthDay", ChargesHelper.feeOnMonthDay);
|
||||
map.put("chargeTimeType", CHARGE_MONTHLY_FEE);
|
||||
map.put("feeInterval", 2);
|
||||
String chargesCreateJson = new Gson().toJson(map);
|
||||
System.out.println(chargesCreateJson);
|
||||
return chargesCreateJson;
|
||||
}
|
||||
|
||||
public static String getSavingsOverdraftFeeJSON() {
|
||||
final HashMap<String, Object> map = populateDefaultsForSavings();
|
||||
map.put("chargeTimeType", CHARGE_OVERDRAFT_FEE);
|
||||
String chargesCreateJson = new Gson().toJson(map);
|
||||
System.out.println(chargesCreateJson);
|
||||
return chargesCreateJson;
|
||||
}
|
||||
|
||||
public static HashMap<String, Object> populateDefaultsForSavings() {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("active", ChargesHelper.active);
|
||||
map.put("amount", ChargesHelper.amount);
|
||||
map.put("chargeAppliesTo", ChargesHelper.CHARGE_APPLIES_TO_SAVINGS);
|
||||
map.put("chargeCalculationType", ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT);
|
||||
map.put("currencyCode", ChargesHelper.currencyCode);
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("monthDayFormat", ChargesHelper.monthDayFormat);
|
||||
map.put("name", Utils.randomNameGenerator("Charge_Savings_", 6));
|
||||
return map;
|
||||
}
|
||||
|
||||
public static String getLoanDisbursementJSON() {
|
||||
return getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, ChargesHelper.amount);
|
||||
}
|
||||
|
||||
public static String getLoanDisbursementJSON(final Integer chargeCalculationType, final String amount) {
|
||||
return getLoanDisbursementJSON(chargeCalculationType, amount, ChargesHelper.CHARGE_PAYMENT_MODE_REGULAR);
|
||||
}
|
||||
|
||||
public static String getLoanDisbursementAccountTransferJSON(final Integer chargeCalculationType, final String amount) {
|
||||
return getLoanDisbursementJSON(chargeCalculationType, amount, ChargesHelper.CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
|
||||
}
|
||||
|
||||
public static String getLoanDisbursementJSON(final Integer chargeCalculationType, final String amount, final Integer paymentmode) {
|
||||
final HashMap<String, Object> map = populateDefaultsForLoan();
|
||||
map.put("chargeTimeType", CHARGE_DISBURSEMENT_FEE);
|
||||
map.put("chargePaymentMode", paymentmode);
|
||||
map.put("amount", amount);
|
||||
map.put("chargeCalculationType", chargeCalculationType);
|
||||
String chargesCreateJson = new Gson().toJson(map);
|
||||
System.out.println(chargesCreateJson);
|
||||
return chargesCreateJson;
|
||||
}
|
||||
|
||||
public static String getLoanSpecifiedDueDateJSON() {
|
||||
return getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, ChargesHelper.amount, ChargesHelper.penalty);
|
||||
}
|
||||
|
||||
public static String getLoanSpecifiedDueDateJSON(final Integer chargeCalculationType, final String amount, boolean penalty) {
|
||||
return getLoanSpecifiedDueDateJSON(chargeCalculationType, amount, penalty, ChargesHelper.CHARGE_PAYMENT_MODE_REGULAR);
|
||||
}
|
||||
|
||||
public static String getLoanSpecifiedDueDateJSON(final Integer chargeCalculationType, final String amount, final boolean penalty,
|
||||
final Integer paymentMode) {
|
||||
final HashMap<String, Object> map = populateDefaultsForLoan();
|
||||
map.put("chargeTimeType", CHARGE_SPECIFIED_DUE_DATE);
|
||||
map.put("chargePaymentMode", paymentMode);
|
||||
map.put("penalty", penalty);
|
||||
map.put("amount", amount);
|
||||
map.put("chargeCalculationType", chargeCalculationType);
|
||||
|
||||
String chargesCreateJson = new Gson().toJson(map);
|
||||
System.out.println(chargesCreateJson);
|
||||
return chargesCreateJson;
|
||||
}
|
||||
|
||||
public static String getLoanSpecifiedDueDateWithAccountTransferJSON(final Integer chargeCalculationType, final String amount,
|
||||
boolean penalty) {
|
||||
return getLoanSpecifiedDueDateJSON(chargeCalculationType, amount, penalty, ChargesHelper.CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
|
||||
}
|
||||
|
||||
public static String getLoanSpecifiedDueDateWithAccountTransferJSON() {
|
||||
return getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, ChargesHelper.amount, ChargesHelper.penalty,
|
||||
ChargesHelper.CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
|
||||
}
|
||||
|
||||
public static String getLoanInstallmentJSON(final Integer chargeCalculationType, final String amount, boolean penalty) {
|
||||
return getLoanInstallmentJSON(chargeCalculationType, amount, penalty, ChargesHelper.CHARGE_PAYMENT_MODE_REGULAR);
|
||||
}
|
||||
|
||||
public static String getLoanInstallmentJSON(final Integer chargeCalculationType, final String amount, final boolean penalty,
|
||||
final Integer paymentMode) {
|
||||
final HashMap<String, Object> map = populateDefaultsForLoan();
|
||||
map.put("chargeTimeType", CHARGE_INSTALLMENT_FEE);
|
||||
map.put("chargePaymentMode", paymentMode);
|
||||
map.put("penalty", penalty);
|
||||
map.put("amount", amount);
|
||||
map.put("chargeCalculationType", chargeCalculationType);
|
||||
|
||||
String chargesCreateJson = new Gson().toJson(map);
|
||||
System.out.println(chargesCreateJson);
|
||||
return chargesCreateJson;
|
||||
}
|
||||
|
||||
public static String getLoanInstallmentWithAccountTransferJSON(final Integer chargeCalculationType, final String amount, boolean penalty) {
|
||||
return getLoanInstallmentJSON(chargeCalculationType, amount, penalty, ChargesHelper.CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
|
||||
}
|
||||
|
||||
public static String getLoanInstallmentFeeJSON() {
|
||||
return getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, ChargesHelper.amount, ChargesHelper.penalty);
|
||||
}
|
||||
|
||||
public static String getLoanOverdueFeeJSON() {
|
||||
final HashMap<String, Object> map = populateDefaultsForLoan();
|
||||
map.put("penalty", ChargesHelper.penalty);
|
||||
map.put("chargePaymentMode", ChargesHelper.CHARGE_PAYMENT_MODE_REGULAR);
|
||||
map.put("chargeTimeType", CHARGE_OVERDUE_INSTALLMENT_FEE);
|
||||
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_MONTHS);
|
||||
map.put("feeOnMonthDay", ChargesHelper.feeOnMonthDay);
|
||||
map.put("feeInterval", 2);
|
||||
String chargesCreateJson = new Gson().toJson(map);
|
||||
System.out.println(chargesCreateJson);
|
||||
return chargesCreateJson;
|
||||
}
|
||||
|
||||
public static HashMap<String, Object> populateDefaultsForLoan() {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("active", ChargesHelper.active);
|
||||
map.put("amount", ChargesHelper.amount);
|
||||
map.put("chargeAppliesTo", ChargesHelper.CHARGE_APPLIES_TO_LOAN);
|
||||
map.put("chargeCalculationType", ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT);
|
||||
map.put("currencyCode", ChargesHelper.currencyCode);
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("monthDayFormat", ChargesHelper.monthDayFormat);
|
||||
map.put("name", Utils.randomNameGenerator("Charge_Loans_", 6));
|
||||
return map;
|
||||
}
|
||||
|
||||
public static Integer createCharges(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final String request) {
|
||||
return Utils.performServerPost(requestSpec, responseSpec, CREATE_CHARGES_URL, request, "resourceId");
|
||||
}
|
||||
|
||||
public static ArrayList<HashMap> getCharges(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
|
||||
return (ArrayList) Utils.performServerGet(requestSpec, responseSpec, CHARGES_URL + "?" + Utils.TENANT_IDENTIFIER, "");
|
||||
}
|
||||
|
||||
public static HashMap getChargeById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final Integer chargeId) {
|
||||
return Utils.performServerGet(requestSpec, responseSpec, CHARGES_URL + "/" + chargeId + "?" + Utils.TENANT_IDENTIFIER, "");
|
||||
}
|
||||
|
||||
public static HashMap getChargeChanges(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final Integer chargeId) {
|
||||
return Utils.performServerGet(requestSpec, responseSpec, CHARGES_URL + "/" + chargeId + "?" + Utils.TENANT_IDENTIFIER,
|
||||
CommonConstants.RESPONSE_CHANGES);
|
||||
}
|
||||
|
||||
public static HashMap updateCharges(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final Integer chargeId, final String request) {
|
||||
return Utils.performServerPut(requestSpec, responseSpec, CHARGES_URL + "/" + chargeId + "?" + Utils.TENANT_IDENTIFIER, request,
|
||||
CommonConstants.RESPONSE_CHANGES);
|
||||
}
|
||||
|
||||
public static Integer deleteCharge(final ResponseSpecification responseSpec, final RequestSpecification requestSpec,
|
||||
final Integer chargeId) {
|
||||
return Utils.performServerDelete(requestSpec, responseSpec, CHARGES_URL + "/" + chargeId + "?" + Utils.TENANT_IDENTIFIER,
|
||||
CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
}
|
||||
|
||||
public static String getModifyChargeJSON() {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("amount", "200.0");
|
||||
String json = new Gson().toJson(map);
|
||||
System.out.println(json);
|
||||
return json;
|
||||
}
|
||||
|
||||
public static String getModifyWithdrawalFeeSavingsChargeJSON() {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT);
|
||||
String json = new Gson().toJson(map);
|
||||
System.out.println(json);
|
||||
return json;
|
||||
}
|
||||
|
||||
public static String getModifyChargeAsPecentageAmountJSON() {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT);
|
||||
map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
|
||||
String json = new Gson().toJson(map);
|
||||
System.out.println(json);
|
||||
return json;
|
||||
}
|
||||
|
||||
public static String getModifyChargeAsPecentageLoanAmountWithInterestJSON() {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST);
|
||||
map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
|
||||
String json = new Gson().toJson(map);
|
||||
System.out.println(json);
|
||||
return json;
|
||||
}
|
||||
|
||||
public static String getModifyChargeAsPercentageInterestJSON() {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST);
|
||||
map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
|
||||
String json = new Gson().toJson(map);
|
||||
System.out.println(json);
|
||||
return json;
|
||||
}
|
||||
|
||||
public static String getModifyChargeFeeFrequencyAsDaysJSON() {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_DAYS);
|
||||
map.put("feeInterval", 2);
|
||||
String json = new Gson().toJson(map);
|
||||
System.out.println(json);
|
||||
return json;
|
||||
}
|
||||
|
||||
public static String getModifyChargeFeeFrequencyAsWeeksJSON() {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_WEEKS);
|
||||
map.put("feeInterval", 2);
|
||||
String json = new Gson().toJson(map);
|
||||
System.out.println(json);
|
||||
return json;
|
||||
}
|
||||
|
||||
public static String getModifyChargeFeeFrequencyAsMonthsJSON() {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_MONTHS);
|
||||
map.put("feeInterval", 2);
|
||||
String json = new Gson().toJson(map);
|
||||
System.out.println(json);
|
||||
return json;
|
||||
}
|
||||
|
||||
public static String getModifyChargeFeeFrequencyAsYearsJSON() {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_YEARS);
|
||||
map.put("feeInterval", 2);
|
||||
String json = new Gson().toJson(map);
|
||||
System.out.println(json);
|
||||
return json;
|
||||
}
|
||||
|
||||
}
|
||||
+472
@@ -0,0 +1,472 @@
|
||||
package org.mifosplatform.integrationtests.common.fixeddeposit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings({ "unused", "rawtypes" })
|
||||
public class FixedDepositAccountHelper {
|
||||
|
||||
private final RequestSpecification requestSpec;
|
||||
private final ResponseSpecification responseSpec;
|
||||
|
||||
public FixedDepositAccountHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
|
||||
this.requestSpec = requestSpec;
|
||||
this.responseSpec = responseSpec;
|
||||
}
|
||||
|
||||
private static final String FIXED_DEPOSIT_ACCOUNT_URL = "/mifosng-provider/api/v1/fixeddepositaccounts";
|
||||
private static final String APPLY_FIXED_DEPOSIT_ACCOUNT_URL = FIXED_DEPOSIT_ACCOUNT_URL + "?" + Utils.TENANT_IDENTIFIER;
|
||||
private static final String APPROVE_FIXED_DEPOSIT_COMMAND = "approve";
|
||||
private static final String UNDO_APPROVAL_FIXED_DEPOSIT_COMMAND = "undoapproval";
|
||||
private static final String REJECT_FIXED_DEPOSIT_COMMAND = "reject";
|
||||
private static final String WITHDRAWN_BY_CLIENT_FIXED_DEPOSIT_COMMAND = "withdrawnByApplicant";
|
||||
private static final String ACTIVATE_FIXED_DEPOSIT_COMMAND = "activate";
|
||||
private static final String CLOSE_FIXED_DEPOSIT_COMMAND = "close";
|
||||
private static final String POST_INTEREST_FIXED_DEPOSIT_COMMAND = "postInterest";
|
||||
private static final String CALCULATE_INTEREST_FIXED_DEPOSIT_COMMAND = "calculateInterest";
|
||||
private static final String CALCULATE_PREMATURE_AMOUNT_COMMAND = "calculatePrematureAmount";
|
||||
private static final String PREMATURE_CLOSE_COMMAND = "prematureClose";
|
||||
|
||||
private static final String LOCALE = "en_GB";
|
||||
private static final String DIGITS_AFTER_DECIMAL = "4";
|
||||
private static final String IN_MULTIPLES_OF = "100";
|
||||
private static final String USD = "USD";
|
||||
public static final String DAYS = "0";
|
||||
private static final String WEEKS = "1";
|
||||
private static final String MONTHS = "2";
|
||||
private static final String YEARS = "3";
|
||||
private static final String DAILY = "1";
|
||||
private static final String MONTHLY = "4";
|
||||
private static final String QUARTERLY = "5";
|
||||
private static final String BI_ANNUALLY = "6";
|
||||
private static final String ANNUALLY = "7";
|
||||
private static final String INTEREST_CALCULATION_USING_DAILY_BALANCE = "1";
|
||||
private static final String INTEREST_CALCULATION_USING_AVERAGE_DAILY_BALANCE = "2";
|
||||
private static final String DAYS_360 = "360";
|
||||
private static final String DAYS_365 = "365";
|
||||
public final static String depositAmount = "100000";
|
||||
|
||||
private String interestCompoundingPeriodType = MONTHLY;
|
||||
private String interestPostingPeriodType = MONTHLY;
|
||||
private String interestCalculationType = INTEREST_CALCULATION_USING_DAILY_BALANCE;
|
||||
private String lockinPeriodFrequency = "1";
|
||||
private String lockingPeriodFrequencyType = MONTHS;
|
||||
private final String minDepositTerm = "6";
|
||||
private final String minDepositTermTypeId = MONTHS;
|
||||
private final String maxDepositTerm = "10";
|
||||
private final String maxDepositTermTypeId = YEARS;
|
||||
private final String inMultiplesOfDepositTerm = "2";
|
||||
private final String inMultiplesOfDepositTermTypeId = MONTHS;
|
||||
private final String preClosurePenalInterest = "2";
|
||||
private String interestCalculationDaysInYearType = DAYS_365;
|
||||
private final boolean preClosurePenalApplicable = true;
|
||||
private final boolean isActiveChart = true;
|
||||
private final String currencyCode = USD;
|
||||
|
||||
private final String depositPeriod = "14";
|
||||
private final String depositPeriodFrequencyId = MONTHS;
|
||||
private String submittedOnDate = "";
|
||||
private String savingsId = null;
|
||||
private boolean transferInterest = false;
|
||||
|
||||
public String build(final String clientId, final String productId, final String validFrom, final String validTo,
|
||||
final String penalInterestType) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
|
||||
List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
|
||||
HashMap<String, String> chartSlabsMap1 = new HashMap<String, String>();
|
||||
chartSlabsMap1.put("description", "First");
|
||||
chartSlabsMap1.put("periodType", MONTHS);
|
||||
chartSlabsMap1.put("fromPeriod", "1");
|
||||
chartSlabsMap1.put("toPeriod", "6");
|
||||
chartSlabsMap1.put("annualInterestRate", "5");
|
||||
chartSlabsMap1.put("locale", LOCALE);
|
||||
chartSlabs.add(0, chartSlabsMap1);
|
||||
|
||||
HashMap<String, String> chartSlabsMap2 = new HashMap<String, String>();
|
||||
chartSlabsMap2.put("description", "Second");
|
||||
chartSlabsMap2.put("periodType", MONTHS);
|
||||
chartSlabsMap2.put("fromPeriod", "7");
|
||||
chartSlabsMap2.put("toPeriod", "12");
|
||||
chartSlabsMap2.put("annualInterestRate", "6");
|
||||
chartSlabsMap2.put("locale", LOCALE);
|
||||
chartSlabs.add(1, chartSlabsMap2);
|
||||
|
||||
HashMap<String, String> chartSlabsMap3 = new HashMap<String, String>();
|
||||
chartSlabsMap3.put("description", "Third");
|
||||
chartSlabsMap3.put("periodType", MONTHS);
|
||||
chartSlabsMap3.put("fromPeriod", "13");
|
||||
chartSlabsMap3.put("toPeriod", "18");
|
||||
chartSlabsMap3.put("annualInterestRate", "7");
|
||||
chartSlabsMap3.put("locale", LOCALE);
|
||||
chartSlabs.add(2, chartSlabsMap3);
|
||||
|
||||
HashMap<String, String> chartSlabsMap4 = new HashMap<String, String>();
|
||||
chartSlabsMap4.put("description", "Fourth");
|
||||
chartSlabsMap4.put("periodType", MONTHS);
|
||||
chartSlabsMap4.put("fromPeriod", "19");
|
||||
chartSlabsMap4.put("toPeriod", "24");
|
||||
chartSlabsMap4.put("annualInterestRate", "8");
|
||||
chartSlabsMap4.put("locale", LOCALE);
|
||||
chartSlabs.add(3, chartSlabsMap4);
|
||||
|
||||
List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>();
|
||||
HashMap<String, Object> chartsMap = new HashMap<String, Object>();
|
||||
chartsMap.put("fromDate", validFrom);
|
||||
chartsMap.put("endDate", validTo);
|
||||
chartsMap.put("dateFormat", "dd MMMM yyyy");
|
||||
chartsMap.put("locale", LOCALE);
|
||||
chartsMap.put("isActiveChart", this.isActiveChart);
|
||||
chartsMap.put("chartSlabs", chartSlabs);
|
||||
charts.add(chartsMap);
|
||||
|
||||
map.put("charts", charts);
|
||||
map.put("productId", productId);
|
||||
map.put("clientId", clientId);
|
||||
map.put("interestCalculationDaysInYearType", this.interestCalculationDaysInYearType);
|
||||
map.put("locale", LOCALE);
|
||||
map.put("dateFormat", "dd MMMM yyyy");
|
||||
map.put("monthDayFormat", "dd MMM");
|
||||
map.put("interestCalculationType", this.interestCalculationType);
|
||||
map.put("interestCompoundingPeriodType", this.interestCompoundingPeriodType);
|
||||
map.put("interestPostingPeriodType", this.interestPostingPeriodType);
|
||||
map.put("lockinPeriodFrequency", this.lockinPeriodFrequency);
|
||||
map.put("lockinPeriodFrequencyType", this.lockingPeriodFrequencyType);
|
||||
map.put("preClosurePenalApplicable", "true");
|
||||
map.put("minDepositTermTypeId", this.minDepositTermTypeId);
|
||||
map.put("minDepositTerm", this.minDepositTerm);
|
||||
map.put("maxDepositTermTypeId", this.maxDepositTermTypeId);
|
||||
map.put("maxDepositTerm", this.maxDepositTerm);
|
||||
map.put("preClosurePenalApplicable", this.preClosurePenalApplicable);
|
||||
map.put("inMultiplesOfDepositTerm", this.inMultiplesOfDepositTerm);
|
||||
map.put("inMultiplesOfDepositTermTypeId", this.inMultiplesOfDepositTermTypeId);
|
||||
map.put("preClosurePenalInterest", this.preClosurePenalInterest);
|
||||
map.put("preClosurePenalInterestOnTypeId", penalInterestType);
|
||||
map.put("depositAmount", depositAmount);
|
||||
map.put("depositPeriod", this.depositPeriod);
|
||||
map.put("depositPeriodFrequencyId", this.depositPeriodFrequencyId);
|
||||
map.put("submittedOnDate", this.submittedOnDate);
|
||||
map.put("linkAccountId", savingsId);
|
||||
map.put("transferInterestToSavings", transferInterest);
|
||||
|
||||
String fixedDepositAccountJson = new Gson().toJson(map);
|
||||
System.out.println(fixedDepositAccountJson);
|
||||
return fixedDepositAccountJson;
|
||||
}
|
||||
|
||||
public static Integer applyFixedDepositApplication(final String fixedDepositAccountAsJson, final RequestSpecification requestSpec,
|
||||
final ResponseSpecification responseSpec) {
|
||||
System.out.println("--------------------- APPLYING FOR FIXED DEPOSIT ACCOUNT ------------------------");
|
||||
return Utils.performServerPost(requestSpec, responseSpec, APPLY_FIXED_DEPOSIT_ACCOUNT_URL, fixedDepositAccountAsJson,
|
||||
CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
}
|
||||
|
||||
public static HashMap getFixedDepositAccountById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final Integer accountID) {
|
||||
final String GET_FIXED_DEPOSIT_BY_ID_URL = FIXED_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?" + Utils.TENANT_IDENTIFIER;
|
||||
System.out.println("------------------------ RETRIEVING FIXED DEPOSIT ACCOUNT BY ID -------------------------");
|
||||
return Utils.performServerGet(requestSpec, responseSpec, GET_FIXED_DEPOSIT_BY_ID_URL, "");
|
||||
}
|
||||
|
||||
public HashMap getFixedDepositSummary(final Integer accountID) {
|
||||
final String URL = FIXED_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?" + Utils.TENANT_IDENTIFIER;
|
||||
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, URL, "summary");
|
||||
return response;
|
||||
}
|
||||
|
||||
public static Float getInterestRate(ArrayList<ArrayList<HashMap>> interestSlabData, Integer depositPeriod) {
|
||||
|
||||
Float annualInterestRate = 0.0f;
|
||||
for (Integer slabIndex = 0; slabIndex < interestSlabData.get(0).size(); slabIndex++) {
|
||||
Integer fromPeriod = (Integer) interestSlabData.get(0).get(slabIndex).get("fromPeriod");
|
||||
Integer toPeriod = (Integer) interestSlabData.get(0).get(slabIndex).get("toPeriod");
|
||||
if (depositPeriod >= fromPeriod && depositPeriod <= toPeriod) {
|
||||
annualInterestRate = (Float) interestSlabData.get(0).get(slabIndex).get("annualInterestRate");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return annualInterestRate;
|
||||
}
|
||||
|
||||
public static Float getPrincipalAfterCompoundingInterest(Calendar currentDate, Float principal, Integer depositPeriod,
|
||||
double interestPerDay, Integer compoundingInterval, Integer postingInterval) {
|
||||
|
||||
Float totalInterest = 0.0f;
|
||||
Float interestEarned = 0.0f;
|
||||
|
||||
for (int i = 1; i <= depositPeriod; i++) {
|
||||
Integer daysInMonth = currentDate.getActualMaximum(Calendar.DATE);
|
||||
for (int j = 0; j < daysInMonth; j++) {
|
||||
|
||||
interestEarned = (float) (principal * interestPerDay);
|
||||
totalInterest += interestEarned;
|
||||
if (compoundingInterval == 0) {
|
||||
principal += interestEarned;
|
||||
}
|
||||
}
|
||||
if ((i % postingInterval) == 0 || i == depositPeriod) {
|
||||
if (compoundingInterval != 0) {
|
||||
principal += totalInterest;
|
||||
}
|
||||
totalInterest = 0.0f;
|
||||
System.out.println(principal);
|
||||
|
||||
}
|
||||
currentDate.add(Calendar.MONTH, 1);
|
||||
interestEarned = 0.0f;
|
||||
}
|
||||
return principal;
|
||||
}
|
||||
|
||||
public HashMap updateFixedDepositAccount(final String clientID, final String productID, final String accountID, final String validFrom,
|
||||
final String validTo, final String penalInterestType, final String submittedOnDate) {
|
||||
|
||||
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) //
|
||||
.withSubmittedOnDate(submittedOnDate) //
|
||||
.build(clientID, productID, validFrom, validTo, penalInterestType);
|
||||
|
||||
return Utils.performServerPut(this.requestSpec, this.responseSpec, FIXED_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?"
|
||||
+ Utils.TENANT_IDENTIFIER, fixedDepositApplicationJSON, CommonConstants.RESPONSE_CHANGES);
|
||||
}
|
||||
|
||||
public HashMap updateInterestCalculationConfigForFixedDeposit(final String clientID, final String productID, final String accountID,
|
||||
final String submittedOnDate, final String validFrom, final String validTo, final String numberOfDaysPerYear,
|
||||
final String penalInterestType, final String interestCalculationType, final String interestCompoundingPeriodType,
|
||||
final String interestPostingPeriodType) {
|
||||
|
||||
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) //
|
||||
.withSubmittedOnDate(submittedOnDate) //
|
||||
.withNumberOfDaysPerYear(numberOfDaysPerYear) //
|
||||
.withInterestCalculationPeriodType(interestCalculationType) //
|
||||
.withInterestCompoundingPeriodType(interestCompoundingPeriodType) //
|
||||
.withInterestPostingPeriodType(interestPostingPeriodType) //
|
||||
.build(clientID, productID, validFrom, validTo, penalInterestType);
|
||||
|
||||
return Utils.performServerPut(this.requestSpec, this.responseSpec, FIXED_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?"
|
||||
+ Utils.TENANT_IDENTIFIER, fixedDepositApplicationJSON, CommonConstants.RESPONSE_CHANGES);
|
||||
}
|
||||
|
||||
public HashMap approveFixedDeposit(final Integer fixedDepositAccountID, final String approvedOnDate) {
|
||||
System.out.println("--------------------------------- APPROVING FIXED DEPOSIT APPLICATION ------------------------------------");
|
||||
return performFixedDepositApplicationActions(createFixedDepositOperationURL(APPROVE_FIXED_DEPOSIT_COMMAND, fixedDepositAccountID),
|
||||
getApproveFixedDepositAccountAsJSON(approvedOnDate));
|
||||
}
|
||||
|
||||
public HashMap undoApproval(final Integer fixedDepositAccountID) {
|
||||
System.out.println("--------------------------------- UNDO APPROVING FIXED DEPOSIT APPLICATION -------------------------------");
|
||||
final String undoBodyJson = "{'note':'UNDO APPROVAL'}";
|
||||
return performFixedDepositApplicationActions(
|
||||
createFixedDepositOperationURL(UNDO_APPROVAL_FIXED_DEPOSIT_COMMAND, fixedDepositAccountID), undoBodyJson);
|
||||
}
|
||||
|
||||
public HashMap rejectApplication(final Integer fixedDepositAccountID, final String rejectedOnDate) {
|
||||
System.out.println("--------------------------------- REJECT FIXED DEPOSIT APPLICATION -------------------------------");
|
||||
return performFixedDepositApplicationActions(createFixedDepositOperationURL(REJECT_FIXED_DEPOSIT_COMMAND, fixedDepositAccountID),
|
||||
getRejectedFixedDepositAsJSON(rejectedOnDate));
|
||||
}
|
||||
|
||||
public HashMap withdrawApplication(final Integer fixedDepositAccountID, final String withdrawApplicationOnDate) {
|
||||
System.out.println("--------------------------------- Withdraw FIXED DEPOSIT APPLICATION -------------------------------");
|
||||
return performFixedDepositApplicationActions(
|
||||
createFixedDepositOperationURL(WITHDRAWN_BY_CLIENT_FIXED_DEPOSIT_COMMAND, fixedDepositAccountID),
|
||||
getWithdrawnFixedDepositAccountAsJSON(withdrawApplicationOnDate));
|
||||
}
|
||||
|
||||
public HashMap activateFixedDeposit(final Integer fixedDepositAccountID, final String activationDate) {
|
||||
System.out.println("---------------------------------- ACTIVATING FIXED DEPOSIT APPLICATION ----------------------------------");
|
||||
return performFixedDepositApplicationActions(createFixedDepositOperationURL(ACTIVATE_FIXED_DEPOSIT_COMMAND, fixedDepositAccountID),
|
||||
getActivatedFixedDepositAccountAsJSON(activationDate));
|
||||
}
|
||||
|
||||
public Object deleteFixedDepositApplication(final Integer fixedDepositAccountID, final String jsonAttributeToGetBack) {
|
||||
System.out.println("---------------------------------- DELETE FIXED DEPOSIT APPLICATION ----------------------------------");
|
||||
return Utils.performServerDelete(this.requestSpec, this.responseSpec, FIXED_DEPOSIT_ACCOUNT_URL + "/" + fixedDepositAccountID + "?"
|
||||
+ Utils.TENANT_IDENTIFIER, jsonAttributeToGetBack);
|
||||
|
||||
}
|
||||
|
||||
public Integer calculateInterestForFixedDeposit(final Integer fixedDepositAccountId) {
|
||||
System.out.println("--------------------------------- CALCULATING INTEREST FOR FIXED DEPOSIT --------------------------------");
|
||||
return (Integer) performFixedDepositActions(
|
||||
createFixedDepositCalculateInterestURL(CALCULATE_INTEREST_FIXED_DEPOSIT_COMMAND, fixedDepositAccountId),
|
||||
getCalculatedInterestForFixedDepositApplicationAsJSON(), CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
}
|
||||
|
||||
public Integer postInterestForFixedDeposit(final Integer fixedDepositAccountId) {
|
||||
System.out.println("--------------------------------- POST INTEREST FOR FIXED DEPOSIT --------------------------------");
|
||||
return (Integer) performFixedDepositActions(
|
||||
createFixedDepositCalculateInterestURL(POST_INTEREST_FIXED_DEPOSIT_COMMAND, fixedDepositAccountId),
|
||||
getCalculatedInterestForFixedDepositApplicationAsJSON(), CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
}
|
||||
|
||||
public HashMap calculatePrematureAmountForFixedDeposit(final Integer fixedDepositAccountId, final String closedOnDate) {
|
||||
System.out.println("--------------------- CALCULATING PREMATURE AMOUNT FOR FIXED DEPOSIT ----------------------------");
|
||||
return (HashMap) performFixedDepositActions(
|
||||
createFixedDepositCalculateInterestURL(CALCULATE_PREMATURE_AMOUNT_COMMAND, fixedDepositAccountId),
|
||||
getCalculatedPrematureAmountForFixedDepositAccountAsJSON(closedOnDate), "");
|
||||
}
|
||||
|
||||
public Object prematureCloseForFixedDeposit(final Integer fixedDepositAccountId, final String closedOnDate, final String closureType,
|
||||
final Integer toSavingsId, final String jsonAttributeToGetBack) {
|
||||
System.out.println("--------------------- PREMATURE CLOSE FOR FIXED DEPOSIT ----------------------------");
|
||||
return performFixedDepositActions(createFixedDepositCalculateInterestURL(PREMATURE_CLOSE_COMMAND, fixedDepositAccountId),
|
||||
getPrematureCloseForFixedDepositAccountAsJSON(closedOnDate, closureType, toSavingsId), jsonAttributeToGetBack);
|
||||
}
|
||||
|
||||
private String getApproveFixedDepositAccountAsJSON(final String approvedOnDate) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("approvedOnDate", approvedOnDate);
|
||||
map.put("note", "Approval NOTE");
|
||||
String fixedDepositAccountApproveJson = new Gson().toJson(map);
|
||||
System.out.println(fixedDepositAccountApproveJson);
|
||||
return fixedDepositAccountApproveJson;
|
||||
}
|
||||
|
||||
private String getRejectedFixedDepositAsJSON(final String rejectedOnDate) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("rejectedOnDate", rejectedOnDate);
|
||||
map.put("note", "Rejected NOTE");
|
||||
String fixedDepositAccountJson = new Gson().toJson(map);
|
||||
System.out.println(fixedDepositAccountJson);
|
||||
return fixedDepositAccountJson;
|
||||
}
|
||||
|
||||
private String getWithdrawnFixedDepositAccountAsJSON(final String withdrawnApplicationOnDate) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("withdrawnOnDate", withdrawnApplicationOnDate);
|
||||
map.put("note", "Withdraw NOTE");
|
||||
String fixedDepositAccountJson = new Gson().toJson(map);
|
||||
System.out.println(fixedDepositAccountJson);
|
||||
return fixedDepositAccountJson;
|
||||
}
|
||||
|
||||
private String getActivatedFixedDepositAccountAsJSON(final String activationDate) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("activatedOnDate", activationDate);
|
||||
String fixedDepositAccountActivateJson = new Gson().toJson(map);
|
||||
System.out.println(fixedDepositAccountActivateJson);
|
||||
return fixedDepositAccountActivateJson;
|
||||
}
|
||||
|
||||
private String getCalculatedInterestForFixedDepositApplicationAsJSON() {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
String fixedDepositAccountCalculatedInterestJson = new Gson().toJson(map);
|
||||
System.out.println(fixedDepositAccountCalculatedInterestJson);
|
||||
return fixedDepositAccountCalculatedInterestJson;
|
||||
}
|
||||
|
||||
private String getCalculatedPrematureAmountForFixedDepositAccountAsJSON(final String closedOnDate) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("closedOnDate", closedOnDate);
|
||||
String fixedDepositAccountPrematureClosureJson = new Gson().toJson(map);
|
||||
System.out.println(fixedDepositAccountPrematureClosureJson);
|
||||
return fixedDepositAccountPrematureClosureJson;
|
||||
}
|
||||
|
||||
private String getPrematureCloseForFixedDepositAccountAsJSON(final String closedOnDate, final String closureType,
|
||||
final Integer toSavingsId) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("closedOnDate", closedOnDate);
|
||||
map.put("onAccountClosureId", closureType);
|
||||
if (toSavingsId != null) {
|
||||
map.put("toSavingsAccountId", toSavingsId);
|
||||
map.put("transferDescription", "Transferring To Savings Account");
|
||||
}
|
||||
String fixedDepositAccountPrematureCloseJson = new Gson().toJson(map);
|
||||
System.out.println(fixedDepositAccountPrematureCloseJson);
|
||||
return fixedDepositAccountPrematureCloseJson;
|
||||
}
|
||||
|
||||
private String createFixedDepositOperationURL(final String command, final Integer fixedDepositAccountID) {
|
||||
return FIXED_DEPOSIT_ACCOUNT_URL + "/" + fixedDepositAccountID + "?command=" + command + "&" + Utils.TENANT_IDENTIFIER;
|
||||
}
|
||||
|
||||
private Object performFixedDepositActions(final String postURLForFixedDeposit, final String jsonToBeSent,
|
||||
final String jsonAttributeToGetBack) {
|
||||
return Utils.performServerPost(this.requestSpec, this.responseSpec, postURLForFixedDeposit, jsonToBeSent, jsonAttributeToGetBack);
|
||||
}
|
||||
|
||||
private HashMap performFixedDepositApplicationActions(final String postURLForFixedDepositAction, final String jsonToBeSent) {
|
||||
HashMap status = null;
|
||||
final HashMap response = Utils.performServerPost(this.requestSpec, this.responseSpec, postURLForFixedDepositAction, jsonToBeSent,
|
||||
CommonConstants.RESPONSE_CHANGES);
|
||||
if (response != null) {
|
||||
status = (HashMap) response.get("status");
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
private String createFixedDepositCalculateInterestURL(final String command, final Integer fixedDepositAccountID) {
|
||||
return FIXED_DEPOSIT_ACCOUNT_URL + "/" + fixedDepositAccountID + "?command=" + command + "&" + Utils.TENANT_IDENTIFIER;
|
||||
}
|
||||
|
||||
public static ArrayList retrieveAllFixedDepositAccounts(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
|
||||
System.out.println("-------------------- RETRIEVING ALL FIXED DEPOSIT ACCOUNTS ---------------------");
|
||||
final ArrayList response = Utils.performServerGet(requestSpec, responseSpec, FIXED_DEPOSIT_ACCOUNT_URL + "?"
|
||||
+ Utils.TENANT_IDENTIFIER, "");
|
||||
return response;
|
||||
}
|
||||
|
||||
public FixedDepositAccountHelper withSubmittedOnDate(final String fixedDepositApplicationSubmittedDate) {
|
||||
this.submittedOnDate = fixedDepositApplicationSubmittedDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FixedDepositAccountHelper withNumberOfDaysPerYear(final String numberOfDaysPerYearTypeId) {
|
||||
this.interestCalculationDaysInYearType = numberOfDaysPerYearTypeId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FixedDepositAccountHelper withInterestCalculationPeriodType(final String interestCalculationTypeId) {
|
||||
this.interestCalculationType = interestCalculationTypeId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FixedDepositAccountHelper withInterestCompoundingPeriodType(final String interestCompoundingPeriodTypeId) {
|
||||
this.interestCompoundingPeriodType = interestCompoundingPeriodTypeId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FixedDepositAccountHelper withInterestPostingPeriodType(final String interestPostingPeriodTypeId) {
|
||||
this.interestPostingPeriodType = interestPostingPeriodTypeId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FixedDepositAccountHelper withSavings(final String savingsId) {
|
||||
this.savingsId = savingsId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FixedDepositAccountHelper transferInterest(final boolean transferInterest) {
|
||||
this.transferInterest = transferInterest;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FixedDepositAccountHelper withLockinPeriodFrequency(final String lockingPeriodFrequencyType, final String lockinPeriodFrequency) {
|
||||
this.lockingPeriodFrequencyType = lockingPeriodFrequencyType;
|
||||
this.lockinPeriodFrequency = lockinPeriodFrequency;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package org.mifosplatform.integrationtests.common.fixeddeposit;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class FixedDepositAccountStatusChecker {
|
||||
|
||||
private static final String FIXED_DEPOSIT_ACCOUNT_URL = "/mifosng-provider/api/v1/fixeddepositaccounts";
|
||||
|
||||
public static void verifyFixedDepositIsApproved(final HashMap fixedDepositStatusHashMap) {
|
||||
System.out.println("-------------------- VERIFYING FIXED DEPOSIT APPLICATION IS APPROVED --------------------");
|
||||
assertTrue("Error in Approving Fixed deposit application", getStatus(fixedDepositStatusHashMap, "approved"));
|
||||
System.out.println(fixedDepositStatusHashMap);
|
||||
}
|
||||
|
||||
public static void verifyFixedDepositIsPending(final HashMap fixedDepositStatusHashMap) {
|
||||
System.out.println("-------------------- VERIFYING FIXED DEPOSIT APPLICATION IS PENDING --------------------");
|
||||
assertTrue("FIXED DEPOSIT ACCOUNT IS NOT IN PENDING STATE", getStatus(fixedDepositStatusHashMap, "submittedAndPendingApproval"));
|
||||
System.out.println(fixedDepositStatusHashMap);
|
||||
}
|
||||
|
||||
public static void verifyFixedDepositIsActive(final HashMap fixedDepositStatusHashMap) {
|
||||
System.out.println("----------------- VERIFYING FIXED DEPOSIT APPLICATION IS ACTIVE -----------------");
|
||||
assertTrue("ERROR IN ACTIVATING THE FIXED DEPOSIT APPLICATION", getStatus(fixedDepositStatusHashMap, "active"));
|
||||
System.out.println(fixedDepositStatusHashMap);
|
||||
}
|
||||
|
||||
public static void verifyFixedDepositIsRejected(final HashMap fixedDepositStatusHashMap) {
|
||||
System.out.println("-------------- VERIFYING FIXED DEPOSIT APPLICATION IS REJECTED ----------------");
|
||||
assertTrue("ERROR IN REJECTING THE FIXED DEPOSIT APPLICATION", getStatus(fixedDepositStatusHashMap, "rejected"));
|
||||
System.out.println(fixedDepositStatusHashMap);
|
||||
}
|
||||
|
||||
public static void verifyFixedDepositIsWithdrawn(final HashMap fixedDepositStatusHashMap) {
|
||||
System.out.println("---------------- VERIFYING FIXED DEPOSIT APPLICATION IS WITHDRAWN ----------------");
|
||||
assertTrue("ERROR IN WITHDRAW THE FIXED DEPOSIT APPLICATION", getStatus(fixedDepositStatusHashMap, "withdrawnByApplicant"));
|
||||
System.out.println(fixedDepositStatusHashMap);
|
||||
}
|
||||
|
||||
public static void verifyFixedDepositAccountIsClosed(final HashMap fixedDepositStatusHashMap) {
|
||||
System.out.println("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS CLOSED ---------------------");
|
||||
assertTrue("ERROR IN CLOSING THE FIXED DEPOSIT APPLICATION", getStatus(fixedDepositStatusHashMap, "closed"));
|
||||
System.out.println(fixedDepositStatusHashMap);
|
||||
}
|
||||
|
||||
public static void verifyFixedDepositAccountIsNotActive(final HashMap fixedDepositStatusHashMap) {
|
||||
System.out.println("------------------ VERIFYING FIXED DEPOSIT APPLICATION IS INACTIVE --------------------");
|
||||
Assert.assertFalse(getStatus(fixedDepositStatusHashMap, "active"));
|
||||
System.out.println(fixedDepositStatusHashMap);
|
||||
}
|
||||
|
||||
public static HashMap getStatusOfFixedDepositAccount(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final String fixedDepositAccountID) {
|
||||
final String GET_STATUS_OF_FIXED_DEPOSIT_ACCOUNT_URL = FIXED_DEPOSIT_ACCOUNT_URL + "/" + fixedDepositAccountID + "?"
|
||||
+ Utils.TENANT_IDENTIFIER;
|
||||
return Utils.performServerGet(requestSpec, responseSpec, GET_STATUS_OF_FIXED_DEPOSIT_ACCOUNT_URL, "status");
|
||||
}
|
||||
|
||||
public static void verifyFixedDepositAccountIsPrematureClosed(HashMap fixedDepositStatusHashMap) {
|
||||
System.out.println("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS CLOSED ---------------------");
|
||||
assertTrue("ERROR IN PREMATURELY CLOSING THE FIXED DEPOSIT ACCOUNT", getStatus(fixedDepositStatusHashMap, "prematureClosed"));
|
||||
System.out.println(fixedDepositStatusHashMap);
|
||||
}
|
||||
|
||||
private static boolean getStatus(final HashMap fixedDepositStatusMap, final String fixedDepositStatusString) {
|
||||
return (Boolean) fixedDepositStatusMap.get(fixedDepositStatusString);
|
||||
}
|
||||
}
|
||||
+236
@@ -0,0 +1,236 @@
|
||||
package org.mifosplatform.integrationtests.common.fixeddeposit;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.accounting.Account;
|
||||
import org.mifosplatform.integrationtests.common.accounting.Account.AccountType;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings({ "unused", "rawtypes" })
|
||||
public class FixedDepositProductHelper {
|
||||
|
||||
private final RequestSpecification requestSpec;
|
||||
private final ResponseSpecification responseSpec;
|
||||
|
||||
public FixedDepositProductHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
|
||||
this.requestSpec = requestSpec;
|
||||
this.responseSpec = responseSpec;
|
||||
}
|
||||
|
||||
private static final String FIXED_DEPOSIT_PRODUCT_URL = "/mifosng-provider/api/v1/fixeddepositproducts";
|
||||
private static final String INTEREST_CHART_URL = "/mifosng-provider/api/v1/interestratecharts";
|
||||
private static final String CREATE_FIXED_DEPOSIT_PRODUCT_URL = FIXED_DEPOSIT_PRODUCT_URL + "?" + Utils.TENANT_IDENTIFIER;
|
||||
|
||||
private static final String LOCALE = "en_GB";
|
||||
private static final String DIGITS_AFTER_DECIMAL = "4";
|
||||
private static final String IN_MULTIPLES_OF = "100";
|
||||
private static final String USD = "USD";
|
||||
private static final String DAYS = "0";
|
||||
private static final String WEEKS = "1";
|
||||
private static final String MONTHS = "2";
|
||||
private static final String YEARS = "3";
|
||||
private static final String DAILY = "1";
|
||||
private static final String MONTHLY = "4";
|
||||
private static final String QUARTERLY = "5";
|
||||
private static final String BI_ANNUALLY = "6";
|
||||
private static final String ANNUALLY = "7";
|
||||
private static final String INTEREST_CALCULATION_USING_DAILY_BALANCE = "1";
|
||||
private static final String INTEREST_CALCULATION_USING_AVERAGE_DAILY_BALANCE = "2";
|
||||
private static final String DAYS_360 = "360";
|
||||
private static final String DAYS_365 = "365";
|
||||
private static final String NONE = "1";
|
||||
private static final String CASH_BASED = "2";
|
||||
private static final String ACCRUAL_PERIODIC = "3";
|
||||
private static final String ACCRUAL_UPFRONT = "4";
|
||||
private static final String WHOLE_TERM = "1";
|
||||
private static final String TILL_PREMATURE_WITHDRAWAL = "2";
|
||||
|
||||
private String name = Utils.randomNameGenerator("FIXED_DEPOSIT_PRODUCT_", 6);
|
||||
private String shortName = Utils.randomNameGenerator("", 4);
|
||||
private String description = Utils.randomNameGenerator("", 20);
|
||||
private String interestCompoundingPeriodType = MONTHLY;
|
||||
private String interestPostingPeriodType = MONTHLY;
|
||||
private String interestCalculationType = INTEREST_CALCULATION_USING_DAILY_BALANCE;
|
||||
private String accountingRule = NONE;
|
||||
private String lockinPeriodFrequency = "1";
|
||||
private String lockingPeriodFrequencyType = MONTHS;
|
||||
private String minDepositTerm = "6";
|
||||
private String minDepositTermTypeId = MONTHS;
|
||||
private String maxDepositTerm = "10";
|
||||
private String maxDepositTermTypeId = YEARS;
|
||||
private String inMultiplesOfDepositTerm = "2";
|
||||
private final String depositAmount = "100000";
|
||||
private String inMultiplesOfDepositTermTypeId = MONTHS;
|
||||
private String preClosurePenalInterest = "2";
|
||||
private String preClosurePenalInterestOnTypeId = WHOLE_TERM;
|
||||
private final boolean preClosurePenalApplicable = true;
|
||||
private final String currencyCode = USD;
|
||||
private final String interestCalculationDaysInYearType = DAYS_365;
|
||||
private Account[] accountList = null;
|
||||
|
||||
public String build(final String validFrom, final String validTo) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
|
||||
List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
|
||||
HashMap<String, String> chartSlabsMap1 = new HashMap<String, String>();
|
||||
chartSlabsMap1.put("description", "First");
|
||||
chartSlabsMap1.put("periodType", MONTHS);
|
||||
chartSlabsMap1.put("fromPeriod", "1");
|
||||
chartSlabsMap1.put("toPeriod", "6");
|
||||
chartSlabsMap1.put("annualInterestRate", "5");
|
||||
chartSlabsMap1.put("locale", LOCALE);
|
||||
chartSlabs.add(0, chartSlabsMap1);
|
||||
|
||||
HashMap<String, String> chartSlabsMap2 = new HashMap<String, String>();
|
||||
chartSlabsMap2.put("description", "Second");
|
||||
chartSlabsMap2.put("periodType", MONTHS);
|
||||
chartSlabsMap2.put("fromPeriod", "7");
|
||||
chartSlabsMap2.put("toPeriod", "12");
|
||||
chartSlabsMap2.put("annualInterestRate", "6");
|
||||
chartSlabsMap2.put("locale", LOCALE);
|
||||
chartSlabs.add(1, chartSlabsMap2);
|
||||
|
||||
HashMap<String, String> chartSlabsMap3 = new HashMap<String, String>();
|
||||
chartSlabsMap3.put("description", "Third");
|
||||
chartSlabsMap3.put("periodType", MONTHS);
|
||||
chartSlabsMap3.put("fromPeriod", "13");
|
||||
chartSlabsMap3.put("toPeriod", "18");
|
||||
chartSlabsMap3.put("annualInterestRate", "7");
|
||||
chartSlabsMap3.put("locale", LOCALE);
|
||||
chartSlabs.add(2, chartSlabsMap3);
|
||||
|
||||
HashMap<String, String> chartSlabsMap4 = new HashMap<String, String>();
|
||||
chartSlabsMap4.put("description", "Fourth");
|
||||
chartSlabsMap4.put("periodType", MONTHS);
|
||||
chartSlabsMap4.put("fromPeriod", "19");
|
||||
chartSlabsMap4.put("toPeriod", "24");
|
||||
chartSlabsMap4.put("annualInterestRate", "8");
|
||||
chartSlabsMap4.put("locale", LOCALE);
|
||||
chartSlabs.add(3, chartSlabsMap4);
|
||||
|
||||
List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>();
|
||||
HashMap<String, Object> chartsMap = new HashMap<String, Object>();
|
||||
chartsMap.put("fromDate", validFrom);
|
||||
chartsMap.put("endDate", validTo);
|
||||
chartsMap.put("dateFormat", "dd MMMM yyyy");
|
||||
chartsMap.put("locale", LOCALE);
|
||||
chartsMap.put("chartSlabs", chartSlabs);
|
||||
charts.add(chartsMap);
|
||||
|
||||
map.put("charts", charts);
|
||||
map.put("name", this.name);
|
||||
map.put("shortName", this.shortName);
|
||||
map.put("description", this.description);
|
||||
map.put("currencyCode", this.currencyCode);
|
||||
map.put("interestCalculationDaysInYearType", this.interestCalculationDaysInYearType);
|
||||
map.put("locale", LOCALE);
|
||||
map.put("digitsAfterDecimal", DIGITS_AFTER_DECIMAL);
|
||||
map.put("inMultiplesOf", IN_MULTIPLES_OF);
|
||||
map.put("interestCalculationType", this.interestCalculationType);
|
||||
map.put("interestCompoundingPeriodType", this.interestCompoundingPeriodType);
|
||||
map.put("interestPostingPeriodType", this.interestPostingPeriodType);
|
||||
map.put("accountingRule", this.accountingRule);
|
||||
map.put("lockinPeriodFrequency", this.lockinPeriodFrequency);
|
||||
map.put("lockinPeriodFrequencyType", this.lockingPeriodFrequencyType);
|
||||
map.put("preClosurePenalApplicable", "true");
|
||||
map.put("minDepositTermTypeId", this.minDepositTermTypeId);
|
||||
map.put("minDepositTerm", this.minDepositTerm);
|
||||
map.put("maxDepositTermTypeId", this.maxDepositTermTypeId);
|
||||
map.put("maxDepositTerm", this.maxDepositTerm);
|
||||
map.put("depositAmount", this.depositAmount);
|
||||
map.put("preClosurePenalApplicable", this.preClosurePenalApplicable);
|
||||
map.put("inMultiplesOfDepositTerm", this.inMultiplesOfDepositTerm);
|
||||
map.put("inMultiplesOfDepositTermTypeId", this.inMultiplesOfDepositTermTypeId);
|
||||
map.put("preClosurePenalInterest", this.preClosurePenalInterest);
|
||||
map.put("preClosurePenalInterestOnTypeId", this.preClosurePenalInterestOnTypeId);
|
||||
|
||||
if (this.accountingRule.equals(CASH_BASED)) {
|
||||
map.putAll(getAccountMappingForCashBased());
|
||||
}
|
||||
|
||||
String FixedDepositProductCreateJson = new Gson().toJson(map);
|
||||
System.out.println(FixedDepositProductCreateJson);
|
||||
return FixedDepositProductCreateJson;
|
||||
}
|
||||
|
||||
public FixedDepositProductHelper withAccountingRuleAsNone() {
|
||||
this.accountingRule = NONE;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FixedDepositProductHelper withAccountingRuleAsCashBased(final Account[] account_list) {
|
||||
this.accountingRule = CASH_BASED;
|
||||
this.accountList = account_list;
|
||||
return this;
|
||||
}
|
||||
|
||||
private Map<String, String> getAccountMappingForCashBased() {
|
||||
final Map<String, String> map = new HashMap<String, String>();
|
||||
if (accountList != null) {
|
||||
for (int i = 0; i < this.accountList.length; i++) {
|
||||
if (this.accountList[i].getAccountType().equals(Account.AccountType.ASSET)) {
|
||||
final String ID = this.accountList[i].getAccountID().toString();
|
||||
map.put("savingsReferenceAccountId", ID);
|
||||
}
|
||||
if (this.accountList[i].getAccountType().equals(Account.AccountType.LIABILITY)) {
|
||||
final String ID = this.accountList[i].getAccountID().toString();
|
||||
map.put("savingsControlAccountId", ID);
|
||||
map.put("transfersInSuspenseAccountId", ID);
|
||||
}
|
||||
if (this.accountList[i].getAccountType().equals(Account.AccountType.EXPENSE)) {
|
||||
final String ID = this.accountList[i].getAccountID().toString();
|
||||
map.put("interestOnSavingsAccountId", ID);
|
||||
}
|
||||
if (this.accountList[i].getAccountType().equals(Account.AccountType.INCOME)) {
|
||||
final String ID = this.accountList[i].getAccountID().toString();
|
||||
map.put("incomeFromFeeAccountId", ID);
|
||||
map.put("incomeFromPenaltyAccountId", ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static Integer createFixedDepositProduct(final String fixedDepositProductCreateJson, final RequestSpecification requestSpec,
|
||||
final ResponseSpecification responseSpec) {
|
||||
System.out.println("--------------------- CREATING FIXED DEPOSIT PRODUCT ------------------------");
|
||||
return Utils.performServerPost(requestSpec, responseSpec, CREATE_FIXED_DEPOSIT_PRODUCT_URL, fixedDepositProductCreateJson,
|
||||
CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
}
|
||||
|
||||
public static ArrayList retrieveAllFixedDepositProducts(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
|
||||
System.out.println("-------------------- RETRIEVING ALL FIXED DEPOSIT PRODUCTS ---------------------");
|
||||
final ArrayList response = Utils.performServerGet(requestSpec, responseSpec, FIXED_DEPOSIT_PRODUCT_URL + "?"
|
||||
+ Utils.TENANT_IDENTIFIER, "");
|
||||
return response;
|
||||
}
|
||||
|
||||
public static HashMap retrieveFixedDepositProductById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final String productId) {
|
||||
System.out.println("------------------------ RETRIEVING FIXED DEPOSIT PRODUCT BY ID ------------------------");
|
||||
final String GET_FD_PRODUCT_BY_ID_URL = FIXED_DEPOSIT_PRODUCT_URL + "/" + productId + "?" + Utils.TENANT_IDENTIFIER;
|
||||
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_FD_PRODUCT_BY_ID_URL, "");
|
||||
return response;
|
||||
}
|
||||
|
||||
public static ArrayList getInterestRateChartSlabsByProductId(final RequestSpecification requestSpec,
|
||||
final ResponseSpecification responseSpec, final Integer productId) {
|
||||
System.out.println("-------------------- RETRIEVE INTEREST CHART BY PRODUCT ID ---------------------");
|
||||
final ArrayList response = Utils.performServerGet(requestSpec, responseSpec, INTEREST_CHART_URL + "?productId=" + productId,
|
||||
"chartSlabs");
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
+31
-2
@@ -1,6 +1,8 @@
|
||||
package org.mifosplatform.integrationtests.common.loans;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
@@ -32,10 +34,14 @@ public class LoanApplicationTestBuilder {
|
||||
private String expectedDisbursmentDate = "";
|
||||
private String submittedOnDate = "";
|
||||
private String loanType = "individual";
|
||||
private String fixedEmiAmount = "10000";
|
||||
private String maxOutstandingLoanBalance = "36000";
|
||||
private List<HashMap> disbursementData = null;
|
||||
private List<HashMap> charges = new ArrayList<HashMap>();
|
||||
|
||||
public String build(final String ID, final String loanProductId) {
|
||||
public String build(final String ID, final String loanProductId, final String savingsID) {
|
||||
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("dateFormat", "dd MMMM yyyy");
|
||||
map.put("locale", "en_GB");
|
||||
if (this.loanType == "group") {
|
||||
@@ -58,6 +64,20 @@ public class LoanApplicationTestBuilder {
|
||||
map.put("expectedDisbursementDate", this.expectedDisbursmentDate);
|
||||
map.put("submittedOnDate", this.submittedOnDate);
|
||||
map.put("loanType", this.loanType);
|
||||
if (charges != null) {
|
||||
map.put("charges", charges);
|
||||
}
|
||||
if (savingsID != null) {
|
||||
map.put("linkAccountId", savingsID);
|
||||
}
|
||||
|
||||
if (disbursementData != null) {
|
||||
map.put("disbursementData", disbursementData);
|
||||
map.put("fixedEmiAmount", fixedEmiAmount);
|
||||
map.put("maxOutstandingLoanBalance", maxOutstandingLoanBalance);
|
||||
|
||||
}
|
||||
|
||||
return new Gson().toJson(map);
|
||||
}
|
||||
|
||||
@@ -161,9 +181,18 @@ public class LoanApplicationTestBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public LoanApplicationTestBuilder withCharges(final List<HashMap> charges) {
|
||||
this.charges = charges;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LoanApplicationTestBuilder withLoanType(final String loanType) {
|
||||
this.loanType = loanType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LoanApplicationTestBuilder withTranches(final List<HashMap> disbursementData) {
|
||||
this.disbursementData = disbursementData;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
+57
-10
@@ -1,9 +1,11 @@
|
||||
package org.mifosplatform.integrationtests.common.loans;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.accounting.Account;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
@@ -12,7 +14,7 @@ public class LoanProductTestBuilder {
|
||||
|
||||
private static final String LOCALE = "en_GB";
|
||||
private static final String DIGITS_AFTER_DECIMAL = "2";
|
||||
private static final String INR = "INR";
|
||||
private static final String USD = "USD";
|
||||
private static final String DAYS = "0";
|
||||
private static final String WEEK = "1";
|
||||
private static final String MONTHS = "2";
|
||||
@@ -28,9 +30,11 @@ public class LoanProductTestBuilder {
|
||||
// private static final String RBI_INDIA_STRATEGY ="4";
|
||||
private static final String NONE = "1";
|
||||
private static final String CASH_BASED = "2";
|
||||
private static final String ACCRUAL_BASED = "3";
|
||||
private static final String ACCRUAL_PERIODIC = "3";
|
||||
private static final String ACCRUAL_UPFRONT = "4";
|
||||
|
||||
private String nameOfLoanProduct = ClientHelper.randomNameGenerator("LOAN_PRODUCT_", 6);
|
||||
private String nameOfLoanProduct = Utils.randomNameGenerator("LOAN_PRODUCT_", 6);
|
||||
private String shortName = Utils.randomNameGenerator("", 4);
|
||||
private String principal = "10000.00";
|
||||
private String numberOfRepayments = "5";
|
||||
private String repaymentFrequency = MONTHS;
|
||||
@@ -38,20 +42,33 @@ public class LoanProductTestBuilder {
|
||||
private String interestRatePerPeriod = "2";
|
||||
private String interestRateFrequencyType = MONTHS;
|
||||
private String interestType = FLAT_BALANCE;
|
||||
private String overdueDaysForNPA = "5";
|
||||
private String interestCalculationPeriodType = CALCULATION_PERIOD_SAME_AS_REPAYMENT_PERIOD;
|
||||
private String inArrearsTolerance = "0";
|
||||
private final String transactionProcessingStrategy = MIFOS_STANDARD_STRATEGY;
|
||||
private String accountingRule = NONE;
|
||||
private final String currencyCode = INR;
|
||||
private final String currencyCode = USD;
|
||||
private String amortizationType = EQUAL_INSTALLMENTS;
|
||||
private String minPrincipal = "1000.00";
|
||||
private String maxPrincipal = "100000.00";
|
||||
private Account[] accountList = null;
|
||||
|
||||
public String build() {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
private Boolean multiDisburseLoan = false;
|
||||
private String outstandingLoanBalance = "35000";
|
||||
private String maxTrancheCount = "35000";
|
||||
|
||||
public String build(final String chargeId) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
|
||||
if (chargeId != null) {
|
||||
List<HashMap<String, String>> charges = new ArrayList<HashMap<String, String>>();
|
||||
HashMap<String, String> chargeMap = new HashMap<String, String>();
|
||||
chargeMap.put("id", chargeId);
|
||||
charges.add(chargeMap);
|
||||
map.put("charges", charges);
|
||||
}
|
||||
map.put("name", this.nameOfLoanProduct);
|
||||
map.put("shortName", this.shortName);
|
||||
map.put("currencyCode", this.currencyCode);
|
||||
map.put("locale", LOCALE);
|
||||
map.put("digitsAfterDecimal", DIGITS_AFTER_DECIMAL);
|
||||
@@ -69,8 +86,14 @@ public class LoanProductTestBuilder {
|
||||
map.put("accountingRule", this.accountingRule);
|
||||
map.put("minPrincipal", this.minPrincipal);
|
||||
map.put("maxPrincipal", this.maxPrincipal);
|
||||
map.put("overdueDaysForNPA", this.overdueDaysForNPA);
|
||||
if (multiDisburseLoan) {
|
||||
map.put("multiDisburseLoan", this.multiDisburseLoan);
|
||||
map.put("maxTrancheCount", this.maxTrancheCount);
|
||||
map.put("outstandingLoanBalance", this.outstandingLoanBalance);
|
||||
}
|
||||
|
||||
if (this.accountingRule.equals(ACCRUAL_BASED)) {
|
||||
if (this.accountingRule.equals(ACCRUAL_UPFRONT) || this.accountingRule.equals(ACCRUAL_PERIODIC)) {
|
||||
map.putAll(getAccountMappingForAccrualBased());
|
||||
} else if (this.accountingRule.equals(CASH_BASED)) {
|
||||
map.putAll(getAccountMappingForCashBased());
|
||||
@@ -158,6 +181,11 @@ public class LoanProductTestBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public LoanProductTestBuilder withOverdueDaysForNPA(String days) {
|
||||
this.overdueDaysForNPA = days;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LoanProductTestBuilder withInterestCalculationPeriodTypeAsDays() {
|
||||
this.interestCalculationPeriodType = DAYS;
|
||||
return this;
|
||||
@@ -184,12 +212,23 @@ public class LoanProductTestBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public LoanProductTestBuilder withAccountingRuleAsAccrualBased(final Account[] account_list) {
|
||||
this.accountingRule = ACCRUAL_BASED;
|
||||
public LoanProductTestBuilder withAccountingRuleUpfrontAccrual(final Account[] account_list) {
|
||||
this.accountingRule = ACCRUAL_UPFRONT;
|
||||
this.accountList = account_list;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LoanProductTestBuilder withAccountingRulePeriodicAccrual(final Account[] account_list) {
|
||||
this.accountingRule = ACCRUAL_PERIODIC;
|
||||
this.accountList = account_list;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LoanProductTestBuilder withTranches(boolean multiDisburseLoan) {
|
||||
this.multiDisburseLoan = multiDisburseLoan;
|
||||
return this;
|
||||
}
|
||||
|
||||
private Map<String, String> getAccountMappingForCashBased() {
|
||||
final Map<String, String> map = new HashMap<String, String>();
|
||||
for (int i = 0; i < this.accountList.length; i++) {
|
||||
@@ -204,6 +243,7 @@ public class LoanProductTestBuilder {
|
||||
map.put("interestOnLoanAccountId", ID);
|
||||
map.put("incomeFromFeeAccountId", ID);
|
||||
map.put("incomeFromPenaltyAccountId", ID);
|
||||
map.put("incomeFromRecoveryAccountId", ID);
|
||||
}
|
||||
if (this.accountList[i].getAccountType().equals(Account.AccountType.EXPENSE)) {
|
||||
final String ID = this.accountList[i].getAccountID().toString();
|
||||
@@ -235,6 +275,7 @@ public class LoanProductTestBuilder {
|
||||
map.put("interestOnLoanAccountId", ID);
|
||||
map.put("incomeFromFeeAccountId", ID);
|
||||
map.put("incomeFromPenaltyAccountId", ID);
|
||||
map.put("incomeFromRecoveryAccountId", ID);
|
||||
}
|
||||
if (this.accountList[i].getAccountType().equals(Account.AccountType.EXPENSE)) {
|
||||
final String ID = this.accountList[i].getAccountID().toString();
|
||||
@@ -249,4 +290,10 @@ public class LoanProductTestBuilder {
|
||||
return map;
|
||||
}
|
||||
|
||||
public LoanProductTestBuilder withAccounting(final String accountingRule, final Account[] account_list) {
|
||||
this.accountingRule = accountingRule;
|
||||
this.accountList = account_list;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
@@ -37,6 +37,10 @@ public class LoanStatusChecker {
|
||||
assertFalse(getStatus(loanStatusHashMap, "active"));
|
||||
}
|
||||
|
||||
public static void verifyLoanAccountIsOverPaid(final HashMap loanStatusHashMap) {
|
||||
assertTrue(getStatus(loanStatusHashMap, "overpaid"));
|
||||
}
|
||||
|
||||
public static HashMap getStatusOfLoan(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final Integer loanID) {
|
||||
final String url = "/mifosng-provider/api/v1/loans/" + loanID + "?tenantIdentifier=default";
|
||||
|
||||
+179
-2
@@ -1,17 +1,19 @@
|
||||
package org.mifosplatform.integrationtests.common.loans;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public class LoanTransactionHelper {
|
||||
|
||||
private final RequestSpecification requestSpec;
|
||||
@@ -22,6 +24,7 @@ public class LoanTransactionHelper {
|
||||
private static final String APPROVE_LOAN_COMMAND = "approve";
|
||||
private static final String UNDO_APPROVAL_LOAN_COMMAND = "undoApproval";
|
||||
private static final String DISBURSE_LOAN_COMMAND = "disburse";
|
||||
private static final String DISBURSE_LOAN_TO_SAVINGS_COMMAND = "disburseToSavings";
|
||||
private static final String UNDO_DISBURSE_LOAN_COMMAND = "undoDisbursal";
|
||||
private static final String WRITE_OFF_LOAN_COMMAND = "writeoff";
|
||||
private static final String WAIVE_INTEREST_COMMAND = "waiveinterest";
|
||||
@@ -41,6 +44,11 @@ public class LoanTransactionHelper {
|
||||
return Utils.performServerPost(this.requestSpec, this.responseSpec, APPLY_LOAN_URL, loanApplicationJSON, "loanId");
|
||||
}
|
||||
|
||||
public Integer updateLoan(final Integer id, final String loanApplicationJSON) {
|
||||
return Utils.performServerPut(this.requestSpec, this.responseSpec, "/mifosng-provider/api/v1/loans/" + id
|
||||
+ "?tenantIdentifier=default", loanApplicationJSON, "loanId");
|
||||
}
|
||||
|
||||
public ArrayList getLoanRepaymentSchedule(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final Integer loanID) {
|
||||
final String URL = "/mifosng-provider/api/v1/loans/" + loanID + "?associations=repaymentSchedule&tenantIdentifier=default";
|
||||
@@ -48,6 +56,23 @@ public class LoanTransactionHelper {
|
||||
return (ArrayList) response.get("periods");
|
||||
}
|
||||
|
||||
public HashMap getLoanSummary(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer loanID) {
|
||||
final String URL = "/mifosng-provider/api/v1/loans/" + loanID + "?associations=all&tenantIdentifier=default";
|
||||
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, URL, "summary");
|
||||
return response;
|
||||
}
|
||||
|
||||
public Object getLoanDetail(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer loanID,
|
||||
final String param) {
|
||||
final String URL = "/mifosng-provider/api/v1/loans/" + loanID + "?associations=all&tenantIdentifier=default";
|
||||
return Utils.performServerGet(requestSpec, responseSpec, URL, param);
|
||||
}
|
||||
|
||||
public ArrayList getLoanCharges(final Integer loanId) {
|
||||
final String GET_LOAN_CHARGES_URL = "/mifosng-provider/api/v1/loans/" + loanId + "/charges?" + Utils.TENANT_IDENTIFIER;
|
||||
return Utils.performServerGet(requestSpec, responseSpec, GET_LOAN_CHARGES_URL, "");
|
||||
}
|
||||
|
||||
public HashMap approveLoan(final String approvalDate, final Integer loanID) {
|
||||
return performLoanTransaction(createLoanOperationURL(APPROVE_LOAN_COMMAND, loanID), getApproveLoanAsJSON(approvalDate));
|
||||
}
|
||||
@@ -60,6 +85,10 @@ public class LoanTransactionHelper {
|
||||
public HashMap disburseLoan(final String date, final Integer loanID) {
|
||||
return performLoanTransaction(createLoanOperationURL(DISBURSE_LOAN_COMMAND, loanID), getDisburseLoanAsJSON(date));
|
||||
}
|
||||
|
||||
public HashMap disburseLoanToSavings(final String date, final Integer loanID) {
|
||||
return performLoanTransaction(createLoanOperationURL(DISBURSE_LOAN_TO_SAVINGS_COMMAND, loanID), getDisburseLoanAsJSON(date));
|
||||
}
|
||||
|
||||
public HashMap undoDisbursal(final Integer loanID) {
|
||||
final String undoDisburseJson = "{'note' : 'UNDO DISBURSAL'}";
|
||||
@@ -76,6 +105,12 @@ public class LoanTransactionHelper {
|
||||
public HashMap waiveInterest(final String date, final String amountToBeWaived, final Integer loanID) {
|
||||
return performLoanTransaction(createLoanTransactionURL(WAIVE_INTEREST_COMMAND, loanID), getWaiveBodyAsJSON(date, amountToBeWaived));
|
||||
}
|
||||
|
||||
public Integer waiveInterestAndReturnTransactionId(final String date, final String amountToBeWaived, final Integer loanID) {
|
||||
Integer resourceId = Utils.performServerPost(this.requestSpec, this.responseSpec, createLoanTransactionURL(WAIVE_INTEREST_COMMAND, loanID),
|
||||
getWaiveBodyAsJSON(date, amountToBeWaived), "resourceId");
|
||||
return resourceId;
|
||||
}
|
||||
|
||||
public HashMap makeRepayment(final String date, final Float amountToBePaid, final Integer loanID) {
|
||||
return performLoanTransaction(createLoanTransactionURL(MAKE_REPAYMENT_COMMAND, loanID),
|
||||
@@ -87,6 +122,45 @@ public class LoanTransactionHelper {
|
||||
getWithdrawLoanApplicationBodyAsJSON(date));
|
||||
}
|
||||
|
||||
public Integer addChargesForLoan(final Integer loanId, final String request) {
|
||||
System.out.println("--------------------------------- ADD CHARGES FOR LOAN --------------------------------");
|
||||
final String ADD_CHARGES_URL = "/mifosng-provider/api/v1/loans/" + loanId + "/charges?tenantIdentifier=default";
|
||||
final HashMap response = Utils.performServerPost(requestSpec, responseSpec, ADD_CHARGES_URL, request, "");
|
||||
return (Integer) response.get("resourceId");
|
||||
}
|
||||
|
||||
public Integer updateChargesForLoan(final Integer loanId, final Integer loanchargeId, final String request) {
|
||||
System.out.println("--------------------------------- ADD CHARGES FOR LOAN --------------------------------");
|
||||
final String UPDATE_CHARGES_URL = "/mifosng-provider/api/v1/loans/" + loanId + "/charges/" + loanchargeId
|
||||
+ "?tenantIdentifier=default";
|
||||
final HashMap response = Utils.performServerPut(requestSpec, responseSpec, UPDATE_CHARGES_URL, request, "");
|
||||
return (Integer) response.get("resourceId");
|
||||
}
|
||||
|
||||
public Integer deleteChargesForLoan(final Integer loanId, final Integer loanchargeId) {
|
||||
System.out.println("--------------------------------- DELETE CHARGES FOR LOAN --------------------------------");
|
||||
final String DELETE_CHARGES_URL = "/mifosng-provider/api/v1/loans/" + loanId + "/charges/" + loanchargeId
|
||||
+ "?tenantIdentifier=default";
|
||||
final HashMap response = Utils.performServerDelete(requestSpec, responseSpec, DELETE_CHARGES_URL, "");
|
||||
return (Integer) response.get("resourceId");
|
||||
}
|
||||
|
||||
public Integer waiveChargesForLoan(final Integer loanId, final Integer loanchargeId, final String json) {
|
||||
System.out.println("--------------------------------- WAIVE CHARGES FOR LOAN --------------------------------");
|
||||
final String CHARGES_URL = "/mifosng-provider/api/v1/loans/" + loanId + "/charges/" + loanchargeId
|
||||
+ "?command=waive&tenantIdentifier=default";
|
||||
final HashMap response = Utils.performServerPost(requestSpec, responseSpec, CHARGES_URL, json, "");
|
||||
return (Integer) response.get("resourceId");
|
||||
}
|
||||
|
||||
public Integer payChargesForLoan(final Integer loanId, final Integer loanchargeId, final String json) {
|
||||
System.out.println("--------------------------------- WAIVE CHARGES FOR LOAN --------------------------------");
|
||||
final String CHARGES_URL = "/mifosng-provider/api/v1/loans/" + loanId + "/charges/" + loanchargeId
|
||||
+ "?command=pay&tenantIdentifier=default";
|
||||
final HashMap response = Utils.performServerPost(requestSpec, responseSpec, CHARGES_URL, json, "");
|
||||
return (Integer) response.get("resourceId");
|
||||
}
|
||||
|
||||
private String getDisburseLoanAsJSON(final String actualDisbursementDate) {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
map.put("locale", "en");
|
||||
@@ -144,6 +218,80 @@ public class LoanTransactionHelper {
|
||||
|
||||
}
|
||||
|
||||
public static String getSpecifiedDueDateChargesForLoanAsJSON(final String chargeId) {
|
||||
return getSpecifiedDueDateChargesForLoanAsJSON(chargeId, "12 January 2013", "100");
|
||||
}
|
||||
|
||||
public static String getSpecifiedDueDateChargesForLoanAsJSON(final String chargeId, final String dueDate, final String amount) {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
map.put("locale", "en_GB");
|
||||
map.put("dateFormat", "dd MMMM yyyy");
|
||||
map.put("amount", amount);
|
||||
map.put("dueDate", dueDate);
|
||||
map.put("chargeId", chargeId);
|
||||
String json = new Gson().toJson(map);
|
||||
System.out.println(json);
|
||||
return json;
|
||||
}
|
||||
|
||||
public static String getDisbursementChargesForLoanAsJSON(final String chargeId) {
|
||||
return getDisbursementChargesForLoanAsJSON(chargeId, "100");
|
||||
}
|
||||
|
||||
public static String getDisbursementChargesForLoanAsJSON(final String chargeId, String amount) {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
map.put("locale", "en_GB");
|
||||
map.put("dateFormat", "dd MMMM yyyy");
|
||||
map.put("amount", amount);
|
||||
map.put("chargeId", chargeId);
|
||||
String json = new Gson().toJson(map);
|
||||
System.out.println(json);
|
||||
return json;
|
||||
}
|
||||
|
||||
public static String getInstallmentChargesForLoanAsJSON(final String chargeId, final String amount) {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
map.put("locale", "en_GB");
|
||||
map.put("dateFormat", "dd MMMM yyyy");
|
||||
map.put("amount", amount);
|
||||
map.put("chargeId", chargeId);
|
||||
String json = new Gson().toJson(map);
|
||||
System.out.println(json);
|
||||
return json;
|
||||
}
|
||||
|
||||
public static String getUpdateChargesForLoanAsJSON(String amount) {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
map.put("locale", "en_GB");
|
||||
map.put("dateFormat", "dd MMMM yyyy");
|
||||
map.put("amount", amount);
|
||||
String json = new Gson().toJson(map);
|
||||
System.out.println(json);
|
||||
return json;
|
||||
}
|
||||
|
||||
public static String getPayChargeJSON(final String date, final String installmentNumber) {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
map.put("locale", "en_GB");
|
||||
map.put("dateFormat", "dd MMMM yyyy");
|
||||
map.put("transactionDate", date);
|
||||
if (installmentNumber != null) {
|
||||
map.put("installmentNumber", installmentNumber);
|
||||
}
|
||||
String json = new Gson().toJson(map);
|
||||
System.out.println(json);
|
||||
return json;
|
||||
}
|
||||
|
||||
public static String getWaiveChargeJSON(final String installmentNumber) {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
map.put("locale", "en_GB");
|
||||
map.put("installmentNumber", installmentNumber);
|
||||
String json = new Gson().toJson(map);
|
||||
System.out.println(json);
|
||||
return json;
|
||||
}
|
||||
|
||||
public String getLoanCalculationBodyAsJSON(final String productID) {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
map.put("dateFormat", "dd MMMM yyyy");
|
||||
@@ -180,11 +328,40 @@ public class LoanTransactionHelper {
|
||||
return (HashMap) response.get("status");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void verifyRepaymentScheduleEntryFor(final int repaymentNumber, final float expectedPrincipalOutstanding, final Integer loanID) {
|
||||
System.out.println("---------------------------GETTING LOAN REPAYMENT SCHEDULE--------------------------------");
|
||||
final ArrayList<HashMap> repaymentPeriods = getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
|
||||
assertEquals("Mismatch in Principal Loan Balance Outstanding ", expectedPrincipalOutstanding, repaymentPeriods.get(repaymentNumber)
|
||||
.get("principalLoanBalanceOutstanding"));
|
||||
}
|
||||
|
||||
public void checkAccrualTransactionForRepayment(final LocalDate transactionDate, final Float interestPortion, final Float feePortion,
|
||||
final Float penaltyPortion, final Integer loanID) {
|
||||
|
||||
ArrayList<HashMap> transactions = (ArrayList<HashMap>) getLoanDetail(this.requestSpec, this.responseSpec, loanID, "transactions");
|
||||
boolean isTransactionFound = false;
|
||||
for (int i = 0; i < transactions.size(); i++) {
|
||||
HashMap transactionType = (HashMap) transactions.get(i).get("type");
|
||||
boolean isAccrualTransaction = (Boolean) transactionType.get("accrual");
|
||||
|
||||
if (isAccrualTransaction) {
|
||||
ArrayList<Integer> accrualEntryDateAsArray = (ArrayList<Integer>) transactions.get(i).get("date");
|
||||
LocalDate accrualEntryDate = new LocalDate(accrualEntryDateAsArray.get(0), accrualEntryDateAsArray.get(1),
|
||||
accrualEntryDateAsArray.get(2));
|
||||
|
||||
if (transactionDate.equals(accrualEntryDate)) {
|
||||
isTransactionFound = true;
|
||||
assertEquals("Mismatch in transaction amounts", interestPortion,
|
||||
Float.valueOf(String.valueOf(transactions.get(i).get("interestPortion"))));
|
||||
assertEquals("Mismatch in transaction amounts", feePortion,
|
||||
Float.valueOf(String.valueOf(transactions.get(i).get("feeChargesPortion"))));
|
||||
assertEquals("Mismatch in transaction amounts", penaltyPortion,
|
||||
Float.valueOf(String.valueOf(transactions.get(i).get("penaltyChargesPortion"))));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
assertTrue("No Accrual entries are posted", isTransactionFound);
|
||||
|
||||
}
|
||||
}
|
||||
+537
@@ -0,0 +1,537 @@
|
||||
package org.mifosplatform.integrationtests.common.recurringdeposit;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings({ "unused", "rawtypes" })
|
||||
public class RecurringDepositAccountHelper {
|
||||
|
||||
private final RequestSpecification requestSpec;
|
||||
private final ResponseSpecification responseSpec;
|
||||
|
||||
public RecurringDepositAccountHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
|
||||
this.requestSpec = requestSpec;
|
||||
this.responseSpec = responseSpec;
|
||||
}
|
||||
|
||||
private static final String RECURRING_DEPOSIT_ACCOUNT_URL = "/mifosng-provider/api/v1/recurringdepositaccounts";
|
||||
private static final String APPLY_RECURRING_DEPOSIT_ACCOUNT_URL = RECURRING_DEPOSIT_ACCOUNT_URL + "?" + Utils.TENANT_IDENTIFIER;
|
||||
private static final String APPROVE_RECURRING_DEPOSIT_COMMAND = "approve";
|
||||
private static final String UNDO_APPROVAL_RECURRING_DEPOSIT_COMMAND = "undoapproval";
|
||||
private static final String REJECT_RECURRING_DEPOSIT_COMMAND = "reject";
|
||||
private static final String WITHDRAWN_BY_CLIENT_RECURRING_DEPOSIT_COMMAND = "withdrawnByApplicant";
|
||||
private static final String ACTIVATE_RECURRING_DEPOSIT_COMMAND = "activate";
|
||||
private static final String CLOSE_RECURRING_DEPOSIT_COMMAND = "close";
|
||||
private static final String POST_INTEREST_RECURRING_DEPOSIT_COMMAND = "postInterest";
|
||||
private static final String CALCULATE_INTEREST_RECURRING_DEPOSIT_COMMAND = "calculateInterest";
|
||||
private static final String CALCULATE_PREMATURE_AMOUNT_COMMAND = "calculatePrematureAmount";
|
||||
private static final String PREMATURE_CLOSE_COMMAND = "prematureClose";
|
||||
private static final String DEPOSIT_INTO_RECURRING_DEPOSIT_COMMAND = "deposit";
|
||||
private static final String MODIFY_TRANSACTION_COMMAND = "modify";
|
||||
private static final String UNDO_TRANSACTION_COMMAND = "undo";
|
||||
|
||||
private static final String LOCALE = "en_GB";
|
||||
private static final String DIGITS_AFTER_DECIMAL = "4";
|
||||
private static final String IN_MULTIPLES_OF = "100";
|
||||
private static final String USD = "USD";
|
||||
private static final String DAYS = "0";
|
||||
private static final String WEEKS = "1";
|
||||
private static final String MONTHS = "2";
|
||||
private static final String YEARS = "3";
|
||||
private static final String DAILY = "1";
|
||||
private static final String MONTHLY = "4";
|
||||
private static final String QUARTERLY = "5";
|
||||
private static final String BI_ANNUALLY = "6";
|
||||
private static final String ANNUALLY = "7";
|
||||
private static final String INTEREST_CALCULATION_USING_DAILY_BALANCE = "1";
|
||||
private static final String INTEREST_CALCULATION_USING_AVERAGE_DAILY_BALANCE = "2";
|
||||
private static final String DAYS_360 = "360";
|
||||
private static final String DAYS_365 = "365";
|
||||
private static final String NONE = "1";
|
||||
private static final String CASH_BASED = "2";
|
||||
private static final String ACCRUAL_PERIODIC = "3";
|
||||
private static final String ACCRUAL_UPFRONT = "4";
|
||||
|
||||
private String interestCompoundingPeriodType = MONTHLY;
|
||||
private String interestPostingPeriodType = MONTHLY;
|
||||
private String interestCalculationType = INTEREST_CALCULATION_USING_DAILY_BALANCE;
|
||||
private final String lockinPeriodFrequency = "1";
|
||||
private final String lockingPeriodFrequencyType = MONTHS;
|
||||
private final String minDepositTerm = "6";
|
||||
private final String minDepositTermTypeId = MONTHS;
|
||||
private final String maxDepositTerm = "10";
|
||||
private final String maxDepositTermTypeId = YEARS;
|
||||
private final String inMultiplesOfDepositTerm = "2";
|
||||
private final String inMultiplesOfDepositTermTypeId = MONTHS;
|
||||
private final String preClosurePenalInterest = "2";
|
||||
private final boolean preClosurePenalApplicable = true;
|
||||
private final boolean isActiveChart = true;
|
||||
private final String currencyCode = USD;
|
||||
private String interestCalculationDaysInYearType = DAYS_365;
|
||||
private final String depositAmount = "2000";
|
||||
private final String depositPeriod = "14";
|
||||
private final String depositPeriodFrequencyId = MONTHS;
|
||||
private final String recurringFrequency = "1";
|
||||
private final String recurringFrequencyType = MONTHS;
|
||||
private final String mandatoryRecommendedDepositAmount = "2000";
|
||||
private String submittedOnDate = "";
|
||||
private String expectedFirstDepositOnDate = "";
|
||||
private boolean isCalendarInherited = false;
|
||||
|
||||
public String build(final String clientId, final String productId, final String validFrom, final String validTo,
|
||||
final String penalInterestType) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
|
||||
List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
|
||||
HashMap<String, String> chartSlabsMap1 = new HashMap<String, String>();
|
||||
chartSlabsMap1.put("description", "First");
|
||||
chartSlabsMap1.put("periodType", MONTHS);
|
||||
chartSlabsMap1.put("fromPeriod", "1");
|
||||
chartSlabsMap1.put("toPeriod", "6");
|
||||
chartSlabsMap1.put("annualInterestRate", "5");
|
||||
chartSlabsMap1.put("locale", LOCALE);
|
||||
chartSlabs.add(0, chartSlabsMap1);
|
||||
|
||||
HashMap<String, String> chartSlabsMap2 = new HashMap<String, String>();
|
||||
chartSlabsMap2.put("description", "Second");
|
||||
chartSlabsMap2.put("periodType", MONTHS);
|
||||
chartSlabsMap2.put("fromPeriod", "7");
|
||||
chartSlabsMap2.put("toPeriod", "12");
|
||||
chartSlabsMap2.put("annualInterestRate", "6");
|
||||
chartSlabsMap2.put("locale", LOCALE);
|
||||
chartSlabs.add(1, chartSlabsMap2);
|
||||
|
||||
HashMap<String, String> chartSlabsMap3 = new HashMap<String, String>();
|
||||
chartSlabsMap3.put("description", "Third");
|
||||
chartSlabsMap3.put("periodType", MONTHS);
|
||||
chartSlabsMap3.put("fromPeriod", "13");
|
||||
chartSlabsMap3.put("toPeriod", "18");
|
||||
chartSlabsMap3.put("annualInterestRate", "7");
|
||||
chartSlabsMap3.put("locale", LOCALE);
|
||||
chartSlabs.add(2, chartSlabsMap3);
|
||||
|
||||
HashMap<String, String> chartSlabsMap4 = new HashMap<String, String>();
|
||||
chartSlabsMap4.put("description", "Fourth");
|
||||
chartSlabsMap4.put("periodType", MONTHS);
|
||||
chartSlabsMap4.put("fromPeriod", "19");
|
||||
chartSlabsMap4.put("toPeriod", "24");
|
||||
chartSlabsMap4.put("annualInterestRate", "8");
|
||||
chartSlabsMap4.put("locale", LOCALE);
|
||||
chartSlabs.add(3, chartSlabsMap4);
|
||||
|
||||
List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>();
|
||||
HashMap<String, Object> chartsMap = new HashMap<String, Object>();
|
||||
chartsMap.put("fromDate", validFrom);
|
||||
chartsMap.put("endDate", validTo);
|
||||
chartsMap.put("dateFormat", "dd MMMM yyyy");
|
||||
chartsMap.put("locale", LOCALE);
|
||||
chartsMap.put("isActiveChart", this.isActiveChart);
|
||||
chartsMap.put("chartSlabs", chartSlabs);
|
||||
charts.add(chartsMap);
|
||||
|
||||
map.put("charts", charts);
|
||||
map.put("productId", productId);
|
||||
map.put("clientId", clientId);
|
||||
map.put("interestCalculationDaysInYearType", this.interestCalculationDaysInYearType);
|
||||
map.put("locale", LOCALE);
|
||||
map.put("dateFormat", "dd MMMM yyyy");
|
||||
map.put("monthDayFormat", "dd MMM");
|
||||
map.put("interestCalculationType", this.interestCalculationType);
|
||||
map.put("interestCompoundingPeriodType", this.interestCompoundingPeriodType);
|
||||
map.put("interestPostingPeriodType", this.interestPostingPeriodType);
|
||||
map.put("lockinPeriodFrequency", this.lockinPeriodFrequency);
|
||||
map.put("lockinPeriodFrequencyType", this.lockingPeriodFrequencyType);
|
||||
map.put("preClosurePenalApplicable", "true");
|
||||
map.put("minDepositTermTypeId", this.minDepositTermTypeId);
|
||||
map.put("minDepositTerm", this.minDepositTerm);
|
||||
map.put("maxDepositTermTypeId", this.maxDepositTermTypeId);
|
||||
map.put("maxDepositTerm", this.maxDepositTerm);
|
||||
map.put("preClosurePenalApplicable", this.preClosurePenalApplicable);
|
||||
map.put("inMultiplesOfDepositTerm", this.inMultiplesOfDepositTerm);
|
||||
map.put("inMultiplesOfDepositTermTypeId", this.inMultiplesOfDepositTermTypeId);
|
||||
map.put("preClosurePenalInterest", this.preClosurePenalInterest);
|
||||
map.put("preClosurePenalInterestOnTypeId", penalInterestType);
|
||||
map.put("depositAmount", this.depositAmount);
|
||||
map.put("depositPeriod", this.depositPeriod);
|
||||
map.put("depositPeriodFrequencyId", this.depositPeriodFrequencyId);
|
||||
map.put("submittedOnDate", this.submittedOnDate);
|
||||
map.put("recurringFrequency", this.recurringFrequency);
|
||||
map.put("recurringFrequencyType", this.recurringFrequencyType);
|
||||
map.put("mandatoryRecommendedDepositAmount", this.mandatoryRecommendedDepositAmount);
|
||||
map.put("expectedFirstDepositOnDate", this.expectedFirstDepositOnDate);
|
||||
map.put("isCalendarInherited", this.isCalendarInherited);
|
||||
|
||||
String recurringDepositAccountJson = new Gson().toJson(map);
|
||||
System.out.println(recurringDepositAccountJson);
|
||||
return recurringDepositAccountJson;
|
||||
}
|
||||
|
||||
public static Integer applyRecurringDepositApplication(final String recurringDepositAccountAsJson,
|
||||
final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
|
||||
System.out.println("--------------------- APPLYING FOR RECURRING DEPOSIT ACCOUNT ------------------------");
|
||||
return Utils.performServerPost(requestSpec, responseSpec, APPLY_RECURRING_DEPOSIT_ACCOUNT_URL, recurringDepositAccountAsJson,
|
||||
CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
}
|
||||
|
||||
public static HashMap getRecurringDepositAccountById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final Integer accountID) {
|
||||
final String GET_RECURRING_DEPOSIT_BY_ID_URL = RECURRING_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?" + Utils.TENANT_IDENTIFIER;
|
||||
System.out.println("------------------------ RETRIEVING RECURRING DEPOSIT ACCOUNT BY ID -------------------------");
|
||||
return Utils.performServerGet(requestSpec, responseSpec, GET_RECURRING_DEPOSIT_BY_ID_URL, "");
|
||||
}
|
||||
|
||||
public HashMap getRecurringDepositSummary(final Integer accountID) {
|
||||
final String URL = RECURRING_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?" + Utils.TENANT_IDENTIFIER;
|
||||
final HashMap response = Utils.performServerGet(requestSpec, responseSpec, URL, "summary");
|
||||
return response;
|
||||
}
|
||||
|
||||
public static Float getInterestRate(ArrayList<ArrayList<HashMap>> interestSlabData, Integer depositPeriod) {
|
||||
|
||||
Float annualInterestRate = 0.0f;
|
||||
for (Integer slabIndex = 0; slabIndex < interestSlabData.get(0).size(); slabIndex++) {
|
||||
Integer fromPeriod = (Integer) interestSlabData.get(0).get(slabIndex).get("fromPeriod");
|
||||
Integer toPeriod = (Integer) interestSlabData.get(0).get(slabIndex).get("toPeriod");
|
||||
if (depositPeriod >= fromPeriod && depositPeriod <= toPeriod) {
|
||||
annualInterestRate = (Float) interestSlabData.get(0).get(slabIndex).get("annualInterestRate");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return annualInterestRate;
|
||||
}
|
||||
|
||||
public static Float getPrincipalAfterCompoundingInterest(Calendar currentDate, Float principal, Float depositAmount, Integer depositPeriod,
|
||||
double interestPerDay, Integer compoundingInterval, Integer postingInterval) {
|
||||
|
||||
Float totalInterest = 0.0f;
|
||||
Float interestEarned = 0.0f;
|
||||
|
||||
for (int i = 1; i <= depositPeriod; i++) {
|
||||
Integer daysInMonth = currentDate.getActualMaximum(Calendar.DATE);
|
||||
principal += depositAmount;
|
||||
for (int j = 0; j < daysInMonth; j++) {
|
||||
|
||||
interestEarned = (float) (principal * interestPerDay);
|
||||
totalInterest += interestEarned;
|
||||
if (compoundingInterval == 0) {
|
||||
principal += interestEarned;
|
||||
}
|
||||
|
||||
}
|
||||
if ((i % postingInterval) == 0 || i == depositPeriod) {
|
||||
if (compoundingInterval != 0) {
|
||||
principal += totalInterest;
|
||||
}
|
||||
totalInterest = 0.0f;
|
||||
System.out.println(principal);
|
||||
|
||||
}
|
||||
currentDate.add(Calendar.MONTH, 1);
|
||||
interestEarned = 0.0f;
|
||||
}
|
||||
return principal;
|
||||
}
|
||||
|
||||
public HashMap updateRecurringDepositAccount(final String clientID, final String productID, final String accountID,
|
||||
final String validFrom, final String validTo, final String penalInterestType, final String submittedOnDate) {
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
todaysDate.add(Calendar.DATE, -1);
|
||||
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String EXPECTED_FIRST_DEPOSIT_ON_ON_DATE = SUBMITTED_ON_DATE;
|
||||
final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec)
|
||||
.withSubmittedOnDate(SUBMITTED_ON_DATE).withExpectedFirstDepositOnDate(EXPECTED_FIRST_DEPOSIT_ON_ON_DATE)
|
||||
.build(clientID, productID, validFrom, validTo, penalInterestType);
|
||||
|
||||
return Utils.performServerPut(this.requestSpec, this.responseSpec, RECURRING_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?"
|
||||
+ Utils.TENANT_IDENTIFIER, recurringDepositApplicationJSON, CommonConstants.RESPONSE_CHANGES);
|
||||
}
|
||||
|
||||
public HashMap updateInterestCalculationConfigForRecurringDeposit(final String clientID, final String productID,
|
||||
final String accountID, final String submittedOnDate, final String validFrom, final String validTo,
|
||||
final String numberOfDaysPerYear, final String penalInterestType, final String interestCalculationType,
|
||||
final String interestCompoundingPeriodType, final String interestPostingPeriodType, final String expectedFirstDepositOnDate) {
|
||||
|
||||
final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec) //
|
||||
.withSubmittedOnDate(submittedOnDate) //
|
||||
.withNumberOfDaysPerYear(numberOfDaysPerYear) //
|
||||
.withInterestCalculationPeriodType(interestCalculationType) //
|
||||
.withInterestCompoundingPeriodType(interestCompoundingPeriodType) //
|
||||
.withInterestPostingPeriodType(interestPostingPeriodType) //
|
||||
.withExpectedFirstDepositOnDate(expectedFirstDepositOnDate) //
|
||||
.build(clientID, productID, validFrom, validTo, penalInterestType);
|
||||
|
||||
return Utils.performServerPut(this.requestSpec, this.responseSpec, RECURRING_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?"
|
||||
+ Utils.TENANT_IDENTIFIER, recurringDepositApplicationJSON, CommonConstants.RESPONSE_CHANGES);
|
||||
}
|
||||
|
||||
public Integer updateTransactionForRecurringDeposit(final Integer accountID, final Integer transactionId, final String transactionDate,
|
||||
final Float transactionAmount) {
|
||||
System.out.println("--------------------------------- UPDATE RECURRING DEPOSIT TRANSACTION ------------------------------------");
|
||||
return Utils.performServerPost(this.requestSpec, this.responseSpec, RECURRING_DEPOSIT_ACCOUNT_URL + "/" + accountID
|
||||
+ "/transactions/" + transactionId + "?command=" + MODIFY_TRANSACTION_COMMAND,
|
||||
getUpdateTransactionAsJSON(transactionDate, transactionAmount), CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
}
|
||||
|
||||
public Integer undoTransactionForRecurringDeposit(final Integer accountID, final Integer transactionId, final String transactionDate,
|
||||
final Float transactionAmount) {
|
||||
System.out.println("--------------------------------- UNDO RECURRING DEPOSIT TRANSACTION ------------------------------------");
|
||||
return Utils.performServerPost(this.requestSpec, this.responseSpec, RECURRING_DEPOSIT_ACCOUNT_URL + "/" + accountID
|
||||
+ "/transactions/" + transactionId + "?command=" + UNDO_TRANSACTION_COMMAND,
|
||||
getUpdateTransactionAsJSON(transactionDate, transactionAmount), CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
}
|
||||
|
||||
public HashMap approveRecurringDeposit(final Integer recurringDepositAccountID, final String approvedOnDate) {
|
||||
System.out
|
||||
.println("--------------------------------- APPROVING RECURRING DEPOSIT APPLICATION ------------------------------------");
|
||||
return performRecurringDepositApplicationActions(
|
||||
createRecurringDepositOperationURL(APPROVE_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountID),
|
||||
getApproveRecurringDepositAccountAsJSON(approvedOnDate));
|
||||
}
|
||||
|
||||
public HashMap undoApproval(final Integer recurringDepositAccountID) {
|
||||
System.out
|
||||
.println("--------------------------------- UNDO APPROVING RECURRING DEPOSIT APPLICATION -------------------------------");
|
||||
final String undoBodyJson = "{'note':'UNDO APPROVAL'}";
|
||||
return performRecurringDepositApplicationActions(
|
||||
createRecurringDepositOperationURL(UNDO_APPROVAL_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountID), undoBodyJson);
|
||||
}
|
||||
|
||||
public HashMap rejectApplication(final Integer recurringDepositAccountID, final String rejectedOnDate) {
|
||||
System.out.println("--------------------------------- REJECT RECURRING DEPOSIT APPLICATION -------------------------------");
|
||||
return performRecurringDepositApplicationActions(
|
||||
createRecurringDepositOperationURL(REJECT_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountID),
|
||||
getRejectedRecurringDepositAsJSON(rejectedOnDate));
|
||||
}
|
||||
|
||||
public HashMap withdrawApplication(final Integer recurringDepositAccountID, final String withdrawApplicationOnDate) {
|
||||
System.out.println("--------------------------------- WITHDRAW RECURRING DEPOSIT APPLICATION -------------------------------");
|
||||
return performRecurringDepositApplicationActions(
|
||||
createRecurringDepositOperationURL(WITHDRAWN_BY_CLIENT_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountID),
|
||||
getWithdrawnRecurringDepositAccountAsJSON(withdrawApplicationOnDate));
|
||||
}
|
||||
|
||||
public HashMap activateRecurringDeposit(final Integer recurringDepositAccountID, final String activationDate) {
|
||||
System.out
|
||||
.println("---------------------------------- ACTIVATING RECURRING DEPOSIT APPLICATION ----------------------------------");
|
||||
return performRecurringDepositApplicationActions(
|
||||
createRecurringDepositOperationURL(ACTIVATE_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountID),
|
||||
getActivatedRecurringDepositAccountAsJSON(activationDate));
|
||||
}
|
||||
|
||||
public Object deleteRecurringDepositApplication(final Integer recurringDepositAccountID, final String jsonAttributeToGetBack) {
|
||||
System.out.println("---------------------------------- DELETE RECURRING DEPOSIT APPLICATION ----------------------------------");
|
||||
return Utils.performServerDelete(this.requestSpec, this.responseSpec, RECURRING_DEPOSIT_ACCOUNT_URL + "/"
|
||||
+ recurringDepositAccountID + "?" + Utils.TENANT_IDENTIFIER, jsonAttributeToGetBack);
|
||||
|
||||
}
|
||||
|
||||
public Integer calculateInterestForRecurringDeposit(final Integer recurringDepositAccountId) {
|
||||
System.out.println("--------------------------------- CALCULATING INTEREST FOR RECURRING DEPOSIT --------------------------------");
|
||||
return (Integer) performRecurringDepositActions(
|
||||
createRecurringDepositCalculateInterestURL(CALCULATE_INTEREST_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountId),
|
||||
getCalculatedInterestForRecurringDepositApplicationAsJSON(), CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
}
|
||||
|
||||
public Integer postInterestForRecurringDeposit(final Integer recurringDepositAccountId) {
|
||||
System.out.println("--------------------------------- POST INTEREST FOR RECURRING DEPOSIT --------------------------------");
|
||||
return (Integer) performRecurringDepositActions(
|
||||
createRecurringDepositCalculateInterestURL(POST_INTEREST_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountId),
|
||||
getCalculatedInterestForRecurringDepositApplicationAsJSON(), CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
}
|
||||
|
||||
public Integer depositToRecurringDepositAccount(final Integer recurringDepositAccountId, final Float depositAmount,
|
||||
final String depositedOnDate) {
|
||||
System.out.println("--------------------------------- DEPOSIT TO RECURRING DEPOSIT ACCOUNT --------------------------------");
|
||||
return (Integer) performRecurringDepositActions(
|
||||
createDepositToRecurringDepositURL(DEPOSIT_INTO_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountId),
|
||||
getDepositToRecurringDepositAccountAsJSON(depositAmount, depositedOnDate), CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
}
|
||||
|
||||
public HashMap calculatePrematureAmountForRecurringDeposit(final Integer recurringDepositAccountId, final String closedOnDate) {
|
||||
System.out.println("--------------------- CALCULATING PREMATURE AMOUNT FOR RECURRING DEPOSIT ----------------------------");
|
||||
return (HashMap) performRecurringDepositActions(
|
||||
createRecurringDepositCalculateInterestURL(CALCULATE_PREMATURE_AMOUNT_COMMAND, recurringDepositAccountId),
|
||||
getCalculatedPrematureAmountForRecurringDepositAccountAsJSON(closedOnDate), "");
|
||||
}
|
||||
|
||||
public Object prematureCloseForRecurringDeposit(final Integer recurringDepositAccountId, final String closedOnDate,
|
||||
final String closureType, final Integer toSavingsId, final String jsonAttributeToGetBack) {
|
||||
System.out.println("--------------------- PREMATURE CLOSE FOR RECURRING DEPOSIT ----------------------------");
|
||||
return performRecurringDepositActions(
|
||||
createRecurringDepositCalculateInterestURL(PREMATURE_CLOSE_COMMAND, recurringDepositAccountId),
|
||||
getPrematureCloseForRecurringDepositAccountAsJSON(closedOnDate, closureType, toSavingsId), jsonAttributeToGetBack);
|
||||
}
|
||||
|
||||
private String getApproveRecurringDepositAccountAsJSON(final String approvedOnDate) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("approvedOnDate", approvedOnDate);
|
||||
map.put("note", "Approval NOTE");
|
||||
String recurringDepositAccountApproveJson = new Gson().toJson(map);
|
||||
System.out.println(recurringDepositAccountApproveJson);
|
||||
return recurringDepositAccountApproveJson;
|
||||
}
|
||||
|
||||
private String getUpdateTransactionAsJSON(final String transactionDate, final Float transactionAmount) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("transactionDate", transactionDate);
|
||||
map.put("transactionAmount", transactionAmount);
|
||||
String updateTransactionJson = new Gson().toJson(map);
|
||||
System.out.println(updateTransactionJson);
|
||||
return updateTransactionJson;
|
||||
}
|
||||
|
||||
private String getRejectedRecurringDepositAsJSON(final String rejectedOnDate) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("rejectedOnDate", rejectedOnDate);
|
||||
map.put("note", "Rejected NOTE");
|
||||
String recurringDepositAccountJson = new Gson().toJson(map);
|
||||
System.out.println(recurringDepositAccountJson);
|
||||
return recurringDepositAccountJson;
|
||||
}
|
||||
|
||||
private String getWithdrawnRecurringDepositAccountAsJSON(final String withdrawnApplicationOnDate) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("withdrawnOnDate", withdrawnApplicationOnDate);
|
||||
map.put("note", "Withdraw NOTE");
|
||||
String recurringDepositAccountJson = new Gson().toJson(map);
|
||||
System.out.println(recurringDepositAccountJson);
|
||||
return recurringDepositAccountJson;
|
||||
}
|
||||
|
||||
private String getActivatedRecurringDepositAccountAsJSON(final String activationDate) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("activatedOnDate", activationDate);
|
||||
String recurringDepositAccountActivateJson = new Gson().toJson(map);
|
||||
System.out.println(recurringDepositAccountActivateJson);
|
||||
return recurringDepositAccountActivateJson;
|
||||
}
|
||||
|
||||
private String getCalculatedInterestForRecurringDepositApplicationAsJSON() {
|
||||
final HashMap<String, String> map = new HashMap<String, String>();
|
||||
String recurringDepositAccountCalculatedInterestJson = new Gson().toJson(map);
|
||||
System.out.println(recurringDepositAccountCalculatedInterestJson);
|
||||
return recurringDepositAccountCalculatedInterestJson;
|
||||
}
|
||||
|
||||
private String getCalculatedPrematureAmountForRecurringDepositAccountAsJSON(final String closedOnDate) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("closedOnDate", closedOnDate);
|
||||
String recurringDepositAccountPrematureClosureJson = new Gson().toJson(map);
|
||||
System.out.println(recurringDepositAccountPrematureClosureJson);
|
||||
return recurringDepositAccountPrematureClosureJson;
|
||||
}
|
||||
|
||||
private String getDepositToRecurringDepositAccountAsJSON(final Float depositAmount, final String depositedOnDate) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("transactionAmount", depositAmount);
|
||||
map.put("transactionDate", depositedOnDate);
|
||||
String recurringDepositAccountPrematureClosureJson = new Gson().toJson(map);
|
||||
System.out.println(recurringDepositAccountPrematureClosureJson);
|
||||
return recurringDepositAccountPrematureClosureJson;
|
||||
}
|
||||
|
||||
private String getPrematureCloseForRecurringDepositAccountAsJSON(final String closedOnDate, final String closureType,
|
||||
final Integer toSavingsId) {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("locale", CommonConstants.locale);
|
||||
map.put("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("closedOnDate", closedOnDate);
|
||||
map.put("onAccountClosureId", closureType);
|
||||
if (toSavingsId != null) {
|
||||
map.put("toSavingsAccountId", toSavingsId);
|
||||
map.put("transferDescription", "Transferring To Savings Account");
|
||||
}
|
||||
String recurringDepositAccountPrematureCloseJson = new Gson().toJson(map);
|
||||
System.out.println(recurringDepositAccountPrematureCloseJson);
|
||||
return recurringDepositAccountPrematureCloseJson;
|
||||
}
|
||||
|
||||
private String createRecurringDepositOperationURL(final String command, final Integer recurringDepositAccountID) {
|
||||
return RECURRING_DEPOSIT_ACCOUNT_URL + "/" + recurringDepositAccountID + "?command=" + command + "&" + Utils.TENANT_IDENTIFIER;
|
||||
}
|
||||
|
||||
private Object performRecurringDepositActions(final String postURLForRecurringDeposit, final String jsonToBeSent,
|
||||
final String jsonAttributeToGetBack) {
|
||||
return Utils.performServerPost(this.requestSpec, this.responseSpec, postURLForRecurringDeposit, jsonToBeSent,
|
||||
jsonAttributeToGetBack);
|
||||
}
|
||||
|
||||
private HashMap performRecurringDepositApplicationActions(final String postURLForRecurringDepositAction, final String jsonToBeSent) {
|
||||
HashMap status = null;
|
||||
final HashMap response = Utils.performServerPost(this.requestSpec, this.responseSpec, postURLForRecurringDepositAction,
|
||||
jsonToBeSent, CommonConstants.RESPONSE_CHANGES);
|
||||
if (response != null) {
|
||||
status = (HashMap) response.get("status");
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
private String createRecurringDepositCalculateInterestURL(final String command, final Integer recurringDepositAccountID) {
|
||||
return RECURRING_DEPOSIT_ACCOUNT_URL + "/" + recurringDepositAccountID + "?command=" + command + "&" + Utils.TENANT_IDENTIFIER;
|
||||
}
|
||||
|
||||
private String createDepositToRecurringDepositURL(final String command, final Integer recurringDepositAccountID) {
|
||||
return RECURRING_DEPOSIT_ACCOUNT_URL + "/" + recurringDepositAccountID + "/transactions" + "?command=" + command + "&"
|
||||
+ Utils.TENANT_IDENTIFIER;
|
||||
}
|
||||
|
||||
public RecurringDepositAccountHelper withSubmittedOnDate(final String recurringDepositApplicationSubmittedDate) {
|
||||
this.submittedOnDate = recurringDepositApplicationSubmittedDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RecurringDepositAccountHelper withExpectedFirstDepositOnDate(final String recurringDepositApplicationExpectedFirstDepositOnDate) {
|
||||
this.expectedFirstDepositOnDate = recurringDepositApplicationExpectedFirstDepositOnDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RecurringDepositAccountHelper withNumberOfDaysPerYear(final String numberOfDaysPerYearTypeId) {
|
||||
this.interestCalculationDaysInYearType = numberOfDaysPerYearTypeId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RecurringDepositAccountHelper withInterestCalculationPeriodType(final String interestCalculationTypeId) {
|
||||
this.interestCalculationType = interestCalculationTypeId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RecurringDepositAccountHelper withInterestCompoundingPeriodType(final String interestCompoundingPeriodTypeId) {
|
||||
this.interestCompoundingPeriodType = interestCompoundingPeriodTypeId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RecurringDepositAccountHelper withInterestPostingPeriodType(final String interestPostingPeriodTypeId) {
|
||||
this.interestPostingPeriodType = interestPostingPeriodTypeId;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package org.mifosplatform.integrationtests.common.recurringdeposit;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class RecurringDepositAccountStatusChecker {
|
||||
|
||||
private static final String RECURRING_DEPOSIT_ACCOUNT_URL = "/mifosng-provider/api/v1/recurringdepositaccounts";
|
||||
|
||||
public static void verifyRecurringDepositIsApproved(final HashMap recurringDepositStatusHashMap) {
|
||||
System.out.println("-------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS APPROVED --------------------");
|
||||
assertTrue("Error in Approving Recurring deposit application", getStatus(recurringDepositStatusHashMap, "approved"));
|
||||
System.out.println(recurringDepositStatusHashMap);
|
||||
}
|
||||
|
||||
public static void verifyRecurringDepositIsPending(final HashMap recurringDepositStatusHashMap) {
|
||||
System.out.println("-------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS PENDING --------------------");
|
||||
assertTrue("RECURRING DEPOSIT ACCOUNT IS NOT IN PENDING STATE",
|
||||
getStatus(recurringDepositStatusHashMap, "submittedAndPendingApproval"));
|
||||
System.out.println(recurringDepositStatusHashMap);
|
||||
}
|
||||
|
||||
public static void verifyRecurringDepositIsActive(final HashMap recurringDepositStatusHashMap) {
|
||||
System.out.println("----------------- VERIFYING RECURRING DEPOSIT APPLICATION IS ACTIVE -----------------");
|
||||
assertTrue("ERROR IN ACTIVATING THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "active"));
|
||||
System.out.println(recurringDepositStatusHashMap);
|
||||
}
|
||||
|
||||
public static void verifyRecurringDepositIsRejected(final HashMap recurringDepositStatusHashMap) {
|
||||
System.out.println("-------------- VERIFYING RECURRING DEPOSIT APPLICATION IS REJECTED ----------------");
|
||||
assertTrue("ERROR IN REJECTING THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "rejected"));
|
||||
System.out.println(recurringDepositStatusHashMap);
|
||||
}
|
||||
|
||||
public static void verifyRecurringDepositIsWithdrawn(final HashMap recurringDepositStatusHashMap) {
|
||||
System.out.println("---------------- VERIFYING RECURRING DEPOSIT APPLICATION IS WITHDRAWN ----------------");
|
||||
assertTrue("ERROR IN WITHDRAW THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "withdrawnByApplicant"));
|
||||
System.out.println(recurringDepositStatusHashMap);
|
||||
}
|
||||
|
||||
public static void verifyRecurringDepositAccountIsClosed(final HashMap recurringDepositStatusHashMap) {
|
||||
System.out.println("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS CLOSED ---------------------");
|
||||
assertTrue("ERROR IN CLOSING THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "closed"));
|
||||
System.out.println(recurringDepositStatusHashMap);
|
||||
}
|
||||
|
||||
public static void verifyRecurringDepositAccountIsNotActive(final HashMap recurringDepositStatusHashMap) {
|
||||
System.out.println("------------------ VERIFYING RECURRING DEPOSIT APPLICATION IS INACTIVE --------------------");
|
||||
Assert.assertFalse(getStatus(recurringDepositStatusHashMap, "active"));
|
||||
System.out.println(recurringDepositStatusHashMap);
|
||||
}
|
||||
|
||||
public static HashMap getStatusOfRecurringDepositAccount(final RequestSpecification requestSpec,
|
||||
final ResponseSpecification responseSpec, final String recurringDepositAccountID) {
|
||||
final String GET_STATUS_OF_RECURRING_DEPOSIT_ACCOUNT_URL = RECURRING_DEPOSIT_ACCOUNT_URL + "/" + recurringDepositAccountID + "?"
|
||||
+ Utils.TENANT_IDENTIFIER;
|
||||
return Utils.performServerGet(requestSpec, responseSpec, GET_STATUS_OF_RECURRING_DEPOSIT_ACCOUNT_URL, "status");
|
||||
}
|
||||
|
||||
public static void verifyRecurringDepositAccountIsPrematureClosed(HashMap recurringDepositStatusHashMap) {
|
||||
System.out.println("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS CLOSED ---------------------");
|
||||
assertTrue("ERROR IN PREMATURELY CLOSING THE RECURRING DEPOSIT ACCOUNT",
|
||||
getStatus(recurringDepositStatusHashMap, "prematureClosed"));
|
||||
System.out.println(recurringDepositStatusHashMap);
|
||||
}
|
||||
|
||||
private static boolean getStatus(final HashMap recurringDepositStatusMap, final String recurringDepositStatusString) {
|
||||
return (Boolean) recurringDepositStatusMap.get(recurringDepositStatusString);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user