Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

PSPCL iFix Adapter is a java standalone application, which will be running as a cron job to fetch the bills and payments from the PSPCL system and reconcile the same. And finally, publish them to the iFix core system.

...

  • Sort the pspcl bills and payments results based on 'BILL_ISSUE_DATE' and 'TXNDATE' respectively.

For the first time check if any bill is present with the given Account Number in Pspcl adapter DB
If No i.e. no bill with given account number then just add the bill details in the PSPCL adapter DB and send the fiscal event to fiscal event service for bill . Here we will not do nothing for payments.
If yes i.e. we have previous bill details in Pspcl db for given account umber .
: Now check for if the bill details which you got for the account number is same or if its a new bill. we can check this by bill number if its same bill or not(Basically call pspcl db tocheck if bill exist with same account number and same bill number
If yes: That means we already have the bill details and we have already send the bill fiscal event previously. So don’t send the bill fiscal event to fiscal event service Now check for the payments details received from the PSPCL system. PSPCL send all the transaction made in last 50 days buffer.
firstly, Filter out the payments and keep only payments made after the bill issue date.(i.e. previous bill which you already have in db as well as in the get bill detail Api from PSPCL SYSTEM.
example : if last bill issue date is 15th of may. then take all payments made after 15th of may.
then check for the payments if these payments are already send to fiscal event service .Basically check in pspcl db by comparing the txn id . Check if there is any new payment made or not
if yes: Then save the details of the Payments in PSPCL adapter DB and send the payment fiscal event to fiscal event service.
if No: Then no need to save or send any fiscal event to fiscal event service.
If No: That means we have new bill which got generated. Save the bill details in Pspcl Adapter DB and send fiscal event details to fiscal event service by calculating current month bill (we will calculate the current bill based on the logic below). Now same as above check for payments check. filter out the Payments made after the previous bill issue date which we can get from pspcl DB by order by bill issue date DESC and limit 1. Also filter out Payments made before the current new bill issue Date. Check if there is any new payments made
if yes:
1. Then save payments details in PSPCL adapter DB and send payment fiscal event to fiscal event Service.
2. Then calculate the current month bill from the below logic
Calculated current bill = (Curr_Bill - (Last_Bill - Last_Payments ))(last_payments made between previous bill_issue_date and current_month bill_issue_date ))
Curr_Bill: This is the pspcl bill that we get in pspcl bill result.
Last_Bill: Will get this bill from PSPCL db by sorting result with bill issue date limit it to 1
Last_Payments: Will pick up the record from the PSPCL payment detail table with 'TXNDATE' as a range from 'LAST_BILL_ISSUE_DATE' & 'CURRENT_MOTH_BILL_ISSUE_DATE '.
3. Save bill details which we got from PSPCL system with same bill amount. And send fiscal event bill amount from calculated current bill amount from above logic

if No:
1. No need to save any payment details and send fiscal event as there is no new payments done

...

FLOW OF DATA TO MGRAMSEVA
PSPCL SYSTEM → PSPCL-IFIX-ADAPTER CRONJOB → FISCAL-EVENT-SERVICE
IFIX-REFERENCE-ADAPTER SCHEDULED JOB → MGRAMSEVA SYSTEM

NOTES AND ASSUMPTION
NOTE1. :::
for creating/pushing the date in mgramseva from mgramseva adpater there should be one superuser which can login credential for all tenants in PROD.

2.Bill will be always be zero from pspcl if the advance is more than current bill amount (Asssumption we will not accept negative bill) and we will send the bill details oly if bill amount is greater than Zero.
3.If partial advance is paid than we will not use the logic of
{currentMonthBill- (lastMonthBill- (totalpayments ))} totalPayment is Sum of Payments made between Last and current bill issue date))
if (lastMonthBill- (totalpayments ) is less than zero we will only send the current bill amount as the due amount received from PSPCL system

Document Resources and Links

...