openapi: 3.0.0
servers:
  - description: Locally Deployed Environment
    url: 'http://localhost:8310/ms-servicerequest-api/api/v2.0.0'
info:
  description: Service Request Microservice
  version: v2.0.0
  title: Service Request APIs
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
paths:
  '/orders/type/{typeId}/subType/{subTypeId}/serviceRequestConfiguration/{requestConfigId}':
    post:
      description: Creates new Service Request Configuration record with the given details, version 2 api with update and cancel switch, and endpoints
      summary: Creates new Service Request Configuration record
      operationId: createServiceReqConfigV2
      tags:
        - Service Request Configuration
      parameters:
        - name: typeId 
          in: path
          description: Type Id
          required: true
          schema:
            type: string
            example: card
        - name: subTypeId
          in: path
          description: SubType Id
          required: true
          schema:
            type: string
            example: replaceCard
        - name: requestConfigId
          in: path
          description: Request Config Id
          required: true
          schema:
            type: string
            example: replaceCard
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ServiceReqConfRequest'
      responses:
        '200':
          description: Status for the creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardResponse'
        default:
          description: Get the error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
    put:
      description: Updates Service Request Configuration record with the given details, version 2 api with update and cancel switch, and endpoints
      summary: Updates Service Request Configuration record
      operationId: updateServiceReqConfigV2
      tags:
        - Service Request Configuration
      parameters:
        - name: typeId
          in: path
          description: Type Id
          required: true
          schema:
            type: string
            example: card
        - name: subTypeId
          in: path
          description: SubType Id
          required: true
          schema:
            type: string
            example: replaceCard
        - name: requestConfigId
          in: path
          description: Request Config Id
          required: true
          schema:
            type: string
            example: replaceCard
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ServiceReqConfRequest'
      responses:
        '200':
          description: Status for the creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardResponse'
        default:
          description: Get the error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
  /orders/serviceRequestConfigurations:
    get:
      description: Fetch the Service Request Configuration record with the given details,version 2 api with update and cancel switch, and endpoints
      summary: Returns the Service Request Configuration record
      operationId: getServiceReqConfigV2
      tags:
        - Service Request Configuration
      parameters:
        - name: type
          in: query
          description: Type Id
          schema:
            type: string
            example: card
        - name: subType
          in: query
          description: SubType Id
          schema:
            type: string
            example: replaceCard
      responses:
        '200':
          description: Status for the creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceReqConfigResponses'
        default:
          description: Get the error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
  '/orders/party/{partyId}/type/{typeId}/subtype/{subtypeId}/serviceRequest':
    post:
      description: Creates new Service Request record with the given details
      summary: Creates new Service Request record
      operationId: createServiceReqV2
      tags:
        - Service Request
      parameters:
        - name: partyId
          in: path
          description: party Id
          required: true
          schema:
            type: string
            example: GB0010001-100100
        - name: typeId
          in: path
          description: type Id
          required: true
          schema:
            type: string
            example: card
        - name: subtypeId
          in: path
          description: subtype Id
          required: true
          schema:
            type: string
            example: replaceCard
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceRequest'
      responses:
        '200':
          description: Status for the creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardResponse'
        default:
          description: Get the error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
  '/orders/serviceRequest/{requestId}/updateRequest':
    post:
      description : Initiates an update process in the backend, if update is enabled for the request, helps in modifying fields and their values once a created request has already been processed
      summary : Updates the Requested record
      operationId : updateRequestDetailsV2
      tags:
        - Service Request
      parameters:
        - name: requestId
          in : path
          description : Service Request id
          required : true
          schema:
            type: string
            example: ORD127REDFDSAS
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRequest'
      responses:
        '200':
          description: Status for the creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardResponse'
        default:
          description: Get the error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
  '/orders/serviceRequest/{requestId}/cancelRequest':
    post:
      description : Initiates a cancel process in the backend, if cancel is enabled for the request, helps in cancelling a request, once a created request has already been processed or is in process by the backend
      summary : Cancels the Requested record
      operationId : cancelRequestDetailsV2
      tags:
        - Service Request
      parameters:
        - name : requestId
          in : path
          description : Request ID
          required : true
          schema :
            type : string
            example: ORD127REDFDSAS
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelRequest'
      responses:
        '200':
          description: Status for the creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardResponse'
        default:
          description: Get the error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
  '/orders/party/{partyId}':
    get:
      description: Fetch the Request record
      summary: Returns the Service Request(s) for a given customer, if present
      operationId: getRequestDetailsV2
      tags:
        - Service Request
      parameters:
        - name: partyId
          in: path
          description: party Id
          required: true
          schema:
            type: string
            example: GB0010001-100100
        - name: status
          in: query
          description: Service Request status
          schema:
            type: string
            example: Initiated
        - name: account
          in: query
          description: Account Id
          schema:
            type: string
            example: GB0010001-89707
        - name: type
          in: query
          description: Type
          schema:
            type: string
            example: card
        - name: subType
          in: query
          description: subType
          schema:
            type: string
            example: replaceCard
        - name: dateFrom
          in: query
          description: Starting Date
          schema:
            type: string
            example: "2020-09-10"
        - name: dateTo
          in: query
          description: Ending Date
          schema:
            type: string
            example: "2020-09-10"
        - name: pageNumber
          in: query
          description: page number
          required: false
          schema:
            type: number
            format: integer
            example: 5            
        - name: pageSize
          in: query
          description: page size
          required: false
          schema:
            type: number
            format: integer
            example: 5 
      responses:
        '200':
          description: Status for fetch success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceRequestResponse'
        default:
          description: Get the error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
  '/orders/serviceRequest/{requestId}':
    get:
      description: Returns the Service Request record(s)
      summary: Returns the Service Request record(s) for comma separated requestIds
      operationId: getAllRequestDetailsByRequestIdV2
      tags:
        - Service Request
      parameters:
        - name: requestId
          in: path
          description: Request Id
          required: true
          schema:
            type: string
            example: SRD20251HNXN9
        - name: partyId
          in: query
          description: party Id
          schema:
            type: string
            example: GB0010001-100100          
      responses:
        '200':
          description: Status for the creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceRequestResponse'
        default:
          description: Get the error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'    
    put:
      description: Update the Service Request record
      summary: updates the Service Request record
      operationId: updateServiceReqV2
      tags:
        - Service Request
      parameters:
        - name: requestId
          in: path
          description: Request Id
          required: true
          schema:
            type: string
            example: SRD20251HNXN9
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateServiceRequest'
      responses:
        '200':
          description: Status for the creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardResponse'
        default:
          description: Get the error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
  '/orders/serviceRequest':
    get:
      description: Fetch the Request record
      summary: Returns the Service Request(s) for a given customer based on a custom criteria, if present
      operationId: getServiceRequestBasedOnCriteriaV2
      tags:
        - Service Request
      parameters:
        - name: partyId
          in: query
          description: party Id
          schema:
            type: string
            example: GB0010001-100100
        - name: status
          in: query
          description: Service Request status
          schema:
            type: string
            example: Initiated
        - name: accountId
          in: query
          description: Account Id
          schema:
            type: string
            example: GB0010001-89707
        - name: type
          in: query
          description: Type
          schema:
            type: string
            example: card
        - name: subType
          in: query
          description: subType
          schema:
            type: string
            example: replaceCard
        - name: dateFrom
          in: query
          description: Starting Date
          schema:
            type: string
            example: "2020-09-10"
        - name: dateTo
          in: query
          description: Ending Date
          schema:
            type: string
            example: "2020-09-10"
        - name: pageNumber
          in: query
          description: page number
          required: false
          schema:
            type: number
            format: integer
            example: 5            
        - name: pageSize
          in: query
          description: page size
          required: false
          schema:
            type: number
            format: integer
            example: 5
        - name: bankReferenceName
          in: query
          description: This field holds the name of the queue in which a request is placed until it is claimed for processing and later holds the username of bank user who claims the request
          schema:
            type: string
            example: que_<name of the queue>/ username such as bankofficer1, servicingops1
        - name: requestStage
          in: query
          description: Indicates the current stage of the service request which had been placed in the bank user's queue
          schema:
            type: string
            example: Open, In Progress, Completed
        - name: requestStatus
          in: query
          description: Internal status of Service Request
          schema:
            type: string
            example: Approved, Rejected, Request Initiated
      responses:
        '200':
          description: Status for fetch success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceRequestResponse'
        default:
          description: Get the error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
  '/orders/type/{typeId}/subType/{subTypeId}/status/statusCheck':
    put:
      description: Status check for Awaiting order periodically
      summary: Status check for Awaiting order periodically
      operationId: reTriggerAwaitingSerReqV2
      tags:
        - ReTrigger Service Request
      parameters:
        - name: typeId
          in: path
          description: Type Id
          required: true
          schema:
            type: string
            example: card
        - name: subTypeId
          in: path
          description: SubType Id
          required: true
          schema:
            type: string
            example: replaceCard
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReTriggerRequestItem'
      responses:
        '200':
          description: Status for the creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardResponse'
        default:
          description: Get the error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
  '/orders/party/{partyId}/serviceRequest/{requestId}/approve':
    post:
      description: Approval for the Service Request
      summary: Approve a service request
      operationId: approveServiceRequestV2
      tags:
        - Service Request
      parameters:
        - name: partyId
          in: path
          description: Username or Id of the approver
          required: true
          schema:
            type: string
            example: 100100
        - name: requestId
          in: path
          description: Request Id
          required: true
          schema:
            type: string
            example: OCB21021U0UIG        
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalRequest'
      responses:
        '200':
          description: Status for the creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalResponse'
        default:
          description: Get the error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'       
  '/orders/party/{partyId}/serviceRequest/{requestId}/reject':
    post:
      description: Reject for the Service Request
      summary: Reject a service request
      operationId: rejectServiceRequestV2
      tags:
        - Service Request
      parameters:
        - name: partyId
          in: path
          description: Username or Id of the approver
          required: true
          schema:
            type: string
            example: 100100
        - name: requestId
          in: path
          description: Request Id
          required: true
          schema:
            type: string
            example: OCB21021U0UIG        
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RejectRequest'
      responses:
        '200':
          description: Status for the creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalResponse'
        default:
          description: Get the error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
  /orders/serviceRequest/{requestId}/attributeHistory:
    get:
      description: Get the Service Request Attribute History record(s)
      summary: Returns the Service Request Attribute History record(s)
      operationId: getSRAttributeHistoryV2
      tags:
        - Service Request
      parameters:
        - name: requestId
          in: path
          description: Request Id
          required: true
          schema:
            type: string
            example: SRD20251HNXN9
        - name: version
          in: query
          description: version
          schema:
            type: string
            example: 1,2 or latest          
      responses:
        '200':
          description: Status for the get SRAttributeHistory
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SRAttributeHistoryResponse'
        default:
          description: Get the error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'                   
  '/orders/party/{partyId}/serviceRequest/{requestId}/withdraw':
    post:
      description: Withdraw for the Service Request
      summary: Withdraw a service request
      operationId: withdrawServiceRequestV2
      tags:
        - Service Request
      parameters:
        - name: partyId
          in: path
          description: Party Id
          required: true
          schema:
            type: string
            example: 100100
        - name: requestId
          in: path
          description: Request Id
          required: true
          schema:
            type: string
            example: OCB21021U0UIG        
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WithdrawRequest'
      responses:
        '200':
          description: Status for the creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalResponse'
        default:
          description: Get the error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'

  /orders/serviceRequest/{requestId}/actionHistoryDetails:
    get:
      description: Fetch the details of the actions performed on a service request.
      summary: Returns the Action History record(s) of the service request
      operationId: getSRAuditHistoryV2
      tags:
        - Service Request
      parameters:
        - name: requestId
          in: path
          description: Request Id of the service request
          required: true
          schema:
            type: string
            example: SRD20251HNXN9
        - name: actionType
          in: query
          description: Action Type performed on the service request
          schema:
            type: string
            example: Decision,Amendment
        - name: actionOwnerId
          in: query
          description: Specifies the Id of the Service Request Action Owner
          schema:
            type: string
            example: 1000101
      responses:
        '200':
          description: Status for the get SRAuditHistory
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SRAuditHistoryResponse'
        default:
          description: Get the error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
  '/system/file':
    post:
      description: Ingest JSON file
      summary: Ingest file
      operationId: fileIngestorV2
      tags:
        - File
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileRequest'
      responses:
        '200':
          description: Status for the creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileListResponse'
        default:
          description: Get the error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
