Skip to content

Commit c0a99de

Browse files
committed
ECER-5118: Merge branch 'master' into stories/ecer-5118 and resolve merge conflicts
2 parents 7f17145 + 96db3d9 commit c0a99de

25 files changed

+970
-20
lines changed

src/ECER.Clients.RegistryPortal/ECER.Clients.RegistryPortal.Server/ICRA/ICRAEligibilityMapper.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public ICRAEligibilityMapper()
1313
CreateMap<InternationalCertification, Managers.Registry.Contract.ICRA.InternationalCertification>()
1414
.ReverseMap();
1515
CreateMap<EmploymentReference, Managers.Registry.Contract.ICRA.EmploymentReference>()
16+
.ForMember(dest => dest.Type, opt => opt.Ignore())
1617
.ForMember(d => d.Status, o => o.Ignore())
1718
.ForMember(d => d.WillProvideReference, o => o.Ignore())
1819
.ReverseMap();
@@ -26,5 +27,6 @@ public ICRAEligibilityMapper()
2627
.ForCtorParam(nameof(EmploymentReference.EmailAddress), o => o.MapFrom(s => s.EmailAddress))
2728
.ForMember(d => d.PhoneNumber, o => o.MapFrom(s => s.PhoneNumber))
2829
.ForMember(d => d.WillProvideReference, o => o.MapFrom(s => s.WillProvideReference));
30+
2931
}
3032
}

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/api/reference.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ const postWorkExperienceReference = async (
4949
});
5050
};
5151

