Setting up dashboard policy profile
For 99% of the products, a requirement is to show the policy information in the dashboard. To achieve this without introducing product-specific components into the KASKO platform, the scope is limited to the app repository (i.e. plugin). This guide covers how to set up a basic summary screen and how to enable MTAs for it.
Adding policy profile screen to dashboard
Add summary screen
To start, we will need to create a summary screen specifically for the dashboard. In some cases, we might reuse the customer-facing summary screen (if all the information is there), but in most cases, we will need to set up a new screen.
TIP: Most apps use the path
summary-admin
for the dashboard-specific summary screen.
Example:
Point to the summary screen
Next, we need to point the user to the new dashboard summary screen as soon as the app is opened. This can be achieved via conditional logic within the initial_screens
config.
A flag called is_admin
will always be set to true
if the user is entering via the dashboard with required authentication credentials.
Example:
Improve the styling (optional)
Lastly, we can improve the styling of the application that's being embedded within the dashboard.
This can be done by modifying the dashboard.css
file within the application. See KASKO example app for working samples.
IMPORTANT: it is also required that
dashboard_entry_points
have been set up correctly in the.kasko
directory of the build artifact. An example can be found in the KASKO example app.
MTA & Policy Edit
Mid-term adjustments (MTAs) give dashboard users the ability to modify quote data for a policy that has been purchased beforehand. Policy edit is the same, but for non pricing relevant fields (policy fields). However, these will work only given some specific requirements. These are listed below.
Requirements
must be an item product or pb product (old product-variants will not work)
must use v2+ quote-svc
must-have the dashboard policy profile screen set up correctly (see above)
must have MTA field definitions (see below)
Enabling MTAs
All it takes is to create proper field definitions for MTAs. These are quote_patch
and policy_patch
. Either of them can be skipped if there are no fields that can be modified in the given request.
When the field definitions have been set, the framework will know for which fields the "edit" button needs to be shown based on editable
property.
Patch field definition must include all fields that should be sent to API.
Fields that are not listed here, will be editable in UI and not sent to API;
Fields that are listed here and marked as non-editable, will also be sent to API, but user will not be able to edit them.
Only validation in quote_patch
fields will be evaluated so quote
can have different validation for the same field.
editable
property can only be boolean value inside field definition, but inside manifest it is also possible to overwrite it with jsonlogic.
Manifest only:
In example above, duration
field will be disabled if policy aleady has duration
set.
IMPORTANT: it is also necessary to change the
next
definition of all the screens where the MTA fields are. This is so that the framework would know where to navigate after the user changes his values and clicks the "next" button.
Testing locally
To test MTA & policy edit locally, just use snippet configuartion like so:
This snippet
config should be exported from local webapp integration response.js
file.
Then open local webapp in browser with suffix /snippet
. This will load snippet configuration you have defined.
Last updated