feat(bank-transfer): add maker-checker support for bank transfers

- Added request_type column to m_clerk_disbursement_request via migration 0336
- submit() extracts requestType from body, stores in DB (defaults to DISBURSEMENT)
- approve() detects BANK_TRANSFER mode via request_type field:
    - DR entries: directDebitSavingsAccount / directDebitCurrentAccount
    - CR entries: directCreditSavingsAccount / directCreditCurrentAccount
    - GL: DR SavingsControl(per DR) / CR SavingsControl(per CR)
    - Audit INSERT into m_bank_transfer_log with unique BT voucher number
    - Existing disbursement/collection logic unchanged in else branch
- list(), myRequests(), loadRecord() all return request_type
- Migration 0335 (m_bank_transfer_log) also included

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jaanu423
2026-06-17 14:47:21 +05:30
co-authored by Claude Sonnet 4.6
parent bf5ce421df
commit 7354da8c1e
4 changed files with 664 additions and 129 deletions
@@ -362,4 +362,6 @@
<include file="parts/0332_create_clerk_disbursement_request.xml" relativeToChangelogFile="true"/>
<include file="parts/0333_rename_disbursed_to_withdrawn.xml" relativeToChangelogFile="true"/>
<include file="parts/0334_clerk_disbursement_add_error_message.xml" relativeToChangelogFile="true"/>
<include file="parts/0335_create_bank_transfer_log.xml" relativeToChangelogFile="true"/>
<include file="parts/0336_add_request_type_to_clerk_disbursement.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
<changeSet id="0335_create_bank_transfer_log" author="CBS">
<preConditions onFail="MARK_RAN">
<not><tableExists tableName="m_bank_transfer_log"/></not>
</preConditions>
<createTable tableName="m_bank_transfer_log">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="voucher_no" type="VARCHAR(25)">
<constraints unique="true" nullable="false"/>
</column>
<column name="office_id" type="BIGINT">
<constraints nullable="false"/>
</column>
<column name="currency_code" type="VARCHAR(3)" defaultValue="INR">
<constraints nullable="false"/>
</column>
<column name="total_amount" type="DECIMAL(19,6)">
<constraints nullable="false"/>
</column>
<column name="description" type="VARCHAR(500)"/>
<column name="debit_entries" type="TEXT"/>
<column name="credit_entries" type="TEXT"/>
<column name="txn_refs" type="TEXT"/>
<column name="gl_txn_id" type="VARCHAR(100)"/>
<column name="teller_id" type="BIGINT"/>
<column name="teller_name" type="VARCHAR(150)"/>
<column name="teller_username" type="VARCHAR(100)"/>
<column name="status" type="VARCHAR(20)" defaultValue="COMPLETED">
<constraints nullable="false"/>
</column>
<column name="error_message" type="VARCHAR(1000)"/>
<column name="created_at" type="TIMESTAMP" defaultValueComputed="CURRENT_TIMESTAMP">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
</databaseChangeLog>
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
<changeSet id="0336_add_request_type_to_clerk_disbursement" author="CBS">
<preConditions onFail="MARK_RAN">
<not><columnExists tableName="m_clerk_disbursement_request" columnName="request_type"/></not>
</preConditions>
<addColumn tableName="m_clerk_disbursement_request">
<column name="request_type" type="VARCHAR(30)" defaultValue="DISBURSEMENT">
<constraints nullable="false"/>
</column>
</addColumn>
</changeSet>
</databaseChangeLog>