Design Time
This section covers the details of the design-time APIs supported by SRMS 2.0.
POSTv1.0.0/order/serviceRequests/serviceRequestConfiguration/{requestType}
http://localhost:7101/ms-servicerequest-api/api/v1.0.0/order/serviceRequests/serviceRequestConfiguration/orderChequebook{
"serviceRequestSchema": {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"accountNo": {
"type": "string",
"title": "Account Number",
"description": "Account No of the user"
},
"chequeType": {
"type": "string",
"title": "ChequeBook Type",
"description": "Type of the chequebook"
},
"notes": {
"type": "string",
"title": "Notes",
"description": "Notes"
}
},
"required": [
"accountNo",
"chequeType",
"notes"
]
},
"serviceRequestProperties": [
{
"key": "id",
"value": "CHQ"
},
{
"key": "noofapproval",
"value": "1"
}
]
}
{
"serviceRequestId": "orderChequebook",
"message": "Service Request Type Schema Created Successfully",
"responseStatus": "Created"
} PUTv1.0.0/order/serviceRequests/serviceRequestConfiguration/{requestType}
http://localhost:7101/ms-servicerequest-api/api/v1.0.0/order/serviceRequests/serviceRequestConfiguration/orderChequebook{
"serviceRequestSchema": {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"accountNo": {
"type": "string",
"title": "Account Number",
"description": "Account No of the user"
},
"chequeType": {
"type": "string",
"title": "ChequeBook Type",
"description": "Type of the chequebook"
},
"notes": {
"type": "string",
"title": "Notes",
"description": "Notes"
}
},
"required": [
"accountNo",
"chequeType",
"notes"
]
},
"serviceRequestProperties": [
{
"key": "noofapproval",
"value": "2"
}
]
}
{
"serviceRequestId": "orderChequebook",
"message": "Service Request Type Schema Updated Successfully"
} GETv1.0.0/order/serviceRequests/serviceRequestConfiguration/{requestType}
http://localhost:7101/ms-servicerequest-api/api/v1.0.0/order/serviceRequests/serviceRequestConfiguration/orderChequebook{
"serviceRequestSchema": {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"chequeType": {
"description": "Type of the chequebook",
"type": "string",
"title": "ChequeBook Type"
},
"notes": {
"description": "Notes",
"type": "string",
"title": "Notes"
},
"accountNo": {
"description": "Account No of the user",
"type": "string",
"title": "Account Number"
}
},
"required": [
"accountNo",
"chequeType",
"notes"
]
},
"serviceRequestProperties": [
{
"key": "id",
"value": "CHQ"
},
{
"key": "noofapproval",
"value": "2"
}
]
}GETv1.0.0/order/serviceRequests/catalog
http://localhost:7101/ms-servicerequest-api/api/v1.0.0/order/serviceRequests/catalog{
"items": [
{
"requestType": "orderChequebook",
"createdBy": "2900086473289",
"createDate": "Sat Mar 25 04:52:12 GMT 2023"
},
{
"requestType": "addStandingOrder",
"createdBy": "2900086473289",
"createDate": "Sat Mar 25 04:59:10 GMT 2023"
}
]
}
GETv1.0.0/order/serviceRequests/serviceRequestSchema?requestType={request_type}
http://localhost:7101/ms-servicerequest-api/api/v1.0.0/order/serviceRequests/serviceRequestSchema?requestType=orderChequebook{
"openapi": "3.0.0",
"info": {
"description": "Service Request Microservice is an infrastructure support to extend the specific Microservice data model without impairing its existing system functions.",
"title": "Service Request Microservice APIs",
"version": "1.0.0"
},
"tags": [
{
"name": "Service Request Microservice",
"description": "APIs to store and retrieve Service Request Record schema and its records"
}
],
"servers": [
{
"url": "http://localhost:7101/ms-servicerequest-api/api/v1.0.0"
}
],
"security": [
{
"bearerAuth": []
}
],
"paths": {
"/order/approval/{recordId}/": {
"summary": "retrieve makerchecker record for the provided identifier",
"get": {
"summary": "retrieve makerchecker record for the provided identifier",
"description": "retrieve makerchecker record for the provided identifier",
"operationId": "getMakerCheckerRecordById",
"responses": {
"200": {
"description": "Returns the makerchecker record",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApprovalRequest"
}
}
}
}
},
"parameters": [
{
"schema": {
"type": "string"
},
"in": "path",
"explode": false,
"name": "recordId",
"description": "represents an identifier for service request saved in the maker checker process",
"required": true,
"example": "220833CD3QY49"
}
],
"tags": [
"MakerChecker"
]
},
"description": "retrieve makerchecker record for the provided identifier"
},
"/order/approval/": {
"summary": "Resource url for mananging makerchecker records",
"get": {
"summary": "retrieve the list of records based on the provided approval state and recordcreatedDate in the input parameter",
"description": "retrieve the list of records for approval based on provided approvalStatus and recordcreatedDate",
"operationId": "getMakerCheckerRecordsByCriteria",
"responses": {
"200": {
"description": "Returns the makerchecker records for the provided approvalstate and record create date range.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApprovalRequests"
}
}
}
}
},
"parameters": [
{
"schema": {
"type": "string",
"enum": [
"APPROVED",
"DRAFT",
"PENDINGFORAPPROVAL",
"SUBMITTED",
"REJECTED"
]
},
"in": "query",
"explode": true,
"name": "approvalStatus",
"description": "The state of a request shows its workflow status, if he is waiting approval or is rejected or blacklisted",
"required": false
},
{
"schema": {
"type": "string"
},
"in": "query",
"explode": true,
"name": "page_number",
"required": false
},
{
"schema": {
"type": "string"
},
"in": "query",
"explode": true,
"name": "page_size",
"required": false
},
{
"schema": {
"format": "date",
"type": "string",
"example": "2017-05-21T00:00:00.000+00:00"
},
"in": "query",
"explode": true,
"name": "endDate",
"description": "Returns a list of approvals created before the specified date",
"required": true
},
{
"schema": {
"format": "date",
"type": "string",
"example": "2017-04-21T00:00:00.000+00:00"
},
"in": "query",
"explode": true,
"name": "startDate",
"description": "Returns a list of approvals created after the specified date",
"required": true
},
{
"schema": {
"type": "string"
},
"in": "query",
"explode": true,
"name": "resourceType",
"required": false
},
{
"schema": {
"type": "string"
},
"in": "query",
"explode": true,
"name": "accountId",
"required": false
},
{
"schema": {
"type": "string"
},
"in": "query",
"explode": true,
"name": "customerId",
"required": false
},
{
"schema": {
"type": "string"
},
"in": "query",
"explode": true,
"name": "transactionId",
"required": false
}
],
"tags": [
"MakerChecker"
]
},
"description": "support operation for submit,retrieve and approve requests",
"put": {
"summary": "Approve or Reject makerchecker records",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApprovalRequestInput"
}
}
}
},
"description": "Approve or Reject makerchecker records",
"operationId": "approveMakerCheckerRecord",
"responses": {
"200": {
"description": "Returns status of the response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Status"
}
}
}
}
},
"tags": [
"MakerChecker"
]
}
},
"/order/servicerequests/requestType/{requestType}/{attributeValue}": {
"get": {
"summary": "Fetches list of Request Type Records for a given request type",
"description": "Fetch list of Request Type Records for a given request type",
"operationId": "fetchServiceRequestTypeRecords",
"responses": {
"200": {
"description": "Returns the request type created for the service request type",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RequestTypeRecords"
}
}
}
},
"default": {
"description": "Returns the Service Request Type schema error response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Errors"
}
}
}
}
},
"parameters": [
{
"schema": {
"type": "string"
},
"in": "path",
"explode": false,
"name": "requestType",
"description": "Indicates name of the Service Request Type",
"required": true,
"example": "chequebook"
},
{
"schema": {
"type": "string"
},
"in": "path",
"explode": false,
"name": "attributeValue",
"description": "Resource ID",
"required": true,
"example": "100100"
},
{
"schema": {
"format": "int32",
"type": "integer"
},
"in": "query",
"explode": true,
"name": "page_number",
"description": "PageNumber",
"required": false
},
{
"schema": {
"format": "int32",
"type": "integer"
},
"in": "query",
"explode": true,
"name": "page_size",
"description": "PageSize",
"required": false
}
],
"tags": [
"Runtime"
]
}
},
"/order/serviceRequests": {
"summary": "Service Request Runtime API",
"post": {
"summary": "Create the Service Request Type Record",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServiceRequestBody"
}
}
}
},
"description": "Create the Service Request Type Record",
"operationId": "createServiceRequestTypeRecord",
"responses": {
"200": {
"description": "Returns the status of the service request type",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Status"
}
}
}
},
"default": {
"description": "Returns the Service Request Type schema error response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Errors"
}
}
}
}
},
"parameters": [
{
"schema": {
"type": "string"
},
"in": "query",
"explode": true,
"name": "requestType",
"description": "Indicates Service Request Type",
"required": true,
"example": "chequebook"
},
{
"schema": {
"type": "string"
},
"in": "query",
"explode": true,
"name": "schemaVersionId",
"description": "Indicates the version of the request type schema",
"required": false,
"example": "1.0.0"
},
{
"schema": {
"type": "string",
"enum": [
"SAVE",
"SUBMIT"
]
},
"in": "query",
"explode": true,
"name": "purpose",
"description": "Indicates the purpose",
"required": false,
"example": "SAVE"
},
{
"schema": {
"type": "string"
},
"in": "query",
"explode": true,
"name": "serviceRequestId",
"description": "Indicates the unique identifier of the service request",
"required": false,
"example": "SR2022189160"
}
],
"tags": [
"Runtime"
]
},
"get": {
"summary": "Fetch the Service Request Records",
"description": "Fetch the Service Request Records for a given Service Request Type",
"operationId": "getServiceRequestRecords",
"responses": {
"200": {
"description": "Returns the list of of the service requests created for the service request type",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServiceRequestRecords"
}
}
}
},
"default": {
"description": "Returns the Service Request Type schema error response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Errors"
}
}
}
}
},
"parameters": [
{
"schema": {
"type": "string"
},
"in": "query",
"explode": true,
"name": "requestType",
"description": "Indicates name of the Service Request Type",
"required": true,
"example": "chequebook"
},
{
"schema": {
"type": "string",
"enum": [
"Submitted",
"Failed",
"Fulfilled"
]
},
"in": "query",
"explode": true,
"name": "status",
"description": "Indicates the status of the service request",
"required": false
},
{
"schema": {
"type": "string"
},
"in": "query",
"explode": true,
"name": "accountId",
"description": "Indicates the account number",
"required": false,
"example": "100100"
},
{
"schema": {
"type": "string"
},
"in": "query",
"explode": true,
"name": "customerId",
"description": "Indicates the customer number",
"required": false,
"example": "1001001"
},
{
"schema": {
"type": "string"
},
"in": "query",
"explode": true,
"name": "transactionId",
"description": "Indicates the transaction number",
"required": false,
"example": "ABC1234"
},
{
"schema": {
"type": "string",
"enum": [
"Created",
"Approved",
"Rejected"
]
},
"in": "query",
"explode": true,
"name": "actionTaken",
"description": "Indicates the action taken by user",
"required": false
},
{
"schema": {
"format": "date",
"type": "string"
},
"in": "query",
"explode": true,
"name": "fromDate",
"description": "Indicates the date used to filter only requests created after specified date.",
"required": false,
"example": "Sat Jul 02 14:07:38 GMT 2022"
},
{
"schema": {
"format": "date",
"type": "string"
},
"in": "query",
"explode": true,
"name": "toDate",
"description": "Indicates he date used to filter only requests created before specified date.",
"required": false,
"example": "Sat Jul 03 14:07:38 GMT 2022"
},
{
"schema": {
"format": "int32",
"type": "integer"
},
"in": "query",
"explode": true,
"name": "page_number",
"description": "PageNumber",
"required": false
},
{
"schema": {
"format": "int32",
"type": "integer"
},
"in": "query",
"explode": true,
"name": "page_size",
"description": "PageSize",
"required": false
},
{
"schema": {
"type": "string",
"enum": [
"APPROVED",
"DRAFT",
"PENDINGFORAPPROVAL",
"SUBMITTED",
"REJECTED"
]
},
"in": "query",
"explode": true,
"name": "approvalStatus",
"description": "The state of a request shows its workflow status, if he is waiting approval or is rejected or blacklisted",
"required": false
}
],
"tags": [
"Runtime"
]
},
"description": "API to save the record for a new Service Request Type"
},
"/order/serviceRequests/{serviceRequestId}": {
"get": {
"summary": "Fetch the Service Request Record for a given service request ID",
"description": "Fetch the Service Request Record for a given service request ID",
"operationId": "getServiceRequestRecordById",
"responses": {
"200": {
"description": "Returns the list of of the service requests created for the service request type",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServiceRequestRecord"
}
}
}
},
"default": {
"description": "Returns the Service Request Type schema error response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Errors"
}
}
}
}
},
"parameters": [
{
"schema": {
"type": "string"
},
"in": "path",
"explode": false,
"name": "serviceRequestId",
"description": "Indicates the unique identifier of the Service Request",
"required": true,
"example": "SR2022189160"
},
{
"schema": {
"type": "string"
},
"in": "query",
"explode": true,
"name": "requestType",
"description": "Indicates name of the Service Request Type",
"required": true,
"example": "chequebook"
},
{
"schema": {
"type": "string"
},
"in": "query",
"explode": true,
"name": "resourceId",
"description": "Resource ID",
"required": false,
"example": "100100"
},
{
"schema": {
"format": "int32",
"type": "integer"
},
"in": "query",
"explode": true,
"name": "page_number",
"description": "PageNumber",
"required": false
},
{
"schema": {
"format": "int32",
"type": "integer"
},
"in": "query",
"explode": true,
"name": "page_size",
"description": "PageSize",
"required": false
}
],
"tags": [
"Runtime"
]
},
"put": {
"summary": "Update the Service Request Type Record",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServiceRequestBody"
}
}
}
},
"description": "Update the Service Request Type Record",
"operationId": "updateServiceRequestTypeRecord",
"responses": {
"200": {
"description": "Returns the status of the service request type",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Status"
}
}
}
},
"default": {
"description": "Returns the Service Request Type schema error response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Errors"
}
}
}
}
},
"parameters": [
{
"schema": {
"type": "string"
},
"in": "path",
"explode": false,
"name": "serviceRequestId",
"description": "Indicates the unique identifier of the Service Request",
"required": true,
"example": "SR2022189160"
},
{
"schema": {
"type": "string"
},
"in": "query",
"explode": true,
"name": "schemaVersionId",
"description": "Indicates the version of the request type schema",
"required": false,
"example": "1.0.0"
},
{
"schema": {
"type": "string"
},
"in": "query",
"explode": true,
"name": "requestType",
"description": "Indicates name of the Service Request Type",
"required": true,
"example": "chequebook"
}
],
"tags": [
"Runtime"
]
}
}
},
"components": {
"schemas": {
"Status": {
"properties": {
"serviceRequestId": {
"description": "Unique identifier of the service request",
"type": "string",
"example": "SR202218930"
},
"message": {
"description": "Detailed message",
"type": "string",
"example": "Service request created successfully"
},
"responseStatus": {
"description": "Response Status",
"type": "string",
"enum": [
"Created",
"Updated"
],
"example": "Created"
}
}
},
"orderChequebookRecord": {
"properties": {
"chequeType": {
"description": "Type of the chequebook",
"title": "ChequeBook Type",
"type": "string"
},
"notes": {
"description": "Notes",
"title": "Notes",
"type": "string"
},
"accountNo": {
"description": "Account No of the user",
"title": "Account Number",
"type": "string"
}
}
},
"ServiceRequestRecords": {
"description": "List of error details",
"type": "array",
"items": {
"$ref": "#/components/schemas/ServiceRequestRecord"
}
},
"ApprovalRequest": {
"description": "Get Draft Response",
"type": "object",
"properties": {
"approvalStatus": {
"type": "string",
"enum": [
"APPROVED",
"DRAFT",
"PENDINGFORAPPROVAL",
"SUBMITTED",
"REJECTED"
]
},
"serviceRequestId": {
"type": "string"
},
"requestType": {
"type": "string"
},
"userId": {
"description": "represents the user id submitted the service request.",
"type": "string"
},
"transactionId": {
"type": "string"
},
"PendingApprovals": {
"description": "contains number of pending approvals to get approved completely",
"type": "integer"
},
"externalReference": {
"description": "Not used. it will be used to support extenal workflow",
"type": "string"
},
"accountId": {
"type": "string"
},
"approvedDateTime": {
"description": "represents the data time when the service request is approved by the last approver",
"type": "string"
},
"payload": {
"description": "contains details of the service request under approval",
"type": "object"
},
"customerId": {
"type": "string"
},
"operationId": {
"type": "string"
},
"externalEventStatus": {
"description": "Not used. it will be used to support extenal workflow",
"type": "string"
},
"creationDateTime": {
"description": "represents the data time when the service request is submitted for approval",
"type": "string"
},
"authorisers": {
"description": "contains list of users approved the service request",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"Error": {
"properties": {
"errorMessage": {
"description": "Detailed error message",
"type": "string",
"example": "chequeStatus: is missing but it is required"
},
"errorcode": {
"description": "Unique identifier of an error",
"type": "string",
"example": "1004"
}
}
},
"ServiceRequestBody": {
"description": "Represents the service request input payload for POST/PUT request",
"title": "Service Request Record Input Body",
"type": "object",
"properties": {
"serviceRequest": {
"description": "JSON Record of the Service Request Type entity",
"type": "object",
"$ref": "#/components/schemas/orderChequebookRecord"
}
}
},
"ServiceRequest": {
"required": [
"actionNotes",
"purpose"
],
"properties": {
"serviceRequestId": {
"description": "represents an identifier for the serivce request record id",
"title": "Service Request ID",
"type": "string"
},
"purpose": {
"description": "represents maker checker status of the record",
"title": "Maker checker status,",
"type": "string",
"enum": [
"APPROVE",
"REJECT"
]
},
"actionNotes": {
"description": "captures the comments from the approver while approving the request.",
"title": "Notes",
"type": "string"
}
}
},
"Errors": {
"description": "List of error details",
"type": "array",
"items": {
"$ref": "#/components/schemas/Error"
}
},
"ApprovalRequests": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ApprovalRequest"
}
},
"ServiceRequestRecord": {
"title": "Service Request Record",
"type": "object",
"properties": {
"approvalStatus": {
"description": "Status of the makerchecker record",
"type": "string",
"example": "Approved"
},
"serviceRequestId": {
"description": "Unique identifier of a service request",
"type": "string",
"example": "SR2022092120"
},
"notes": {
"description": "Notes",
"type": "string",
"example": "Cheque book is in printing stage"
},
"requestType": {
"description": "Type of the service request, say chequebook, creditcard",
"type": "string",
"example": "chequebook"
},
"lastUpdateDate": {
"format": "date",
"description": "Date on which the request was last Modified",
"type": "string"
},
"approvedBy": {
"description": "User who approved the service request",
"type": "string",
"example": "DEF"
},
"transactionId": {
"description": "Transaction No to which the service request is created",
"type": "string",
"example": "DEF"
},
"accountId": {
"description": "Account No to which the service request is created",
"type": "string",
"example": "100100"
},
"createdBy": {
"description": "User who created the service request",
"type": "string",
"example": "ABC"
},
"processDate": {
"format": "date",
"description": "Date on which the request was processed",
"type": "string"
},
"serviceRequest": {
"description": "Virtual table record",
"type": "object"
},
"customerId": {
"description": "Customer No to which the service request is created",
"type": "string",
"example": "1001001"
},
"status": {
"description": "Status of the Service Request",
"type": "string",
"example": "Submitted"
},
"createDate": {
"format": "date",
"description": "Date on which the request was created",
"type": "string"
}
}
},
"ApprovalRequestInput": {
"description": "Maker Response",
"type": "object",
"properties": {
"serviceRequest": {
"allOf": [
{
"$ref": "#/components/schemas/ServiceRequest"
}
],
"description": "JSON Record of the Service Request Type entity"
}
}
},
"RequestTypeRecords": {
"title": "Array of Virtual Table records",
"type": "array",
"items": {
"$ref": "#/components/schemas/RequestTypeRecord"
}
},
"RequestTypeRecord": {
"title": "Virtual Table Record",
"type": "object",
"properties": {
"data": {
"description": "JSON schema of the Virtural Table entity.",
"type": "object"
}
}
}
},
"securitySchemes": {
"bearerAuth": {
"bearerFormat": "JWT",
"scheme": "bearer",
"type": "http"
}
}
}
}
In this topic