1. Overview

Microservice containing the business logic for managing reasons-Service.

1.1. URI scheme

Host : localhost:9898
BasePath : /

1.2. Tags

  • reason-category-controller : Reason Category Controller

  • reason-controller : Reason Controller

  • reason-tree-controller : Reason Tree Controller

2. Resources

2.1. Reason-category-controller

Reason Category Controller

2.1.1. Creates a reason category

POST /ea/v1/reasoncategories
Parameters
Type Name Description Schema

Body

command
optional

ReasonCategoryDto object to create reasoncategory

ReasonCategoryDto

Responses
HTTP Code Description Schema

201

Created

ReasonCategoryDto

401

Unauthorized

No Content

406

Not_Acceptable

No Content

500

Internal Server Error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.1.2. Fetches all the reason categories

GET /ea/v1/reasoncategories
Responses
HTTP Code Description Schema

200

OK

QueryDTO«List«ReasonCategoryDto»»

401

Unauthorized

No Content

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.1.3. Fectches a reason category by category id

GET /ea/v1/reasoncategories/{id}
Parameters
Type Name Description Schema

Path

id
optional

Category id of reasonCategory to get reasoncategory

integer (int64)

Responses
HTTP Code Description Schema

200

OK

ReasonCategoryDto

401

Unauthorized

No Content

404

NOT_FOUND

No Content

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.1.4. Updates a reason category by categoryId

PUT /ea/v1/reasoncategories/{id}
Parameters
Type Name Description Schema

Path

id
optional

Category id of resoncategory to update the reason category

integer (int64)

Body

command
optional

ReasonCategoryDto object to create reasoncategory

ReasonCategoryDto

Responses
HTTP Code Description Schema

200

OK

ReasonCategoryDto

401

Unauthorized

No Content

406

Not_Acceptable

HttpErrorResponse

500

Internal Server Error

No Content

Consumes
  • application/json

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.1.5. Delete a reason category by category id

DELETE /ea/v1/reasoncategories/{id}
Parameters
Type Name Description Schema

Path

id
optional

Category id of reasoncategory to delete the reasoncategory

integer (int64)

Responses
HTTP Code Description Schema

200

OK

No Content

401

Unauthorized

No Content

404

Not Found

No Content

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.2. Reason-controller

Reason Controller

2.2.1. Creates a reason

POST /ea/v2/reasons
Parameters
Type Name Description Schema

Body

command
required

ReasonDto object to create a reason

ReasonDto

Responses
HTTP Code Description Schema

201

Created

ReasonDto

401

Unauthorized

No Content

404

Not_Acceptable

No Content

500

Internal Server Error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.2.2. Fetches all reasons

GET /ea/v2/reasons
Responses
HTTP Code Description Schema

200

OK

QueryDTO«List«ReasonDto»»

401

Unauthorized

No Content

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.2.3. doPing

GET /ea/v2/reasons/ping
Responses
HTTP Code Description Schema

200

OK

string

Produces
  • /

Security
Type Name Scopes

oauth2

oauth

default

2.2.4. Fetches reason by reason id

GET /ea/v2/reasons/{id}
Parameters
Type Name Description Schema

Path

id
required

Reason id of reason to get a reason

integer (int64)

Responses
HTTP Code Description Schema

200

OK

Reason

401

Unauthorized

No Content

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.2.5. Updates a reason by reason id

PUT /ea/v2/reasons/{id}
Parameters
Type Name Description Schema

Path

id
required

Reason id of reason to update a reason

integer (int64)

Body

command
required

ReasonDto object to update a reason

ReasonDto

Responses
HTTP Code Description Schema

200

OK

Reason

401

Unauthorized

No Content

404

Not_Acceptable

No Content

500

Internal Server Error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.2.6. Delete a reason by reasonId

DELETE /ea/v2/reasons/{id}
Parameters
Type Name Description Schema

Path

id
required

reasonId of reason to delete a reason

integer (int64)

Responses
HTTP Code Description Schema

