From d5c09659ff1ed972cbcbcc86ff40d7fcec82f35d Mon Sep 17 00:00:00 2001 From: Keith Woodlock Date: Sun, 27 Jan 2013 00:04:01 +0000 Subject: [PATCH] drop audit columns on organisation currency, update api docs on configuration api. --- api-docs/apiLive.htm | 256 ++++++++++++---- .../0001a-mifosplatform-core-ddl-latest.sql | 4 - .../0002-mifosng-base-reference-data.sql | 13 +- .../bare-bones-demo/bk_bare_bones_demo.sql | 289 +++++++++++++++++- .../03-drop-currency-audit-columns.sql | 5 + .../monetary/api/CurrenciesApiResource.java | 5 +- .../service/CurrencyReadPlatformService.java | 6 +- .../CurrencyReadPlatformServiceImpl.java | 34 ++- ...WritePlatformServiceJpaRepositoryImpl.java | 5 +- ...sationCurrencyReadPlatformServiceImpl.java | 6 +- .../office/data/OfficeTransactionData.java | 11 +- .../office/domain/OrganisationCurrency.java | 37 +-- .../OfficeReadPlatformServiceImpl.java | 5 +- .../portfolio/charge/data/ChargeData.java | 7 +- .../ChargeReadPlatformServiceImpl.java | 2 +- .../api/LoanProductsApiResource.java | 2 +- .../loanproduct/data/LoanProductData.java | 36 +-- .../api/SavingsAccountApiResource.java | 2 +- .../data/SavingAccountData.java | 11 +- .../api/SavingProductsApiResource.java | 12 +- .../data/SavingProductData.java | 43 ++- .../SavingProductReadPlatformServiceImpl.java | 7 +- .../api/DepositProductsApiResource.java | 2 +- .../data/DepositProductData.java | 10 +- 24 files changed, 602 insertions(+), 208 deletions(-) create mode 100644 mifosng-db/patches/03-drop-currency-audit-columns.sql diff --git a/api-docs/apiLive.htm b/api-docs/apiLive.htm index a33a2c666..fb375e1b4 100644 --- a/api-docs/apiLive.htm +++ b/api-docs/apiLive.htm @@ -135,8 +135,87 @@ function getBaseURL(docURL)
- - + + + + + + + + + + + + + + + + + + + + +
RESOURCES
POST
create/complex update
GET
read
PUT
update
DELETE
delete
CONFIGURATIONconfigurations/currencyRetrieve Currency ConfigurationUpdate Currency Configuration
+
+ + + + +
RESOURCES
+
+
+ + + + + + + +
+
POST
+
+
create/complex update
+
+
+ + + + + + + +
+
GET
+
+
read
+
+
+ + + + + + + +
+
PUT
+
+
update
+
+
+ + + + + + + +
+
DELETE
+
+
delete
+
+
CURRENCYcurrenciesRetrieve Currency ConfigurationUpdate Currency Configuration
GLOBAL CONFIGURATIONconfigurationsRetrieve Global ConfigurationUpdate Global Configuration
@@ -2144,8 +2223,8 @@ Request Body:  
-

Configuration

-

Application related configuration. For example, selecting the currencies permitted for use within the MFI.

+

Currency

+

Application related configuration around viewing/updating the currencies permitted for use within the MFI.

@@ -2155,61 +2234,42 @@ Request Body:

Retrieve Currency Configuration

Returns the list of currencies permitted for use AND the list of currencies not selected (but available for selection).

Example Requests:

-
configurations/currency
+
currencies


-
configurations/currency?fields=selectedCurrencyOptions
+
currencies?fields=selectedCurrencyOptions
- GET https://Domain Name/api/v1/configurations/currency -{ - "selectedCurrencyOptions" : [ { - "code" : "XOF", - "name" : "CFA Franc BCEAO", - "decimalPlaces" : 0, - "displaySymbol" : "CFA", - "nameCode" : "currency.XOF", - "displayLabel" : "CFA Franc BCEAO (CFA)" - }, { - "code" : "ETB", - "name" : "Ethiopian Birr", - "decimalPlaces" : 2, - "nameCode" : "currency.ETB", - "displayLabel" : "Ethiopian Birr [ETB]" - } ], - "currencyOptions" : [ { - "code" : "AED", - "name" : "UAE Dirham", - "decimalPlaces" : 2, - "nameCode" : "currency.AED", - "displayLabel" : "UAE Dirham [AED]" - }, { - "code" : "AFN", - "name" : "Afghanistan Afghani", - "decimalPlaces" : 2, - "nameCode" : "currency.AFN", - "displayLabel" : "Afghanistan Afghani [AFN]" - }, ... - ] + GET https://Domain Name/api/v1/currencies + { + "selectedCurrencyOptions" : [ { + "code": "USD", + "name": "US Dollar", + "decimalPlaces": 2, + "displaySymbol": "$", + "nameCode": "currency.USD", + "displayLabel": "US Dollar ($)" + }] } - +
-   -
-
-

Update Currency Configuration

-

Updates the list of currencies permitted for use.

-
-
- PUT https://Domain Name/api/v1/configurations/currency - PUT configurations/currency +   +
+
+

Update Currency Configuration

+

Updates the list of currencies permitted for use.

+
+
+ PUT https://Domain Name/api/v1/currencies + PUT currencies Content-Type: application/json -Request Body:{ +Request Body: +{ "currencies": ["KES", "BND", "LBP", "GHC", "USD", "XOF", "AED", "AMD"] } - - { + + { "currencies": [ "KES", "BND", @@ -2221,10 +2281,61 @@ Request Body:{ "AMD" ] } - -
+
- +
+ +   +
+
+

Global Configuration

+

Global configuration related to set of supported enable/disable configurations e.g. maker-checker.

+
+
+ +   +
+
+

Retrieve Global Configuration

+

Returns the list global enable/disable configurations.

+

Example Requests:

+
configurations
+
+
+ GET https://Domain Name/api/v1/configurations + { + "globalConfiguration": [ + { + "name": "maker-checker", + "enabled": false + } + ] +} + +
+
+ +   +
+
+

Update Global Configuration

+

Updates an enable/disable global configuration item.