components:
  schemas:
    StandardErrorResponse:
      properties:
        errorCode:
          description: Holds an error code
          example: SRMS-0110
          type: string
        errorMessage:
          description: Holds an error Message
          example: Transformation Failed
          type: string
    StandardResponse:
      properties:
        id:
          description: Unique identifier for ServiceReqConfig/ServiceReq
          example: '200722894'
          type: string
        status:
          type: string
          description: Specifies http error code extension
          example: Success
        message:
          type: string
          description: Specifies the text that provide more details and corrective actions
          example: Created/Updated Succesfully
    RejectRequest:
      properties:
        comments:
          type: string
          description: Description for the Approved/Rejected
          example: Check Book Request Approved
        signatoryApproved:
          type: string
          description: This attribute indicates whether the service request has been approved by all the signatories / bank admins
          example: true
        uuid:
          type: string
          description: Unique Identifier
          example: 390882aa-6453-4546-ad74-77dd33655f0c
        approverType:
          type: string
          description: Type of the approver
          example: admin/signatory
        approverName:
          type: string
          description: The name of the person who approves the request
          example: John
    WithdrawRequest:
      properties:
        comments:
          type: string
          description: Description for the Approved/Rejected
          example: Check Book Request Approved
        signatoryApproved:
          type: string
          description: This attribute indicates whether the service request has been approved by all the signatories / bank admins
          example: true
        uuid:
          type: string
          description: Unique Identifier
          example: 390882aa-6453-4546-ad74-77dd33655f0c
    ApprovalRequest:
      properties:
        comments:
          type: string
          description: Description for the Approved/Rejected
          example: Check Book Request Approved
        signatoryApproved:
          type: string
          description: This attribute indicates whether the service request has been approved by all the signatories / bank admins
          example: true
        uuid:
          type: string
          description: Unique Identifier
          example: 390882aa-6453-4546-ad74-77dd33655f0c
        approverType:
          type: string
          description: Type of the approver
          example: admin/signatory
        approverName:
          type: string
          description: The name of the person who approves the request
          example: John
    ApprovalResponse:
      properties:
        partyId:
          type: string
          description: Party Id
          example: 100100
        requestId: 
          type: string
          description: Request Id
          example: OCB21021U0UIG
        comments:
          type: string
          description: Description for the Approved/Rejected
          example: Check Book Request Approved
        signatoryAction:
          type: string
          description: Signatory Action
          example: Approved
        serviceReqStatus:
          type: string
          description: Overall Status of the request
          example: Request Placed
        adminAction:
          type: string
          description: Indicates the action performed by a bank admin on a service request
          example: Approved, Rejected
    StandardFileResponse:
      properties:
        id:
          description: Unique identifier for ServiceReqConfig/ServiceReq
          example: 'conf1.json'
          type: string
        status:
          type: string
          description: Specifies http error code extension
          example: Success
        response:
          type: object
          description: Specifies the text that provide more details and corrective actions
          example:
            {"id":"ChequeBookRequest","status":"Success"}
    FileRequest:
      properties:
        filename:
          type: array
          items:
            type: string 
          description: List of files to be Ingested
          example: 
            - serviceRequestConfig.json
            - getServiceReqConfig.json
    FileListResponse:
      properties:
        APIResponses:
          type: array
          items:
            $ref: '#/components/schemas/StandardFileResponse'
          description: Attributes      
    AttributeObjects:
      properties:
        attributeName:
          type: string
          description: Attribute Name
          example: ChequeIssueId/note
        mandatory:
          type: boolean
          description: Attribute Value Mandatory or Not
          example: true
        dataType:
          type: string
          description: Data Type for Attribute
          example: string
        maxLength:
          type: number
          description: Maximum Length for an Attribute
          example: 15
        allowedValues:
          type: array
          items:
            type: string
          description: Allowded Values for an Attribute
          example:
            - SB.2406
            - SB.2568
    ServiceReqConfRequestItem:
      properties:
        requestConfigId:
          type: string
          description: Service Request Configuration Name
          example: replaceCard
        type:
          type: string
          description: Type for a ServiceReqConfig
          example: Card
        subType:
          type: string
          description: SubType for a ServiceReqConfig
          example: replaceCard
        endPointCommandName:
          type: string
          description: EndPoint/Command Name for a ServiceReqConfig
          example: T24ISSTOPPAYMENTS_CREATECHEQUEBOOKREQUESTS
        maxRetryAttempt:
          type: number
          description: Maximum Retry Attempt for a ServiceReqConfig
          example: 15
        adminApprovalRequired:
          type: boolean
          description: Infinity AdminApprovalRequired for a ServiceReqConfig
          example: true
        notificationEnabled:
          type: boolean
          description: Notification Enabled for a ServiceReqConfig
          example: true
        notificationStages:
          type: array
          items:
            type: string
          description: Notification Stages for a ServiceReqConfig
          example:
            - Initiated
            - Processed
        awaitingEnabled:
          type: boolean
          description: Awaiting Enabled for a ServiceReqConfig
          example: false
        awaitingEndPoint:
          type: string
          description: Awaiting End Point for a ServiceReqConfig
          example: T24ISSTOPPAYMENTS_CREATECHEQUEBOOKREQUESTS
        awaitingMaxRetryAttempted:
          type: number
          description: Awaiting Max Retry Attempt for a ServiceReqConfig
          example: 15
        preSubmissionScript:
          type: string
          description: Base64 string that coverts the stores the external JS Validation
          example: zhfuifnerDSAHRIOnjfsaduf+oHDSNFEO=UR184145+62
        requestAttribute:
          type: array
          items:
            $ref: '#/components/schemas/AttributeObjects'
          description: Attributes
        realTime:
          type: boolean
          description: Real Time for a ServiceReqConfig
          example: false
        eventSource:
          type: string
          description: Event Source for a ServiceReqConfig
          example: api
        product:
          type: string
          description: Product for the ServiceReqConfig
          example: Card
        prefix:
          type: string
          description: Prefix for the Service Request
          example: CRD
        defaultStatus:
          type: string
          description: Default Status , in case backend response does not contain status
          example: Yet to confirm
        statusConfigurationMapper:
          type: object
          description: Mapper to maintain status lifecycle
          example:
            ISSUED: ORDER CONFIRMED
            REQUEST RECIEVED: ORDER RECIEVED
        updateEnabled:
          type: boolean
          description: Indicates whether SR can be updated or not
          example: true  
        cancelEnabled:
          type: boolean
          description: Indicates whether SR can be updated or not
          example: true   
        updateEndPoint:
          type: string
          description: EndPoint/Command Name for a update ServiceReqConfig
          example: T24ISSTOPPAYMENTS_CREATECHEQUEBOOKREQUESTS 
        cancelEndPoint:
          type: string
          description: EndPoint/Command Name for a cancel ServiceReqConfig
          example: T24ISSTOPPAYMENTS_CREATECHEQUEBOOKREQUESTS
        legalEntityId:
          type: string
          description: LegalEntityId
          example: GB0010001
    UpdateRequest:
      properties:
        uuid:
          type: string
          description : Unique Identifier
          example: 390882aa-6453-4546-ad74-77dd33655f0c
        requestIn:
          type: object
          description: Request Load for Creating ServiceReq
          example:
            checkIssueId: SB.2406
            note: CreateNew
        signatoryApprovalRequired:
          type: string
          description: signatory Approved or Not
          example: true
    CancelRequest:
      properties:
        uuid:
          type: string
          description : Unique Identifier
          example: 390882aa-6453-4546-ad74-77dd33655f0c
        requestIn:
          type: object
          description: Request Load for Creating ServiceReq
          example:
            checkIssueId: SB.2406
            note: CreateNew
        signatoryApprovalRequired:
          type: string
          description: signatory Approved or Not
          example: true
    ServiceRequest:
      properties:
        uuid:
          type: string
          description: Unique Identifier
          example: 390882aa-6453-4546-ad74-77dd33655f0c
        serviceReqConfId:
          type: string
          description: serviceReqConfName Id
          example: deleteCard
        account:
          type: string
          description: Account Id
          example: '87907'
        requestIn:
          type: object
          description: Request Load for Creating ServiceReq
          example:
            checkIssueId: SB.2406
            note: CreateNew
        signatoryApprovalRequired:
          type: string
          description: signatory Approved or Not
          example: true
        legalEntityId:
          type: string
          description: LegalEntityId
          example: GB0010001
        customerName:
          type: string
          description: Name of the customer who creates the Service Request
          example: James Gosling
    ServiceRequestView:
      properties:
        serviceReqId:
          type: string
          description: Generic serviceReq ID
          example: ORD127REDFDSAS
        externalserviceReqRef:
          type: string
          description: External serviceReq ID
          example: ORD12HNFU34I4N5
        description:
          type: string
          description: Description ServiceReq
          example: Status Initiated
        partyId:
          type: string
          description: Party ID
          example: GB0010001-100100
        accountId:
          type: string
          description: Account ID
          example: GB0010001-89707
        type:
          type: string
          description: Type ID
          example: Card
        subType:
          type: string
          description: Sub Type ID
          example: replaceCard
        type_description:
          type: string
          description: Type Description
          example: Card
        subType_description:
          type: string
          description: Subtype Description
          example: Card
        currentAttempt:
          type: number
          description: Number of Attempts
          example: 5
        requestConfigId:
          type: string
          description: serviceReqConfig ID
          example: replaceCard
        serviceReqRequestIn:
          type: object
          description: Request In for ServiceReq
          example:
            checkIssueId: SB.2406
            note: CreateNew
        serviceReqResponse:
          type: object
          description: ServiceReq Response
          example:
            httpStatus: '200'
            dbpError: ''
        responseAttributes:
          type: object
          description: Response Attributes in Detail
          example:
            httpStatus: '200'
            dbpError: ''
        errorDetails:
          type: string
          description: Error Details from Fabric
          example: Nil
        errorMessage:
          type: string
          description: Error Message from Fabric
          example: Nil
        additionalInfo:
          type: string
          description: Additional Info and Details from Fabric
          example: Operation was successfully completed with this additional info
        serviceReqStatus:
          type: string
          description: ServiceReq Updated Status - as per external system
          example: Initiated/Success
        internalStatus:
          type: string
          description: Status maintained by Service Request Internally to track retrigger attempts
          example: ReInitiated/Awaiting
        serviceReqProcessedTime:
          type: string
          description: ServiceReq Processing Time
          example: '2020-08-20T06:01:01.729Z'
        requestDate:
          type: string
          description: Date of request
          example: '2020-08-20'
        requestCreatedTime:
          type: string
          format: date
          description: Timestamp of request creation
          example: '2020-08-20T06:01:01.729Z'
        signatoryApprovalRequired:
          type: string
          description: signatory Approved or Not
          example: true
        returnCode:
          type: string
          description: Returns the Error Code
          example: 400
        additionalErrorInfo:
          type: string
          description: Additional Error Message
          example: Service Request Not found
        currrentSignatoryApprovedCount:
          type: number
          description: Number of approval done by signatory
          example: 1
        currentSignatoryRejectCount:
          type: number
          description: Number of rejection done by signatory
          example: 1
        actionPerformed:
          type: string
          description: Action Performed
          example: CREATE
        legalEntityId:
          type: string
          description: LegalEntityId
          example: GB0010001
        externalStatus:
          type: string
          description: Fulfilment Status of Service Request
          example: Issued, Request received, Success
        bankReferenceName:
          type: string
          description: This field holds the name of the queue in which a request is placed until it is claimed for processing and later holds the username of bank user who claims the request
          example: que_<name of the queue>/ username such as bankofficer1, servicingops1
        parentProcessId:
          type: string
          description: Holds the identifier of the Parent process initiated for performing a task/series of tasks on a service request
          example: 2044
        activeProcessId:
          type: string
          description: Holds the identifier of the sub process (that is part of a parent process) which is currently active and performs a specific task related to a servcie request
          example: 1023
        requestStage:
          type: string
          description: Indicates the current stage of the service request which had been placed in the bank user's queue
          example: Open, In Progress, Completed
        adminApprovalCount:
          type: number
          description: Number of approval done by bank admins
          example: 1
        adminRejectionCount:
          type: number
          description: Number of rejection done by bank admins
          example: 0
        signatoryComments:
          type: string
          description: Comments by Signatory for Approval/Rejection
          example: Check Book Request Approved
        adminComments:
          type: string
          description: Comments by Bank Admin for Approval/Rejection 
          example: Check Book Request Approved
        customerName:
          type: string
          description: Name of the customer who creates the Service Request
          example: James Gosling
    ServiceRequestResponse:
      properties:
        serviceReqs:
          type: array
          items:
            $ref: '#/components/schemas/ServiceRequestView'
          description: List of serviceReq
    UpdateServiceRequest:
      properties:
        request:
          type: string
          description: Request In for ServiceReq
          example: '{''checkIssueId'':''SB.2406'',''note'':''CreateNew''}'
        backendResponse:
          type: string
          description: ServiceReq Response
          example: '{''httpStatus'':''200'',''dbpError'':''''}'
        serviceReqId:
          type: string
          description: Generic serviceReq ID
          example: ORD127REDFDSAS
        status:
          type: string
          description: ServiceReq Updated Status
          example: Initiated/Success
        errorMessage:
          type: string
          description: Error Details from Fabric
          example: Nil
        externalReference:
          type: string
          description: External ServiceRequest
          example: SB.1441  
        errorDetails:
          type: string
          description: Error Details from Fabric
          example: Nil
        additionalInfo:
          type: string
          description: Additional Info and Details from Fabric
          example: Operation was successfully completed with this additional info
        parentProcessId:
          type: string
          description: Holds the identifier of the Parent process initiated for performing a task/series of tasks on a service request
          example: 2044
        activeProcessId:
          type: string
          description: Holds the identifier of the sub process (that is part of a parent process) which is currently active and performs a specific task related to a servcie request
          example: 1023
        bankReferenceName:
          type: string
          description: This field holds the name of the queue in which a request is placed until it is claimed for processing and later holds the username of bank user who claims the request
          example: que_<name of the queue>/ username such as bankofficer1, servicingops1
        requestStage:
          type: string
          description: Indicates the current stage of the service request which had been placed in the bank user's queue
          example: Open, In Progress, Completed
        requestAttributes:
          type: object
          description: Updates the request attributes used while creating ServiceRequest
          example:
            checkIssueId: DUMMY.1234
            note: UpdateNew
    ReTriggerRequestItem:
      properties:
        dateFrom:
          type: string
          format: date
          description: Starting Date in UTC/YYYY-MM-DD format
          example: '2020-08-20T06:01:01.729Z'
        dateTo:
          type: string
          format: date
          description: Ending Date in UTC/YYYY-MM-DD format
          example: '2020-08-20T06:01:01.729Z'
        status:
          type: array
          items:
            type: string 
          description: List of Status to be Retriggered
          example: 
            - Initiated
            - Awaiting
        uuid:
          type: string
          description: Unique Identifier
          example: 390882aa-6453-4546-ad74-77dd33655f0c   
    ServiceReqConfRequest:
      type: object
      properties:
        serReqConfigDetails:
          allOf:
            - $ref: '#/components/schemas/ServiceReqConfRequestItem'
          description: Service Request Configuration Details
        fileName:
          type: array
          description: External JS File
          items:
            type: string
            format: binary
    ServiceReqConfigResponses:
      properties:
        serviceReqConfig:
          type: array
          items:
            $ref: '#/components/schemas/ServiceReqConfRequestItem'
    ServiceReqAttributeHistoryItem:
      properties:   
        serviceRequestId:
          type: string
          description: Service Request ID
          example: SR127REDFDSAS    
        version:
          type: string
          description: Version
          example: 1    
        action:
          type: string
          description: Action Perfomed
          example: cancel/udpate    
        changedPayload:
          type: object
          description: Key Value Pair of the previous Image
          example:
            chequeBookId: 5            
    SRAttributeHistoryResponse:
      properties:
        srAttributeRecords:
          type: array
          items:
            $ref: '#/components/schemas/ServiceReqAttributeHistoryItem'
    ServiceReqAuditHistoryItem:
      properties:   
        serviceRequestId:
          type: string
          description: The unique id to identify the service request
          example: SR127REDFDSAS
        actionOwnerId:
          type: string
          description: Digital profile Id of the action performer
          example: 1000101 
        actionOwnerName:
          type: string
          description: Name of the action performer
          example: John
        actionOwnerRole:
          type: string
          description: Role of the action performer
          example: admin/signatory
        actionPerformed:
          type: string
          description: Action Performed by the user
          example: Approved/Rejected
        comments:
          type: string
          description: comments provided by the user during action performed
          example: Required document needs to be submitted
        actionDate:
          type: string
          description: Date on which the action is performed by the user
          example: '2020-08-20'
        actionDateTime:
          type: string
          format: date
          description: Timestamp on which the action is performed by the user
          example: '2020-08-20T06:01:01.729Z'
        actionType:
          type : string
          description: Type of action performed
          example : Decision/Amendment
        isFinalAction:
          type : boolean
          description: Indicates whether the final action is performed or not
          example : true
    SRAuditHistoryResponse:
      properties:
        actionHistoryDetails:
          type: array
          items:
            $ref: '#/components/schemas/ServiceReqAuditHistoryItem'