Published on : July 14, 2020

Create new app with collection rights: cagents

Create two screens (module)

  • My Loans
    • Path: /cagent/my-loans
  • Agency Loans
    • Path: /cagents/agency-loans
  • Loan
    • Path: /cagents/loan/sublan/<sublan_id>

============================================================================================================================================

Screen:  “My Loans”  (Path: /cagent/my-loans)

a. Check if the user is logged in or not (empty app.user.email), if the users not logged in show the OTP Login form.

b. Once the user is logged in the

  • Search: Show options to search the applications using email_id/mobile_number.
  • My Cases: Show list of all the applications assigned to the loggedin user .

Block: Search:

Note: Search against: mobile_number/email_id

  • Show below data once the search result is found:
  • Sublan ID : link to page: ‘/cagents/loans/sublan/<sublanid>’
  • Assigned to
  • Name
  • Email
  • Mobile Number

   Note: Next to “Assigned to“, show below:

  • For internal users, Provide button to assign the case to loantap internal or external agency
    • When clicked on the loantap  internal show the drop down of all the agents of the loantap internal agency
    • When clicked on the external agency, show the list of all the collection agencies
  • For the external users, show the button to self-assign the case.
  • Button to update the selection.
    • Meta keys store in sublan
      • assigned_agency
      • assigned_agency_date
      • assigned_agent
      • assigned_date

Data Store when Internal Agency is assigned

meta_key meta_value
assigned_agency loantap-internal
assigned_agency_date 20201012
assigned_agent vibhav@loantap.in
assigned_date 20201012

Data Store when External Agency is assigned

meta_key meta_value
assigned_agency storm
assigned_agency_date 20201012

Data Store when External Agent self-assigns

meta_key meta_value
assigned_agent agent@gmail.com
assigned_date 20201012

Note: use below query to show the search result

with

q0 as (select object_id as lapp_id from lapp_meta where coll_id=’lapp’ and meta_key in (‘personal_email’, ‘mobile_number’) and meta_value=[esc.str template.search_value/]),

q1 as (select q0.*, meta_value as mobile_number from q0 left join lapp_meta on q0.lapp_id=lapp_meta.object_id and coll_id=’lapp’ and meta_key=’personal_email’),

q2 as (select q1.*, meta_value as personal_email from q1 left join lapp_meta on q1.lapp_id=lapp_meta.object_id and coll_id=’lapp’ and meta_key=’mobile_number’),

q3 as (select q2.*, meta_value as full_name from q2 left join lapp_meta on q2.lapp_id=lapp_meta.object_id and coll_id=’lapp’ and meta_key=’full_name’),

q4 as (select q3.*, object_id as sublan_id from q3 join sublan on q3.lapp_id=sublan.meta_value and coll_id=’sublan’ and meta_key=’lapp_id’),

