Create New Master

Steps to follow to create a new Master -

  1. Create a schema using Postman (API) - Schema( JSON draft-07 ) can be constructed by inputting the required JSON Object here Below is the sample cURL to create a schema.

curl --location --request POST 'https://qa.digit.org/mdms-v2/schema/v1/_create' \
--header 'Content-Type: application/json' \
--data-raw '{
    "RequestInfo": {
        "apiId": "asset-services",
        "ver": null,
        "ts": null,
        "action": null,
        "did": null,
        "key": null,
        "msgId": "search with from and to values",
        "authToken": "b2250d2c-3c25-40c9-960d-c4dda7443d44",
        "correlationId": null,
        "userInfo": {
            "id": "1",
            "userName": null,
            "name": null,
            "type": null,
            "mobileNumber": null,
            "emailId": null,
            "roles": null
        }
    },
    "SchemaDefinition": {
        "id": "b55f449c-61bb-4c56-b8cd-99cbdb00ee7f",
        "tenantId": "pb",  // update the state tenant id as per environment
        "code": "ACCESSCONTROL-ROLEACTIONS.roleactions",
        "description": "roleactions",
        "definition": {
            "type": "object",
            "title": "Generated schema for Root",
            "$schema": "http://json-schema.org/draft-07/schema#",
            "isActive": true,
            "properties": {
                "rolecode": {
                    "type": "string"
                },
                "actionid": {
                    "type": "string"
                },
                "actioncode": {
                    "type": "string"
                },
                "tenantId": {
                    "type": "string"
                }
            },
            "required": [
                "rolecode",
                "actionid"
            ],
            "x-unique": [
                "rolecode",
                "actionid"
            ],
            "x-ref-schema": [
                {
                    "fieldPath": "rolecode",
                    "schemaCode": "ACCESSCONTROL-ROLES.roles"
                },
                {
                    "fieldPath": "actionid",
                    "schemaCode": "ACCESSCONTROL-ACTIONS-TEST.actions-test"
                }
            ]
        },
        "isActive": true,
        "auditDetails": {
            "createdBy": "902fcdad-8742-4e13-b9f0-12605a6180bb",
            "lastModifiedBy": "902fcdad-8742-4e13-b9f0-12605a6180bb",
            "createdTime": 1693284323630,
            "lastModifiedTime": 1693284323630
        }
    }
}'

  1. Add actions-test and roleactions for search, create, and update. Below is the sample code for the actions-test for the schema mentioned above::

Here is the sample code for the roleactions::

  1. Push the localization messages using the rainmaker-schema module to the schema's name(on the Add Master Data page and sidebar), tooltips, and all the fields on the UI. Example::

Last updated

Was this helpful?