{"openapi":"3.1.0","info":{"title":"LAU Case Back-End API","description":"Log and Audit Case Back-End API, used for auditing case searches and actions.","license":{"name":"REFORM Common Components","url":""},"version":"0.1"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"tags":[{"name":"Case action database operations.","description":"This is the Log and Audit Back-End API that will audit case actions. The API will be invoked by both the CCD (POST) and the LAU front-end service (GET)."},{"name":"Case search database operations.","description":"This is the Log and Audit Back-End API that will audit case searches. The API will be invoked by both the CCD (POST) and the LAU front-end service (GET)."}],"paths":{"/audit/caseSearch":{"get":{"tags":["GET end-points","Case search database operations."],"summary":"Retrieve case search audits","description":"This operation will query and return a list of case searches based on the search conditions provided in the URL path.","operationId":"getCaseSearch","parameters":[{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"example":"Bearer eyJ0eXAiOiJK........."},{"name":"Service Authorization","in":"header","required":true,"schema":{"type":"string"},"example":"Bearer eyJ0eXAiOiJK........."},{"name":"User ID","in":"query","required":false,"schema":{"type":"string"},"example":3748238},{"name":"Case Reference ID","in":"query","required":false,"schema":{"type":"string"},"example":1615817621013640},{"name":"Start Timestamp","in":"query","required":false,"schema":{"type":"string"},"example":"2021-06-23T22:20:05"},{"name":"End Timestamp","in":"query","required":false,"schema":{"type":"string"},"example":"2021-08-23T22:20:05"},{"name":"Size","in":"query","required":false,"schema":{"type":"string"},"example":500},{"name":"Page","in":"query","required":false,"schema":{"type":"string"},"example":1}],"responses":{"200":{"description":"Request executed successfully. Response contains of case search logs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseSearchGetResponse"}}}},"400":{"description":"Missing userId, caseRef, startTimestamp or endTimestamp parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseSearchGetResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseSearchGetResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseSearchGetResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseSearchGetResponse"}}}}}},"post":{"tags":["Case search database operations.","POST end-points"],"summary":"Save case search audits","description":"This operation will persist CCD case search entries which are posted in the request. Single CaseSearch per request will be stored in the database.","operationId":"saveCaseSearch","parameters":[{"name":"Service Authorization","in":"header","required":true,"schema":{"type":"string"},"example":"Bearer eyJ0eXAiOiJK........."}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseSearchPostRequest"}}},"required":true},"responses":{"201":{"description":"Created SearchLog case response - includes caseSearchId from DB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseSearchPostResponse"}}}},"400":{"description":"Invalid case search","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseSearchPostResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseSearchPostResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseSearchPostResponse"}}}}}}},"/audit/caseAction":{"get":{"tags":["GET end-points","Case action database operations."],"summary":"Retrieve case action audits","description":"This operation will query and return a list of case actions based on the search conditions provided in the URL path.","operationId":"getCaseAction","parameters":[{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"example":"Bearer eyJ0eXAiOiJK........."},{"name":"Service Authorization","in":"header","required":true,"schema":{"type":"string"},"example":"Bearer eyJ0eXAiOiJK........."},{"name":"User ID","in":"query","required":false,"schema":{"type":"string"},"example":3748238},{"name":"Case Reference ID","in":"query","required":false,"schema":{"type":"string"},"example":1615817621013640},{"name":"Case Type ID","in":"query","required":false,"schema":{"type":"string"},"example":"GrantOfRepresentation"},{"name":"Case Action","in":"query","required":false,"schema":{"type":"string"},"example":"VIEW"},{"name":"Case Jurisdiction ID","in":"query","required":false,"schema":{"type":"string"},"example":"PROBATE"},{"name":"Start Timestamp","in":"query","required":false,"schema":{"type":"string"},"example":"2021-06-23T22:20:05"},{"name":"End Timestamp","in":"query","required":false,"schema":{"type":"string"},"example":"2021-08-23T22:20:05"},{"name":"Size","in":"query","required":false,"schema":{"type":"string"},"example":500},{"name":"Page","in":"query","required":false,"schema":{"type":"string"},"example":1}],"responses":{"200":{"description":"Request executed successfully. Response contains of case view logs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseActionGetResponse"}}}},"400":{"description":"Missing userId, caseTypeId, caseJurisdictionId, caseRef, startTimestamp or endTimestamp parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseActionGetResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseActionGetResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseActionGetResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseActionGetResponse"}}}}}},"post":{"tags":["Case action database operations.","POST end-points"],"summary":"Save case action audits","description":"This operation will persist CCD case action entries which are posted in the request. Single CaseAction per request will be stored in the database.","operationId":"saveCaseAction","parameters":[{"name":"Service Authorization","in":"header","required":true,"schema":{"type":"string"},"example":"Bearer eyJ0eXAiOiJK........."}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseActionPostRequest"}}},"required":true},"responses":{"201":{"description":"Created actionLog case response - includes caseActionId from DB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseActionPostResponse"}}}},"400":{"description":"Invalid case action","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseActionPostResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseActionPostResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseActionPostResponse"}}}}}}},"/audit/accessRequest":{"get":{"tags":["GET end-points","Challenged and Specific access request endpoints"],"summary":"Retrieve access request records","description":"Endpoint to retrieve access request records based on search conditions","operationId":"getAccessRequest","parameters":[{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"example":"Bearer eyJ0eXAiOiJK........."},{"name":"Service Authorization","in":"header","required":true,"schema":{"type":"string"},"example":"Bearer eyJ0eXAiOiJK........."},{"name":"User ID","in":"query","required":false,"schema":{"type":"string"},"example":"abcd-1234-9876"},{"name":"Case Reference ID","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{16}$"},"example":1615817621013640},{"name":"Request Type","in":"query","required":false,"schema":{"type":"string","enum":["CHALLENGED","SPECIFIC"]},"example":"CHALLENGED"},{"name":"Start Timestamp","in":"query","required":true,"schema":{"type":"string"},"example":"2021-06-23T22:20:05"},{"name":"End Timestamp","in":"query","required":true,"schema":{"type":"string"},"example":"2021-08-23T22:20:05"},{"name":"Size","in":"query","required":false,"schema":{"type":"integer","format":"int32"},"example":500},{"name":"Page","in":"query","required":false,"schema":{"type":"integer","format":"int32"},"example":1}],"responses":{"200":{"description":"A list of Access Request records","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessRequestGetResponse"}}}},"400":{"description":"Missing userId, caseRef, request type, start or end timestamp","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessRequestGetResponse"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessRequestGetResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessRequestGetResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessRequestGetResponse"}}}}}},"post":{"tags":["POST end-points","Challenged and Specific access request endpoints"],"summary":"Save access request","description":"This will save specific or challenged access request","operationId":"saveAccessRequest","parameters":[{"name":"Service Authorization","in":"header","required":true,"schema":{"type":"string"},"example":"Bearer eyJ0eXAiOiJK........."}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessRequestPostRequest"}}},"required":true},"responses":{"201":{"description":"Access request saved successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessRequestPostResponse"}}}},"400":{"description":"Invalid request received","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessRequestPostResponse"}}}},"403":{"description":"Authorization failed","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessRequestPostResponse"}}}},"500":{"description":"Error occurred while saving access request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessRequestPostResponse"}}}}}}},"/":{"get":{"tags":["root-controller"],"operationId":"welcome","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"CaseSearchPostRequest":{"type":"object","properties":{"searchLog":{"$ref":"#/components/schemas/SearchLog"}}},"SearchLog":{"type":"object","description":"Data model for the case search log","properties":{"userId":{"type":"string","description":"The user on whose behalf the operation took place"},"caseRefs":{"type":"array","description":"The caseRefs effected by the search operation","items":{"type":"string"}},"timestamp":{"type":"string","description":"When the operation took place with microseconds in iso-8601-date-and-time-format"}}},"CaseSearchPostResponse":{"type":"object","properties":{"searchLog":{"$ref":"#/components/schemas/SearchLogPostResponse"}}},"SearchLogPostResponse":{"type":"object","description":"Data model for the case search log","properties":{"id":{"type":"string","description":"The database unique id"},"userId":{"type":"string","description":"The user on whose behalf the operation took place"},"caseRefs":{"type":"array","description":"The caseRefs effected by the search operation","items":{"type":"string"}},"timestamp":{"type":"string","description":"When the operation took place with microseconds in iso-8601-date-and-time-format"}}},"ActionLog":{"type":"object","description":"Data model for the case action log","properties":{"userId":{"type":"string","description":"The user on whose behalf the operation took place"},"caseAction":{"type":"string","description":"The action carried out on the case, i.e. CREATE, UPDATE, VIEW, DELETE"},"caseRef":{"type":"string","description":"The caseRef effected by the action"},"caseJurisdictionId":{"type":"string","description":"The Jurisdiction Id of the case affected by the action"},"caseTypeId":{"type":"string","description":"The Case Type Id of the case affected by the action"},"timestamp":{"type":"string","description":"When the operation took place with microseconds in iso-8601-date-and-time-format"}}},"CaseActionPostRequest":{"type":"object","properties":{"actionLog":{"$ref":"#/components/schemas/ActionLog"}}},"ActionLogPostResponse":{"type":"object","properties":{"caseActionId":{"type":"string"},"userId":{"type":"string"},"caseRef":{"type":"string"},"caseJurisdictionId":{"type":"string"},"caseTypeId":{"type":"string"},"caseAction":{"type":"string"},"timestamp":{"type":"string"}}},"CaseActionPostResponse":{"type":"object","properties":{"actionLog":{"$ref":"#/components/schemas/ActionLogPostResponse"}}},"AccessRequestLog":{"type":"object","properties":{"requestType":{"type":"string","enum":["CHALLENGED","SPECIFIC"]},"userId":{"type":"string","maxLength":64,"minLength":1},"caseRef":{"type":"string","minLength":1,"pattern":"^\\d{16}$"},"reason":{"type":"string"},"action":{"type":"string","enum":["CREATED","APPROVED","AUTO-APPROVED","REJECTED"]},"timestamp":{"type":"string","minLength":1},"requestEndTimestamp":{"type":"string"}},"required":["action","caseRef","requestType","timestamp","userId"]},"AccessRequestPostRequest":{"type":"object","properties":{"accessLog":{"$ref":"#/components/schemas/AccessRequestLog"}},"required":["accessLog"]},"AccessRequestPostResponse":{"type":"object","properties":{"accessLog":{"$ref":"#/components/schemas/AccessRequestLog"}}},"CaseSearchGetResponse":{"type":"object","description":"Case Search GET Response","properties":{"searchLog":{"type":"array","items":{"$ref":"#/components/schemas/SearchLog"}},"startRecordNumber":{"type":"integer","format":"int32","description":"The index of the first record out of the full result set provided in the result set"},"moreRecords":{"type":"boolean","description":"Indicates whether there are more records beyond the current page in the full result set"},"totalNumberOfRecords":{"type":"integer","format":"int64","description":"The total number of records for a query"}}},"CaseActionGetResponse":{"type":"object","description":"Case Action GET Response","properties":{"actionLog":{"type":"array","items":{"$ref":"#/components/schemas/ActionLog"}},"startRecordNumber":{"type":"integer","format":"int32","description":"The index of the first record out of the full result set provided in the result set"},"moreRecords":{"type":"boolean","description":"Indicates whether there are more records beyond the current page in the full result set"},"totalNumberOfRecords":{"type":"integer","format":"int64","description":"The total number of records in the full result set"}}},"AccessRequestGetResponse":{"type":"object","properties":{"accessLog":{"type":"array","items":{"$ref":"#/components/schemas/AccessRequestLog"}},"startRecordNumber":{"type":"integer","format":"int32"},"moreRecords":{"type":"boolean"},"totalNumberOfRecords":{"type":"integer","format":"int64"}}}}}}
