check_funds_with_bank

Triggered by Batch job

driver condition

frequency

hourly (specified by configuration yml)

retries

yes. subject to a configurable limit specified by configuration yml

driving table

disbursement_envelope_batch_status

eligible envelopes

envelope.disbursement_schedule_date < today AND

envelope.cancellation_status = 'NOT_CANCELLED'

AND

envelope.number_of_disbursements = batch_status.number_of_disbursements_received

AND

envelope.total_disbursement_amount = batch_status.total_disbursement_amount_received

AND

( ( funds_available_status = "pending_check" AND funds_available_retries < retry_limit) OR ( funds_available_status = 'not_available" AND funds_available_retries < retry_limit) )

Business Logic

Pick up Eligible - disbursement_envelope

Pick up Bank Details from table - benefit_program

Get Bank Connector Instance - from Bank Connector Factory

Invoke - Check Funds API

If Success and Funds are available, update the following

  1. disbursement_envelope_batch_status.funds_available_with_bank = funds_available

  2. disbursement_envelope_batch_status.funds_available_latest_timestamp = now()

  3. disbursement_envelope_batch_status.funds_available_latest_error_code = null

  4. disbursement_envelope_batch_status.funds_available_retries = +1

If Success and Funds are Unavailable, update the following

  1. disbursement_envelope_batch_status.funds_available_with_bank = funds_not_available

  2. disbursement_envelope_batch_status.funds_available_latest_timestamp = now()

  3. disbursement_envelope_batch_status.funds_available_latest_error_code = null

  4. disbursement_envelope_batch_status.funds_available_retries = +1

If Failure, update the following

  1. disbursement_envelope_batch_status.funds_available_with_bank = pending_check

  2. disbursement_envelope_batch_status.funds_available_latest_timestamp = now()

  3. disbursement_envelope_batch_status.funds_available_latest_error_code = error_code

  4. disbursement_envelope_batch_status.funds_available_retries = +1

Last updated

Logo

Copyright © 2024 OpenG2P. This work is licensed under Creative Commons Attribution International LicenseCC-BY-4.0 unless otherwise noted.

#712: Pramod's Jun 3 changes

Change request updated