Published on : May 26, 2020

Sample Call

[do.@cmr]
[cmr-service.job-type-controller.default_repsonse_controller /]
[/do.@cmr]

Input

KeyDescriptionSample Value
@cmr.step_config.events.launch Array of events to call at launch of screen[flow category=”flow” action=”default_cmr” label=”started” /]
[section category=”section” action=”your_needs” label=”started” /]
[step category=”step” action=”job_type” label=”initiated” /]
[lapp_journey category=”lapp_journey” action=”Started CMR_Flow” label=”{@cmr.lapp_id}” /]
@cmr.lapp.lapp_status Current Status of the applicationjunk-app
@cmr.lapp.job_subtype Selected job subtype of the applicant (if available)partnership-or-proprietorship-firm-or-llp
@cmr.response_content.title Header – Title of the screenEmployment Type
@cmr.response_content.descHeader – Description of the screenKnowing your profession will help us craft credit products best suited for you
@cmr.section_idCurrent Section Id of the screen your_needs

Output

Logic

  • Render events array and store in @cmr.events_data in the required format.
[
"flow"         => 
[
"category" => "flow"
"action"   =>  "default_cmr"
"label"    => "started"
]
"section"      => 
[
"category" => "section"
"action"   =>"your_needs"
"label"    => "started"
]
"step"         => 
[
"category" => "step"
"action"   => "job_type"
"label"    => "initiated"
]
"lapp_journey" => 
[
"category" =>"lapp_journey"
"action"   =>  "Started CMR_Flow"
"label"    =>  "APP1667371973860628"
]
]
 
  • Call Service to fire GA Events. (Link to service)
  [ctracking.ga.events data="{@cmr.events_data}" /]
  • Fetch the selected job subtype from the input variable @cmr.lapp.job_subtype and store in  template variable selected_job_subtype.
  • Call Service to fetch all available job types
[product_services.get-taxonomy.job_types o.set="template.job_types" /]
  • Iterate through job types and store in template.data in the required format to display the form view as shown below :
[
    "salaried"       =>  
        [
            "title"           => "Salaried"
            "description"     => "(Ex. Working at MNC, Govt or similar)"
            "sub_description" => "<span class="font-bold">Type of Establishment</span> you are currently working with"
            "options"         =>  
                [
                    0 =>  
                        [
                            "label"  => "Public or Private Limited Company"
                            "value"  => "public-or-private-limited-company"
                            "active" => ""
                        ]
                    1 =>  
                        [
                            "label"  => "Partnership or Proprietorship Firm or LLP"
                            "value"  => "partnership-or-proprietorship-firm-or-llp"
                            "active" => "checked"
                        ]
                    2 =>  
                        [
                            "label"  => "Government Employee"
                            "value"  => "government-employee"
                            "active" => ""
                        ]
                    3 =>  
                        [
                            "label"  => "Trust or NGO"
                            "value"  => "trust-or-ngo"
                            "active" => ""
                        ]
                ]
        ]
    "self-employed"  =>  
        [
            "title"           => "Self Employed Professional"
            "description"     => "(Ex. CA, Lawyer, Doctor or similar)"
            "sub_description" => "<span class="font-bold">Type of Professional</span>"
            "options"         => []
              
        ]
    "business-owner" =>  
        [
            "title"           => "Business Owner"
            "description"     => "(Ex. Director, Partner, Proprieter or similar)"
            "sub_description" => "<span class="font-bold">Your Designation / Type of Business</span>"
            "options"         => []
        ]
]
  • Call service to display form view (Radio Button – Accordion)
[service.run service="advanced_form_control.radio-button-accordion.main" data="{template.data}" name="job_subtype" /]
  • Set template variable disabled if template variable selected_job_subtype is not empty
  • Show Continue button
  • Set javascript function to handle the enabling of Continue button on click event.
function validateForm(){
    if($("input[type='radio'][name='job_subtype']:checked").val() != undefined ){
            $("#continue-form-btn").removeClass("disabled");
    }
}