1. Overview

Microservice containing the business logic for managing comment-app-service.

1.1. URI scheme

Host : localhost
BasePath : /

1.2. Tags

  • comment-controller : Comment Controller

  • document-controller : Document Controller

  • work-order-controller : Work Order Controller

2. Resources

2.1. Comment-controller

Comment Controller

2.1.1. Creates a new comment thread

POST /comments-viewer/v1/commentThreads
Parameters
Type Name Description Schema

Body

commonCommentRecord
required

CommentThread object to add a new comment

CommonCommentRecord

Responses
HTTP Code Description Schema

200

OK

object

201

Created

BaseResponse

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Consumes
  • application/json;charset=UTF-8

Produces
  • application/json;charset=UTF-8

  • application/hal+json

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.1.2. Fetches the list of comments that are associated to the entity instance

GET /comments-viewer/v1/commentThreads
Parameters
Type Name Description Schema Default

Query

entityId
required

EntityId of the comment to fetch the comments associated to it

string

Query

entityType
required

Entity Type on which comments are created

enum (WorkOrder, SerialNumber, ProductionEvent)

Query

showComments
optional

True to get comments on each thread. False to get only threads

boolean

"true"

Responses
HTTP Code Description Schema

200

OK

CommonCommentPage

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.1.3. Add a comment to the specified thread

POST /comments-viewer/v1/commentThreads/{threadId}/comments
Parameters
Type Name Description Schema

Path

threadId
required

Thread Id of the comment to fetch the comments associated to it

integer (int64)

Body

commentRecord
required

The new comment details to be added to the thread specified by threadId

CommonCommentRecord

Responses
HTTP Code Description Schema

200

OK

object

201

Created

BaseResponse

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Consumes
  • application/json;charset=UTF-8

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.1.4. Fetches the list of comments that are associated to the thread

GET /comments-viewer/v1/commentThreads/{threadId}/comments
Parameters
Type Name Description Schema

Path

threadId
required

Thread Id of the comment to fetch the comments associated to it

integer (int64)

Responses
HTTP Code Description Schema

200

OK

CommonCommentPage

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.1.5. Fetches comment that are associated to the thread and commentId

GET /comments-viewer/v1/commentThreads/{threadId}/comments/{commentId}
Parameters
Type Name Description Schema

Path

commentId
required

Comment Id of the comment to fetch the comments associated to it

integer (int64)

Path

threadId
required

Thread Id of the comment to fetch the comments associated to it

integer (int64)

Responses
HTTP Code Description Schema

200

OK

CommonCommentPage

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.1.6. Update comment

PUT /comments-viewer/v1/commentThreads/{threadId}/comments/{commentId}
Parameters
Type Name Description Schema

Path

commentId
required

Comment Id of the comment to update

integer (int64)

Path

threadId
required

Thread Id of the comment to update

integer (int64)

Body

commonCommentRecord
required

SecureCommentRecord Object to update a comment

CommonCommentRecord

Responses
HTTP Code Description Schema

200

OK

CommentRecord

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Consumes
  • application/json;charset=UTF-8

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.1.7. Deletes common comment

DELETE /comments-viewer/v1/commentThreads/{threadId}/comments/{commentId}
Parameters
Type Name Description Schema

Path

commentId
required

comment Id to delete

integer (int64)

Path

threadId
required

comment thread Id to delete

integer (int64)

Query

commentType
optional

valid comment types that the comment is sub comment of Enti types to . Ex: Skip, Overdue for Activities.

string

Query

entityId
required

entityId is from the type of entityType’s id .

integer (int64)

Query

entityType
required

valid entityType to comment. Ex:WorkOrder,SerialNumber

string

Responses
HTTP Code Description Schema

200

OK

object

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.2. Document-controller

Document Controller

2.2.1. Create metadata

POST /comments-viewer/v1/documents
Parameters
Type Name Description Schema

Query

clientId
required

clientId

string

Body

documentMetaInfo
required

Metadata for creation of document or revision

string

Responses
HTTP Code Description Schema

201

Created

object

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

422

Unprocessable Entity

Api error

Consumes
  • application/json

Produces
  • application/json

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.2.2. Get Documents

GET /comments-viewer/v1/documents
Parameters
Type Name Description Schema Default

Query

clientId
required

clientId

string

Query

docId
optional

document id

string

Query

pageNo
optional

page

integer (int32)

0

Query

size
optional

size

integer (int32)

20

Responses
HTTP Code Description Schema

200

OK

object

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

422

Unprocessable Entity

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.2.3. Document upload

PUT /comments-viewer/v1/documents
Parameters
Type Name Description Schema