200

OK

Reason

401

Unauthorized

No Content

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3. Reason-tree-controller

Reason Tree Controller

2.3.1. Get reasonTree header by tree id

GET /ea/v1/reasontreebymachine/{id}/header
Parameters
Type Name Description Schema Default

Path

id
optional

Tree id of reason to get the reason tree header

integer (int64)

Query

eventType
optional

The eventType can be 2-Downtime 3-Waste to get the reason tree nodes. Defatult 2-Downtime

enum (Downtime, Waste)

"Downtime"

Query

treeType
optional

The tree type can be 1-Reason 2-Action 3-NPT 4-UDE to get the reason tree header

enum (Reason, Action, NPT, UDE)

"Reason"

Responses
HTTP Code Description Schema

200

OK

< ReasonTreeHeaderDto > array

406

Not_Acceptable

HttpErrorResponse

422

Unprocessable Entity

HttpErrorResponse

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3.2. Assign tree to machine by machine id

POST /ea/v1/reasontreebymachine/{machineId}
Parameters
Type Name Description Schema

Path

machineId
optional

The machine id to which assign the reasonTree

integer (int64)

Body

command
optional

ReasonTreeShortDto object to assign the reasonTree

ReasonTreeShortDto

Responses
HTTP Code Description Schema

200

OK

boolean

401

Unauthorized

No Content

500

Internal Server Error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3.3. Fetches reason tree by machine id

GET /ea/v1/reasontreebymachine/{machineId}
Parameters
Type Name Description Schema

Path

machineId
optional

The machine id to which get the reasonTree

integer (int64)

Responses
HTTP Code Description Schema

200

OK

ReasonTreeDto

401

Unauthorized

No Content

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3.4. Modify tree to machine by machine id

PUT /ea/v1/reasontreebymachine/{machineId}
Parameters
Type Name Description Schema

Path

machineId
optional

The machineId to which modify the reasonTree

integer (int64)

Body

command
optional

ReasonTreeShortDto object to modify the reasonTree

ReasonTreeShortDto

Responses
HTTP Code Description Schema

200

OK

boolean

401

Unauthorized

No Content

500

Internal Server Error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3.5. Delete reason tree from machine by machine id

DELETE /ea/v1/reasontreebymachine/{machineId}
Parameters
Type Name Description Schema

Path

machineId
optional

The machine id to which delete the reasonTree

integer (int64)

Body

command
optional

ReasonTreeShortDto object to delete the reasonTree

ReasonTreeShortDto

Responses
HTTP Code Description Schema

200

OK

boolean

401

Unauthorized

No Content

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3.6. Fetches reason tree nodes by machine id

GET /ea/v1/reasontreebymachine/{machineId}/nodes
Parameters
Type Name Description Schema Default

Path

machineId
optional

The machine id of the unit to which get the reason tree nodes

integer (int64)

Query

categoryId
optional

The category id of the reason to get the reason tree nodes

integer (int64)

Query

eventType
optional

The eventType can be 2-Downtime 3-Waste to get the reason tree nodes. Defatult 2-Downtime

enum (Downtime, Waste)

"Downtime"

Query

levels
optional

The levels can be 1-level1 2-level2 3-level3 4-level4 of the reason to get the reason tree nodes

integer (int32)

Query

treeType
optional

The treeType can be 1-Reason 2-Action 3-NPT 4-UDE to get the reason tree nodes

enum (Reason, Action, NPT, UDE)

"Reason"

Responses
HTTP Code Description Schema

200

OK

< ReasonTreeNode > array

406

Not_Acceptable

HttpErrorResponse

422

Unprocessable Entity

HttpErrorResponse

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3.7. Fetches top N reasons by machine id

GET /ea/v1/reasontreebymachine/{machineId}/topNreason
Parameters
Type Name Description Schema Default

Path

machineId
optional

The machine id to which get the top N reason of reason tree

integer (int64)

Query

eventType
optional

