block_funds_with_bank
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 | disbursement_schedule_date <= today AND cancellation_status = 'NOT_CANCELLED' AND number_of_disbursements = number_of_disbursements_received AND funds_available_status = 'FUNDS_AVAILABLE' AND ( ( funds_block_status = "PENDING_CHECK" AND funds_block_retries < retry_limit) OR (funds_block_status = 'FUNDS_BLOCK_FAILURE" AND funds_block_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 - Block Funds API
If Success and Funds are Blocked, update the following
disbursement_envelope_batch_status.funds_blocked_with_bank = FUNDS_BLOCK_SUCCESS
disbursement_envelope_batch_status.funds_blocked_latest_timestamp = now()
disbursement_envelope_batch_status.funds_blocked_latest_error_code = null
disbursement_envelope_batch_status.funds_blocked_retries = +1
disbursement_envelope_batch_status.funds_blocked_reference_number = block reference number from bank
If Success and Funds could not be blocked, update the following
disbursement_envelope_batch_status.funds_blocked_with_bank = FUNDS_BLOCK_FAILURE
disbursement_envelope_batch_status.funds_blocked_latest_timestamp = now()
disbursement_envelope_batch_status.funds_blocked_latest_error_code = error code from bank
disbursement_envelope_batch_status.funds_blocked_retries = +1
disbursement_envelope_batch_status.funds_blocked_reference_number = blank
If Failure, update the following
disbursement_envelope_batch_status.funds_blocked_with_bank = FUNDS_BLOCK_FAILURE
disbursement_envelope_batch_status.funds_blocked_latest_timestamp = now()
disbursement_envelope_batch_status.funds_blocked_latest_error_code = error code from bank
disbursement_envelope_batch_status.funds_blocked_retries = +1
disbursement_envelope_batch_status.funds_blocked_reference_number = blank
Last updated