Este tema contém os padrões MDM para tipos de relacionamento
Tipos de Relacionamentos (Relationship)
-
Descrição
Esta entidade padroniza os seguintes atributos de tipos de relacionamento:- Id
- nome
-
Estrutura dos Campos
Campo Descrição Tipo Link dataId data.id (identificador) do tipo de relacionamento int name nome do tipo de relacionamento string dataIdentifier identificador de unicidade da entidade string -
Como consultar ultima versão do schema da entidade
- Exemplo de retorno
Clique em "JSON"
{ "statusCode": 200, "success": true, "message": "Success", "document": { "_id": "6408e4892fdf838348471ee4", "entityType": "relationship", "revision": 3, "dataIdentifierSetup": [ "name" ], "jsonSchema": { "title": "Relationship Entity", "required": [ "entityType", "revision", "data" ], "properties": { "entityType": { "title": "This entity provides the default most commom relationship used at nstech Platform", "pattern": "^(.*)$", "$id": "#/properties/entityType", "type": "string" }, "revision": { "title": "An integer value", "default": 1, "$id": "#/properties/revision", "type": "integer" }, "data": { "title": "the composition of the document object", "$id": "#/properties/data", "type": "object", "required": [ "name" ], "properties": { "name": { "title": "Name of Relationship type.", "$id": "#/properties/data/properties/name", "type": "string", "minLength": 1, "maxLenght": 200 }, "dataId": { "title": "The Unique Key for a document of this entity. If you don't know, don't put this in the document and it will be generated automatically.", "$id": "#/properties/data/properties/dataId", "type": "integer" } } } }, "$id": "http://example.org/root.json#", "type": "object", "definitions": {}, "$schema": "http://json-schema.org/draft-07/schema#" }, "authDefinition": { "resources": { "relationship": { "create": true, "update": true, "delete": true, "view": true } } }, "sensiblePropertiesPath": [], "effectiveDate": "2023-01-25T18:25:46.314Z", "status": true, "deleted": false } }
- Exemplo de retorno
-
Exemplo de chamada ao endpoint (GET) pela API get records by queryTemplate
-
Exemplo de chamada ao endpoint (GET) usando “data id”
-
Exemplo de chamada ao endpoint (GET) usando “updatedAt”
-
Exemplo de retorno
Clique em "JSON"
{ "statusCode": 200, "success": true, "message": "Success", "document": [ { "_id": "636ff4b1cff33738b4078c18", "entityType": "relationship", "revision": 1, "data": { "name": "Amigo", "dataId": 1, "dataIdentifier": { "name": "Amigo" } }, "createdAt": "2022-11-12T19:32:01.920Z", "deleted": false, "userCreator": "service-account-mdm", "updatedAt": "2022-11-12T19:32:01.920Z" }, { "_id": "636ff4bccff33738b4078c1a", "entityType": "relationship", "revision": 1, "data": { "name": "Amiga", "dataId": 2, "dataIdentifier": { "name": "Amiga" } }, "createdAt": "2022-11-12T19:32:12.064Z", "deleted": false, "userCreator": "service-account-mdm", "updatedAt": "2022-11-12T19:32:12.064Z" } ], "page": 1, "limit": 2, "nextPageURL": "https://dev.nstech.com.br:8080/platform/mdm-stg/platform/api/mdm-stg/entities/relationship/queryByTemplate/all?page=2&limit=2" }