The eventType can be 2-Downtime 3-Waste to get the reason to N reason of tree nodes. Defatult 2-Downtime

enum (Downtime, Waste)

"Downtime"

Query

showTopNBars
optional

Show top N bars to the UI.The default value is 5.

integer (int64)

5

Query

treeType
optional

The tree type 1-Reason 2-Action 3-NPT 4-UDE to get the top N reason of reason tree

enum (Reason, Action, NPT, UDE)

"Reason"

Responses
HTTP Code Description Schema

200

OK

< QuickPickReason > array

406

Not_Acceptable

HttpErrorResponse

422

Unprocessable Entity

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3.8. Create reason trees

POST /ea/v1/reasontrees
Parameters
Type Name Description Schema

Body

command
required

ReasonTreeDto object to create reason tree

ReasonTreeDto

Responses
HTTP Code Description Schema

201

Created

ReasonTreeDto

401

Unauthorized

No Content

406

Not_Acceptable

No Content

500

Internal Server Error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3.9. Fetches all reason trees

GET /ea/v1/reasontrees
Responses
HTTP Code Description Schema

200

OK

QueryDTO«List«ReasonTreeDto»»

401

Unauthorized

No Content

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3.10. Fetches reason tree by tree id

GET /ea/v1/reasontrees/{id}
Parameters
Type Name Description Schema

Path

id
required

Tree id of reason tree to get reason tree

integer (int64)

Responses
HTTP Code Description Schema

200

OK

ReasonTreeDto

401

Unauthorized

No Content

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3.11. Updates reason tree by reason id

PUT /ea/v1/reasontrees/{id}
Parameters
Type Name Description Schema

Path

id
required

Reason id of reason tree to update reson tree

integer (int64)

Body

command
required

ReasonTreeDto object to create reason tree

ReasonTreeDto

Responses
HTTP Code Description Schema

200

OK

ReasonTreeDto

401

Unauthorized

No Content

406

Not_Acceptable

No Content

500

Internal Server Error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3.12. Delete reason tree by tree id

DELETE /ea/v1/reasontrees/{id}
Parameters
Type Name Description Schema

Path

id
required

Tree id of reason tree to delete reason tree

integer (int64)

Responses
HTTP Code Description Schema

200

OK

No Content

401

Unauthorized

No Content

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3.13. Creates a reasonTree Top N node

POST /ea/v1/reasontrees/{id}/nodes
Parameters
Type Name Description Schema

Path

id
required

Tree id of reasonTree to create top N node of reason tree

integer (int64)

Body

command
required

ReasonTreeNodeShortDto object to create top N node of reason tree

ReasonTreeNodeShortDto

Responses
HTTP Code Description Schema

201

Created

ReasonTreeNodeShortDto

401

Unauthorized

No Content

406

Not Acceptable

No Content

500

Internal Server Error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3.14. Fetches reason tree nodes by tree id

GET /ea/v1/reasontrees/{id}/nodes
Parameters
Type Name Description Schema

Path

id
required

treeId of reasonTree to get reason tree nodes

integer (int64)

Query

categoryId
optional

The Category id of the reason tree to get reason tree nodes

integer (int64)

Query

levels
optional

The levels can be 1-level1 2-level2 3-level3 4-level4 of the reason tree to get reasonTreeNodes

integer (int32)

Responses
HTTP Code Description Schema

200

OK

< ReasonTreeNodeDto > array

401

Unauthorized

No Content

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3.15. Creates a reasonTree node by node id

POST /ea/v1/reasontrees/{id}/nodes/{nodeId}
Parameters
Type Name Description Schema

Path

id
required

Tree id of reason trees to create reason tree node

integer (int64)

Path

nodeId
required

Node id of nodes to create reasonTree nodes

integer (int64)

Body

command
required

ReasonTreeNodeShortDto object to create reason tree node

ReasonTreeNodeShortDto

Responses
HTTP Code Description Schema

201

Created

ReasonTree

401

Unauthorized

No Content

406

Not Acceptable

No Content

500

