Create New Master
Steps to follow to create a new Master -
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
}
}
}'
Add actions-test and roleactions for search, create, and update. Below is the sample code for the actions-test for the schema mentioned above::
{
"id": 2486,
"name": "MDMS",
"url": "url",
"displayName": "Roleactions",
"orderNumber": 1,
"parentModule": "",
"enabled": true,
"serviceCode": "MDMS",
"code": "null",
"navigationURL": "/workbench-ui/employee/workbench/mdms-search-v2?moduleName=ACCESSCONTROL-ROLEACTIONS&masterName=roleactions",
"path": "9MDMS.ACCESSCONTROL-ROLEACTIONSroleactions",
"leftIcon": "dynamic:ContractIcon"
},
{
"id": 2487,
"name": "MDMS",
"url":"/mdms-v2/v2/_create/ACCESSCONTROL-ROLEACTIONS.roleactions",
"displayName": "Create ACCESSCONTROL-ROLEACTIONS roleactions",
"orderNumber": 1,
"parentModule": "",
"enabled": true,
"serviceCode": "MDMS",
"code": "null",
"path": ""
},{
"id": 2488,
"name": "MDMS",
"url":"/mdms-v2/v2/_update/ACCESSCONTROL-ROLEACTIONS.roleactions",
"displayName": "Update ACCESSCONTROL-ROLEACTIONS roleactions",
"orderNumber": 1,
"parentModule": "",
"enabled": true,
"serviceCode": "MDMS",
"code": "null",
"path": ""
}
Here is the sample code for the roleactions::
{
"rolecode": "MDMS_ADMIN",
"actionid": 2486,
"actioncode": "",
"tenantId": "pb"
},
{
"rolecode": "MDMS_ADMIN",
"actionid": 2487,
"actioncode": "",
"tenantId": "pb"
},
{
"rolecode": "MDMS_ADMIN",
"actionid": 2488,
"actioncode": "",
"tenantId": "pb"
}
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::
{
"code": "SCHEMA_ACCESSCONTROL_ROLEACTIONS_ROLEACTIONS",
"message": "Role Action",
"module": "rainmaker-schema",
"locale": "en_IN"
},
{
"code": "ACCESSCONTROL_ROLEACTIONS_ROLEACTIONS_TENANTID",
"message": "Tenant Id",
"module": "rainmaker-schema",
"locale": "en_IN"
},
{
"code": "TIP_ACCESSCONTROL_ROLEACTIONS_ROLEACTIONS_TENANTID",
"message": "Tenant Id",
"module": "rainmaker-schema",
"locale": "en_IN"
}
Last updated