2.0info: 1.13.1 rules description: Motor de regras ERP senior X x-senior-domain: erpx x-senior-domain-path: erpx x-senior-service-path: rules contact: name: Senior X Platform url: https://dev.senior.com.br email: seniorx-dev@senior.com.brhost: platform.senior.com.br /t/senior.com.br/bridge/1.0/rest/erpxsecurityDefinitions: APIKeyHeader: type: apiKey in: header name: Authorizationsecurity: – APIKeyHeader: [] – application/json – application/jsonpaths: /rules/queries/healthcheck: post: description: Query para o SRE verificar a disponibilidade do serviço tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object responses: 200: description: Ok schema: type: object required: – status – checks properties: status: type: string allOf: – #/definitions/upDown description: Status geral do serviço checks: type: array items: type: object allOf: – #/definitions/checkData minimum: 1 description: Verificações para assegurar o status 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Query para o SRE verificar a disponibilidade do serviço tags: – Queries x-senior-visibility: PRIVATE parameters: responses: 200: description: Ok schema: type: object required: – status – checks properties: status: type: string allOf: – #/definitions/upDown description: Status geral do serviço checks: type: array items: type: object allOf: – #/definitions/checkData minimum: 1 description: Verificações para assegurar o status 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /rules/queries/getEntitiesForRuleComposition: post: description: Busca de entidades para compor a fórmula tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: entityName: type: array items: type: string description: Filtro de entidades responses: 200: description: Ok schema: type: object required: – result properties: result: type: array items: type: object allOf: – #/definitions/recEntitiesForRuleComposition minimum: 1 description: Lista das Tabelas e seus campos 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Busca de entidades para compor a fórmula tags: – Queries x-senior-visibility: PRIVATE parameters: – name: entityName description: Filtro de entidades in: query type: array items: type: string responses: 200: description: Ok schema: type: object required: – result properties: result: type: array items: type: object allOf: – #/definitions/recEntitiesForRuleComposition minimum: 1 description: Lista das Tabelas e seus campos 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /rules/queries/getRuleCompositionAndVariables: post: description: Busca regra e variáveis necessárias tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: id: type: string description: Id da regra code: type: string description: Código da regra responses: 200: description: Ok schema: type: object required: – result properties: result: type: object allOf: – #/definitions/recRuleCompositionAndVariables description: Lista das Tabelas e seus campos 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Busca regra e variáveis necessárias tags: – Queries x-senior-visibility: PRIVATE parameters: – name: id description: Id da regra in: query type: string – name: code description: Código da regra in: query type: string responses: 200: description: Ok schema: type: object required: – result properties: result: type: object allOf: – #/definitions/recRuleCompositionAndVariables description: Lista das Tabelas e seus campos 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /rules/queries/getMetadata: post: description: Default getMetadata query. Every service must handle this command and return metadata in the format requested. tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: metadataFormat: type: string description: responses: 200: description: Ok schema: type: object required: – metadata properties: metadata: type: string description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Default getMetadata query. Every service must handle this command and return metadata in the format requested. tags: – Queries x-senior-visibility: PRIVATE parameters: – name: metadataFormat description: in: query type: string responses: 200: description: Ok schema: type: object required: – metadata properties: metadata: type: string description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /rules/queries/exportRule: post: description: tags: – Queries x-senior-visibility: PUBLIC parameters: – name: input in: body required: true schema: type: object required: – config properties: config: type: object allOf: – #/definitions/exportConfig description: responses: 200: description: Ok schema: type: object required: – exportJobId properties: exportJobId: type: string description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /rules/queries/getDependencies: post: description: Returns a list with all dependencies from this service, along with their respective versions tags: – Queries x-senior-visibility: PUBLIC responses: 200: description: Ok schema: type: object required: – dependencies properties: dependencies: type: array items: type: object allOf: – #/definitions/dependency minimum: 1 description: List with this service dependencies 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Returns a list with all dependencies from this service, along with their respective versions tags: – Queries x-senior-visibility: PUBLIC responses: 200: description: Ok schema: type: object required: – dependencies properties: dependencies: type: array items: type: object allOf: – #/definitions/dependency minimum: 1 description: List with this service dependencies 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /rules/actions/migrateSchema: post: description: Realiza a migração do schema do banco de dados tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /rules/actions/forceMigrateSchema: post: description: Executa o migrateSchema já removendo o tenant atual do cache da migração do schema do banco de dados, sem necessidade de reiniciar o serviço tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /rules/actions/executeRule: post: description: Executar a regra tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: composition: type: string description: Fórmula id: type: string description: Id da regra code: type: string description: Código da regra variables: type: array items: type: object allOf: – #/definitions/recVariable description: Variaveis para substituir/buscar preValidate: type: boolean description: Indica se deve ser feita validação prévia da fórmula (opção de desabilitar para chamadas em grande volume, e que já tem as regra validadas de antemão) responses: 200: description: Ok schema: type: object required: – result properties: result: type: string description: resultado 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /rules/actions/executeRuleBatch: post: description: Executar batch de regras tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – ruleBatch properties: ruleBatch: type: array items: type: object allOf: – #/definitions/recExecuteRule minimum: 1 description: Lote de regras sharedVariables: type: array items: type: object allOf: – #/definitions/recVariable description: Variaveis para substituir/buscar preValidate: type: boolean description: Indica se deve ser feita validação prévia da fórmula (opção de desabilitar para chamadas em grande volume, e que já tem as regra validadas de antemão) responses: 200: description: Ok schema: type: object required: – result properties: result: type: array items: type: object allOf: – #/definitions/recRuleResult minimum: 1 description: resultado 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /rules/actions/ruleCompositionIsValid: post: description: Verifica se a regra é válida tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: composition: type: string description: Fórmula id: type: string description: Id da regra code: type: string description: Código da regra responses: 200: description: Ok schema: type: object required: – isValid – causeMessage properties: isValid: type: boolean description: resultado causeMessage: type: string description: Causa da regra está inválida 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /rules/actions/odata: post: description: tags: – Actions x-senior-visibility: PRIVATE responses: 204: description: No response 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /rules/actions/importRule: post: description: tags: – Actions x-senior-visibility: PUBLIC parameters: – name: input in: body required: true schema: type: object required: – config properties: config: type: object allOf: – #/definitions/importConfig description: responses: 200: description: Ok schema: type: object required: – importJobId properties: importJobId: type: string description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /rules/signals/executeRuleBatchAsync: post: description: Executar batch de regras tags: – Signals parameters: – name: input in: body required: true schema: type: object required: – ruleBatch – callBackPrimitive – identifier properties: ruleBatch: type: array items: type: object allOf: – #/definitions/recExecuteRule minimum: 1 description: Lote de regras sharedVariables: type: array items: type: object allOf: – #/definitions/recVariable description: Variaveis para substituir/buscar preValidate: type: boolean description: Indica se deve ser feita validação prévia da fórmula callBackPrimitive: type: string description: Indica a primitiva a ser chamada para passar o retorno identifier: type: string description: Identificador responses: 202: description: Accepted default: description: Error response schema: #/definitions/genericError /rules/events/importRuleEvent: post: description: x-senior-event: true tags: – Events parameters: – name: input in: body required: true schema: type: object required: – eventpl properties: eventpl: type: object allOf: – #/definitions/importEventStatus description: responses: 200: description: OK default: description: Error response schema: #/definitions/genericError /rules/events/exportRuleEvent: post: description: x-senior-event: true tags: – Events parameters: – name: input in: body required: true schema: type: object required: – eventpl properties: eventpl: type: object allOf: – #/definitions/exportEventStatus description: responses: 200: description: OK default: description: Error response schema: #/definitions/genericError /rules/entities/rule: post: description: Esta entidade pode ser customizada. tags: – CRUD x-senior-visibility: PRIVATE parameters: – name: entity in: body required: true schema: type: object allOf: – #/definitions/rule responses: 200: description: The created resource schema: #/definitions/rule 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError patch: description: Esta entidade pode ser customizada. tags: – CRUD x-senior-visibility: PRIVATE parameters: – name: entity in: body required: true schema: type: object allOf: – #/definitions/rule responses: 200: description: The created resource schema: #/definitions/rule 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Esta entidade pode ser customizada. tags: – CRUD x-senior-visibility: PRIVATE parameters: – name: offset in: query type: number – name: size in: query type: number responses: 200: description: Ok schema: type: array items: #/definitions/rule 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /rules/entities/rule/{id}: put: description: Esta entidade pode ser customizada. tags: – CRUD x-senior-visibility: PRIVATE parameters: – name: id in: path required: true type: string – name: entity in: body required: true schema: #/definitions/rule responses: 200: description: Ok schema: #/definitions/rule 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError patch: description: Esta entidade pode ser customizada. tags: – CRUD x-senior-visibility: PRIVATE parameters: – name: id in: path required: true type: string – name: entity in: body required: true schema: #/definitions/rule responses: 200: description: Ok schema: #/definitions/rule 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Esta entidade pode ser customizada. tags: – CRUD x-senior-visibility: PRIVATE parameters: – name: id in: path required: true type: string responses: 200: description: Ok schema: #/definitions/rule 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError delete: description: Esta entidade pode ser customizada. tags: – CRUD x-senior-visibility: PRIVATE parameters: – name: id in: path required: true type: string responses: 200: description: Ok 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /rules/entities/rule/bulk: post: description: Esta entidade pode ser customizada. tags: – Bulk parameters: – name: entities in: body required: true schema: type: array items: #/definitions/rule responses: 200: description: The bulk creation has created resources 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError definitions: upDown: description: Up or down type: string enum: – UP – DOWN enumSituation: description: Situação type: string enum: – ACTIVE – INACTIVE enumRuleType: description: Situação type: string enum: – CONTABILIDADE – HISTORICO userNotificationKind: description: User notification kind. type: string enum: – Operational – Management – News userNotificationPriority: description: User notification priority. type: string enum: – Error – Alert – None eventEmailFormat: description: Format of the email type: string enum: – HTML – PLAIN_TEXT fieldType: description: type: string enum: – BINARY – BOOLEAN – DATE – DATETIME – DOUBLE – ENUM – INTEGER – MONEY – STRING – TIME fileFormat: description: type: string enum: – CSV – FLAT – JSON – XML hookFunction: description: type: string enum: – BEFORE_PARSE – BEFORE_CONVERSION – ON_ERROR – VALIDATE eventType: description: type: string enum: – CHUNK – DOWNLOAD – ERROR – FINISH – START errorStrategy: description: type: string enum: – CALL_SCRIPT – IGNORE – STOP status: description: type: string enum: – DONE – DONE_WITH_ERRORS – DOWNLOADING – ERROR – NOT_STARTED – RUNNING errorType: description: type: string enum: – CONVERT_ERROR – SERVICE_ERROR checkData: description: Dados do healthcheck type: object required: – name – status properties: name: type: string description: Nome do healthcheck status: type: string allOf: – #/definitions/upDown description: Status do healthcheck recExecuteRule: description: Agrupador para execução de lista de regras type: object properties: composition: type: string description: Fórmula id: type: string description: Id da regra code: type: string description: Código da regra identifier: type: string description: Identificador para identificar os resultados variables: type: array items: type: object allOf: – #/definitions/recVariable description: Variaveis para substituir/buscar recRuleResult: description: Agrupador para resultados da lista de regras type: object properties: identifier: type: string description: identificador result: type: string description: resultado errorMsg: type: string description: mensagem de erro recVariable: description: Variavel para substituição na fórmula ou ID para busca type: object required: – name – value properties: name: type: string description: nome à substituir (#var1) value: type: string description: valor à atribuir recEntitiesForRuleComposition: description: Entidades com seus campos e relações type: object required: – entityName – recRelationField properties: entityName: type: string description: Nome da entidade recRelationField: type: array items: type: object allOf: – #/definitions/recFieldForRuleComposition minimum: 1 description: Campos e relações recFieldForRuleComposition: description: Relação ou campo final type: object required: – field – type – relation properties: field: type: string description: Nome do campo type: type: string description: asd relation: type: boolean description: Indicativo de se o campo é uma relação para outra entidade recRuleCompositionAndVariables: description: Composição da regra e suas variáveis type: object required: – ruleComposition – variables properties: ruleComposition: type: string description: Composição da regra variables: type: array items: type: string minimum: 1 description: Indicativo de se o campo é uma relação para outra entidade rule: description: Rule type: object required: – code – description – ruleType – situation – ruleComposition properties: id: type: string format: uuid description: Id da entidade code: type: string maxLength: 30 description: Código description: type: string maxLength: 255 description: Descrição ruleType: type: string allOf: – #/definitions/enumRuleType description: Tipo regra situation: type: string allOf: – #/definitions/enumSituation description: Situação ruleComposition: type: string format: byte description: Composição da regra createdBy: type: string description: createdDate: type: string format: date-time description: lastModifiedBy: type: string description: lastModifiedDate: type: string format: date-time description: notifyUserEventPayload: description: Represents a regular user event notification payload discriminator: _discriminator type: object required: – notificationKind – notificationPriority – notificationSubject – notificationContent – sourceDomain – sourceService – destinationUser – _discriminator properties: notificationClass: type: string description: Class of notification notificationOrigin: type: string description: Origin of notification. Free text. Optional. notificationKind: type: string allOf: – #/definitions/userNotificationKind description: Notification kind. notificationPriority: type: string allOf: – #/definitions/userNotificationPriority description: Notification priority. notificationSubject: type: string description: Notification subject. notificationContent: type: string description: Notification content. sourceDomain: type: string description: Domain that generates the notification. sourceService: type: string description: Service that generates the notification. destinationUser: type: string description: Username of the destination user. link: type: string description: Notification link _discriminator: type: string description: emailNotifyUserEventPayload: description: Represents an email notification payload allOf: – #/definitions/notifyUserEventPayload – type: object required: – from properties: from: type: string description: Email sender address sendTo: type: array items: type: string description: Additional recipients to send the email to format: type: string allOf: – #/definitions/eventEmailFormat description: Email format pushNotifyUserEventPayload: description: Represents a push notification payload allOf: – #/definitions/notifyUserEventPayload – type: object required: – applicationId properties: applicationId: type: string description: Apple/Google application id blobReference: description: Default blob reference type. Every service defines its own. type: object required: – targetObjectId properties: domainName: type: string description: The domain the blob belongs to. serviceName: type: string description: The service the blob belongs to. targetObjectId: type: string description: The basic id of the blob. targetCopyId: type: string description: The id of the blob copy. basicErrorPayload: description: Default error payload type. Every service defines its own. type: object properties: message: type: string description: The user-facing error message, if any. errorCode: type: string description: The program-accessible (and service-specific) error code. importError: description: type: object required: – errorType – lineNumber – bean – message – exceptionClass properties: errorType: type: string allOf: – #/definitions/errorType description: lineNumber: type: integer format: int64 description: bean: type: string description: message: type: string description: exceptionClass: type: string description: fielddto: description: type: object required: – id – name – fieldType properties: id: type: integer format: int64 description: name: type: string description: fieldType: type: string allOf: – #/definitions/fieldType description: start: type: integer format: int64 description: size: type: integer format: int64 description: maskPattern: type: string description: hookdto: description: type: object required: – hookFunction – script properties: hookFunction: type: string allOf: – #/definitions/hookFunction description: script: type: string description: layoutdto: description: type: object required: – id – description – fileFormat – errorStrategy – skipLines – fields properties: id: type: integer format: int64 description: description: type: string description: fileFormat: type: string allOf: – #/definitions/fileFormat description: errorStrategy: type: string allOf: – #/definitions/errorStrategy description: delimiter: type: string description: skipLines: type: integer format: int64 description: fields: type: array items: type: object allOf: – #/definitions/fielddto minimum: 1 description: hooks: type: array items: type: object allOf: – #/definitions/hookdto description: importReport: description: type: object required: – id – startTime – endTime – uri – beanClass – serviceClass – layout – sucessCount – errorsCount – filteredCount – skippedCount properties: id: type: string description: startTime: type: string format: date-time description: endTime: type: string format: date-time description: uri: type: string description: beanClass: type: string description: serviceClass: type: string description: layout: type: object allOf: – #/definitions/layoutdto description: sucessCount: type: integer format: int64 description: errorsCount: type: integer format: int64 description: filteredCount: type: integer format: int64 description: skippedCount: type: integer format: int64 description: importErrors: type: array items: type: object allOf: – #/definitions/importError description: exportEventStatus: description: type: object required: – importerId – eventType – recordCount properties: importerId: type: string description: eventType: type: string allOf: – #/definitions/eventType description: recordCount: type: integer format: int64 description: importEventStatus: description: type: object required: – importerId – eventType – status – recordCount properties: importerId: type: string description: eventType: type: string allOf: – #/definitions/eventType description: status: type: string allOf: – #/definitions/status description: errorMessage: type: string description: recordCount: type: integer format: int64 description: importReport: type: object allOf: – #/definitions/importReport description: exportConfig: description: type: object required: – uri – layout – async – errorStrategy properties: uri: type: string description: layout: type: object allOf: – #/definitions/layoutdto description: async: type: boolean description: errorStrategy: type: string description: importConfig: description: type: object required: – uri – layout – async – batchSize – errorStrategy properties: uri: type: string description: layout: type: object allOf: – #/definitions/layoutdto description: async: type: boolean description: batchSize: type: integer format: int64 description: errorStrategy: type: string allOf: – #/definitions/errorStrategy description: dependency: description: Represents a service dependency type: object required: – domain – service – version properties: domain: type: string description: Domain of the dependency service service: type: string description: Name of the dependency service type: string description: Version of the dependency service genericError: properties: message: type: string description: Messaging describing the error. reason: type: string description: A symbolic code identifying the category of the reason of the error. enum: – BAD_REQUEST – UNAUTHORIZED – PAYMENT_REQUIRED – FORBIDDEN – OBJECT_NOT_FOUND – REQUEST_TIMEOUT – GONE – UNPROCESSABLE – INTERNAL_ERROR – NOT_IMPLEMENTED – SERVICE_UNAVAILABLE – INSUFFICIENT_STORAGE