52+
const postIcraEligibilityWorkExperienceReference = async (
53+
icraEligibilityWorkExperienceSubmission: Components.Schemas.ICRAWorkExperienceReferenceSubmissionRequest,
54+
): Promise<ApiResponse<any>> => {
55+
const client = await getClient();
56+
return apiResultHandler.execute({
57+
request: client.icra_workExperience_reference_post(null, icraEligibilityWorkExperienceSubmission),
58+
key: "icra_workExperience_reference_post",
59+
});
60+
};
61+
5262
const resendCharacterReference = async (params: Paths.ApplicationCharacterReferenceResendInvitePost.PathParameters): Promise<ApiResponse<any>> => {
5363
const client = await getClient();
5464
return apiResultHandler.execute({
@@ -92,6 +102,7 @@ export {
92102
optOutReference,
93103
postCharacterReference,
94104
postWorkExperienceReference,
105+
postIcraEligibilityWorkExperienceReference,
95106
resendCharacterReference,
96107
resendWorkExperienceReference,
97108
upsertCharacterReference,

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceDateInput.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ export default defineComponent({
4444
* @param value - JS date value as a string
4545
*/
4646
updateModelValue(value: Date) {
47+
//allows the ability to clear the date if necessary
48+
if (!value) {
49+
this.$emit("update:model-value", undefined);
50+
return;
51+
}
4752
const luxonDate = DateTime.fromJSDate(new Date(value));
4853
const formattedDate = luxonDate.toFormat("yyyy-MM-dd");
4954
this.$emit("update:model-value", formattedDate);

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceEmploymentExperience.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export default defineComponent({
252252
async handleDelete(_reference: Components.Schemas.EmploymentReference, index: number) {
253253
this.$emit("update:model-value", removeElementByIndex(this.modelValue, index));
254254
255-
// await this.icraStore.saveDraft();
255+
await this.icraStore.saveDraft();
256256
257257
this.alertStore.setSuccessAlert("You have deleted your reference.");
258258
},

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceInternationalCertification.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@ export default defineComponent({
377377
onlineCertificateValidationToolOfRegulatoryAuthority: "",
378378
certificateStatus: "Expired",
379379
certificateTitle: "",
380-
issueDate: "",
381-
expiryDate: "",
380+
issueDate: undefined,
381+
expiryDate: undefined,
382382
files: [],
383383
newFiles: [],
384384
deletedFiles: [],
@@ -627,8 +627,8 @@ export default defineComponent({
627627
this.onlineCertificateValidationToolOfRegulatoryAuthority = "";
628628
this.certificateStatus = undefined;
629629
this.certificateTitle = "";
630-
this.issueDate = "";
631-
this.expiryDate = "";
630+
this.issueDate = undefined;
631+
this.expiryDate = undefined;
632632
this.files = [];
633633
this.newFiles = [];
634634
this.deletedFiles = [];

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/reference/Reference.vue

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
<v-btn
4545
v-else-if="wizardStore.step === userReviewStep"
4646
:loading="
47-
wizardStore.wizardData.inviteType === PortalInviteType.CHARACTER
48-
? loadingStore.isLoading('character_reference_post')
49-
: loadingStore.isLoading('workExperience_reference_post')
47+
loadingStore.isLoading('character_reference_post') ||
48+
loadingStore.isLoading('workExperience_reference_post') ||
49+
loadingStore.isLoading('icra_workExperience_reference_post')
5050
"
5151
rounded="lg"
5252
variant="flat"
@@ -67,10 +67,17 @@
6767
import { defineComponent } from "vue";
6868
import { useRoute, useRouter } from "vue-router";
6969
70-
import { getReference, optOutReference, postCharacterReference, postWorkExperienceReference } from "@/api/reference";
70+
import {
71+
getReference,
72+
optOutReference,
73+
postCharacterReference,
74+
postWorkExperienceReference,
75+
postIcraEligibilityWorkExperienceReference,
76+
} from "@/api/reference";
7177
import characterReferenceWizard from "@/config/character-reference-wizard";
7278
import workExperienceReference400HoursWizard from "@/config/work-experience-reference-400-hours-wizard";
7379
import workExperienceReferenceWizard from "@/config/work-experience-reference-wizard";
80+
import IcraEligibilityWorkExperienceReferenceWizard from "@/config/icra-eligibility/icra-eligibility-work-experience-reference-wizard";
7481
import { useAlertStore } from "@/store/alert";
7582
import { useLoadingStore } from "@/store/loading";
7683
import { useWizardStore } from "@/store/wizard";
@@ -112,6 +119,9 @@ export default defineComponent({
112119
} else if (data?.portalInvitation?.inviteType === PortalInviteType.CHARACTER) {
113120
wizardStore.initializeWizardForCharacterReference(characterReferenceWizard, data.portalInvitation);
114121
wizardConfigSetup = characterReferenceWizard;
122+
} else if (data?.portalInvitation?.inviteType === PortalInviteType.ICRA_WORK_EXPERIENCE) {
123+
wizardStore.initializeWizardForWorkExReferenceIcraEligibility(IcraEligibilityWorkExperienceReferenceWizard, data.portalInvitation);
124+
wizardConfigSetup = IcraEligibilityWorkExperienceReferenceWizard;
115125
}
116126
return {
117127
alertStore,
@@ -137,7 +147,16 @@ export default defineComponent({
137147
return this.wizardStore.steps.findIndex((step) => step.stage === "Review") + 1;
138148
},
139149
inviteTypeTitle(): string {
140-
return this.wizardStore.wizardData?.inviteType === PortalInviteType.WORK_EXPERIENCE ? "Work experience reference" : "Character reference";
150+
switch (this.wizardStore.wizardData?.inviteType) {
151+
case PortalInviteType.CHARACTER:
152+
return "Character reference";
153+
case PortalInviteType.WORK_EXPERIENCE:
154+
return "Work experience reference";
155+
case PortalInviteType.ICRA_WORK_EXPERIENCE:
156+
return "Employment verification";
157+
default:
158+
return `Unhandled portal invite type ${this.wizardStore.wizardData?.inviteType}`;
159+
}
141160
},
142161
},
143162
watch: {
@@ -187,6 +206,19 @@ export default defineComponent({
187206
return;
188207
}
189208
209+
switch (this.wizardStore.wizardData.inviteType) {
210+
case PortalInviteType.CHARACTER:
211+
case PortalInviteType.WORK_EXPERIENCE:
212+
await this.handleSubmitReferenceFlow();
213+
break;
214+
case PortalInviteType.ICRA_WORK_EXPERIENCE:
215+
await this.handleSubmitIcraEligibilityReferenceFlow();
216+
break;
217+
default:
218+
this.alertStore.setFailureAlert(`Unhandled portal invite type ${this.wizardStore.wizardData?.inviteType}`);
219+
}
220+
},
221+
async handleSubmitReferenceFlow() {
190222
if (this.wizardStore.wizardData.inviteType === PortalInviteType.CHARACTER) {
191223
const response = await postCharacterReference({
192224
token: this.route.params.token as string,
@@ -248,6 +280,39 @@ export default defineComponent({
248280
}
249281
}
250282
},
283+
async handleSubmitIcraEligibilityReferenceFlow() {
284+
const icraEligibilityContact =
285+
this.wizardStore.wizardData[
286+
this.wizardStore?.wizardConfig?.steps?.contactInformation?.form?.inputs?.icraEligibilityWorkExperienceContactInformation?.id || ""
287+
];
288+
289+
const icraWorkExperienceEvaluation =
290+
this.wizardStore.wizardData[this.wizardStore?.wizardConfig?.steps?.workExperienceEvaluation?.form?.inputs?.workExperienceEvaluation?.id || ""];
291+
292+
const response = await postIcraEligibilityWorkExperienceReference({
293+
token: this.route.params.token as string,
294+
willProvideReference: this.wizardStore.wizardData[this.wizardStore?.wizardConfig?.steps?.declaration?.form?.inputs?.willProvideReference?.id || ""],
295+
recaptchaToken: this.wizardStore.wizardData[this.wizardStore?.wizardConfig?.steps?.review?.form?.inputs?.recaptchaToken?.id || ""],
296+
//contact step
297+
firstName: icraEligibilityContact.firstName,
298+
lastName: icraEligibilityContact.lastName,
299+
emailAddress: icraEligibilityContact.email,
300+
phoneNumber: icraEligibilityContact.phoneNumber,
301+
//work experience evaluation step
302+
countryId: icraWorkExperienceEvaluation.countryId,
303+
employerName: icraWorkExperienceEvaluation.employerName,
304+
positionTitle: icraWorkExperienceEvaluation.positionTitle,
305+
startDate: icraWorkExperienceEvaluation.startDate,
306+
endDate: icraWorkExperienceEvaluation.endDate,
307+
workedWithChildren: icraWorkExperienceEvaluation.workedWithChildren,
308+
childcareAgeRanges: icraWorkExperienceEvaluation.childcareAgeRanges,
309+
referenceRelationship: icraWorkExperienceEvaluation.referenceRelationship,
310+
});
311+
312+
if (!response?.error) {
313+
this.router.push({ path: "/reference-submitted" });
314+
}
315+
},
251316
async handleDecline() {
252317
const currentStepFormId = this.wizardStore.currentStep.form.id;
253318
const formRef = (this.$refs.wizard as typeof Wizard).$refs[currentStepFormId][0].$refs[currentStepFormId];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<template>
2+
<v-row>
3+
<v-col cols="12" md="12" lg="12" xl="12">
4+
<h2>Contact information</h2>
5+
<div role="doc-subtitle">We may contact you to verify or clarify information you provide.</div>
6+
<v-row class="mt-5">
7+
<v-col cols="12" md="8" lg="6" xl="4">
8+
<EceTextField
9+
id="lastNameTextInput"
10+
:model-value="modelValue.lastName"
11+
:rules="[Rules.required('Enter your last name')]"
12+
label="Last Name"
13+
autocomplete="family-name"
14+
maxlength="100"
15+
@input="updateField('lastName', $event)"
16+
/>
17+
</v-col>
18+
</v-row>
19+
<v-row>
20+
<v-col cols="12" md="8" lg="6" xl="4">
21+
<EceTextField
22+
id="firstNameTextInput"
23+
:model-value="modelValue.firstName"
24+
label="First Name"
25+
autocomplete="given-name"
26+
maxlength="100"
27+
@input="updateField('firstName', $event)"
28+
/>
29+
</v-col>
30+
</v-row>
31+
<v-row>
32+
<v-col cols="12" md="8" lg="6" xl="4">
33+
<EceTextField
34+
id="emailTextInput"
35+
:model-value="modelValue.email"
36+
:rules="[Rules.required(), Rules.email('Enter your email in the format \'[email protected]\'')]"
37+
label="Email"
38+
autocomplete="email"
39+
maxlength="200"
40+
@input="updateField('email', $event)"
41+
/>
42+
</v-col>
43+
</v-row>
44+
<v-row>
45+
<v-col cols="12" md="8" lg="6" xl="4">
46+
<EceTextField
47+
id="phoneNumberTextInput"
48+
:model-value="modelValue.phoneNumber"
49+
:rules="[Rules.required('Enter a phone number'), Rules.phoneNumber('Enter your valid phone number')]"
50+
label="Phone Number"
51+
autocomplete="tel"
52+
@input="updateField('phoneNumber', $event)"
53+
></EceTextField>
54+
</v-col>
55+
</v-row>
56+
</v-col>
57+
</v-row>
58+
</template>
59+
60+
<script lang="ts">
61+
import { defineComponent } from "vue";
62+
63+
import EceTextField from "@/components/inputs/EceTextField.vue";
64+
import type { Components } from "@/types/openapi";
65+
import { isNumber } from "@/utils/formInput";
66+
import * as Rules from "@/utils/formRules";
67+
68+
export default defineComponent({
69+
name: "EceIcraEligibilityWorkExperienceContact",
70+
components: { EceTextField },
71+
props: {
72+
modelValue: {
73+
type: Object as () => Components.Schemas.ReferenceContactInformation,
74+
required: true,
75+
},
76+
},
77+
emits: {
78+
"update:model-value": (_contactInformationData: Components.Schemas.ReferenceContactInformation) => true,
79+
},
80+
setup() {},
81+
data() {
82+
return {
83+
Rules,
84+
};
85+
},
86+
methods: {
87+
isNumber,
88+
updateField(fieldName: keyof Components.Schemas.ReferenceContactInformation, value: any) {
89+
this.$emit("update:model-value", {
90+
...this.modelValue,
91+
[fieldName]: value,
92+
});
93+
},
94+
},
95+
});
96+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<template>
2+
<ReferencePreviewCard :is-valid="true" title="Your contact information" reference-stage="ContactInformation">
3+
<template #content>
4+
<v-row>
5+
<v-col cols="4">
6+
<p class="small">Last Name</p>
7+
</v-col>
8+
<v-col cols="8">
9+
<p class="small font-weight-bold">{{ reference.lastName }}</p>
10+
</v-col>
11+
</v-row>
12+
<v-row>
13+
<v-col cols="4">
14+
<p class="small">First Name</p>
15+
</v-col>
16+
<v-col cols="8">
17+
<p class="small font-weight-bold">{{ reference.firstName }}</p>
18+
</v-col>
19+
</v-row>
20+
<v-row>
21+
<v-col cols="4">
22+
<p class="small">Email</p>
23+
</v-col>
24+
<v-col cols="8">
25+
<p class="small font-weight-bold">{{ reference.email }}</p>
26+
</v-col>
27+
</v-row>
28+
<v-row>
29+
<v-col cols="4">
30+
<p class="small">Phone Number</p>
31+
</v-col>
32+
<v-col cols="8">
33+
<p class="small font-weight-bold">{{ reference.phoneNumber }}</p>
34+
</v-col>
35+
</v-row>
36+
</template>
37+
</ReferencePreviewCard>
38+
</template>
39+
40+
<script lang="ts">
41+
import { defineComponent } from "vue";
42+
43+
import ReferencePreviewCard from "@/components/reference/inputs/ReferencePreviewCard.vue";
44+
import { useConfigStore } from "@/store/config";
45+
import { useWizardStore } from "@/store/wizard";
46+
import type { Components } from "@/types/openapi";
47+
import { formatDate } from "@/utils/format";
48+
49+
export default defineComponent({
50+
name: "EceIcraEligibilityWorkExperienceContactPreview",
51+
components: {
52+
ReferencePreviewCard,
53+
},
54+
setup: () => {
55+
const wizardStore = useWizardStore();
56+
const configStore = useConfigStore();
57+
return {
58+
wizardStore,
59+
configStore,
60+
};
61+
},
62+
computed: {
63+
reference(): Components.Schemas.ReferenceContactInformation {
64+
return {
65+
firstName:
66+
this.wizardStore.wizardData[
67+
this.wizardStore?.wizardConfig?.steps?.contactInformation?.form?.inputs?.icraEligibilityWorkExperienceContactInformation?.id || ""
68+
]?.firstName,
69+
lastName:
70+
this.wizardStore.wizardData[
71+
this.wizardStore?.wizardConfig?.steps?.contactInformation?.form?.inputs?.icraEligibilityWorkExperienceContactInformation?.id || ""
72+
]?.lastName,
73+
email:
74+
this.wizardStore.wizardData[
75+
this.wizardStore?.wizardConfig?.steps?.contactInformation?.form?.inputs?.icraEligibilityWorkExperienceContactInformation?.id || ""
76+
]?.email,
77+
phoneNumber:
78+
this.wizardStore.wizardData[
79+
this.wizardStore?.wizardConfig?.steps?.contactInformation?.form?.inputs?.icraEligibilityWorkExperienceContactInformation?.id || ""
80+
]?.phoneNumber,
81+
};
82+
},
83+
},
84+
methods: {
85+
formatDate,
86+
},
87+
});
88+
</script>

0 commit comments

Comments
 (0)