feat(clerk): add GL disbursement maker-checker backend
- Add ClerkDisbursementRequestApiResource with submit/list/my/approve/reject endpoints - Approve posts savings/current deposits then offsets DR source GL / CR Cash at Vault - Add Liquibase migration for m_clerk_disbursement_request table (IF NOT EXISTS indexes) - Add VoucherService constants TYPE_DISBURSEMENT and REF_CLERK_DISBURSEMENT_REQUEST Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
3e1abaef03
commit
a6eae3d6e8
@@ -359,4 +359,5 @@
|
||||
<include file="parts/0329_create_voucher.xml" relativeToChangelogFile="true"/>
|
||||
<include file="parts/0330_create_cashier_deposit_request.xml" relativeToChangelogFile="true"/>
|
||||
<include file="parts/0331_add_gl_columns_to_cashier_deposit_request.xml" relativeToChangelogFile="true"/>
|
||||
<include file="parts/0332_create_clerk_disbursement_request.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
<?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="0332_create_clerk_disbursement_request" author="CBS">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<not><tableExists tableName="m_clerk_disbursement_request"/></not>
|
||||
</preConditions>
|
||||
|
||||
<createTable tableName="m_clerk_disbursement_request">
|
||||
<column name="id" type="BIGSERIAL">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<column name="voucher_no" type="VARCHAR(20)"/>
|
||||
<column name="status" type="VARCHAR(20)" defaultValue="PENDING">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
|
||||
<!-- DR side: GL account info -->
|
||||
<column name="gl_account_id" type="BIGINT"/>
|
||||
<column name="gl_account_no" type="VARCHAR(50)"/>
|
||||
<column name="gl_account_name" type="VARCHAR(150)"/>
|
||||
<column name="dr_amount" type="DECIMAL(19,6)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="office_id" type="BIGINT"/>
|
||||
<column name="currency_code" type="VARCHAR(10)" defaultValue="INR"/>
|
||||
|
||||
<!-- CR side: JSON array of credit entries -->
|
||||
<!-- Format: [{"accountNo":"0032","accountType":"SD","savingsAccountId":123,"amount":5000,"paymentTypeId":1}] -->
|
||||
<column name="credit_entries" type="TEXT">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
|
||||
<column name="payment_type_id" type="BIGINT"/>
|
||||
<column name="payment_type_name" type="VARCHAR(100)"/>
|
||||
<column name="description" type="VARCHAR(500)"/>
|
||||
|
||||
<!-- Maker (clerk) -->
|
||||
<column name="clerk_id" type="BIGINT">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="clerk_name" type="VARCHAR(150)"/>
|
||||
<column name="clerk_username" type="VARCHAR(100)"/>
|
||||
|
||||
<!-- Checker (manager) -->
|
||||
<column name="manager_id" type="BIGINT"/>
|
||||
<column name="manager_name" type="VARCHAR(150)"/>
|
||||
<column name="manager_username" type="VARCHAR(100)"/>
|
||||
<column name="rejection_reason" type="VARCHAR(500)"/>
|
||||
|
||||
<!-- Result: comma-separated txn refs (one per CR entry) -->
|
||||
<column name="txn_refs" type="VARCHAR(500)"/>
|
||||
|
||||
<column name="activity_log" type="TEXT"/>
|
||||
<column name="submitted_at" type="TIMESTAMP">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="actioned_at" type="TIMESTAMP"/>
|
||||
</createTable>
|
||||
|
||||
<sql>CREATE INDEX IF NOT EXISTS idx_cdr_status ON m_clerk_disbursement_request(status)</sql>
|
||||
<sql>CREATE INDEX IF NOT EXISTS idx_cdr_clerk_id ON m_clerk_disbursement_request(clerk_id)</sql>
|
||||
<sql>CREATE INDEX IF NOT EXISTS idx_cdr_submitted_at ON m_clerk_disbursement_request(submitted_at)</sql>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
Reference in New Issue
Block a user