description | layout | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Triggered by Batch job |
|
- block_funds_with_bank API invoked by bank_block_funds_worker (Celery worker task)
- Worker invoked by
- block_funds_with_bank_beat_producer (Celery beat producer)
frequency | hourly (specified by configuration yml) |
attempts | 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 funds_available_status = 'FUNDS_AVAILABLE' AND ( |
- Pick up Eligible - disbursement_envelope
- Delegate a task to bank_block_funds_worker
- Payload - disbursement_envelope_id
- Payload - disbursement_envelope_id
- get the details of the disbursement_envelope - total funds needed for this envelope
- get details from benefit_program_configuration
- get the instance of BankConnector (implementing BankConnectorInterface) from BankConnectorFactory
- BankConnectorInterface - There will be a connector (implementation of the BankConnectorInterface) for every Sponsor Bank
- Invoke - Block Funds API
SUCCESS and FUNDS_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
SUCCESS and FUNDS_NOT_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
FAILURE
- 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