From a2fa8688aec78a0bc7ca04b1c626d892810c0ad0 Mon Sep 17 00:00:00 2001 From: Anshul Rathore Date: Fri, 14 Aug 2026 12:54:43 +0530 Subject: [PATCH] Update client KYC and AML changes --- ...WritePlatformServiceJpaRepositoryImpl.java | 7 ++++ .../src/main/resources/application.properties | 4 +-- ...add_sponsor_dd_cash_charges_gl_mapping.xml | 33 ++++++++++------- ...0_add_sponsor_dd_cash_receipt_suspense.xml | 34 ++++++++++-------- .../0353_add_sponsor_dd_gst_on_charges.xml | 34 ++++++++++-------- .../2028_update_saving_product_temp_table.xml | 36 ++++++++++++++++--- 6 files changed, 101 insertions(+), 47 deletions(-) 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 d68f38566..b70f4c51f 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 @@ -159,6 +159,13 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP this.clientNonPersonRepository.delete(clientNonPerson); } + // Safely cascade-delete child records that have foreign keys pointing to this client + this.jdbcTemplate.update("delete from m_client_identifier where client_id = ?", clientId); + this.jdbcTemplate.update("delete from m_family_members where client_id = ?", clientId); + this.jdbcTemplate.update("delete from m_client_address where client_id = ?", clientId); + this.jdbcTemplate.update("delete from m_address where client_id = ?", clientId); + this.jdbcTemplate.update("delete from m_client_kyc where client_id = ?", clientId); + this.clientRepository.delete(client); this.clientRepository.flush(); return new CommandProcessingResultBuilder() // diff --git a/fineract-provider/src/main/resources/application.properties b/fineract-provider/src/main/resources/application.properties index 6ff256688..fbf1fd99b 100644 --- a/fineract-provider/src/main/resources/application.properties +++ b/fineract-provider/src/main/resources/application.properties @@ -46,7 +46,7 @@ fineract.security.oauth2.client.registrations.frontend-client.require-authorizat fineract.tenant.host=${FINERACT_DEFAULT_TENANTDB_HOSTNAME:localhost} fineract.tenant.port=${FINERACT_DEFAULT_TENANTDB_PORT:5432} fineract.tenant.username=${FINERACT_DEFAULT_TENANTDB_UID:postgres} -fineract.tenant.password=${FINERACT_DEFAULT_TENANTDB_PWD:Keshav@898966} +fineract.tenant.password=${FINERACT_DEFAULT_TENANTDB_PWD:anshul@9009} fineract.tenant.parameters=${FINERACT_DEFAULT_TENANTDB_CONN_PARAMS:} fineract.tenant.timezone=${FINERACT_DEFAULT_TENANTDB_TIMEZONE:Asia/Kolkata} fineract.tenant.identifier=${FINERACT_DEFAULT_TENANTDB_IDENTIFIER:default} @@ -407,7 +407,7 @@ server.tomcat.mbeanregistry.enabled=${FINERACT_SERVER_TOMCAT_MBEANREGISTRY_ENABL spring.datasource.hikari.driverClassName=${FINERACT_HIKARI_DRIVER_SOURCE_CLASS_NAME:org.postgresql.Driver} spring.datasource.hikari.jdbcUrl=${FINERACT_HIKARI_JDBC_URL:jdbc:postgresql://localhost:5432/fineract_tenants} spring.datasource.hikari.username=${FINERACT_HIKARI_USERNAME:postgres} -spring.datasource.hikari.password=${FINERACT_HIKARI_PASSWORD:Keshav@898966} +spring.datasource.hikari.password=${FINERACT_HIKARI_PASSWORD:anshul@9009} spring.datasource.hikari.minimumIdle=${FINERACT_HIKARI_MINIMUM_IDLE:3} spring.datasource.hikari.maximumPoolSize=${FINERACT_HIKARI_MAXIMUM_POOL_SIZE:10} spring.datasource.hikari.idleTimeout=${FINERACT_HIKARI_IDLE_TIMEOUT:60000} diff --git a/fineract-provider/src/main/resources/db/changelog/tenant/parts/0348_add_sponsor_dd_cash_charges_gl_mapping.xml b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0348_add_sponsor_dd_cash_charges_gl_mapping.xml index c7494f36a..6b9a3dcec 100644 --- a/fineract-provider/src/main/resources/db/changelog/tenant/parts/0348_add_sponsor_dd_cash_charges_gl_mapping.xml +++ b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0348_add_sponsor_dd_cash_charges_gl_mapping.xml @@ -23,24 +23,31 @@ + already used by "INCOME FROM LOAN" (gl_code 10.1) / "INCOME FROM ALL" (gl_code 10.2). + parent_id is resolved dynamically via subquery (not hardcoded) because the numeric id of + the "INCOME HEAD" row is not guaranteed to be the same across environments/fresh DBs. --> + + 9:c2bc9949d0b0ab1972d1de1fb0131bd5 select count(*) from acc_gl_account where gl_code = '10.3' - - - - - - - - - - - + + INSERT INTO acc_gl_account (name, gl_code, parent_id, hierarchy, account_usage, classification_enum, disabled, manual_journal_entries_allowed, description) + VALUES ( + 'DD Issuance Charges Income', + '10.3', + (SELECT id FROM acc_gl_account WHERE gl_code = '10'), + '.', + 1, + 4, + FALSE, + TRUE, + 'Commission/charges income collected from customers and walk-in purchasers when issuing a sponsor bank demand draft.' + ); + + + + 9:0a94b7ae03cdf15952a416c3f1a6434f - - select count(*) from acc_gl_account where gl_code = '9.4' - + + + select count(*) from acc_gl_account where gl_code = '9.4' + + select count(*) from acc_gl_account where gl_code = '9' + - - - - - - - - - - - + + INSERT INTO acc_gl_account (name, gl_code, parent_id, hierarchy, account_usage, classification_enum, disabled, manual_journal_entries_allowed, description) + SELECT 'DD Cash Received - Pending Approval', '9.4', parent.id, '.', 1, 2, FALSE, TRUE, + 'Interim liability for cash physically received from a walk-in DD purchaser at submission time, pending manager approval of the issuance request. Cleared into Sponsor DD Payable + Charges Income on approval, or reversed back to Cash at Tellers on rejection.' + FROM acc_gl_account parent + WHERE parent.gl_code = '9'; + diff --git a/fineract-provider/src/main/resources/db/changelog/tenant/parts/0353_add_sponsor_dd_gst_on_charges.xml b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0353_add_sponsor_dd_gst_on_charges.xml index 02c79e220..cbd40e0dc 100644 --- a/fineract-provider/src/main/resources/db/changelog/tenant/parts/0353_add_sponsor_dd_gst_on_charges.xml +++ b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0353_add_sponsor_dd_gst_on_charges.xml @@ -23,23 +23,29 @@ + + + 9:b235f4e341d21adee8e1d2d280a2b0f4 - - select count(*) from acc_gl_account where gl_code = '9.5' - + + + select count(*) from acc_gl_account where gl_code = '9.5' + + select count(*) from acc_gl_account where gl_code = '9' + - - - - - - - - - - - + + INSERT INTO acc_gl_account (name, gl_code, parent_id, hierarchy, account_usage, classification_enum, disabled, manual_journal_entries_allowed, description) + SELECT 'GST Payable on DD Charges', '9.5', parent.id, '.', 1, 2, FALSE, TRUE, + 'GST collected from customers/purchasers on Sponsor DD issuance charges, held pending remittance to the government - not bank income.' + FROM acc_gl_account parent + WHERE parent.gl_code = '9'; + diff --git a/fineract-savings/src/main/resources/db/changelog/tenant/module/savings/parts/parts/2028_update_saving_product_temp_table.xml b/fineract-savings/src/main/resources/db/changelog/tenant/module/savings/parts/parts/2028_update_saving_product_temp_table.xml index c6bfea24a..9a442ccf3 100644 --- a/fineract-savings/src/main/resources/db/changelog/tenant/module/savings/parts/parts/2028_update_saving_product_temp_table.xml +++ b/fineract-savings/src/main/resources/db/changelog/tenant/module/savings/parts/parts/2028_update_saving_product_temp_table.xml @@ -22,26 +22,47 @@ xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd"> + - + + + + + + + - + + + + + - + + + + @@ -74,9 +95,16 @@ + - + + + + + +