+
+
+ PUT https://Domain Name/api/v1/configurations?maker-checker=false + PUT configurations +Content-Type: application/json +Request Body: +{ +} + + { + "changes": {} +} + +
+
+  
@@ -3154,11 +3265,14 @@ Request body: Content-Type: application/json Request body: { - "name": "Updated Role Name" + "description": "some description(changed)" } { - "resourceId": 8 + "resourceId": 8, + "changes": { + "description": "some description(changed)" + } }
@@ -3183,8 +3297,7 @@ Request body: "code": "READ_PERMISSION", "entityName": "PERMISSION", "actionName": "READ", - "selected": false, - "isMakerChecker": false + "selected": false }, { "grouping": "authorisation", @@ -3192,15 +3305,13 @@ Request body: "entityName": "ROLE", "actionName": "CREATE", "selected": false, - "isMakerChecker": false }, { "grouping": "authorisation", "code": "DELETE_ROLE", "entityName": "ROLE", "actionName": "DELETE", - "selected": false, - "isMakerChecker": false + "selected": false },...] } @@ -3218,13 +3329,16 @@ Request body: Content-Type: application/json Request body: { -ADJUST_LOAN: "true", -ALL_FUNCTIONS: "true", -ALL_FUNCTIONS_READ: "true" +"permissions": {"ALL_FUNCTIONS_READ": "true"} } { - "resourceId": 8 + "resourceId": 8, + "changes": { + "permissions": { + "ALL_FUNCTIONS_READ": true + } + } }
@@ -3298,7 +3412,21 @@ ALL_FUNCTIONS_READ: "true" offices/{officeId}Retrieve an OfficeUpdate an Office LOAN PRODUCTloanproductsCreate a Loan ProductList Loan Products loanproducts/{productId}Retrieve a Loan ProductUpdate a Loan Product - CONFIGURATIONconfigurations/currencyRetrieve Currency ConfigurationUpdate Currency Configuration + + CURRENCY + currencies + + Retrieve Currency Configuration + Update Currency Configuration + + + + GLOBAL CONFIGURATIONconfigurations + + Retrieve Global Configuration + Update Global Configuration + + DATA TABLEdatatablesList Data Tables datatables/register/{datatable}/{apptable}Register Data Table datatables/deregister/{datatable}Deregister Data Table diff --git a/mifosng-db/0001a-mifosplatform-core-ddl-latest.sql b/mifosng-db/0001a-mifosplatform-core-ddl-latest.sql index 2693c9e87..8e73a889b 100644 --- a/mifosng-db/0001a-mifosplatform-core-ddl-latest.sql +++ b/mifosng-db/0001a-mifosplatform-core-ddl-latest.sql @@ -75,10 +75,6 @@ CREATE TABLE `m_organisation_currency` ( `name` varchar(50) NOT NULL, `display_symbol` varchar(10) DEFAULT NULL, `internationalized_name_code` varchar(50) NOT NULL, - `createdby_id` bigint(20) DEFAULT NULL, - `created_date` datetime DEFAULT NULL, - `lastmodified_date` datetime DEFAULT NULL, - `lastmodifiedby_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/mifosng-db/0002-mifosng-base-reference-data.sql b/mifosng-db/0002-mifosng-base-reference-data.sql index 6d3466719..1dc194146 100644 --- a/mifosng-db/0002-mifosng-base-reference-data.sql +++ b/mifosng-db/0002-mifosng-base-reference-data.sql @@ -1,4 +1,4 @@ --- currency symbols may not apply through command line on windows so use a different client like mysql workbench +-- currency symbols may not apply through command line on windows so use a different client like mysql workbench INSERT INTO `ref_loan_transaction_processing_strategy` (`id`,`code`,`name`) @@ -66,7 +66,7 @@ VALUES (42,'EEK',2,NULL,'Estonian Kroon','currency.EEK'),(43,'EGP',2,NULL,'Egyptian Pound','currency.EGP'),(44,'ERN',2,NULL,'Eritrea Nafka','currency.ERN'), -(45,'ETB',2,NULL,'Ethiopian Birr','currency.ETB'),(46,'EUR',2,'€','Euro','currency.EUR'), +(45,'ETB',2,NULL,'Ethiopian Birr','currency.ETB'),(46,'EUR',2,'€','Euro','currency.EUR'), (47,'FJD',2,NULL,'Fiji Dollar','currency.FJD'),(48,'FKP',2,NULL,'Falkland Islands Pound','currency.FKP'),(49,'GBP',2,NULL,'Pound Sterling','currency.GBP'),(50,'GEL',2,NULL,'Georgian Lari','currency.GEL'), @@ -79,7 +79,7 @@ Islands Pound','currency.FKP'),(49,'GBP',2,NULL,'Pound Sterling','currency.GBP') (61,'HUF',2,NULL,'Hungarian Forint','currency.HUF'),(62,'IDR',2,NULL,'Indonesian Rupiah','currency.IDR'),(63,'ILS',2,NULL,'New Israeli Shekel','currency.ILS'), -(64,'INR',2,'?','Indian Rupee','currency.INR'), +(64,'INR',2,'₹','Indian Rupee','currency.INR'), (65,'IQD',3,NULL,'Iraqi Dinar','currency.IQD'),(66,'IRR',2,NULL,'Iranian Rial','currency.IRR'), (67,'ISK',0,NULL,'Iceland Krona','currency.ISK'),(68,'JMD',2,NULL,'Jamaican Dollar','currency.JMD'),(69,'JOD',3,NULL,'Jordanian Dinar','currency.JOD'), @@ -92,7 +92,7 @@ Islands Pound','currency.FKP'),(49,'GBP',2,NULL,'Pound Sterling','currency.GBP') (78,'KYD',2,NULL,'Cayman Islands Dollar','currency.KYD'),(79,'KZT',2,NULL,'Kazakhstan Tenge','currency.KZT'), (80,'LAK',2,NULL,'Lao Kip','currency.LAK'), -(81,'LBP',2,'L£','Lebanese Pound','currency.LBP'), +(81,'LBP',2,'L£','Lebanese Pound','currency.LBP'), (82,'LKR',2,NULL,'Sri Lanka Rupee','currency.LKR'),(83,'LRD',2,NULL,'Liberian Dollar','currency.LRD'),(84,'LSL',2,NULL,'Lesotho Loti','currency.LSL'), (85,'LTL',2,NULL,'Lithuanian Litas','currency.LTL'),(86,'LVL',2,NULL,'Latvian Lats','currency.LVL'),(87,'LYD',3,NULL,'Libyan Dinar','currency.LYD'), @@ -151,9 +151,8 @@ Pound','currency.SYP'),(136,'SZL',2,NULL,'Swaziland Lilangeni','currency.SZL'),( (162,'ZMK',2,NULL,'Zambian Kwacha','currency.ZMK'), (163,'ZWD',2,NULL,'Zimbabwe Dollar','currency.ZWD'); -INSERT INTO `m_organisation_currency` (`id`, `code`, `decimal_places`, `name`, `display_symbol`, `internationalized_name_code`, `createdby_id`, `created_date`, -`lastmodified_date`, `lastmodifiedby_id`) -VALUES (21,'USD',2,'US Dollar','$','currency.USD',1,'2012-05-01 22:43:02','2012-05-01 22:43:02',1); +INSERT INTO `m_organisation_currency` (`id`, `code`, `decimal_places`, `name`, `display_symbol`, `internationalized_name_code`) +VALUES (21,'USD',2,'US Dollar','$','currency.USD'); -- create single code and code value for client identifiers INSERT INTO `m_code` diff --git a/mifosng-db/multi-tenant-demo-backups/bare-bones-demo/bk_bare_bones_demo.sql b/mifosng-db/multi-tenant-demo-backups/bare-bones-demo/bk_bare_bones_demo.sql index aa6f97eb4..55761e5c3 100644 --- a/mifosng-db/multi-tenant-demo-backups/bare-bones-demo/bk_bare_bones_demo.sql +++ b/mifosng-db/multi-tenant-demo-backups/bare-bones-demo/bk_bare_bones_demo.sql @@ -159,6 +159,68 @@ LOCK TABLES `acc_product_mapping` WRITE; /*!40000 ALTER TABLE `acc_product_mapping` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `additional client fields data` +-- + +DROP TABLE IF EXISTS `additional client fields data`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `additional client fields data` ( + `client_id` bigint(20) NOT NULL, + `Business Description` varchar(100) DEFAULT NULL, + `Years in Business` int(11) DEFAULT NULL, + `Gender_cd` int(11) DEFAULT NULL, + `Education_cv` varchar(60) DEFAULT NULL, + `Next Visit` date DEFAULT NULL, + `Highest Rate Paid` decimal(19,6) DEFAULT NULL, + `Comment` text, + PRIMARY KEY (`client_id`), + CONSTRAINT `FK_Additional Client Fields Data_1` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `additional client fields data` +-- + +LOCK TABLES `additional client fields data` WRITE; +/*!40000 ALTER TABLE `additional client fields data` DISABLE KEYS */; +INSERT INTO `additional client fields data` VALUES (15,'first business',45,21,'Trade','2012-10-10','4.400000','some comments\ni \nmade up'),(16,NULL,88,21,'Trade','2012-10-03',NULL,'lk\nk\nk'),(17,'farmer',10,21,'Primary','2012-11-17','12.000000','efewd'),(36,NULL,NULL,21,'Primary','2012-11-15',NULL,NULL); +/*!40000 ALTER TABLE `additional client fields data` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `additional loan fields data` +-- + +DROP TABLE IF EXISTS `additional loan fields data`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `additional loan fields data` ( + `loan_id` bigint(20) NOT NULL, + `Business Description` varchar(100) DEFAULT NULL, + `Years in Business` int(11) DEFAULT NULL, + `Gender_cd` int(11) DEFAULT NULL, + `Education_cv` varchar(60) DEFAULT NULL, + `Next Visit` date DEFAULT NULL, + `Highest Rate Paid` decimal(19,6) DEFAULT NULL, + `Comment` text, + PRIMARY KEY (`loan_id`), + CONSTRAINT `FK_Additional Loan Fields Data_1` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `additional loan fields data` +-- + +LOCK TABLES `additional loan fields data` WRITE; +/*!40000 ALTER TABLE `additional loan fields data` DISABLE KEYS */; +INSERT INTO `additional loan fields data` VALUES (44,NULL,NULL,21,'Tertiary',NULL,NULL,'some comment'),(52,'IT Consultant',2004,21,'Primary','2012-12-12',NULL,'no further comment'); +/*!40000 ALTER TABLE `additional loan fields data` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `c_configuration` -- @@ -184,6 +246,72 @@ INSERT INTO `c_configuration` VALUES (1,'maker-checker',0); /*!40000 ALTER TABLE `c_configuration` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `extra family details data` +-- + +DROP TABLE IF EXISTS `extra family details data`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `extra family details data` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `client_id` bigint(20) NOT NULL, + `Name` varchar(40) DEFAULT NULL, + `Date of Birth` date DEFAULT NULL, + `Points Score` int(11) DEFAULT NULL, + `Education_cdHighest` int(11) DEFAULT NULL, + `Other Notes` text, + PRIMARY KEY (`id`), + KEY `FK_Extra Family Details Data_1` (`client_id`), + CONSTRAINT `FK_Extra Family Details Data_1` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `extra family details data` +-- + +LOCK TABLES `extra family details data` WRITE; +/*!40000 ALTER TABLE `extra family details data` DISABLE KEYS */; +INSERT INTO `extra family details data` VALUES (1,16,'fasdf','2012-10-02',NULL,5,NULL),(2,35,'Jo','2004-02-04',NULL,4,NULL),(3,17,'father','1961-11-09',1,4,'kkn'),(4,15,'sfdgd',NULL,NULL,NULL,NULL),(5,15,'tretw',NULL,NULL,NULL,NULL),(6,17,'asdfasd','2013-01-22',12,4,'asdfa'); +/*!40000 ALTER TABLE `extra family details data` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `extra_client_details` +-- + +DROP TABLE IF EXISTS `extra_client_details`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `extra_client_details` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `client_id` bigint(20) NOT NULL, + `client_dob` date DEFAULT NULL, + `client_address` varchar(60) DEFAULT NULL, + `father_name` varchar(40) DEFAULT NULL, + `nominee` varchar(40) DEFAULT NULL, + `nominee_relationship` varchar(40) DEFAULT NULL, + `nominee_address` varchar(60) DEFAULT NULL, + `crime_no` varchar(40) DEFAULT NULL, + `police_station` varchar(40) DEFAULT NULL, + `other_notes` text, + PRIMARY KEY (`id`), + UNIQUE KEY `client_id` (`client_id`), + KEY `FK_extra_client_details_1` (`client_id`), + CONSTRAINT `FK_extra_client_details` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `extra_client_details` +-- + +LOCK TABLES `extra_client_details` WRITE; +/*!40000 ALTER TABLE `extra_client_details` DISABLE KEYS */; +/*!40000 ALTER TABLE `extra_client_details` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `m_appuser` -- @@ -367,6 +495,73 @@ LOCK TABLES `m_client_identifier` WRITE; /*!40000 ALTER TABLE `m_client_identifier` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `m_client_xadditional information` +-- + +DROP TABLE IF EXISTS `m_client_xadditional information`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_client_xadditional information` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `Ethnic Group` varchar(50) DEFAULT NULL, + `Ethnic Group Other` varchar(50) DEFAULT NULL, + `Household Location` varchar(50) DEFAULT NULL, + `Household Location Other` varchar(50) DEFAULT NULL, + `Religion` varchar(50) DEFAULT NULL, + `Religion Other` varchar(50) DEFAULT NULL, + `Knowledge of Person` varchar(50) DEFAULT NULL, + `Gender` varchar(10) DEFAULT NULL, + `Whois` mediumtext, + PRIMARY KEY (`id`), + CONSTRAINT `portfolio_client_extra_Additional Information_fk1` FOREIGN KEY (`id`) REFERENCES `m_client` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION +) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_client_xadditional information` +-- + +LOCK TABLES `m_client_xadditional information` WRITE; +/*!40000 ALTER TABLE `m_client_xadditional information` DISABLE KEYS */; +INSERT INTO `m_client_xadditional information` VALUES (1,'Italian',NULL,'North Sikkim',NULL,'Unknown',NULL,'Friend of staff member','Male','More info about this and other things\n\nuntil the end'),(4,'Bedouin',NULL,'North Sikkim',NULL,'Atheist',NULL,'Staff member',NULL,NULL),(13,'Other','Chin','Other','Zatual','Protestant',NULL,'Other','Male',NULL),(15,'Berber',NULL,'South Sikkim',NULL,'Animist',NULL,NULL,'Male',NULL),(16,'Italian',NULL,'North Sikkim',NULL,NULL,NULL,'Friend of staff member',NULL,NULL),(17,'Berber',NULL,'North Sikkim',NULL,'Muslim',NULL,'Spouse of staff member','Male',NULL),(24,'Unknown',NULL,'East Sikkim',NULL,'Animist',NULL,'Staff member','Male',NULL),(25,'Other','Kryptonian','Other','Metropolis','Other','Humanist','Other','Male','Farm boy turned reporter.'),(27,'Other','Asian','Other','Xian','Other',NULL,'Other','Female','uh?'),(34,'Italian',NULL,'East Sikkim',NULL,'Muslim',NULL,'Not known by any staff member','Male',NULL); +/*!40000 ALTER TABLE `m_client_xadditional information` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_client_xhighly improbable info` +-- + +DROP TABLE IF EXISTS `m_client_xhighly improbable info`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_client_xhighly improbable info` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `Fathers Favourite Team` varchar(50) DEFAULT NULL, + `Mothers Favourite Team` varchar(50) DEFAULT NULL, + `Fathers DOB` date DEFAULT NULL, + `Mothers DOB` date DEFAULT NULL, + `Fathers Education` varchar(50) DEFAULT NULL, + `Mothers Education` varchar(50) DEFAULT NULL, + `Number of Children` int(11) DEFAULT NULL, + `Favourite Town` varchar(30) DEFAULT NULL, + `Closing Comments` mediumtext, + `Annual Family Income` decimal(19,6) DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `portfolio_client_extra_Highly Improbable Info_fk1` FOREIGN KEY (`id`) REFERENCES `m_client` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION +) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_client_xhighly improbable info` +-- + +LOCK TABLES `m_client_xhighly improbable info` WRITE; +/*!40000 ALTER TABLE `m_client_xhighly improbable info` DISABLE KEYS */; +INSERT INTO `m_client_xhighly improbable info` VALUES (1,'AC Milan','Manchester Utd',NULL,NULL,'Secondary','Secondary',NULL,NULL,NULL,NULL),(2,'Sao Paulo',NULL,'2012-07-12',NULL,NULL,NULL,NULL,NULL,'bally\r\n\r\ncl',NULL),(3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(16,'Sao Paulo',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(17,'Juventus',NULL,'2012-08-15',NULL,NULL,NULL,NULL,NULL,NULL,NULL),(25,'None, hates soccer','Sao Paulo','1984-04-19','1978-11-16','Trade','Tertiary',3,'Copenhagen','We find him not guilty.','30000.432000'); +/*!40000 ALTER TABLE `m_client_xhighly improbable info` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `m_code` -- @@ -958,6 +1153,35 @@ LOCK TABLES `m_loan_transaction` WRITE; /*!40000 ALTER TABLE `m_loan_transaction` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `m_loan_xadditional information` +-- + +DROP TABLE IF EXISTS `m_loan_xadditional information`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_loan_xadditional information` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `Business Location` varchar(50) DEFAULT NULL, + `Business Location Other` varchar(50) DEFAULT NULL, + `Business` varchar(10) DEFAULT NULL, + `Business Description` mediumtext, + `Business Title` varchar(100) DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `portfolio_loan_extra_Additional Information_fk1` FOREIGN KEY (`id`) REFERENCES `m_loan` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION +) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_loan_xadditional information` +-- + +LOCK TABLES `m_loan_xadditional information` WRITE; +/*!40000 ALTER TABLE `m_loan_xadditional information` DISABLE KEYS */; +INSERT INTO `m_loan_xadditional information` VALUES (1,'East Sikkim',NULL,'New',NULL,NULL),(30,'Other','Metropolis','Existing','Reporting on those wacky superheroes.','Daily Planet'),(31,'Other','EVERYWHERE','New',NULL,'Batman Justice Inc.'); +/*!40000 ALTER TABLE `m_loan_xadditional information` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `m_note` -- @@ -1084,10 +1308,6 @@ CREATE TABLE `m_organisation_currency` ( `name` varchar(50) NOT NULL, `display_symbol` varchar(10) DEFAULT NULL, `internationalized_name_code` varchar(50) NOT NULL, - `createdby_id` bigint(20) DEFAULT NULL, - `created_date` datetime DEFAULT NULL, - `lastmodified_date` datetime DEFAULT NULL, - `lastmodifiedby_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -1098,7 +1318,7 @@ CREATE TABLE `m_organisation_currency` ( LOCK TABLES `m_organisation_currency` WRITE; /*!40000 ALTER TABLE `m_organisation_currency` DISABLE KEYS */; -INSERT INTO `m_organisation_currency` VALUES (21,'USD',2,'US Dollar','$','currency.USD',1,'2012-05-01 22:43:02','2012-05-01 22:43:02',1); +INSERT INTO `m_organisation_currency` VALUES (21,'USD',2,'US Dollar','$','currency.USD'); /*!40000 ALTER TABLE `m_organisation_currency` ENABLE KEYS */; UNLOCK TABLES; @@ -1648,6 +1868,63 @@ INSERT INTO `ref_loan_transaction_processing_strategy` VALUES (1,'mifos-standard /*!40000 ALTER TABLE `ref_loan_transaction_processing_strategy` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `risk_analysis` +-- + +DROP TABLE IF EXISTS `risk_analysis`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `risk_analysis` ( + `client_id` bigint(20) NOT NULL, + `proposed_loan_amount` decimal(19,6) DEFAULT NULL, + `assets_cash` decimal(19,6) DEFAULT NULL, + `assets_bank_accounts` decimal(19,6) DEFAULT NULL, + `assets_accounts_receivable` decimal(19,6) DEFAULT NULL, + `assets_inventory` decimal(19,6) DEFAULT NULL, + `assets_total_fixed_business` decimal(19,6) DEFAULT NULL, + `assets_total_business` decimal(19,6) DEFAULT NULL, + `assets_total_household` decimal(19,6) DEFAULT NULL, + `liabilities_accounts_payable` decimal(19,6) DEFAULT NULL, + `liabilities_business_debts` decimal(19,6) DEFAULT NULL, + `liabilities_total_business` decimal(19,6) DEFAULT NULL, + `liabilities_equity_working_capital` decimal(19,6) DEFAULT NULL, + `liabilities_total_household` decimal(19,6) DEFAULT NULL, + `liabilities_household_equity` decimal(19,6) DEFAULT NULL, + `cashflow_cash_sales` decimal(19,6) DEFAULT NULL, + `cashflow_cash_sales2` decimal(19,6) DEFAULT NULL, + `cashflow_cost_goods_sold` decimal(19,6) DEFAULT NULL, + `cashflow_cost_goods_sold2` decimal(19,6) DEFAULT NULL, + `cashflow_gross_profit` decimal(19,6) DEFAULT NULL, + `cashflow_other_income1` decimal(19,6) DEFAULT NULL, + `cashflow_total_income2` decimal(19,6) DEFAULT NULL, + `cashflow_household_expense` decimal(19,6) DEFAULT NULL, + `cashflow_payments_to_savings` decimal(19,6) DEFAULT NULL, + `cashflow_operational_expenses` decimal(19,6) DEFAULT NULL, + `cashflow_disposable_income` decimal(19,6) DEFAULT NULL, + `cashflow_amount_loan_installment` decimal(19,6) DEFAULT NULL, + `cashflow_available_surplus` decimal(19,6) DEFAULT NULL, + `fi_inventory_turnover` decimal(19,6) DEFAULT NULL, + `fi_gross_margin` decimal(19,6) DEFAULT NULL, + `fi_indebtedness` decimal(19,6) DEFAULT NULL, + `fi_loan_recommendation` decimal(19,6) DEFAULT NULL, + `fi_roe` decimal(19,6) DEFAULT NULL, + `fi_repayment_capacity` decimal(19,6) DEFAULT NULL, + PRIMARY KEY (`client_id`), + CONSTRAINT `FK_risk_analysis_1` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `risk_analysis` +-- + +LOCK TABLES `risk_analysis` WRITE; +/*!40000 ALTER TABLE `risk_analysis` DISABLE KEYS */; +INSERT INTO `risk_analysis` VALUES (3,'33.000000','1.000000',NULL,'3.000000',NULL,NULL,'4.000000',NULL,NULL,NULL,'55.000000','-51.000000',NULL,'0.000000',NULL,NULL,NULL,NULL,'0.000000',NULL,NULL,NULL,NULL,NULL,'0.000000',NULL,'0.000000',NULL,NULL,'-1.080000','-1.730000','0.000000',NULL),(15,'0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000'),(16,'444.000000','51.000000',NULL,'33.330000',NULL,NULL,'84.330000',NULL,NULL,NULL,NULL,'84.330000',NULL,'0.000000','444.000000','3.000000','343.000000','42.000000','62.000000',NULL,NULL,NULL,NULL,NULL,'62.000000',NULL,'62.000000',NULL,'0.230000','0.000000','5.270000','0.740000','0.000000'),(22,NULL,'50000.000000',NULL,NULL,NULL,NULL,'50000.000000',NULL,NULL,NULL,NULL,'50000.000000',NULL,'0.000000','20000.000000',NULL,NULL,NULL,'20000.000000',NULL,NULL,'8300.000000',NULL,'2000.000000','9700.000000',NULL,'9700.000000',NULL,'1.000000','0.000000','0.000000','0.400000','0.000000'),(25,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(58,NULL,'500000.000000',NULL,NULL,NULL,NULL,'500000.000000',NULL,NULL,NULL,NULL,'500000.000000',NULL,'0.000000',NULL,NULL,NULL,NULL,'0.000000','30000.000000',NULL,'0.000000',NULL,'3000.000000','27000.000000',NULL,'27000.000000',NULL,NULL,'0.000000','0.000000','0.000000','0.000000'); +/*!40000 ALTER TABLE `risk_analysis` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `rpt_sequence` -- @@ -1793,4 +2070,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2013-01-26 20:21:03 +-- Dump completed on 2013-01-27 0:02:57 diff --git a/mifosng-db/patches/03-drop-currency-audit-columns.sql b/mifosng-db/patches/03-drop-currency-audit-columns.sql new file mode 100644 index 000000000..cd4947e58 --- /dev/null +++ b/mifosng-db/patches/03-drop-currency-audit-columns.sql @@ -0,0 +1,5 @@ +ALTER TABLE `m_organisation_currency` +DROP COLUMN `lastmodifiedby_id` , +DROP COLUMN `lastmodified_date` , +DROP COLUMN `created_date`, +DROP COLUMN `createdby_id`; \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/api/CurrenciesApiResource.java b/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/api/CurrenciesApiResource.java index ed856f71a..3cf23e60b 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/api/CurrenciesApiResource.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/api/CurrenciesApiResource.java @@ -72,7 +72,10 @@ public class CurrenciesApiResource { @Produces({ MediaType.APPLICATION_JSON }) public String updateCurrencies(final String apiRequestBodyAsJson) { - final CommandWrapper commandRequest = new CommandWrapperBuilder().updateCurrencies().withJson(apiRequestBodyAsJson).build(); + final CommandWrapper commandRequest = new CommandWrapperBuilder() // + .updateCurrencies() // + .withJson(apiRequestBodyAsJson) // + .build(); final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest); diff --git a/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/service/CurrencyReadPlatformService.java b/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/service/CurrencyReadPlatformService.java index 852800388..62530c4ea 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/service/CurrencyReadPlatformService.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/service/CurrencyReadPlatformService.java @@ -1,12 +1,12 @@ package org.mifosplatform.organisation.monetary.service; -import java.util.List; +import java.util.Collection; import org.mifosplatform.organisation.monetary.data.CurrencyData; public interface CurrencyReadPlatformService { - List retrieveAllowedCurrencies(); + Collection retrieveAllowedCurrencies(); - List retrieveAllPlatformCurrencies(); + Collection retrieveAllPlatformCurrencies(); } \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/service/CurrencyReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/service/CurrencyReadPlatformServiceImpl.java index 589ad7920..9743b4790 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/service/CurrencyReadPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/service/CurrencyReadPlatformServiceImpl.java @@ -2,7 +2,7 @@ package org.mifosplatform.organisation.monetary.service; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.List; +import java.util.Collection; import org.mifosplatform.infrastructure.core.domain.JdbcSupport; import org.mifosplatform.infrastructure.core.service.TenantAwareRoutingDataSource; @@ -18,33 +18,31 @@ public class CurrencyReadPlatformServiceImpl implements CurrencyReadPlatformServ private final JdbcTemplate jdbcTemplate; private final PlatformSecurityContext context; + private final CurrencyMapper currencyRowMapper; @Autowired public CurrencyReadPlatformServiceImpl(final PlatformSecurityContext context, final TenantAwareRoutingDataSource dataSource) { this.context = context; this.jdbcTemplate = new JdbcTemplate(dataSource); + this.currencyRowMapper = new CurrencyMapper(); } @Override - public List retrieveAllowedCurrencies() { + public Collection retrieveAllowedCurrencies() { context.authenticatedUser(); - String sql = "select c.code as code, c.name as name, c.decimal_places as decimalPlaces, c.display_symbol as displaySymbol, c.internationalized_name_code as nameCode from m_organisation_currency c order by c.name"; + final String sql = "select " + currencyRowMapper.schema() + " from m_organisation_currency c order by c.name"; - RowMapper rm = new CurrencyMapper(); - - return this.jdbcTemplate.query(sql, rm, new Object[] {}); + return this.jdbcTemplate.query(sql, currencyRowMapper, new Object[] {}); } @Override - public List retrieveAllPlatformCurrencies() { + public Collection retrieveAllPlatformCurrencies() { - String sql = "select c.code as code, c.name as name, c.decimal_places as decimalPlaces, c.display_symbol as displaySymbol, c.internationalized_name_code as nameCode from m_currency c order by c.name"; + final String sql = "select " + currencyRowMapper.schema() + " from m_currency c order by c.name"; - RowMapper rm = new CurrencyMapper(); - - return this.jdbcTemplate.query(sql, rm, new Object[] {}); + return this.jdbcTemplate.query(sql, currencyRowMapper, new Object[] {}); } private static final class CurrencyMapper implements RowMapper { @@ -52,13 +50,17 @@ public class CurrencyReadPlatformServiceImpl implements CurrencyReadPlatformServ @Override public CurrencyData mapRow(final ResultSet rs, @SuppressWarnings("unused") final int rowNum) throws SQLException { - String code = rs.getString("code"); - String name = rs.getString("name"); - int decimalPlaces = JdbcSupport.getInteger(rs, "decimalPlaces"); - String displaySymbol = rs.getString("displaySymbol"); - String nameCode = rs.getString("nameCode"); + final String code = rs.getString("code"); + final String name = rs.getString("name"); + final int decimalPlaces = JdbcSupport.getInteger(rs, "decimalPlaces"); + final String displaySymbol = rs.getString("displaySymbol"); + final String nameCode = rs.getString("nameCode"); return new CurrencyData(code, name, decimalPlaces, displaySymbol, nameCode); } + + public String schema() { + return " c.code as code, c.name as name, c.decimal_places as decimalPlaces, c.display_symbol as displaySymbol, c.internationalized_name_code as nameCode "; + } } } \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/service/CurrencyWritePlatformServiceJpaRepositoryImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/service/CurrencyWritePlatformServiceJpaRepositoryImpl.java index f8d546b6f..37e981dd5 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/service/CurrencyWritePlatformServiceJpaRepositoryImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/service/CurrencyWritePlatformServiceJpaRepositoryImpl.java @@ -70,6 +70,9 @@ public class CurrencyWritePlatformServiceJpaRepositoryImpl implements CurrencyWr this.organisationCurrencyRepository.deleteAll(); this.organisationCurrencyRepository.save(allowedCurrencies); - return new CommandProcessingResultBuilder().withCommandId(command.commandId()).with(changes).build(); + return new CommandProcessingResultBuilder() // + .withCommandId(command.commandId()) // + .with(changes) // + .build(); } } \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/service/OrganisationCurrencyReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/service/OrganisationCurrencyReadPlatformServiceImpl.java index a505d96d5..56fd4b030 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/service/OrganisationCurrencyReadPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/organisation/monetary/service/OrganisationCurrencyReadPlatformServiceImpl.java @@ -1,6 +1,6 @@ package org.mifosplatform.organisation.monetary.service; -import java.util.List; +import java.util.Collection; import org.mifosplatform.organisation.monetary.data.ApplicationCurrencyConfigurationData; import org.mifosplatform.organisation.monetary.data.CurrencyData; @@ -20,8 +20,8 @@ public class OrganisationCurrencyReadPlatformServiceImpl implements Organisation @Override public ApplicationCurrencyConfigurationData retrieveCurrencyConfiguration() { - final List selectedCurrencyOptions = this.currencyReadPlatformService.retrieveAllowedCurrencies(); - final List currencyOptions = this.currencyReadPlatformService.retrieveAllPlatformCurrencies(); + final Collection selectedCurrencyOptions = this.currencyReadPlatformService.retrieveAllowedCurrencies(); + final Collection currencyOptions = this.currencyReadPlatformService.retrieveAllPlatformCurrencies(); // remove selected currency options currencyOptions.removeAll(selectedCurrencyOptions); diff --git a/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/data/OfficeTransactionData.java b/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/data/OfficeTransactionData.java index 4c99287df..5783e4263 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/data/OfficeTransactionData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/data/OfficeTransactionData.java @@ -1,7 +1,7 @@ package org.mifosplatform.organisation.office.data; import java.math.BigDecimal; -import java.util.List; +import java.util.Collection; import org.joda.time.LocalDate; import org.mifosplatform.organisation.monetary.data.CurrencyData; @@ -30,12 +30,12 @@ public class OfficeTransactionData { @SuppressWarnings("unused") private final String description; @SuppressWarnings("unused") - private final List currencyOptions; + private final Collection currencyOptions; @SuppressWarnings("unused") - private final List allowedOffices; + private final Collection allowedOffices; - public OfficeTransactionData(final LocalDate transactionDate, final List allowedOffices, - final List currencyOptions) { + public OfficeTransactionData(final LocalDate transactionDate, final Collection allowedOffices, + final Collection currencyOptions) { this.transactionDate = transactionDate; this.allowedOffices = allowedOffices; this.currencyOptions = currencyOptions; @@ -63,6 +63,5 @@ public class OfficeTransactionData { this.transactionDate = transactionDate; this.currencyOptions = null; this.allowedOffices = null; - } } \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/domain/OrganisationCurrency.java b/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/domain/OrganisationCurrency.java index 8302234ee..23ca4b57c 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/domain/OrganisationCurrency.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/domain/OrganisationCurrency.java @@ -4,32 +4,34 @@ import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; -import org.mifosplatform.infrastructure.core.domain.AbstractAuditableCustom; -import org.mifosplatform.useradministration.domain.AppUser; +import org.springframework.data.jpa.domain.AbstractPersistable; +/** + * Represents currencies allowed for this MFI/organisation. + */ @Entity @Table(name = "m_organisation_currency") -public class OrganisationCurrency extends AbstractAuditableCustom { +public class OrganisationCurrency extends AbstractPersistable { @SuppressWarnings("unused") - @Column(name = "code", nullable = false, length=3) - private final String code; + @Column(name = "code", nullable = false, length = 3) + private final String code; @SuppressWarnings("unused") @Column(name = "decimal_places", nullable = false) private final Integer decimalPlaces; - + @SuppressWarnings("unused") - @Column(name = "name", nullable = false, length=50) - private final String name; - + @Column(name = "name", nullable = false, length = 50) + private final String name; + @SuppressWarnings("unused") - @Column(name = "internationalized_name_code", nullable = false, length=50) - private final String nameCode; - + @Column(name = "internationalized_name_code", nullable = false, length = 50) + private final String nameCode; + @SuppressWarnings("unused") - @Column(name = "display_symbol", nullable = true, length=10) - private final String displaySymbol; + @Column(name = "display_symbol", nullable = true, length = 10) + private final String displaySymbol; protected OrganisationCurrency() { this.code = null; @@ -39,11 +41,12 @@ public class OrganisationCurrency extends AbstractAuditableCustom this.displaySymbol = null; } - public OrganisationCurrency(final String code, final String name, final int decimalPlaces, final String nameCode, final String displaySymbol) { + public OrganisationCurrency(final String code, final String name, final int decimalPlaces, final String nameCode, + final String displaySymbol) { this.code = code; this.name = name; this.decimalPlaces = decimalPlaces; - this.nameCode = nameCode; - this.displaySymbol = displaySymbol; + this.nameCode = nameCode; + this.displaySymbol = displaySymbol; } } \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/service/OfficeReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/service/OfficeReadPlatformServiceImpl.java index ccabec63d..6980aed7a 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/service/OfficeReadPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/service/OfficeReadPlatformServiceImpl.java @@ -5,7 +5,6 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.Collection; -import java.util.List; import org.joda.time.LocalDate; import org.mifosplatform.infrastructure.core.domain.JdbcSupport; @@ -246,8 +245,8 @@ public class OfficeReadPlatformServiceImpl implements OfficeReadPlatformService public OfficeTransactionData retrieveNewOfficeTransactionDetails() { context.authenticatedUser(); - List parentLookups = new ArrayList(retrieveAllOfficesForLookup()); - List currencyOptions = currencyReadPlatformService.retrieveAllowedCurrencies(); + final Collection parentLookups = retrieveAllOfficesForDropdown(); + final Collection currencyOptions = currencyReadPlatformService.retrieveAllowedCurrencies(); return new OfficeTransactionData(new LocalDate(), parentLookups, currencyOptions); } diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/charge/data/ChargeData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/charge/data/ChargeData.java index 60b24049a..208c08a74 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/charge/data/ChargeData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/charge/data/ChargeData.java @@ -1,6 +1,7 @@ package org.mifosplatform.portfolio.charge.data; import java.math.BigDecimal; +import java.util.Collection; import java.util.List; import org.mifosplatform.infrastructure.core.data.EnumOptionData; @@ -21,12 +22,12 @@ public class ChargeData { private final EnumOptionData chargeAppliesTo; private final EnumOptionData chargeCalculationType; - private final List currencyOptions; + private final Collection currencyOptions; private final List chargeCalculationTypeOptions; private final List chargeAppliesToOptions; private final List chargeTimeTypeOptions; - public static ChargeData template(final List currencyOptions, final List chargeCalculationTypeOptions, + public static ChargeData template(final Collection currencyOptions, final List chargeCalculationTypeOptions, final List chargeAppliesToOptions, final List chargeTimeTypeOptions) { return new ChargeData(null, null, null, null, null, null, null, false, false, currencyOptions, chargeCalculationTypeOptions, @@ -59,7 +60,7 @@ public class ChargeData { public ChargeData(final Long id, final String name, final BigDecimal amount, final CurrencyData currency, final EnumOptionData chargeTimeType, final EnumOptionData chargeAppliesTo, final EnumOptionData chargeCalculationType, - final boolean penalty, final boolean active, final List currencyOptions, + final boolean penalty, final boolean active, final Collection currencyOptions, final List chargeCalculationTypeOptions, final List chargeAppliesToOptions, final List chargeTimeTypeOptions) { this.id = id; diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/charge/service/ChargeReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/charge/service/ChargeReadPlatformServiceImpl.java index ff7f02236..2002ebcc9 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/charge/service/ChargeReadPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/charge/service/ChargeReadPlatformServiceImpl.java @@ -72,7 +72,7 @@ public class ChargeReadPlatformServiceImpl implements ChargeReadPlatformService this.context.authenticatedUser(); - final List currencyOptions = currencyReadPlatformService.retrieveAllowedCurrencies(); + final Collection currencyOptions = currencyReadPlatformService.retrieveAllowedCurrencies(); final List allowedChargeCalculationTypeOptions = this.chargeDropdownReadPlatformService.retrieveCalculationTypes(); final List allowedChargeAppliesToOptions = this.chargeDropdownReadPlatformService.retrieveApplicableToTypes(); final List allowedChargeTimeOptions = this.chargeDropdownReadPlatformService.retrieveCollectionTimeTypes(); diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/api/LoanProductsApiResource.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/api/LoanProductsApiResource.java index cbec08dc0..e4baf343b 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/api/LoanProductsApiResource.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/api/LoanProductsApiResource.java @@ -177,7 +177,7 @@ public class LoanProductsApiResource { Collection chargeOptions = this.chargeReadPlatformService.retrieveLoanApplicableCharges(feeChargesOnly); chargeOptions.removeAll(productData.charges()); - final List currencyOptions = currencyReadPlatformService.retrieveAllowedCurrencies(); + final Collection currencyOptions = currencyReadPlatformService.retrieveAllowedCurrencies(); final List amortizationTypeOptions = dropdownReadPlatformService.retrieveLoanAmortizationTypeOptions(); final List interestTypeOptions = dropdownReadPlatformService.retrieveLoanInterestTypeOptions(); final List interestCalculationPeriodTypeOptions = dropdownReadPlatformService diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/data/LoanProductData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/data/LoanProductData.java index 04875308b..d54e02331 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/data/LoanProductData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/data/LoanProductData.java @@ -55,7 +55,7 @@ public class LoanProductData { private final DateTime createdOn; private final DateTime lastModifedOn; - private final List currencyOptions; + private final Collection currencyOptions; private final Collection fundOptions; private final Collection transactionProcessingStrategyOptions; private final List amortizationTypeOptions; @@ -70,8 +70,8 @@ public class LoanProductData { private final List assetAccountOptions; private final List incomeAccountOptions; private final List expenseAccountOptions; - - //accounting related mapping feilds + + // accounting related mapping feilds private Long loanPortfolioAccountId; private Long fundSourceAccountId; private Long interestOnLoanAccountId; @@ -196,14 +196,14 @@ public class LoanProductData { this.loanTermFrequencyTypeOptions = null; this.repaymentFrequencyTypeOptions = null; this.interestRateFrequencyTypeOptions = null; - + this.assetAccountOptions = null; this.incomeAccountOptions = null; this.expenseAccountOptions = null; } public LoanProductData(final LoanProductData productData, final Collection chargeOptions, - final List currencyOptions, final List amortizationTypeOptions, + final Collection currencyOptions, final List amortizationTypeOptions, final List interestTypeOptions, final List interestCalculationPeriodTypeOptions, final List loanTermFrequencyTypeOptions, final List repaymentFrequencyTypeOptions, final List interestRateFrequencyTypeOptions, final Collection fundOptions, @@ -238,7 +238,7 @@ public class LoanProductData { this.chargeOptions = chargeOptions; this.currencyOptions = currencyOptions; if (this.currencyOptions.size() == 1) { - this.currency = this.currencyOptions.get(0); + this.currency = new ArrayList(this.currencyOptions).get(0); } else { this.currency = productData.currency; } @@ -250,7 +250,7 @@ public class LoanProductData { this.loanTermFrequencyTypeOptions = loanTermFrequencyTypeOptions; this.repaymentFrequencyTypeOptions = repaymentFrequencyTypeOptions; this.interestRateFrequencyTypeOptions = interestRateFrequencyTypeOptions; - + this.assetAccountOptions = assetAccountOptions; this.incomeAccountOptions = incomeAccountOptions; this.expenseAccountOptions = expenseAccountOptions; @@ -356,10 +356,6 @@ public class LoanProductData { return lastModifedOn; } - public List getCurrencyOptions() { - return currencyOptions; - } - public Collection getFundOptions() { return fundOptions; } @@ -408,22 +404,18 @@ public class LoanProductData { return this.expenseAccountOptions; } - public Long getLoanPortfolioAccountId() { return this.loanPortfolioAccountId; } - public void setLoanPortfolioAccountId(Long loanPortfolioAccountId) { this.loanPortfolioAccountId = loanPortfolioAccountId; } - public Long getFundSourceAccountId() { return this.fundSourceAccountId; } - public void setFundSourceAccountId(Long fundSourceAccountId) { this.fundSourceAccountId = fundSourceAccountId; } @@ -432,27 +424,22 @@ public class LoanProductData { return this.interestOnLoanAccountId; } - public void setInterestOnLoanAccountId(Long interestOnLoanAccountId) { this.interestOnLoanAccountId = interestOnLoanAccountId; } - public Long getIncomeFromFeeAccountId() { return this.incomeFromFeeAccountId; } - public void setIncomeFromFeeAccountId(Long incomeFromFeeAccountId) { this.incomeFromFeeAccountId = incomeFromFeeAccountId; } - public Long getIncomeFromPenaltyAccountId() { return this.incomeFromPenaltyAccountId; } - public void setIncomeFromPenaltyAccountId(Long incomeFromPenaltyAccountId) { this.incomeFromPenaltyAccountId = incomeFromPenaltyAccountId; } @@ -461,45 +448,36 @@ public class LoanProductData { return this.writeOffAccountId; } - public void setWriteOffAccountId(Long writeOffAccountId) { this.writeOffAccountId = writeOffAccountId; } - public Long getReceivableInterestAccountId() { return this.receivableInterestAccountId; } - public void setReceivableInterestAccountId(Long receivableInterestAccountId) { this.receivableInterestAccountId = receivableInterestAccountId; } - public Long getReceivableFeeAccountId() { return this.receivableFeeAccountId; } - public void setReceivableFeeAccountId(Long receivableFeeAccountId) { this.receivableFeeAccountId = receivableFeeAccountId; } - public Long getReceivablePenaltyAccountId() { return this.receivablePenaltyAccountId; } - public void setReceivablePenaltyAccountId(Long receivablePenaltyAccountId) { this.receivablePenaltyAccountId = receivablePenaltyAccountId; } - public Integer getAccountingType() { return this.accountingType; } - } \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/api/SavingsAccountApiResource.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/api/SavingsAccountApiResource.java index 0d5f4a216..0840fda79 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/api/SavingsAccountApiResource.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/api/SavingsAccountApiResource.java @@ -239,7 +239,7 @@ public class SavingsAccountApiResource { "dueAmount")); Collection productOptions = savingProductReadPlatformService.retrieveAllSavingProductsForLookup(); - List currencyOptions = this.currencyReadPlatformService.retrieveAllowedCurrencies(); + Collection currencyOptions = this.currencyReadPlatformService.retrieveAllowedCurrencies(); EnumOptionData recurring = SavingProductEnumerations.savingProductType(SavingProductType.RECURRING); EnumOptionData regular = SavingProductEnumerations.savingProductType(SavingProductType.REGULAR); diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/data/SavingAccountData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/data/SavingAccountData.java index d29b3c18e..52ecd9c17 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/data/SavingAccountData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/data/SavingAccountData.java @@ -51,7 +51,7 @@ public class SavingAccountData { private final Integer depositEvery; private final List productOptions; - private final List currencyOptions; + private final Collection currencyOptions; private final List savingsProductTypeOptions; private final List tenureTypeOptions; private final List savingFrequencyOptions; @@ -188,10 +188,11 @@ public class SavingAccountData { this.interestPostFrequency = null; } - public SavingAccountData(SavingAccountData account, Collection productOptions, List currencyOptions, - List savingsProductTypeOptions, List tenureTypeOptions, - List savingFrequencyOptions, List savingsInterestTypeOptions, - List lockinPeriodTypeOptions, List interestCalculationOptions, BigDecimal dueAmount) { + public SavingAccountData(SavingAccountData account, Collection productOptions, + Collection currencyOptions, List savingsProductTypeOptions, + List tenureTypeOptions, List savingFrequencyOptions, + List savingsInterestTypeOptions, List lockinPeriodTypeOptions, + List interestCalculationOptions, BigDecimal dueAmount) { this.id = account.id; this.status = account.status; this.externalId = account.externalId; diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/api/SavingProductsApiResource.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/api/SavingProductsApiResource.java index 074c35f45..9f21ff251 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/api/SavingProductsApiResource.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/api/SavingProductsApiResource.java @@ -100,7 +100,7 @@ public class SavingProductsApiResource { "description", "currencyCode", "digitsAfterDecimal", "interstRate", "minInterestRate", "maxInterestRate", "savingsDepositAmount", "savingProductType", "tenureType", "tenure", "frequency", "interestType", "interestCalculationMethod", "minimumBalanceForWithdrawal", "isPartialDepositAllowed", "isLockinPeriodAllowed", - "lockinPeriod", "lockinPeriodType","depositEvery")); + "lockinPeriod", "lockinPeriodType", "depositEvery")); Set responseParameters = ApiParameterHelper.extractFieldsForResponseIfProvided(uriInfo.getQueryParameters()); if (responseParameters.isEmpty()) { @@ -125,15 +125,15 @@ public class SavingProductsApiResource { "description", "currencyCode", "digitsAfterDecimal", "interstRate", "minInterestRate", "maxInterestRate", "savingsDepositAmount", "savingProductType", "tenureType", "tenure", "frequency", "interestType", "interestCalculationMethod", "minimumBalanceForWithdrawal", "isPartialDepositAllowed", "isLockinPeriodAllowed", - "lockinPeriod", "lockinPeriodType","depositEvery")); + "lockinPeriod", "lockinPeriodType", "depositEvery")); Set responseParameters = ApiParameterHelper.extractFieldsForResponseIfProvided(uriInfo.getQueryParameters()); if (responseParameters.isEmpty()) { responseParameters.addAll(typicalResponseParameters); } - + SavingProductData savingProduct = this.savingProductReadPlatformService.retrieveSavingProduct(productId); - + boolean prettyPrint = ApiParameterHelper.prettyPrint(uriInfo.getQueryParameters()); boolean template = ApiParameterHelper.template(uriInfo.getQueryParameters()); if (template) { @@ -154,7 +154,7 @@ public class SavingProductsApiResource { Set typicalResponseParameters = new HashSet(Arrays.asList("id", "createdOn", "lastModifedOn", "locale", "name", "description", "currencyCode", "digitsAfterDecimal", "interstRate", "savingsDepositAmount", "savingProductType", "tenureType", "tenure", "frequency", "interestType", "interestCalculationMethod", "minimumBalanceForWithdrawal", - "isPartialDepositAllowed", "isLockinPeriodAllowed", "lockinPeriod", "lockinPeriodType", "currencyOptions","depositEvery")); + "isPartialDepositAllowed", "isLockinPeriodAllowed", "lockinPeriod", "lockinPeriodType", "currencyOptions", "depositEvery")); Set responseParameters = ApiParameterHelper.extractFieldsForResponseIfProvided(uriInfo.getQueryParameters()); if (responseParameters.isEmpty()) { @@ -171,7 +171,7 @@ public class SavingProductsApiResource { responseParameters.addAll(Arrays.asList("currencyOptions", "savingsProductTypeOptions", "tenureTypeOptions", "savingFrequencyOptions", "savingsInterestTypeOptions", "lockinPeriodTypeOptions", "interestCalculationOptions")); - List currencyOptions = this.currencyReadPlatformService.retrieveAllowedCurrencies(); + Collection currencyOptions = this.currencyReadPlatformService.retrieveAllowedCurrencies(); EnumOptionData reccuring = SavingProductEnumerations.savingProductType(SavingProductType.RECURRING); EnumOptionData regular = SavingProductEnumerations.savingProductType(SavingProductType.REGULAR); diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/data/SavingProductData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/data/SavingProductData.java index 2d2f8698e..c7c5d2fc8 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/data/SavingProductData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/data/SavingProductData.java @@ -3,6 +3,7 @@ package org.mifosplatform.portfolio.savingsaccountproduct.data; import java.io.Serializable; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import org.joda.time.DateTime; @@ -44,16 +45,17 @@ public class SavingProductData implements Serializable { private DateTime lastModifedOn; private final Integer depositEvery; - private List currencyOptions = new ArrayList(); - List savingsProductTypeOptions = new ArrayList(); - List tenureTypeOptions = new ArrayList(); - List savingFrequencyOptions = new ArrayList(); - List savingsInterestTypeOptions = new ArrayList(); - List lockinPeriodTypeOptions = new ArrayList(); - List interestCalculationOptions = new ArrayList(); + @SuppressWarnings("unused") + private Collection currencyOptions = new ArrayList(); + private List savingsProductTypeOptions = new ArrayList(); + private List tenureTypeOptions = new ArrayList(); + private List savingFrequencyOptions = new ArrayList(); + private List savingsInterestTypeOptions = new ArrayList(); + private List lockinPeriodTypeOptions = new ArrayList(); + private List interestCalculationOptions = new ArrayList(); public SavingProductData() { - this.createdOn = new DateTime(); + this.createdOn = new DateTime(); this.lastModifedOn = new DateTime(); this.id = null; this.name = null; @@ -69,13 +71,14 @@ public class SavingProductData implements Serializable { this.tenure = Integer.valueOf(12); this.savingFrequencyType = SavingProductEnumerations.interestFrequencyType(SavingFrequencyType.MONTHLY); this.interestType = SavingProductEnumerations.savingInterestType(SavingsInterestType.COMPOUNDING); - this.interestCalculationMethod = SavingProductEnumerations.savingInterestCalculationMethod(SavingInterestCalculationMethod.AVERAGEBAL); + this.interestCalculationMethod = SavingProductEnumerations + .savingInterestCalculationMethod(SavingInterestCalculationMethod.AVERAGEBAL); this.minimumBalanceForWithdrawal = BigDecimal.valueOf(100); this.isPartialDepositAllowed = false; this.isLockinPeriodAllowed = false; this.lockinPeriod = Integer.valueOf(0); this.lockinPeriodType = SavingProductEnumerations.savingsLockinPeriod(SavingsLockinPeriodEnum.MONTHS); - this.depositEvery=Integer.valueOf(3); + this.depositEvery = Integer.valueOf(3); } public SavingProductData(DateTime createdOn, DateTime lastModifedOn, Long id, String name, String description, BigDecimal interestRate, @@ -109,10 +112,10 @@ public class SavingProductData implements Serializable { this.depositEvery = depositEvery; } - public SavingProductData(SavingProductData product, List currencyOptions, List savingsProductTypeOptions, - List tenureTypeOptions, List savingFrequencyOptions, - List savingsInterestTypeOptions, List lockinPeriodTypeOptions, - List interestCalculationOptions) { + public SavingProductData(SavingProductData product, Collection currencyOptions, + List savingsProductTypeOptions, List tenureTypeOptions, + List savingFrequencyOptions, List savingsInterestTypeOptions, + List lockinPeriodTypeOptions, List interestCalculationOptions) { this.createdOn = product.getCreatedOn(); this.lastModifedOn = product.getLastModifedOn(); @@ -232,11 +235,7 @@ public class SavingProductData implements Serializable { return lastModifedOn; } - public List getCurrencyOptions() { - return currencyOptions; - } - - public void setCurrencyOptions(List currencyOptions) { + public void setCurrencyOptions(Collection currencyOptions) { this.currencyOptions = currencyOptions; } @@ -268,8 +267,8 @@ public class SavingProductData implements Serializable { return interestCalculationOptions; } - public Integer getDepositEvery() { - return this.depositEvery; - } + public Integer getDepositEvery() { + return this.depositEvery; + } } diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/service/SavingProductReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/service/SavingProductReadPlatformServiceImpl.java index aa2c53cae..072f67505 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/service/SavingProductReadPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/service/SavingProductReadPlatformServiceImpl.java @@ -4,7 +4,6 @@ import java.math.BigDecimal; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Collection; -import java.util.List; import org.joda.time.DateTime; import org.mifosplatform.infrastructure.core.data.EnumOptionData; @@ -60,7 +59,7 @@ public class SavingProductReadPlatformServiceImpl implements SavingProductReadPl SavingProductLookupMapper savingProductLookupMapper = new SavingProductLookupMapper(); - String sql = "select " + savingProductLookupMapper.savingProductLookupSchema() + " where sp.is_deleted=0"; + String sql = "select " + savingProductLookupMapper.savingProductLookupSchema() + " where sp.is_deleted=0"; return this.jdbcTemplate.query(sql, savingProductLookupMapper, new Object[] {}); } @@ -146,7 +145,7 @@ public class SavingProductReadPlatformServiceImpl implements SavingProductReadPl return new SavingProductData(createdOn, lastModifedOn, id, name, description, interestRate, minInterestRate, maxInterestRate, currencyData, currencyDigits, savingsDepositAmount, savingProductTypeEnum, tenureTypeEnum, tenure, savingFrequencyType, savingInterestType, interestCalculationMethodEnum, minimumBalanceForWithdrawal, isPartialDepositAllowed, - isLockinPeriodAllowed, lockinPeriod, lockinPeriodType,depositEvery); + isLockinPeriodAllowed, lockinPeriod, lockinPeriodType, depositEvery); } } @@ -169,7 +168,7 @@ public class SavingProductReadPlatformServiceImpl implements SavingProductReadPl private void populateProductDataWithDropdownOptions(final SavingProductData productData) { - List currencyOptions = currencyReadPlatformService.retrieveAllowedCurrencies(); + Collection currencyOptions = currencyReadPlatformService.retrieveAllowedCurrencies(); productData.setCurrencyOptions(currencyOptions); } diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/api/DepositProductsApiResource.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/api/DepositProductsApiResource.java index c5e0d9ce2..356e3b81a 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/api/DepositProductsApiResource.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/api/DepositProductsApiResource.java @@ -180,7 +180,7 @@ public class DepositProductsApiResource { private DepositProductData handleTemplateRelatedData(final Set responseParameters, final DepositProductData productData) { responseParameters.addAll(Arrays.asList("currencyOptions", "interestCompoundedEveryPeriodTypeOptions")); - List allowedCurrencies = this.currencyReadPlatformService.retrieveAllowedCurrencies(); + Collection allowedCurrencies = this.currencyReadPlatformService.retrieveAllowedCurrencies(); EnumOptionData monthly = SavingsDepositEnumerations.interestCompoundingPeriodType(PeriodFrequencyType.MONTHS); List interestCompoundedEveryPeriodTypeOptions = Arrays.asList(monthly); diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/data/DepositProductData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/data/DepositProductData.java index a284f28b9..f0b43e783 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/data/DepositProductData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/data/DepositProductData.java @@ -2,6 +2,7 @@ package org.mifosplatform.portfolio.savingsdepositproduct.data; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import org.joda.time.DateTime; @@ -40,7 +41,7 @@ public class DepositProductData { private final DateTime createdOn; private final DateTime lastModifedOn; - private final List currencyOptions; + private final Collection currencyOptions; private final List interestCompoundedEveryPeriodTypeOptions; public DepositProductData(final DateTime createdOn, final DateTime lastModifedOn, final Long id, final String externalId, @@ -82,7 +83,8 @@ public class DepositProductData { this.interestCompoundedEveryPeriodTypeOptions = new ArrayList(); } - public DepositProductData(final List currencyOptions, final EnumOptionData defaultInterestCompoundedEveryPeriodType, + public DepositProductData(final Collection currencyOptions, + final EnumOptionData defaultInterestCompoundedEveryPeriodType, final List interestCompoundedEveryPeriodTypeOptions) { this.createdOn = null; this.lastModifedOn = null; @@ -115,7 +117,7 @@ public class DepositProductData { this.interestCompoundedEveryPeriodTypeOptions = interestCompoundedEveryPeriodTypeOptions; } - public DepositProductData(final DepositProductData product, final List currencyOptions, + public DepositProductData(final DepositProductData product, final Collection currencyOptions, final List interestCompoundedEveryPeriodTypeOptions) { this.createdOn = product.getCreatedOn(); this.lastModifedOn = product.getLastModifedOn(); @@ -224,7 +226,7 @@ public class DepositProductData { return lastModifedOn; } - public List getCurrencyOptions() { + public Collection getCurrencyOptions() { return currencyOptions; }