Internal Server Error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3.16. Fetches reason tree nodes by node id

GET /ea/v1/reasontrees/{id}/nodes/{nodeId}
Parameters
Type Name Description Schema

Path

id
required

Tree id of reasonTree to get reasonTree nodes

integer (int64)

Path

nodeId
required

Node id of the nodes to get reason tree nodes

integer (int64)

Query

categoryId
optional

Category id of reason to get reason tree nodes

integer (int64)

Query

levels
optional

The levels can be 1-level1 2-level2 3-level3 4-level4 of reasons to get reasonTree nodes

integer (int32)

Responses
HTTP Code Description Schema

200

OK

ReasonTreeNodeDto

401

Unauthorized

No Content

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3.17. Updates a reasonTree node category by node id

PUT /ea/v1/reasontrees/{id}/nodes/{nodeId}
Parameters
Type Name Description Schema

Path

id
required

treeId of reasonTrees to update reasonTreeNode category

integer (int64)

Path

nodeId
required

Node id of nodes to update reason tree node category

integer (int64)

Body

command
required

ReasonTreeNodeShortDto object to update reasonTreeNodes

ReasonTreeNodeShortDto

Responses
HTTP Code Description Schema

200

OK

ReasonTreeNodeShortDto

401

Unauthorized

No Content

500

Internal Server Error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

2.3.18. Delete a reasonTree node by node id

DELETE /ea/v1/reasontrees/{id}/nodes/{nodeId}
Parameters
Type Name Description Schema

Path

id
required

treeId of reasonTrees to delete reasonTreenode

integer (int64)

Path

nodeId
required

nodeId of node to delete reasonTreenode

integer (int64)

Responses
HTTP Code Description Schema

200

OK

No Content

401

Unauthorized

No Content

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

oauth

default

3. Definitions

3.1. Error

Name Schema

code
optional

string

details
optional

object

3.2. HttpErrorResponse

Name Schema

error
optional

Error

path
optional

string

timestamp
optional

string

Name Schema

href
optional

string

rel
optional

string

templated
optional

boolean

3.4. QueryDTO«List«ReasonCategoryDto»»

Name Schema

_embedded
optional

QueryEmbeddedResourceDTO«List«ReasonCategoryDto»»

first
optional

boolean

last
optional

boolean

links
optional

< Link > array

number
optional

integer (int32)

numberOfElements
optional

integer (int32)

size
optional

integer (int32)

sort
optional

Sort

totalElements
optional

integer (int64)

totalPages
optional

integer (int32)

3.5. QueryDTO«List«ReasonDto»»

Name Schema

_embedded
optional

QueryEmbeddedResourceDTO«List«ReasonDto»»

first
optional

boolean

last
optional

boolean

links
optional

< Link > array

number
optional

integer (int32)

numberOfElements
optional

integer (int32)

size
optional

integer (int32)

sort
optional

Sort

totalElements
optional

integer (int64)

totalPages
optional

integer (int32)

3.6. QueryDTO«List«ReasonTreeDto»»

Name Schema

_embedded
optional

QueryEmbeddedResourceDTO«List«ReasonTreeDto»»

first
optional

boolean

last
optional

boolean

links
optional

< Link > array

number
optional

integer (int32)

numberOfElements
optional

integer (int32)

size
optional

integer (int32)

sort
optional

Sort

totalElements
optional

integer (int64)

totalPages
optional

integer (int32)

3.7. QueryEmbeddedResourceDTO«List«ReasonCategoryDto»»

Name Schema

resource
optional

< ReasonCategoryDto > array

3.8. QueryEmbeddedResourceDTO«List«ReasonDto»»

Name Schema

resource
optional

< ReasonDto > array

3.9. QueryEmbeddedResourceDTO«List«ReasonTreeDto»»

Name Schema

resource
optional

< ReasonTreeDto > array

3.10. QuickPickReason

Name Schema

level1
optional

ReasonTreeNodeDto

level2
optional

ReasonTreeNodeDto