Query

attachmentName
optional

attachment name

string

Query

clientId
required

clientId

string

Query

docId
required

document id

string

Query

rev
required

_rev

string

FormData

file
required

document to upload

file

Responses
HTTP Code Description Schema

200

OK

object

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

409

Conflict

Api error

422

Unprocessable Entity

Api error

Consumes
  • multipart/form-data

Produces
  • /

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.2.4. Get document

GET /comments-viewer/v1/documents/attachment
Parameters
Type Name Description Schema

Query

attachmentName
required

attachment name

string

Query

clientId
required

clientId

string

Query

docId
required

document id or url

string

Responses
HTTP Code Description Schema

200

OK

object

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

422

Unprocessable Entity

HttpErrorResponse

Produces
  • /

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.3. Work-order-controller

Work Order Controller

2.3.1. Fetches the list of materiallot actuals that are associated to the workorder

GET /workorder/{workOrderId}/materiallotactuals
Parameters
Type Name Description Schema

Path

workOrderId
required

workOrderId to fetch the material lot actuals associated to workorder

integer (int64)

Responses
HTTP Code Description Schema

200

OK

< object > array

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

3. Definitions

3.1. Api error

Http Error response.

Name Schema

errorCode
optional

string

message
optional

string

requestPath
optional

string

status
optional

enum (100, 101, 102, 103, 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 426, 428, 429, 431, 451, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511)

subErrors
optional

ApiSubError

3.2. ApiSubError

Name Schema

errorCode
optional

string

field
optional

string

message
optional

string

value
optional

object

3.3. Attachment

Name Description Schema

attachmentName
optional

document name

string

attachmentType
optional

attachment type

string

documentId
optional

documentId of the document

string

3.4. BaseResponse

Name Schema

data
optional

object

links
optional

< Link > array

message
optional

string

statusCode
optional

integer (int32)

3.5. CommentRecord

Name Description Schema

attachments
optional

Comment Attachments

< Attachment > array

commentId
optional

Unique identifier of this comment record

integer (int64)

commentText
optional

The text of the comment

string

commentTime
optional

The time this comment was entered

string (date-time)

threadId
optional

Comment thread this record is part of

integer (int64)

user
optional

The user performing on comment

IdNameValue

3.6. CommonComment

Name Description Schema

attachments
optional

Comment Attachments

< Attachment > array

commentId
optional

Unique identifier of this comment record

integer (int64)

commentText
optional

The text of the comment

string

commentTime
optional

The time this comment was entered

string (date-time)

links
optional

< Link > array

threadId
optional

Comment thread this record is part of

integer (int64)

user
optional

The user performing on comment

IdNameValue

3.7. CommonCommentPage

Name Schema

content
optional

< CommonComment > array

links
optional

< Link > array

page
optional

PageMetadata

3.8. CommonCommentRecord

Name Description Schema

attachments
optional

Comment Attachments

< Attachment > array

commentText
optional

The text of the comment

string

commentType
optional

CommentType that the comment is mapped to. Ex: 1 for Tests, 80 for Activities

string

entityId
optional

EntityId’s instance Id for this comment

integer (int64)

entityType
optional

Entity Type of Plant Apps or non-Plant Apps for this comment record

string

3.9. Error

Name Schema

code
optional

string

details
optional

object

3.10. HttpErrorResponse

Name Schema

error
optional

Error

path
optional

string

timestamp
optional

string

3.11. IdNameValue

Name Description Schema

id
optional

The unique ID of the entity

integer (int64)

name
optional

The name of the entity

string

Name Description Schema

href
optional

string

rel
optional

string

templated
optional

Example : false

boolean

3.13. PageMetadata

Name Schema

number
optional

integer (int64)

size
optional

integer (int64)

totalElements
optional

integer (int64)

totalPages
optional

integer (int64)

4. Security

4.1. access_token

Type : oauth2
Flow : accessCode
Token URL : https://10.181.213.234/uaa/oauth/authorize
Token URL : https://10.181.213.234/uaa/oauth/token

Name Description

default

Default oauth2 scope.

4.2. resource_owner

Type : oauth2
Flow : password
Token URL : https://10.181.213.234/uaa/oauth/token

Name Description

default

Default oauth2 scope.

4.3. implicit_grant

Type : oauth2
Flow : implicit
Token URL : https://10.181.213.234/uaa/oauth/authorize

Name Description

default

Default oauth2 scope.

4.4. client_creds

Type : oauth2
Flow : application
Token URL : https://10.181.213.234/uaa/oauth/token

Name Description

default

Default oauth2 scope.