From 07af3c27f8307cd58e7119005364a2ec111c34c2 Mon Sep 17 00:00:00 2001 From: Nitin Hegde <165893206+hegdenitin@users.noreply.github.com> Date: Fri, 13 Sep 2024 13:45:49 +0530 Subject: [PATCH] MOSIP-33486 Prereg new APIs (#721) * MOSIP-33486 Prereg new APIs Signed-off-by: NitinHegde * MOSIP-33486 Prereg new APIs Signed-off-by: NitinHegde --------- Signed-off-by: NitinHegde --- .../FetchAvailabilityData.yml | 31 ++++++++++++++++ .../fetchAvailabilityData.hbs | 3 ++ .../fetchAvailabilityDataResult.hbs | 5 +++ .../GetApplicationStatusByApplicationID.yml | 32 +++++++++++++++++ .../getApplicationStatusByApplicationID.hbs | 3 ++ ...ApplicationStatusByApplicationIDResult.hbs | 3 ++ .../GetApplicationsApplicationID.yml | 32 +++++++++++++++++ .../getApplicationsApplicationID.hbs | 3 ++ .../getApplicationsApplicationIDResult.hbs | 5 +++ .../GetPreRegDemographicDataByPrid.yml | 35 +++++++++++++++++++ .../getPreRegDemographicDataByPrid.hbs | 3 ++ .../getPreRegDemographicDataByPridResult.hbs | 11 ++++++ .../preReg/createPrereg/createPrereg.yml | 21 +++++++++++ apitest/testNgXmlFiles/preregApi.xml | 29 ++++++++++++++- 14 files changed, 215 insertions(+), 1 deletion(-) create mode 100644 apitest/src/main/resources/preReg/FetchAvailabilityData/FetchAvailabilityData.yml create mode 100644 apitest/src/main/resources/preReg/FetchAvailabilityData/fetchAvailabilityData.hbs create mode 100644 apitest/src/main/resources/preReg/FetchAvailabilityData/fetchAvailabilityDataResult.hbs create mode 100644 apitest/src/main/resources/preReg/GetApplicationStatusByApplicationID/GetApplicationStatusByApplicationID.yml create mode 100644 apitest/src/main/resources/preReg/GetApplicationStatusByApplicationID/getApplicationStatusByApplicationID.hbs create mode 100644 apitest/src/main/resources/preReg/GetApplicationStatusByApplicationID/getApplicationStatusByApplicationIDResult.hbs create mode 100644 apitest/src/main/resources/preReg/GetApplicationsApplicationID/GetApplicationsApplicationID.yml create mode 100644 apitest/src/main/resources/preReg/GetApplicationsApplicationID/getApplicationsApplicationID.hbs create mode 100644 apitest/src/main/resources/preReg/GetApplicationsApplicationID/getApplicationsApplicationIDResult.hbs create mode 100644 apitest/src/main/resources/preReg/GetPreRegDemographicDataByPrid/GetPreRegDemographicDataByPrid.yml create mode 100644 apitest/src/main/resources/preReg/GetPreRegDemographicDataByPrid/getPreRegDemographicDataByPrid.hbs create mode 100644 apitest/src/main/resources/preReg/GetPreRegDemographicDataByPrid/getPreRegDemographicDataByPridResult.hbs diff --git a/apitest/src/main/resources/preReg/FetchAvailabilityData/FetchAvailabilityData.yml b/apitest/src/main/resources/preReg/FetchAvailabilityData/FetchAvailabilityData.yml new file mode 100644 index 0000000000..275effbd61 --- /dev/null +++ b/apitest/src/main/resources/preReg/FetchAvailabilityData/FetchAvailabilityData.yml @@ -0,0 +1,31 @@ +FetchAvailabilityDataByCenterID: + Prereg_FetchAvailabilityDataByCenterID_All_Valid_Smoke_sid: + endPoint: /preregistration/v1/applications/appointment/slots/availability/10003 + description: Fetch the available data by center ID + role: batch + restMethod: get + inputTemplate: preReg/FetchAvailabilityData/fetchAvailabilityData + outputTemplate: preReg/FetchAvailabilityData/fetchAvailabilityDataResult + input: '{ + "registrationCenterId": "10003" +}' + output: '{ + "regCenterId": "10003" +}' + Prereg_FetchAvailabilityData_inValid_CenterID_Smoke_sid: + endPoint: /preregistration/v1/applications/appointment/slots/availability/{registrationCenterId} + description: Fetch the available data by invalid center ID + role: batch + restMethod: get + inputTemplate: preReg/FetchAvailabilityData/fetchAvailabilityData + outputTemplate: preReg/error + input: '{ + "registrationCenterId": "@#@$W#" +}' + output: '{ + "errors": [ + { + "errorCode": "KER-MSD-215" + } + ] +}' \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/FetchAvailabilityData/fetchAvailabilityData.hbs b/apitest/src/main/resources/preReg/FetchAvailabilityData/fetchAvailabilityData.hbs new file mode 100644 index 0000000000..38c9e50ee9 --- /dev/null +++ b/apitest/src/main/resources/preReg/FetchAvailabilityData/fetchAvailabilityData.hbs @@ -0,0 +1,3 @@ +{ + "registrationCenterId": "{{registrationCenterId}}" +} \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/FetchAvailabilityData/fetchAvailabilityDataResult.hbs b/apitest/src/main/resources/preReg/FetchAvailabilityData/fetchAvailabilityDataResult.hbs new file mode 100644 index 0000000000..7bfbbb9a10 --- /dev/null +++ b/apitest/src/main/resources/preReg/FetchAvailabilityData/fetchAvailabilityDataResult.hbs @@ -0,0 +1,5 @@ +{ + "response": { + "regCenterId": "{{regCenterId}}" + } +} \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/GetApplicationStatusByApplicationID/GetApplicationStatusByApplicationID.yml b/apitest/src/main/resources/preReg/GetApplicationStatusByApplicationID/GetApplicationStatusByApplicationID.yml new file mode 100644 index 0000000000..699c47f303 --- /dev/null +++ b/apitest/src/main/resources/preReg/GetApplicationStatusByApplicationID/GetApplicationStatusByApplicationID.yml @@ -0,0 +1,32 @@ +GetApplicationStatusByApplicationID: + Prereg_GetApplicationStatusByApplicationID_All_Valid_Smoke_sid: + endPoint: /preregistration/v1/applications/status/{applicationId} + description: Retrieve the application status by application ID + role: batch + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: preReg/GetApplicationStatusByApplicationID/getApplicationStatusByApplicationID + outputTemplate: preReg/GetApplicationStatusByApplicationID/getApplicationStatusByApplicationIDResult + input: '{ + "applicationId": "52917592714578" +}' + output: '{ + "response": "Cancelled" +}' + Prereg_GetApplicationStatusByApplicationID_InValid_applicationId: + endPoint: /preregistration/v1/applications/status/{applicationId} + description: Retrieve the application status by invalid application ID + role: batch + restMethod: get + inputTemplate: preReg/GetApplicationStatusByApplicationID/getApplicationStatusByApplicationID + outputTemplate: preReg/error + input: '{ + "applicationId": "erwsdhgqw5dcfbz" +}' + output: '{ + "errors": [ + { + "errorCode": "PRG_APP_013" + } + ] +}' \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/GetApplicationStatusByApplicationID/getApplicationStatusByApplicationID.hbs b/apitest/src/main/resources/preReg/GetApplicationStatusByApplicationID/getApplicationStatusByApplicationID.hbs new file mode 100644 index 0000000000..95f5a367e5 --- /dev/null +++ b/apitest/src/main/resources/preReg/GetApplicationStatusByApplicationID/getApplicationStatusByApplicationID.hbs @@ -0,0 +1,3 @@ +{ + "applicationId": "{{applicationId}}" +} \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/GetApplicationStatusByApplicationID/getApplicationStatusByApplicationIDResult.hbs b/apitest/src/main/resources/preReg/GetApplicationStatusByApplicationID/getApplicationStatusByApplicationIDResult.hbs new file mode 100644 index 0000000000..eb8d6fea9a --- /dev/null +++ b/apitest/src/main/resources/preReg/GetApplicationStatusByApplicationID/getApplicationStatusByApplicationIDResult.hbs @@ -0,0 +1,3 @@ +{ + "response": "{{response}}" +} \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/GetApplicationsApplicationID/GetApplicationsApplicationID.yml b/apitest/src/main/resources/preReg/GetApplicationsApplicationID/GetApplicationsApplicationID.yml new file mode 100644 index 0000000000..83b927cb94 --- /dev/null +++ b/apitest/src/main/resources/preReg/GetApplicationsApplicationID/GetApplicationsApplicationID.yml @@ -0,0 +1,32 @@ +GetApplicationsApplicationID: + Prereg_GetApplicationsApplicationID_All_Valid_Smoke_sid: + endPoint: /preregistration/v1/applications/{applicationId} + description: Retrieve the application by application ID + role: batch + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: preReg/GetApplicationsApplicationID/getApplicationsApplicationID + outputTemplate: preReg/GetApplicationsApplicationID/getApplicationsApplicationIDResult + input: '{ + "applicationId": "52917592714578" +}' + output: '{ + "applicationId": "52917592714578" +}' + Prereg_GetApplicationsApplicationID_InValid_applicationID: + endPoint: /preregistration/v1/applications/{applicationId} + description: Retrieve the application by invalid application ID + role: batch + restMethod: get + inputTemplate: preReg/GetApplicationsApplicationID/getApplicationsApplicationID + outputTemplate: preReg/error + input: '{ + "applicationId": "erwsdhgqw5dcfbz" +}' + output: '{ + "errors": [ + { + "errorCode": "PRG_APP_013" + } + ] +}' \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/GetApplicationsApplicationID/getApplicationsApplicationID.hbs b/apitest/src/main/resources/preReg/GetApplicationsApplicationID/getApplicationsApplicationID.hbs new file mode 100644 index 0000000000..95f5a367e5 --- /dev/null +++ b/apitest/src/main/resources/preReg/GetApplicationsApplicationID/getApplicationsApplicationID.hbs @@ -0,0 +1,3 @@ +{ + "applicationId": "{{applicationId}}" +} \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/GetApplicationsApplicationID/getApplicationsApplicationIDResult.hbs b/apitest/src/main/resources/preReg/GetApplicationsApplicationID/getApplicationsApplicationIDResult.hbs new file mode 100644 index 0000000000..24fe17af94 --- /dev/null +++ b/apitest/src/main/resources/preReg/GetApplicationsApplicationID/getApplicationsApplicationIDResult.hbs @@ -0,0 +1,5 @@ +{ + "response": { + "applicationId": "{{applicationId}}" + } +} \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/GetPreRegDemographicDataByPrid/GetPreRegDemographicDataByPrid.yml b/apitest/src/main/resources/preReg/GetPreRegDemographicDataByPrid/GetPreRegDemographicDataByPrid.yml new file mode 100644 index 0000000000..49bd14ccb9 --- /dev/null +++ b/apitest/src/main/resources/preReg/GetPreRegDemographicDataByPrid/GetPreRegDemographicDataByPrid.yml @@ -0,0 +1,35 @@ +GetPreRegDemographicDataByPrid: + Prereg_GetPreRegDemographicDataByPrid_Valid_preRegistrationId: + endPoint: /preregistration/v1/applications/prereg/{preRegistrationId} + description: Retrieve the PreReg demographic data by PRID + role: batch + restMethod: get + inputTemplate: preReg/GetPreRegDemographicDataByPrid/getPreRegDemographicDataByPrid + outputTemplate: preReg/GetPreRegDemographicDataByPrid/getPreRegDemographicDataByPridResult + input: '{ + "preRegistrationId": "$ID:CreatePrereg_Smoke_PreRegDemographicData_sid_preRegistrationId$" +}' + output: '{ + "preRegistrationId": "$ID:CreatePrereg_Smoke_PreRegDemographicData_sid_preRegistrationId$", + "postalCode":"14022", + "dateOfBirth": "$IGNORE$", + "IDSchemaVersion": "$IGNORE$", + "phone": "$IGNORE$" +}' + Prereg_GetPreRegDemographicDataByPrid_inValid_preRegistrationId: + endPoint: /preregistration/v1/applications/prereg/info/{preRegistrationId} + description: Retrieve the PreReg demographic data by invalid PRID + role: batch + restMethod: get + inputTemplate: preReg/GetPreRegDemographicDataByPrid/getPreRegDemographicDataByPrid + outputTemplate: preReg/error + input: '{ + "preRegistrationId": "123456" +}' + output: '{ + "errors": [ + { + "errorCode": "PRG_PAM_APP_005" + } + ] +}' \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/GetPreRegDemographicDataByPrid/getPreRegDemographicDataByPrid.hbs b/apitest/src/main/resources/preReg/GetPreRegDemographicDataByPrid/getPreRegDemographicDataByPrid.hbs new file mode 100644 index 0000000000..790ad2f299 --- /dev/null +++ b/apitest/src/main/resources/preReg/GetPreRegDemographicDataByPrid/getPreRegDemographicDataByPrid.hbs @@ -0,0 +1,3 @@ +{ + "preRegistrationId": "{{preRegistrationId}}" +} \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/GetPreRegDemographicDataByPrid/getPreRegDemographicDataByPridResult.hbs b/apitest/src/main/resources/preReg/GetPreRegDemographicDataByPrid/getPreRegDemographicDataByPridResult.hbs new file mode 100644 index 0000000000..3f14f25249 --- /dev/null +++ b/apitest/src/main/resources/preReg/GetPreRegDemographicDataByPrid/getPreRegDemographicDataByPridResult.hbs @@ -0,0 +1,11 @@ +{ + "response": { + "demographicDetails": { + "identity": { + "postalCode": "14022", + "dateOfBirth": "1996/01/01", + "phone": "8249742850" + } + } + } +} \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/createPrereg/createPrereg.yml b/apitest/src/main/resources/preReg/createPrereg/createPrereg.yml index 6dbd6ff5ed..aee7974e46 100644 --- a/apitest/src/main/resources/preReg/createPrereg/createPrereg.yml +++ b/apitest/src/main/resources/preReg/createPrereg/createPrereg.yml @@ -673,4 +673,25 @@ CreatePrereg: "id": "mosip.pre-registration.demographic.create" }' output: '{ +}' + Prereg_CreatePrereg_Smoke_PreRegDemographicData_sid: + endPoint: /preregistration/v1/applications/prereg + description: Creating preregistration appointment using PRID for demographic data + role: batch + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: preReg/createPrereg/createPrereg + outputTemplate: preReg/createPrereg/createPreregResult + input: '{ + "postalCode": "14022", + "phone": "8249742850", + "email": "goku@technoforte.co.in", + "IDSchemaVersion": $SCHEMAVERSION$, + "dateOfBirth": "1996/01/01", + "version": "1.0", + "langCode": "$1STLANG$", + "requesttime": "$TIMESTAMP$", + "id": "mosip.pre-registration.demographic.create" +}' + output: '{ }' \ No newline at end of file diff --git a/apitest/testNgXmlFiles/preregApi.xml b/apitest/testNgXmlFiles/preregApi.xml index 470faad4f3..45f92e0243 100644 --- a/apitest/testNgXmlFiles/preregApi.xml +++ b/apitest/testNgXmlFiles/preregApi.xml @@ -332,5 +332,32 @@ - + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file