level3
optional

ReasonTreeNodeDto

level4
optional

ReasonTreeNodeDto

3.11. Reason

Name Schema

reasonId
optional

integer (int64)

reasonLocalName
optional

string

reasonName
optional

string

3.12. ReasonCategoryDto

Name Description Schema

categoryId
optional

The Unique identifier of this category

integer (int64)

categoryName
optional

The name of the category

string

links
optional

< Link > array

3.13. ReasonDto

Name Description Schema

commentRequired
optional

flag to check if reason is mendatory
Example : false

boolean

links
optional

< Link > array

reasonId
optional

The unique identifier of the reason

integer (int64)

reasonName
optional

The name of the reason

string

3.14. ReasonTree

Name Description Schema

treeId
optional

Unique identifier for this tree

integer (int64)

treeLocalName
optional

The name of the local tree

string

treeName
optional

The name of the tree

string

3.15. ReasonTreeDto

Name Description Schema

links
optional

< Link > array

nodes
optional

The List of the reasonTreeNode

< ReasonTreeNodeDto > array

treeId
optional

The Unique identifier of tree

integer (int64)

treeName
optional

The name of tree

string

3.16. ReasonTreeHeaderDto

Name Description Schema

levelName
optional

Name of the level can be 1-level1 2-level2 3-level3 4-level4 of a reason

string

reasonLevel
optional

The level can be 1-level1 2-level2 3-level3 4-level4 of the reason

integer (int32)

3.17. ReasonTreeNode

Name Description Schema

categoryId
optional

Unique identifier of this category

integer (int64)

categoryName
optional

The name of the category

string

categoryNodeId
optional

Unique identifier of this categoryNode

integer (int64)

commentRequired
optional

flag to check if reason is mendatory
Example : false

boolean

level1Id
optional

Unique identifier of this level1

integer (int64)

level2Id
optional

Unique identifier of this level2

integer (int64)

level3Id
optional

Unique identifier of this level3

integer (int64)

level4Id
optional

Unique identifier of this level4

integer (int64)

nodeId
optional

Unique identifier of this node

integer (int64)

parentNodeId
optional

Unique identifier of this parent

integer (int64)

reasonId
optional

Unique identifier of this reason

integer (int64)

reasonLevel
optional

The level of the reason

integer (int32)

reasonName
optional

The name of the reason

string

treeId
optional

Unique identifier of this tree

integer (int64)

3.18. ReasonTreeNodeDto

Name Description Schema

categoryId
optional

The categoryId of the reason

integer (int64)

categoryName
optional

The category name of reason

string

children
optional

The List of the reasonTreeNode

< ReasonTreeNodeDto > array

commentRequired
optional

flag to check if reason is mendatory
Example : false

boolean

links
optional

< Link > array

nodeId
optional

The Unique identifier of node

integer (int64)

parentNodeId
optional

The Unique identifier of parentNode

integer (int64)

reasonId
optional

The Unique identifier of reason

integer (int64)

reasonLevel
optional

The level can be 1-level1 2-level2 3-level3 4-level4 of reason

integer (int32)

reasonName
optional

The name of the reason

string

treeId
optional

The Unique identifier of tree

integer (int64)

3.19. ReasonTreeNodeShortDto

Name Description Schema

categoryId
optional

The Unique identifier of category

integer (int64)

nodeId
optional

The Unique identifier of nodes

integer (int64)

reasonId
optional

The Unique identifier of resons

integer (int64)

userId
optional

The Unique Id of users

integer (int32)

3.20. ReasonTreeShortDto

Name Description Schema

treeId
optional

The Unique identifier of tree

integer (int64)

userId
optional

The Unique identifier of user

integer (int32)

3.21. Sort

Type : object

4. Security

4.1. oauth

Type : oauth2
Flow : accessCode
Token URL : http://localhost:8080/uaa/oauth/authorize
Token URL : http://localhost:8080/uaa/oauth/token

Name Description

default

Default oauth2 scope.