App Marketplace

Documentation

Product mapping fields

Socotra Core allows customers to create unique configurations of their product domains. This flexibility requires app developers either build a unique application per Socotra Core tenant to work with such custom products in tenants or make applications configurable by customers in runtime.

Overview

Product fields are a way to connect application needs and Socotra tenants configurations. They designed to solve this issue in a following way:

  • App developer specifies which "domain" values needs to be read from a tenant to provide a specific service. It can be anything that app needs - a field name that stores a specific piece of data in a policy object, such as a car model or invoice file name for new customers, a field that holds policyholder's full name or number of years they've been covered by a life insurance policy.
  • Customer, launching an app, must map these product fields to the actual schema of their Socotra Core tenant policy schema. This produces a collection values (currently using JSONPath format) that is stored as part of the app configuration
  • In a runtime, application code can retrieve configuration from AppConnect service and use mapping values to interpret json objects with data received in webhooks or read from Socotra Tenant API

App manifest

Product field mappings are configured in socotra-app.json manifest file at the following path

{
  "name": "org-name/app-name",
  "version": "0.0.1",
  "socotra": {
    "fields": [
      // Collection of mapping field objects
    ]
  }
}

Each entry in mapping field objects collection is a json object with following properties.

name string (required) - Property which defines field name and, thus, a key in a map that will be used by app to retrieve mapping expression, configured by customer.

title string (required) - Description of a mapping field for configuration step.

required boolean (optional) - A flag which indicates whether application strictly requires this field to be configured by a customer or not.

hint string (optional) - Optional text which can be used to explain details or give more context to customer, in addition to Title. Example:

{
  "name": "org-name/app-name",
  "version": "0.0.1",
  "socotra": {
    "fields": [
      {
        "name": "policy-holder-name",
        "title": "Policyholder name",
        "required": true,
        "hint": "Account Policyholder name"
      },
      {
        "name": "vehicle-make",
        "title": "Vehicle Make",
        "required": true,
        "hint": "Manufacturer of a vehicle"
      },
      {
        "name": "vehicle-model",
        "title": "Vehicle Model",
        "required": false,
        "hint": "Model of a vehicle"
      },
      {
        "name": "vehicle-year",
        "title": "Vehicle year",
        "hint": "Year in which vehicle was manufactured"
      }
    ]
  }
}