Skip to main content

Vendor Claim Matching & Bank File Validation Logic

Objective

Implement enhanced vendor claim matching logic to ensure proper priority-based attachment with Bank Files (Bank File) and Tentative Bank Files (Tentative Bank File), along with ERP push validations and optimized search filtering.

1. Vendor Claim Matching Priority Logic

Requirement

All vendor claims must first attempt matching with the Main Bank File (Bank File).
If no match is found in Bank File, then matching should be attempted with the Tentative Bank File (Tentative Bank File).
Additionally:
  • If a lead is already attached with a Tentative Bank File
  • And later a valid Bank File entry is received for the same lead
  • Then the system must:
    • Detach the Tentative Bank File association
    • Attach the lead with the Bank File record instead

Matching Priority Flow

  1. Search in Main Bank File (Bank File)
  2. If match found:
    • Attach Bank File
    • Ignore Tentative Bank File
  3. If Bank File match not found:
    • Search in Tentative Bank File (Tentative Bank File)
  4. If Tentative Bank File match found:
    • Attach Tentative Bank File
  5. If lead already attached with Tentative Bank File and Bank File becomes available later:
    • Replace Tentative Bank File with Bank File attachment automatically

2. ERP Push Validation

Requirement

Users should not be allowed to push cases to ERP if:
  • Lead disbursal amount is greater than
  • The amount available in the attached Bank File

Validation Condition

If Lead Disbursal Amount > Attached Bank File Amount
→ Block ERP Push

Expected System Behavior

  • ERP push action should be restricted
  • Proper validation message should be shown to user

Suggested Validation Message

ERP push is not allowed because the disbursal amount exceeds the attached Bank File amount.

3. Allowed Business Categories for Matching

Requirement

Only the following business categories should be considered during matching between Lead Forms and Bank Files.

Allowed Categories

Business CategoryID
Loan TBC11
Loan TBC Trench21
In-house Case20
Payout Sharing Case17
Insurance LPP9
Insurance Others10

Matching Restriction

System should:
  • Consider only the above categories during Bank File/Tentative Bank File matching
  • Ignore all other business categories

4. Bank File Search Optimization (180-Day Filter)

Requirement

While matching Lead Forms with Bank Files:
  • Do not show or consider any Bank File records
  • Which were received via webhook
  • Earlier than 180 days from current date
This restriction is applicable only for the search engine layer to reduce load and improve performance.

Purpose

  • Reduce search engine load
  • Improve matching performance
  • Avoid unnecessary historical record scanning

Note

If database load also increases in future, similar filtering logic can additionally be implemented at DB level.

5. Expected System Behavior Summary

ScenarioExpected Action
Bank File match foundAttach Bank File
Bank File not found, Tentative Bank File foundAttach Tentative Bank File
Tentative Bank File already attached, Bank File later receivedReplace Tentative Bank File with Bank File
Disbursal amount > Bank File amountBlock ERP Push
Business category not in allowed listIgnore from matching
Bank File older than 180 daysExclude from search matching

6. Technical Considerations

Matching Sequence

  • Bank File matching must always execute before Tentative Bank File matching

Reattachment Logic

  • Existing Tentative Bank File linkage should be safely replaceable by Bank File

Validation Layer

  • ERP amount validation should occur before ERP API trigger

Performance Optimization

  • 180-day filtering should preferably be applied at search-query/index level

Auditability

System should maintain logs for:
  • Bank File attachment
  • Tentative Bank File attachment
  • Tentative Bank File replaced by Bank File
  • ERP push validation failures