{"openapi":"3.1.0","info":{"title":"PCQ Back-End APIs","description":"This is the Protected Characteristics Back-End API that will:\n\n- Save user's answers to the database.\n- Serve the consolidation service to fetch PCQ Ids that don't have an associated\n  case record and add case information to a PCQ record in the database.\n- Serve authentication tasks for other services and components to generate a\n  Service SAS token for the PCQ Storage Account container 'pcq' - this will\n  provide Write, List and Create access.\n\nReform Common Components.\n","version":"1.0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"tags":[{"name":"PCQ BackEnd - API for consolidation service operations.","description":"This is the Protected Characteristics Back-End API that will serve the consolidation service to fetch PCQ Ids that don't have an associated case record and add case information to a PCQ record in the database. The API will be invoked by the Consolidation service."},{"name":"PCQ BackEnd - API for SAS token service operations.","description":"This is the Protected Characteristics Back-End API that will serve authentication tasks for other services and components to generate a Service SAS token for the PCQ Storage Account container 'pcq' - this will provoide Write, List and Create access.The API will be invoked by the bulk-scan-processor service."},{"name":"PCQ BackEnd - API for PCQ database operations.","description":"This is the Protected Characteristics Back-End API that will save user's answers to the database. The API will be invoked by the PCQ front-end service."}],"paths":{"/pcq/backend/consolidation/addCaseForPCQ/{pcqId}":{"put":{"tags":["PCQ BackEnd - API for consolidation service operations.","PUT end-points"],"summary":"Add case information on a PCQ answers record.","description":"This API will be invoked by the Consolidation process to to update the case information ( case id ) on the PCQ answers record. ","operationId":"addCaseForPcq","parameters":[{"name":"headers","in":"header","required":true,"schema":{"$ref":"#/components/schemas/HttpHeaders"}},{"name":"ServiceAuthorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"pcqId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"caseId","in":"query","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Request executed successfully. Case Id successfully added to the PCQ Answers record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitResponse"}}}},"400":{"description":"The supplied input parameters are not in the acceptable format. The user will be returned a standard error message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitResponse"}}}},"500":{"description":"General/Un-recoverable error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitResponse"}}}}}}},"/pcq/backend/submitAnswers":{"post":{"tags":["POST end-points","PCQ BackEnd - API for PCQ database operations."],"summary":"Add and update PCQ answers to the database.","description":"This API will create a new record in the database for the given PCQId where none exists and will update an existing record with the answers as submitted by the users","operationId":"submitAnswers","parameters":[{"name":"headers","in":"header","required":true,"schema":{"$ref":"#/components/schemas/HttpHeaders"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PcqAnswerRequest"}}},"required":true},"responses":{"200":{"description":"Operation completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitResponse"}}}},"201":{"description":"Successfully saved to database.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitResponse"}}}},"202":{"description":"Request valid but stale.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitResponse"}}}},"400":{"description":"Request failed schema validation."},"403":{"description":"Version number mismatch."},"500":{"description":"General/Un-recoverable error."}}}},"/pcq/backend/token/bulkscan":{"get":{"tags":["GET end-points","PCQ BackEnd - API for SAS token service operations."],"summary":"Endpoint for BulkScan to generate the PCQ Storage SAS token.","description":"This API will be invoked by the Bulk Scan Processor to generate an Azure Service SAS token to allowthe upload of paper PCQ envelops to the PCQ Blob Storage 'pcq' container.","operationId":"generateBulkScanSasToken","parameters":[{"name":"ServiceAuthorization","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully generated Storage Account SAS token for BulkScan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SasTokenResponse"}}}},"401":{"description":"ServiceAuthorization header invalid or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SasTokenResponse"}}}},"404":{"description":"Service or path not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SasTokenResponse"}}}},"500":{"description":"Server error, unable to generate SAS token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SasTokenResponse"}}}}}}},"/pcq/backend/getAnswer/{pcqId}":{"get":{"tags":["GET end-points","PCQ BackEnd - API for PCQ database operations."],"summary":"Get PCQ answer from the database.","description":"This API will return a record from the PCQ database for the given PCQId. It is intended to be called from the test api for testing purposes.","operationId":"getAnswersByPcqId","parameters":[{"name":"pcqId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Details of the pcq answer record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PcqAnswerResponse"}}}},"400":{"description":"An invalid id was provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PcqAnswerResponse"}}}},"404":{"description":"No pcq answer record was found with the given id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PcqAnswerResponse"}}}}}}},"/pcq/backend/consolidation/pcqRecordWithoutCase":{"get":{"tags":["GET end-points","PCQ BackEnd - API for consolidation service operations."],"summary":"Get list of PCQ Record that don't have associated case information.","description":"This API will be invoked by the Consolidation process to get a list of PCQ records that don’t have an associated case. Any PCQ answer records which are over 90 days old will not be returned in the list. The PCQ Answer response will contain the PCQ Id, Service Id and Actor only.","operationId":"getPcqRecordWithoutCase","parameters":[{"name":"headers","in":"header","required":true,"schema":{"$ref":"#/components/schemas/HttpHeaders"}},{"name":"ServiceAuthorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Request executed successfully. Response will contain the multiple/single PCQ Record(s)/ empty array","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PcqRecordWithoutCaseResponse"}}}},"400":{"description":"Missing co-relation Id information in the header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PcqRecordWithoutCaseResponse"}}}},"500":{"description":"Any general application/database un-recoverable error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PcqRecordWithoutCaseResponse"}}}}}}},"/":{"get":{"tags":["root-controller"],"operationId":"welcome","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"ContentDisposition":{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"},"filename":{"type":"string"},"charset":{"type":"string"},"formData":{"type":"boolean"},"inline":{"type":"boolean"},"attachment":{"type":"boolean"}}},"HttpHeaders":{"type":"object","properties":{"accept":{"type":"array","items":{"$ref":"#/components/schemas/MediaType"}},"acceptLanguageAsLocales":{"type":"array","items":{"type":"string"}},"acceptPatch":{"type":"array","items":{"$ref":"#/components/schemas/MediaType"}},"accessControlAllowCredentials":{"type":"boolean"},"accessControlAllowHeaders":{"type":"array","items":{"type":"string"}},"accessControlAllowMethods":{"type":"array","items":{"$ref":"#/components/schemas/HttpMethod"}},"accessControlAllowOrigin":{"type":"string"},"accessControlExposeHeaders":{"type":"array","items":{"type":"string"}},"accessControlMaxAge":{"type":"integer","format":"int64"},"accessControlRequestHeaders":{"type":"array","items":{"type":"string"}},"accessControlRequestMethod":{"$ref":"#/components/schemas/HttpMethod"},"acceptCharset":{"type":"array","items":{"type":"string"}},"allow":{"type":"array","items":{"$ref":"#/components/schemas/HttpMethod"},"uniqueItems":true},"bearerAuth":{"type":"string","writeOnly":true},"connection":{"type":"array","items":{"type":"string"}},"contentDisposition":{"$ref":"#/components/schemas/ContentDisposition"},"contentLanguage":{"type":"string"},"etag":{"type":"string"},"expires":{"type":"integer","format":"int64"},"ifMatch":{"type":"array","items":{"type":"string"}},"ifNoneMatch":{"type":"array","items":{"type":"string"}},"ifUnmodifiedSince":{"type":"integer","format":"int64"},"origin":{"type":"string"},"pragma":{"type":"string"},"range":{"type":"array","items":{"$ref":"#/components/schemas/HttpRange"}},"upgrade":{"type":"string"},"vary":{"type":"array","items":{"type":"string"}},"basicAuth":{"type":"string","writeOnly":true},"acceptLanguage":{"type":"array","items":{"type":"object","properties":{"range":{"type":"string"},"weight":{"type":"number","format":"double"}}}},"empty":{"type":"boolean"},"location":{"type":"string","format":"uri"},"host":{"type":"object","properties":{"hostString":{"type":"string"},"address":{"type":"object","properties":{"hostAddress":{"type":"string"},"address":{"type":"string","format":"byte"},"hostName":{"type":"string"},"linkLocalAddress":{"type":"boolean"},"multicastAddress":{"type":"boolean"},"anyLocalAddress":{"type":"boolean"},"loopbackAddress":{"type":"boolean"},"siteLocalAddress":{"type":"boolean"},"mcglobal":{"type":"boolean"},"mcnodeLocal":{"type":"boolean"},"mclinkLocal":{"type":"boolean"},"mcsiteLocal":{"type":"boolean"},"mcorgLocal":{"type":"boolean"},"canonicalHostName":{"type":"string"}}},"port":{"type":"integer","format":"int32"},"unresolved":{"type":"boolean"},"hostName":{"type":"string"}}},"all":{"type":"object","additionalProperties":{"type":"string"},"writeOnly":true},"lastModified":{"type":"integer","format":"int64"},"date":{"type":"integer","format":"int64"},"contentLength":{"type":"integer","format":"int64"},"cacheControl":{"type":"string"},"ifModifiedSince":{"type":"integer","format":"int64"},"contentType":{"$ref":"#/components/schemas/MediaType"}}},"HttpMethod":{},"HttpRange":{},"MediaType":{"type":"object","properties":{"type":{"type":"string"},"subtype":{"type":"string"},"parameters":{"type":"object","additionalProperties":{"type":"string"}},"qualityValue":{"type":"number","format":"double"},"wildcardType":{"type":"boolean"},"wildcardSubtype":{"type":"boolean"},"subtypeSuffix":{"type":"string"},"charset":{"type":"string"},"concrete":{"type":"boolean"}}},"SubmitResponse":{"type":"object","properties":{"pcqId":{"type":"string"},"responseStatus":{"type":"string"},"responseStatusCode":{"type":"string"}}},"PcqAnswerRequest":{"type":"object","properties":{"pcqId":{"type":"string"},"dcnNumber":{"type":"string"},"formId":{"type":"string"},"partyId":{"type":"string"},"channel":{"type":"integer","format":"int32"},"completedDate":{"type":"string"},"serviceId":{"type":"string"},"actor":{"type":"string"},"versionNo":{"type":"integer","format":"int32"},"optOut":{"type":"string"},"pcqAnswers":{"$ref":"#/components/schemas/PcqAnswers"},"ccdCaseId":{"type":"string"}}},"PcqAnswers":{"type":"object","properties":{"dob_provided":{"type":"integer","format":"int32"},"dob":{"type":"string"},"language_main":{"type":"integer","format":"int32"},"language_other":{"type":"string"},"english_language_level":{"type":"integer","format":"int32"},"sex":{"type":"integer","format":"int32"},"gender_different":{"type":"integer","format":"int32"},"gender_other":{"type":"string"},"sexuality":{"type":"integer","format":"int32"},"sexuality_other":{"type":"string"},"marriage":{"type":"integer","format":"int32"},"ethnicity":{"type":"integer","format":"int32"},"ethnicity_other":{"type":"string"},"religion":{"type":"integer","format":"int32"},"religion_other":{"type":"string"},"disability_conditions":{"type":"integer","format":"int32"},"disability_impact":{"type":"integer","format":"int32"},"disability_vision":{"type":"integer","format":"int32"},"disability_hearing":{"type":"integer","format":"int32"},"disability_mobility":{"type":"integer","format":"int32"},"disability_dexterity":{"type":"integer","format":"int32"},"disability_learning":{"type":"integer","format":"int32"},"disability_memory":{"type":"integer","format":"int32"},"disability_mental_health":{"type":"integer","format":"int32"},"disability_stamina":{"type":"integer","format":"int32"},"disability_social":{"type":"integer","format":"int32"},"disability_other":{"type":"integer","format":"int32"},"disability_other_details":{"type":"string"},"disability_none":{"type":"integer","format":"int32"},"pregnancy":{"type":"integer","format":"int32"},"opt_out":{"type":"boolean"}}},"SasTokenResponse":{"type":"object","properties":{"sas_token":{"type":"string"}}},"PcqAnswerResponse":{"type":"object","properties":{"pcqAnswers":{"$ref":"#/components/schemas/PcqAnswers"},"pcqId":{"type":"string"},"dcnNumber":{"type":"string"},"formId":{"type":"string"},"ccdCaseId":{"type":"string"},"partyId":{"type":"string"},"channel":{"type":"integer","format":"int32"},"completedDate":{"type":"string"},"serviceId":{"type":"string"},"actor":{"type":"string"},"versionNo":{"type":"integer","format":"int32"}}},"PcqRecordWithoutCaseResponse":{"type":"object","properties":{"pcqRecord":{"type":"array","items":{"$ref":"#/components/schemas/PcqAnswerResponse"}},"responseStatus":{"type":"string"},"responseStatusCode":{"type":"string"}}}}}}