q5 as (select q4.*, meta_value as agency_name from q4 left join sublan on q4.sublan_id=sublan.object_id and coll_id=’sublan’ and meta_key=’assigned_agency’ and meta_value='<agency_name>’),

q6 as (select q5.*, meta_value as agency_assigned from q5 left join sublan on q5.sublan_id=sublan.object_id and coll_id=’sublan’ and meta_key=’assigned_agent’)

select * from q6;

Block: My Cases:

Note: Use below query to show the list of all the assigned cases

with

q1 as (select object_id as sublan_id, meta_value as assigned_agent from sublan where coll_id=’sublan’ and meta_key=’assigned_agent’ and meta_value=[esc.str template.agent_email/]),

q2 as (select q1.*,meta_value as lapp_id from q1 join sublan on q1.sublan_id=sublan.object_id and coll_id=’sublan’ and meta_key=’lapp_id’),

q3 as (select q2.*,meta_value as full_name from q2 left join lapp_meta on q2.lapp_id=lapp_meta.object_id and coll_id=’lapp’ and meta_key=’full_name’),

q4 as (select q3.*,meta_value as personal_email from q3 left join lapp_meta on q3.lapp_id=lapp_meta.object_id  and coll_id=’lapp’ and meta_key=’personal_email’),

q5 as (select q4.*,meta_value as mobile_number from q4 left join lapp_meta on q4.lapp_id=lapp_meta.object_id and coll_id=’lapp’ and meta_key=’mobile_number’),

q6 as (select q5.*, meta_value as lapp_stage from q5 join lapp_meta on q5.lapp_id=lapp_meta.object_id and coll_id=’lapp’ and meta_key=’lapp_stage’ and meta_value=’loan’)

select * from q6;

Once the result is out, show fields:

  • Sublan_id
  • Assigned to:
  • Name
  • Email
  • Mobile Number

============================================================================================================================================

Screen: “Agency Cases” (Path: /cagents/agency-loans)

Note: Use below query to show the list of all the assigned cases

with

q1 as (select object_id as sublan_id, meta_value as assigned_agency from sublan where coll_id=’sublan’ and meta_key=’assigned_agent’ and meta_value=[esc.str template.agent_email/]),

q2 as (select q1.*,meta_value as lapp_id from q1 join sublan on q1.sublan_id=sublan.object_id and coll_id=’sublan’ and meta_key=’lapp_id’),

q3 as (select q2.*,meta_value as full_name from q2 left join lapp_meta on q2.lapp_id=lapp_meta.object_id and coll_id=’lapp’ and meta_key=’full_name’),

q4 as (select q3.*,meta_value as personal_email from q3 left join lapp_meta on q3.lapp_id=lapp_meta.object_id  and coll_id=’lapp’ and meta_key=’personal_email’),

q5 as (select q4.*,meta_value as mobile_number from q4 left join lapp_meta on q4.lapp_id=lapp_meta.object_id and coll_id=’lapp’ and meta_key=’mobile_number’),

q6 as (select q5.*, meta_value as lapp_stage from q5 join lapp_meta on q5.lapp_id=lapp_meta.object_id and coll_id=’lapp’ and meta_key=’lapp_stage’ and meta_value=’loan’)

select * from q6;

Show tabular list of the cases assigned against the agency

S.No Sublan ID Agent Assigned Full Name Mobile Number Personal Email
    <agent_emailid> or <button to  selfassign> <applicant>    

============================================================================================================================================

Screen:  “Loans” (Path: /cagents/loan/sublan/<sublan_id>)

Validate/Check:

  • If the path contains “sublan” and <sublan_id>
  • If the sublan_id is assigned to the loggedin user or not.

Blocks:

Summary Dues:

  • Load sublan health (Sublan.get_health sublan_id={<sublan_id>})
  • Show all the keys present in the summary dues

Log Entries:

  • Show all the log entries made against the sublan id
  • Use service:
    • [sublan_service.single-queries.collection_log_report sublan_id=<sublan_id> o.set=template.query/]

Log Visit

  • Fields to store
    • Subgroup (drop down)
      • Customer not present
      • Customer shifted Residence
    • Comment
    • geotag

PTP (Promise to pay)

  • Fields to store
    • Amount promised
    • Comment
    • Geotag
    • Promise date (due_date)

RTP (Refuse to pay)

  • Fields to store
    • Comment
    • Geotag

Note: To store log, check this link: Click here

Send Payment Link

  • Fields to show
    • Mobile number
    • Email id
    • Button: Send payment link

Add Alternate Profiles

  • Fields to show
    • Source
    • Is this verified
    • Alternate email id
    • Alternate Mobile Number
    • Alternate Resi Address
    • Alternate Permanent Address
    • Alternate Employer Details
    • Alternate Official Email
    • Comment

List of Alternate Profiles

  • Show all the fields added while adding a alternate profile

Show block from below link:

https://loantap.in/post-disbursement/change-customer-details/C1608676051367291?del_env=yes