create_disbursements

API Attributes

Direction

Inward

Invoked by

PBMS

Mode

Synchronous

Tables

disbursement disbursement_batch_control

A disbursement represents a single disbursement transaction under a disbursement_envelope. A disbursement_envelope will contain many hundreds/thousands of disbursements. Each such disbursement will be denoted by a unique disbursement_id

Object design

disbursement

AttributeDatatype

disbursement_envelope_id

The envelope under which this disbursement is being effected Non Unique Index

disbursement_id

Unique identifier for each disbursement transaction - Primary Key

beneficiary_id

The Beneficiary ID to whom this disbursement is being targeted

beneficiary_name

The name of the beneficiary as available in the PBMS / Social Registry records

disbursement_amount

The disbursement amount (in the currency specified in the envelope) for this cycle of the program

narrative

The text that will be available in the Account Statement of the beneficiary's account against this disbursement credit transaction

receipt_time_stamp

Time stamp of receipt of disbursement

cancellation_status

Enum NOT_CANCELLED CANCELLED

cancellation_time_stamp

Time stamp of receipt of cancellation request

disbursement_batch_control

AttributeDescription

disbursement_id

Unique identifier for each disbursement transaction Unique Index

disbursement_envelope_id

The envelope under which this disbursement is being effected Non Unique Index

beneficiary_id

Non Unique Index

bank_disbursement_batch_id

Uniquely represents the shipment bundle into which this disbursement is included. Typically, the payment instruction API into the sponsor bank will be a bulk API, containing many disbursements. Depending on the number of disbursements, there will be many batches into the sponsor bank. This shipment_to_bank_batch_id facilitates identification of the exact shipment batch. The shipment_batch_id is created by the sponsor_bank_dispatch_producer (celery beat producer) Unique Index

mapper_resolution_batch_id

Unique batch id - that represents batch control for ID-Mapper resolution Multiple beneficiary ids will be sent to the mapper resolve API in a single invocation This batch id - represents that batch. All records that are in a single batch_id - will be sent to the mapper resolution in a single API call The mapper_resolution_batch_id - is created during "create_disbursements" inward API from PBMS. All disbursements received in a single API from PBMS are batched together with a single resolution batch id Unique Index

bank_disbursement_batch_status

AttributeDescription

bank_disbursement_batch_id

Unique Index

disbursement_envelope_id

Non Unique Index

disbursement_status

Enum PENDING PROCESSED

disbursement_timestamp

latest_error_code

disbursement_attempts

mapper_resolution_batch_status

AttributeDescription

mapper_resolution_batch_id

Unique Index

resolution_status

Enum PENDING PROCESSED

resolution_timestamp

latest_error_code

resolution_attempts

create_disbursements - Business Logic

Persist in the following tables

  1. disbursements

  2. disbursement_batch_control

  3. bank_disbursement_batch_status

  4. mapper_resolution_batch_status

  5. Every API invocation - will result in 1 record each in disbursement_batch_control & bank_disbursement_batch_status & mapper_resolution_batch_status

  6. The mapper resolution - itself - is dependent on the disbursement_envelope.id_mapper_resolution_required attribute (true/false)

Bulk Insert should be used to persist the tables - wherever multiple records are applicable

Transaction Control - should be ALL or NONE, i.e. either everything should be inserted or none should be inserted.

Validations & exceptions

  1. Ideally, disbursements should arrive before disbursement_schedule_date. However, system will not check this condition. System will anyway process an envelope, only when all the disbursements have arrived.

  2. disbursement_amount - valid non zero number

  3. the total number of disbursements should not exceed the number specified in the envelope

  4. the total_disbursement_amount should not exceed the number specified in the envelope

Last updated

Logo

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