Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Config Service

digit-config-service

Overview

A schema-validated, tenant-scoped configuration store for the DIGIT platform. It manages template bindings, provider credentials, and notification channel toggles used by the WhatsApp notification system.

Key Functionalities

  • Schema validation against MDMS v2 schemas before storing data.

  • Tenant fallback resolution via _resolve API (pg.citya -> pg -> *).

  • Field-level encryption for sensitive fields (e.g., auth tokens) marked with x-security in schema.

  • Unique constraint enforcement via x-unique schema fields.

  • Flyway-managed database migrations.

Pre-requisites

Before you proceed with the configuration, make sure the following prerequisites are met:

  • Java 17

  • PostgreSQL 14+

  • MDMS v2 Service (running at localhost:8083 or configured via MDMS_V2_HOST)

Data Model

Physical Data Model

The service uses a single table eg_config_data to store various configuration types as JSONB, validated by their respective schemas.

type
column
Description

string

id

Unique record ID (UUID)

string

tenantid

Tenant identifier

string

schemacode

Schema type (e.g., TemplateBinding)

string

uniqueidentifier

Derived from x-unique fields

jsonb

data

Configuration payload

boolean

isactive

Record status

string

createdby

Audit field

string

lastmodifiedby

Audit field

bigint

createdtime

Epoch timestamp

bigint

lastmodifiedtime

Epoch timestamp

Schema Setup

Before creating any configuration data, the respective schemas must be registered in the MDMS v2 service. The digit-config-service uses these to validate data and enforce constraints.

1. NotificationChannel Schema

Toggles notification channels (WHATSAPP, SMS, EMAIL) and links them to providers.

2. ProviderDetail Schema

Stores credentials for notification providers (e.g., Twilio).

3. TemplateBinding Schema

Maps domain events to specific templates and locales.

API Endpoints

Base path: /config-service/config/v1

Endpoint
Method
Description

/_create/{schemaCode}

POST

Create a new config record

/_update/{schemaCode}

POST

Update an existing config record

/_search

POST

Search records with exact tenant match

/_resolve

POST

Resolve config with tenant hierarchy fallback

Resolve Logic (Fallback Mechanism)

The /_resolve API implements a hierarchical lookup:

  1. Specific Tenant: e.g., pg.citya

  2. Parent Tenant: e.g., pg (if not found in citya)

  3. Wildcard: * (if not found in parent)

Setup

Build & Run

Configuration Properties

Property
Default
Description

server.servlet.context-path

/config-service

API context path

mdms.v2.host

http://localhost:8083

MDMS v2 service host

encryption.service.enabled

false

Enable/Disable field-level encryption

state.level.tenantid

pg

Tenant ID used for encryption keys


Helm Chart

For full API details, refer to the OpenAPI Spec.

Was this helpful?