Repository: fineract Updated Branches: refs/heads/develop 2e259b158 -> 455ef9827
http://git-wip-us.apache.org/repos/asf/fineract/blob/d4672f9b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientReadPlatformServiceImpl.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientReadPlatformServiceImpl.java index 24d85c5..7751909 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientReadPlatformServiceImpl.java @@ -51,6 +51,7 @@ import org.apache.fineract.portfolio.address.data.AddressData; import org.apache.fineract.portfolio.address.service.AddressReadPlatformService; import org.apache.fineract.portfolio.client.api.ClientApiConstants; import org.apache.fineract.portfolio.client.data.ClientData; +import org.apache.fineract.portfolio.client.data.ClientFamilyMembersData; import org.apache.fineract.portfolio.client.data.ClientNonPersonData; import org.apache.fineract.portfolio.client.data.ClientTimelineData; import org.apache.fineract.portfolio.client.domain.ClientEnumerations; @@ -86,6 +87,7 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService private final ParentGroupsMapper clientGroupsMapper = new ParentGroupsMapper(); private final AddressReadPlatformService addressReadPlatformService; + private final ClientFamilyMembersReadPlatformService clientFamilyMembersReadPlatformService; private final ConfigurationReadPlatformService configurationReadPlatformService; private final EntityDatatableChecksReadService entityDatatableChecksReadService; private final ColumnValidator columnValidator; @@ -95,7 +97,7 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService final OfficeReadPlatformService officeReadPlatformService, final StaffReadPlatformService staffReadPlatformService, final CodeValueReadPlatformService codeValueReadPlatformService, final SavingsProductReadPlatformService savingsProductReadPlatformService, - final AddressReadPlatformService addressReadPlatformService, + final AddressReadPlatformService addressReadPlatformService,final ClientFamilyMembersReadPlatformService clientFamilyMembersReadPlatformService, final ConfigurationReadPlatformService configurationReadPlatformService, final EntityDatatableChecksReadService entityDatatableChecksReadService, final ColumnValidator columnValidator) { @@ -106,6 +108,7 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService this.codeValueReadPlatformService = codeValueReadPlatformService; this.savingsProductReadPlatformService = savingsProductReadPlatformService; this.addressReadPlatformService=addressReadPlatformService; + this.clientFamilyMembersReadPlatformService=clientFamilyMembersReadPlatformService; this.configurationReadPlatformService=configurationReadPlatformService; this.entityDatatableChecksReadService = entityDatatableChecksReadService; this.columnValidator = columnValidator; @@ -130,7 +133,7 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService address = this.addressReadPlatformService.retrieveTemplate(); } - + final ClientFamilyMembersData familyMemberOptions=this.clientFamilyMembersReadPlatformService.retrieveTemplate(); Collection<StaffData> staffOptions = null; @@ -166,7 +169,7 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService return ClientData.template(defaultOfficeId, new LocalDate(), offices, staffOptions, null, genderOptions, savingsProductDatas, clientTypeOptions, clientClassificationOptions, clientNonPersonConstitutionOptions, clientNonPersonMainBusinessLineOptions, - clientLegalFormOptions,address,isAddressEnabled, datatableTemplates); + clientLegalFormOptions,familyMemberOptions,address,isAddressEnabled, datatableTemplates); } @Override @@ -804,7 +807,7 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService final Collection<CodeValueData> clientNonPersonMainBusinessLineOptions = null; final List<EnumOptionData> clientLegalFormOptions = null; return ClientData.template(null, null, null, null, narrations, null, null, clientTypeOptions, clientClassificationOptions, - clientNonPersonConstitutionOptions, clientNonPersonMainBusinessLineOptions, clientLegalFormOptions,null,null, null); + clientNonPersonConstitutionOptions, clientNonPersonMainBusinessLineOptions, clientLegalFormOptions,null,null,null, null); } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/fineract/blob/d4672f9b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java index 2e109c4..a649e51 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java @@ -122,6 +122,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP private final FromJsonHelper fromApiJsonHelper; private final ConfigurationReadPlatformService configurationReadPlatformService; private final AddressWritePlatformService addressWritePlatformService; + private final ClientFamilyMembersWritePlatformService clientFamilyMembersWritePlatformService; private final BusinessEventNotifierService businessEventNotifierService; private final EntityDatatableChecksWritePlatformService entityDatatableChecksWritePlatformService; @Autowired @@ -136,7 +137,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP final CommandProcessingService commandProcessingService, final ConfigurationDomainService configurationDomainService, final AccountNumberFormatRepositoryWrapper accountNumberFormatRepository, final FromJsonHelper fromApiJsonHelper, final ConfigurationReadPlatformService configurationReadPlatformService, - final AddressWritePlatformService addressWritePlatformService, final BusinessEventNotifierService businessEventNotifierService, + final AddressWritePlatformService addressWritePlatformService, final ClientFamilyMembersWritePlatformService clientFamilyMembersWritePlatformService, final BusinessEventNotifierService businessEventNotifierService, final EntityDatatableChecksWritePlatformService entityDatatableChecksWritePlatformService) { this.context = context; this.clientRepository = clientRepository; @@ -158,6 +159,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP this.fromApiJsonHelper = fromApiJsonHelper; this.configurationReadPlatformService = configurationReadPlatformService; this.addressWritePlatformService = addressWritePlatformService; + this.clientFamilyMembersWritePlatformService=clientFamilyMembersWritePlatformService; this.businessEventNotifierService = businessEventNotifierService; this.entityDatatableChecksWritePlatformService = entityDatatableChecksWritePlatformService; } @@ -327,6 +329,12 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP if (isAddressEnabled) { this.addressWritePlatformService.addNewClientAddress(newClient, command); } + + + if(command.arrayOfParameterNamed("familyMembers")!=null) + { + this.clientFamilyMembersWritePlatformService.addClientFamilyMember(newClient, command); + } if(command.parameterExists(ClientApiConstants.datatables)){ this.entityDatatableChecksWritePlatformService.saveDatatables(StatusEnum.CREATE.getCode().longValue(), http://git-wip-us.apache.org/repos/asf/fineract/blob/d4672f9b/fineract-provider/src/main/resources/sql/migrations/core_db/V328__family_members_sql_support.txt ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V328__family_members_sql_support.txt b/fineract-provider/src/main/resources/sql/migrations/core_db/V328__family_members_sql_support.txt new file mode 100644 index 0000000..e6e1101 --- /dev/null +++ b/fineract-provider/src/main/resources/sql/migrations/core_db/V328__family_members_sql_support.txt @@ -0,0 +1,60 @@ +-- +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. +-- + + +CREATE TABLE `m_family_members` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `client_id` bigint(20) NOT NULL, + `firstname` varchar(50) NOT NULL, + `middlename` varchar(50) DEFAULT NULL, + `lastname` varchar(50) DEFAULT NULL, + `qualification` varchar(50) DEFAULT NULL, + `relationship_cv_id` int(11) NOT NULL, + `marital_status_cv_id` int(11) DEFAULT NULL, + `gender_cv_id` int(11) DEFAULT NULL, + `date_of_birth` date DEFAULT NULL, + `age` int(11) DEFAULT NULL, + `profession_cv_id` int(11) DEFAULT NULL, + `mobile_number` varchar(50) DEFAULT NULL, + `is_dependent` tinyint(4) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `FK_m_family_members_client_id_m_client` (`client_id`), + KEY `FK_m_family_members_relationship_m_code_value` (`relationship_cv_id`), + KEY `FK_m_family_members_marital_status_m_code_value` (`marital_status_cv_id`), + KEY `FK_m_family_members_gender_m_code_value` (`gender_cv_id`), + KEY `FK_m_family_members_profession_m_code_value` (`profession_cv_id`), + CONSTRAINT `FK_m_family_members_client_id_m_client` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), + CONSTRAINT `FK_m_family_members_gender_m_code_value` FOREIGN KEY (`gender_cv_id`) REFERENCES `m_code_value` (`id`), + CONSTRAINT `FK_m_family_members_marital_status_m_code_value` FOREIGN KEY (`marital_status_cv_id`) REFERENCES `m_code_value` (`id`), + CONSTRAINT `FK_m_family_members_profession_m_code_value` FOREIGN KEY (`profession_cv_id`) REFERENCES `m_code_value` (`id`), + CONSTRAINT `FK_m_family_members_relationship_m_code_value` FOREIGN KEY (`relationship_cv_id`) REFERENCES `m_code_value` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 + + +-- permissions + +INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATE_FAMILYMEMBERS', 'FAMILYMEMBERS', 'CREATE', 0); +INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_FAMILYMEMBERS', 'FAMILYMEMBERS', 'UPDATE', 0); +INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DELETE_FAMILYMEMBERS', 'FAMILYMEMBERS', 'DELETE', 0); + +-- code inserts + +INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('MARITAL STATUS', 1); +INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('RELATIONSHIP', 1); +INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('PROFESSION', 1);