{"openapi":"3.0.1","info":{"title":"API to provide different miscellaneous services for Pen Registry.","description":"This API is responsible for providing different miscellaneous services.","version":"1"},"servers":[{"url":"https://pen-services-api-8878b4-dev.apps.silver.devops.gov.bc.ca","description":"Generated server url"}],"security":[{"OAUTH2":["VALIDATE_STUDENT_DEMOGRAPHICS"]}],"tags":[{"name":"Endpoint to retrieve saga by its ID (GUID).","description":"Endpoint to retrieve saga by its ID (GUID)."},{"name":"Delete Merge By Primary Key","description":"to support e2e automation testing."},{"name":"Endpoint to validate student request.","description":"Endpoint to validate student request."},{"name":"Endpoint to generate a new PEN number and return the same.","description":"Endpoint to generate a new PEN number and return the same. The transaction ID is mandatory, so that for each unique transaction only one PEN is issued."}],"paths":{"/api/v1/pen-services/pen-services-macro/{macroId}":{"get":{"tags":["pen-services-macro-controller"],"operationId":"findPenServicesMacroById","parameters":[{"name":"macroId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PenServicesMacro"}}}},"404":{"description":"NOT FOUND","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PenServicesMacro"}}}}}},"put":{"tags":["pen-services-macro-controller"],"operationId":"updatePenServicesMacro","parameters":[{"name":"macroId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PenServicesMacro"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PenServicesMacro"}}}},"404":{"description":"NOT FOUND","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PenServicesMacro"}}}}}}},"/api/v1/pen-services/validation/student-request":{"post":{"tags":["Endpoint to validate student request."],"operationId":"validateStudentData","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PenRequestStudentValidationPayload"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PenRequestStudentValidationIssue"}}}}},"400":{"description":"BAD REQUEST","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PenRequestStudentValidationIssue"}}}}}}}},"/api/v1/pen-services/student-merge-complete-saga":{"post":{"tags":["pen-services-saga-controller"],"operationId":"completeStudentMerge","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentMergeCompleteSagaData"}}},"required":true},"responses":{"200":{"description":"OK.","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/api/v1/pen-services/student-demerge-complete-saga":{"post":{"tags":["pen-services-saga-controller"],"operationId":"completeStudentDemerge","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentDemergeCompleteSagaData"}}},"required":true},"responses":{"200":{"description":"OK.","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/api/v1/pen-services/split-pen-saga":{"post":{"tags":["pen-services-saga-controller"],"operationId":"splitPen","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitPenSagaData"}}},"required":true},"responses":{"200":{"description":"OK.","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/api/v1/pen-services/pen-services-macro":{"get":{"tags":["pen-services-macro-controller"],"operationId":"findPenServicesMacros","parameters":[{"name":"macroTypeCode","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PenServicesMacro"}}}}}}},"post":{"tags":["pen-services-macro-controller"],"operationId":"createPenServicesMacro","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PenServicesMacro"}}},"required":true},"responses":{"201":{"description":"CREATED","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PenServicesMacro"}}}}}}},"/api/v1/pen-services/move-sld-saga":{"post":{"tags":["pen-services-saga-controller"],"operationId":"moveSld","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveMultipleSldSagaData"}}},"required":true},"responses":{"200":{"description":"OK.","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/api/v1/pen-services/{studentID}/merges":{"get":{"tags":["student-merge-controller"],"operationId":"findStudentMerges","parameters":[{"name":"studentID","in":"path","required":true,"schema":{"type":"string"}},{"name":"mergeDirection","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StudentMerge"}}}}},"404":{"description":"NOT FOUND","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StudentMerge"}}}}}}}},"/api/v1/pen-services/validation/issue-type-code":{"get":{"tags":["pen-services-api-controller"],"operationId":"getPrbStudentValidationIssueTypeCodes","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PenRequestBatchStudentValidationIssueTypeCode"}}}}}}}},"/api/v1/pen-services/validation/issue-severity-code":{"get":{"tags":["pen-services-api-controller"],"operationId":"getPrbStudentValidationIssueSeverityCodes","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PenRequestBatchStudentValidationIssueSeverityCode"}}}}}}}},"/api/v1/pen-services/validation/issue-field-code":{"get":{"tags":["pen-services-api-controller"],"operationId":"getPrbStudentValidationIssueFieldCodes","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PenRequestBatchStudentValidationFieldCode"}}}}}}}},"/api/v1/pen-services/saga/{sagaID}":{"get":{"tags":["Endpoint to retrieve saga by its ID (GUID)."],"operationId":"readSaga","parameters":[{"name":"sagaID","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Saga"}}}},"404":{"description":"Not Found.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Saga"}}}}}}},"/api/v1/pen-services/next-pen-number":{"get":{"tags":["Endpoint to generate a new PEN number and return the same."],"operationId":"getNextPenNumber","parameters":[{"name":"transactionID","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/api/v1/pen-services/merges/stats":{"get":{"tags":["student-merge-controller"],"operationId":"getMergeStats","parameters":[{"name":"statsType","in":"query","required":true,"schema":{"type":"string","enum":["NUMBER_OF_MERGES_IN_LAST_13_MONTH"]}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StudentMergeStats"}}}}}}},"/api/v1/pen-services/merges/between-dates-created":{"get":{"tags":["student-merge-controller"],"operationId":"findStudentMergesBetweenDatesCreated","parameters":[{"name":"createDateStart","in":"query","required":true,"schema":{"type":"string"}},{"name":"createDateEnd","in":"query","required":true,"schema":{"type":"string"}},{"name":"mergeDirectionCode","in":"query","required":false,"schema":{"type":"string","default":"TO"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StudentMerge"}}}}}}}},"/api/v1/pen-services/merge-source-codes":{"get":{"tags":["student-merge-controller"],"operationId":"getStudentMergeSourceCodes","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StudentMergeSourceCode"}}}}}}}},"/api/v1/pen-services/merges/{studentMergeID}":{"delete":{"tags":["Delete Merge By Primary Key"],"operationId":"deleteMerge","parameters":[{"name":"studentMergeID","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"No Content.","content":{"*/*":{"schema":{"type":"object"}}}}}}}},"components":{"schemas":{"PenServicesMacro":{"required":["macroCode","macroText","macroTypeCode"],"type":"object","properties":{"createUser":{"maxLength":100,"minLength":0,"type":"string"},"updateUser":{"maxLength":100,"minLength":0,"type":"string"},"createDate":{"type":"string"},"updateDate":{"type":"string"},"macroId":{"type":"string"},"macroCode":{"maxLength":10,"minLength":0,"type":"string"},"macroTypeCode":{"maxLength":10,"minLength":0,"type":"string"},"macroText":{"maxLength":4000,"minLength":0,"type":"string"}}},"PenRequestStudentValidationIssue":{"type":"object","properties":{"penRequestBatchStudentValidationIssueId":{"type":"string"},"penRequestBatchValidationIssueSeverityCode":{"type":"string"},"penRequestBatchValidationIssueTypeCode":{"type":"string"},"penRequestBatchValidationFieldCode":{"type":"string"}}},"PenRequestStudentValidationPayload":{"required":["isInteractive","transactionID"],"type":"object","properties":{"isInteractive":{"type":"boolean"},"transactionID":{"type":"string"},"penRequestBatchStudentID":{"type":"string"},"penRequestBatchID":{"type":"string"},"penRequestBatchStudentStatusCode":{"type":"string"},"localID":{"type":"string"},"submittedPen":{"type":"string"},"legalFirstName":{"type":"string"},"legalMiddleNames":{"type":"string"},"legalLastName":{"type":"string"},"usualFirstName":{"type":"string"},"usualMiddleNames":{"type":"string"},"usualLastName":{"type":"string"},"dob":{"type":"string"},"genderCode":{"type":"string"},"gradeCode":{"type":"string"},"postalCode":{"type":"string"},"assignedPEN":{"type":"string"},"studentID":{"type":"string"},"createUser":{"type":"string"},"updateUser":{"type":"string"},"recordNumber":{"type":"integer","format":"int32"},"bestMatchPEN":{"type":"string"},"mincode":{"type":"string"},"submissionNumber":{"type":"string"},"issueList":{"type":"array","items":{"$ref":"#/components/schemas/PenRequestStudentValidationIssue"}}}},"StudentMergeCompleteSagaData":{"required":["historyActivityCode","mergeStudentID","mergedFromPen","mergedToPen","studentMergeDirectionCode","studentMergeSourceCode"],"type":"object","properties":{"studentID":{"type":"string"},"pen":{"type":"string"},"legalFirstName":{"type":"string"},"legalMiddleNames":{"type":"string"},"legalLastName":{"type":"string"},"dob":{"type":"string"},"sexCode":{"type":"string"},"genderCode":{"type":"string"},"usualFirstName":{"type":"string"},"usualMiddleNames":{"type":"string"},"usualLastName":{"type":"string"},"email":{"type":"string"},"deceasedDate":{"type":"string"},"createUser":{"type":"string"},"updateUser":{"type":"string"},"localID":{"type":"string"},"postalCode":{"type":"string"},"gradeCode":{"type":"string"},"mincode":{"type":"string"},"emailVerified":{"type":"string"},"gradeYear":{"type":"string"},"demogCode":{"type":"string"},"statusCode":{"type":"string"},"memo":{"type":"string"},"historyActivityCode":{"type":"string"},"trueStudentID":{"type":"string"},"documentTypeCode":{"type":"string"},"dateOfConfirmation":{"type":"string"},"requestStudentID":{"type":"string"},"mergedToPen":{"type":"string"},"mergedFromPen":{"type":"string"},"mergeStudentID":{"type":"string"},"studentMergeDirectionCode":{"type":"string"},"studentMergeSourceCode":{"type":"string"}}},"StudentDemergeCompleteSagaData":{"required":["historyActivityCode","mergedFromPen","mergedFromStudentID","mergedToPen","mergedToStudentID"],"type":"object","properties":{"studentID":{"type":"string"},"pen":{"type":"string"},"legalFirstName":{"type":"string"},"legalMiddleNames":{"type":"string"},"legalLastName":{"type":"string"},"dob":{"type":"string"},"sexCode":{"type":"string"},"genderCode":{"type":"string"},"usualFirstName":{"type":"string"},"usualMiddleNames":{"type":"string"},"usualLastName":{"type":"string"},"email":{"type":"string"},"deceasedDate":{"type":"string"},"createUser":{"type":"string"},"updateUser":{"type":"string"},"localID":{"type":"string"},"postalCode":{"type":"string"},"gradeCode":{"type":"string"},"mincode":{"type":"string"},"emailVerified":{"type":"string"},"gradeYear":{"type":"string"},"demogCode":{"type":"string"},"statusCode":{"type":"string"},"memo":{"type":"string"},"historyActivityCode":{"type":"string"},"trueStudentID":{"type":"string"},"documentTypeCode":{"type":"string"},"dateOfConfirmation":{"type":"string"},"requestStudentID":{"type":"string"},"mergedFromPen":{"type":"string"},"mergedFromStudentID":{"type":"string"},"mergedToPen":{"type":"string"},"mergedToStudentID":{"type":"string"}}},"SplitPenSagaData":{"required":["historyActivityCode","newStudent"],"type":"object","properties":{"studentID":{"type":"string"},"pen":{"type":"string"},"legalFirstName":{"type":"string"},"legalMiddleNames":{"type":"string"},"legalLastName":{"type":"string"},"dob":{"type":"string"},"sexCode":{"type":"string"},"genderCode":{"type":"string"},"usualFirstName":{"type":"string"},"usualMiddleNames":{"type":"string"},"usualLastName":{"type":"string"},"email":{"type":"string"},"deceasedDate":{"type":"string"},"createUser":{"type":"string"},"updateUser":{"type":"string"},"localID":{"type":"string"},"postalCode":{"type":"string"},"gradeCode":{"type":"string"},"mincode":{"type":"string"},"emailVerified":{"type":"string"},"gradeYear":{"type":"string"},"demogCode":{"type":"string"},"statusCode":{"type":"string"},"memo":{"type":"string"},"historyActivityCode":{"type":"string"},"trueStudentID":{"type":"string"},"documentTypeCode":{"type":"string"},"dateOfConfirmation":{"type":"string"},"requestStudentID":{"type":"string"},"newStudent":{"$ref":"#/components/schemas/StudentSagaData"}}},"StudentSagaData":{"type":"object","properties":{"studentID":{"type":"string"},"pen":{"type":"string"},"legalFirstName":{"type":"string"},"legalMiddleNames":{"type":"string"},"legalLastName":{"type":"string"},"dob":{"type":"string"},"sexCode":{"type":"string"},"genderCode":{"type":"string"},"usualFirstName":{"type":"string"},"usualMiddleNames":{"type":"string"},"usualLastName":{"type":"string"},"email":{"type":"string"},"deceasedDate":{"type":"string"},"createUser":{"type":"string"},"updateUser":{"type":"string"},"localID":{"type":"string"},"postalCode":{"type":"string"},"gradeCode":{"type":"string"},"mincode":{"type":"string"},"emailVerified":{"type":"string"},"gradeYear":{"type":"string"},"demogCode":{"type":"string"},"statusCode":{"type":"string"},"memo":{"type":"string"},"historyActivityCode":{"type":"string"},"trueStudentID":{"type":"string"},"documentTypeCode":{"type":"string"},"dateOfConfirmation":{"type":"string"}}},"MoveMultipleSldSagaData":{"required":["createUser","moveSldSagaData","movedToPen","studentID"],"type":"object","properties":{"moveSldSagaData":{"type":"array","items":{"$ref":"#/components/schemas/MoveSldSagaData"}},"movedToPen":{"type":"string"},"studentID":{"type":"string"},"createUser":{"type":"string"}}},"MoveSldSagaData":{"required":["distNo","pen","reportDate","schlNo","studentId"],"type":"object","properties":{"pen":{"type":"string"},"distNo":{"type":"string"},"schlNo":{"type":"string"},"reportDate":{"type":"integer","format":"int64"},"studentId":{"type":"string"}}},"StudentMerge":{"required":["mergeStudentID","studentID","studentMergeDirectionCode","studentMergeSourceCode"],"type":"object","properties":{"createUser":{"maxLength":100,"minLength":0,"type":"string"},"updateUser":{"maxLength":100,"minLength":0,"type":"string"},"createDate":{"type":"string"},"updateDate":{"type":"string"},"studentMergeID":{"type":"string"},"studentID":{"type":"string"},"mergeStudentID":{"type":"string"},"studentMergeDirectionCode":{"type":"string"},"studentMergeSourceCode":{"type":"string"}}},"PenRequestBatchStudentValidationIssueTypeCode":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"displayOrder":{"type":"integer","format":"int32"},"effectiveDate":{"type":"string"},"expiryDate":{"type":"string"}}},"PenRequestBatchStudentValidationIssueSeverityCode":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"displayOrder":{"type":"integer","format":"int32"},"effectiveDate":{"type":"string"},"expiryDate":{"type":"string"}}},"PenRequestBatchStudentValidationFieldCode":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"displayOrder":{"type":"integer","format":"int32"},"effectiveDate":{"type":"string"},"expiryDate":{"type":"string"}}},"Saga":{"type":"object","properties":{"sagaId":{"type":"string","format":"uuid"},"studentID":{"type":"string","format":"uuid"},"sagaName":{"type":"string"},"sagaState":{"type":"string"},"payload":{"type":"string"},"status":{"type":"string"},"createUser":{"type":"string"},"updateUser":{"type":"string"},"createDate":{"type":"string"},"updateDate":{"type":"string"},"retryCount":{"type":"integer","format":"int32"}}},"StudentMergeStats":{"type":"object","properties":{"numberOfMergesInLastMonths":{"type":"object","additionalProperties":{"type":"integer","format":"int64"}}}},"StudentMergeSourceCode":{"type":"object","properties":{"mergeSourceCode":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"displayOrder":{"type":"integer","format":"int32"},"effectiveDate":{"type":"string"},"expiryDate":{"type":"string"}}}}}}