Published on : June 10, 2020

Backend URL : https://loantap.in/wp-admin/post.php?post=758496&action=edit

Frontend URL : https://loantap.in/banking/workflow-post-instalments/

Post Instalment Flow takes 4 Steps to complete.

Step 1

Import Instalment Data

Step 2

View Instalment Data

Step 3

Post Instalments

Step 4

Workflow Completed! Download CSV

Step 1 : Import Instalment Data

View Interface:

Csv Format:

Sublan_id

Entry_date

Sublan232232

20200101

Submit Flow:
Collect posted data and decode
[request.request_body m.json_decode=true o.set=template.data /]

define table name to store data
[template.set table_name=”marketing.post_instalment_{unique_number}” /]

Import CSV data in table

Query

	
/*Create temporary table in marketing table for 72 hours validity */
CREATE TABLE [template.table_name/] (
	ID INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
	stamp TIMESTAMP,
	created_by VARCHAR(50) NULL,
	[loop.@xx template.data.0]
		[env.@xx.key/] VARCHAR(255) NULL,
	[/loop.@xx]
	service varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
	current_page varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
	message VARCHAR(255) NULL,
	status VARCHAR(50)
	)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='banking||workflow-post-instalments';
			  
	/*store table entry into db*/
	insert into delete_marketing_tables (`table_name`,`expiry_date`)
	select '[template.table_name/]',DATE_ADD(NOW(), INTERVAL 72 HOUR) from dual;

/*Store table name in workflow for other activities*/
First step Mark Completed. Reload Page 

Step 2 : View Instalment Data :

Imported data will display in Manage format Columns Used in UI:
lan_id
sublan_id
lapp_id
product
installment_method
nbfc
lapp_status_label
scheme_id
service
status
Message

Step 3 : Post Instalment Data :

Start activity queue

Service name

common_service.transaction.post_instalmentv2

Edit URL

https://loantap.in/wp-admin/post.php?post=752156&action=edit

Template Name

post_instalmentv2

Update <message column> as Row activity is in process :
       

UPDATE 
	[esc.table env.@data.table/]
SET
	`message`="Row activity is in process"
WHERE
	ID="[env.@data.row.ID/]";  

Validation Checks before proceed :

Sublan_id is missing
UPDATE [esc.table env.@data.table/] SET `message`="Invalid Sublan ID", `status`="error" WHERE ID="[env.@data.row.ID/]"; Entry Date is missing
UPDATE [esc.table env.@data.table/] SET `message`="Invalid entry date", `status`="error" WHERE ID="[env.@data.row.ID/]";

Three Types of instalment post, based on columns :

1) multi_instalment_post
Fire transaction
[sublan_txn.run multi_instalment_post instalment_id=”{@data.row.withdrawal_id}” sublan_id=”{module.sublan_id}” o.set=module.sublan_obj /]

2) pd_instalment_post
Fire transaction
[sublan_txn.run pd_instalment_post entry_date=”{module.entry_date}” sublan_id=”{module.sublan_id}” o.set=module.sublan_obj /]

3) instalment_post (Default):
Fire transaction
[sublan_txn.run instalment_post entry_date=”{module.entry_date}” sublan_id=”{module.sublan_id}” o.set=module.sublan_obj /]

Common Notification Logic :

Mail Status Flag

Logic

Support

yes

Default Value

Common

no

On Empty mail template

Common

no

On transaction status not success

Common

no

On env.@tran.sublan_obj.sublan.temp.disable_mail = yes

For new sublan

no

On env.@tran.sublan_obj.sublan.temp_disable_mail = yes

For old sublan

no

env.@tran.sublan_obj.scheme.scheme.notification

For old sublan

no

env.@tran.send_notification

Common for specific

 Update Marketing table after success :

UPDATE 
	[esc.table env.@data.table/]
SET
	`message`="[module.sublan_obj.last_txn.message/]",
	`status`="[module.sublan_obj.last_txn.status/]"
WHERE 
	ID="[env.@data.row.ID/]";  

 Update Marketing table after error :

UPDATE
	[esc.table env.@data.table/]
SET
	`message`="Critical Error, Please contact Admin",
	`status`="error"
WHERE
	ID="[env.@data.row.ID/]";