Skip to content

Commit a747a76

Browse files
authored
Merge pull request #1578 from bcgov/merge/1.3.4-to-master
Merge/1.3.4 to master
2 parents 054e509 + 378332f commit a747a76

File tree

56 files changed

+3079
-320
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3079
-320
lines changed

src/ECER.Clients.RegistryPortal/ECER.Clients.RegistryPortal.Server/Applications/ApplicationsEndpoints.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void Register(IEndpointRouteBuilder endpointRouteBuilder)
5757
{
5858
return TypedResults.NotFound();
5959
}
60-
if (!result.IsSuccess && result.Error == SubmissionError.DraftApplicationValidationFailed)
60+
if (!result.IsSuccess && result.Error == SubmissionError.DraftApplicationValidationFailed || result.Error == SubmissionError.SubmittedApplicationAlreadyExists)
6161
{
6262
var problemDetails = new ProblemDetails
6363
{
@@ -67,6 +67,7 @@ public void Register(IEndpointRouteBuilder endpointRouteBuilder)
6767
};
6868
return TypedResults.BadRequest(problemDetails);
6969
}
70+
7071
return TypedResults.Ok(new SubmitApplicationResponse(mapper.Map<Application>(result.Application)));
7172
})
7273
.WithOpenApi("Submit an application", string.Empty, "application_post")
@@ -486,7 +487,7 @@ public enum ApplicationStatus
486487
PendingQueue,
487488
PendingPSPConsultationNeeded,
488489
ReconsiderationDecision,
489-
AppealDecision
490+
AppealDecision,
490491
}
491492

492493
public enum ApplicationOrigin

src/ECER.Clients.RegistryPortal/ECER.Clients.RegistryPortal.Server/Communications/CommunicationsEndpoints.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ public enum InitiatedFrom
156156
Investigation,
157157
PortalUser,
158158
Registry,
159+
ProgramRepresentative,
159160
}
160161

161162
public enum CommunicationStatus

src/ECER.Clients.RegistryPortal/ECER.Clients.RegistryPortal.Server/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"BaseUri": "'self'",
4848
"DefaultSource": "'self'",
4949
"ScriptSource": "'self' 'unsafe-inline' 'unsafe-eval' https://www.recaptcha.net/recaptcha/ https://www.gstatic.com/recaptcha/",
50-
"ConnectSource": "'self' https://loginproxy.gov.bc.ca/ https://id.gov.bc.ca/",
50+
"ConnectSource": "'self' https://loginproxy.gov.bc.ca/ https://id.gov.bc.ca/ https://www.recaptcha.net/recaptcha/",
5151
"ImageSource": "'self' data:",
5252
"StyleSource": "'self' 'unsafe-inline'",
5353
"FrameAncestors": "'self'",

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

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,12 @@
1111
<br />
1212
<ul class="ml-10">
1313
<li>Be relevant to the field of early childhood education</li>
14-
<li
15-
v-if="
16-
applicationStore.draftApplication.fromCertificate &&
17-
certificationStore.certificateStatus(applicationStore.draftApplication.fromCertificate) === 'Active'
18-
"
19-
>
14+
<li v-if="fromCertificate && fromCertificate.statusCode === 'Active'">
2015
{{
21-
`Have been completed within the term of your current certificate (Between ${formatDate(certificationStore.certificationEffectiveDate(applicationStore.draftApplication.fromCertificate) || "", "LLLL d, yyyy")} to ${formatDate(certificationStore.certificationExpiryDate(applicationStore.draftApplication.fromCertificate) || "", "LLLL d, yyyy")})`
16+
`Have been completed within the term of your current certificate (Between ${formatDate(fromCertificate?.effectiveDate || "", "LLLL d, yyyy")} to ${formatDate(fromCertificate?.expiryDate || "", "LLLL d, yyyy")})`
2217
}}
2318
</li>
24-
<li
25-
v-else-if="
26-
applicationStore.draftApplication.fromCertificate &&
27-
certificationStore.certificateStatus(applicationStore.draftApplication.fromCertificate) === 'Expired'
28-
"
29-
>
30-
Have been completed within the last 5 years
31-
</li>
19+
<li v-else-if="fromCertificate && fromCertificate.statusCode === 'Expired'">Have been completed within the last 5 years</li>
3220
</ul>
3321
</v-col>
3422
</v-row>
@@ -99,15 +87,15 @@ They should be able to confirm you completed the course or workshop."
9987
Rules.required('Enter the start date of your course or workshop'),
10088
Rules.futureDateNotAllowedRule(),
10189
Rules.conditionalWrapper(
102-
certificationStore.certificateStatus(applicationStore.draftApplication.fromCertificate) === 'Active',
90+
!!(fromCertificate && fromCertificate.statusCode === 'Active'),
10391
Rules.dateBetweenRule(
104-
certificationStore.certificationEffectiveDate(applicationStore.draftApplication.fromCertificate ?? '') || '',
105-
certificationStore.certificationExpiryDate(applicationStore.draftApplication.fromCertificate ?? '') || '',
92+
fromCertificate?.effectiveDate || '',
93+
fromCertificate?.expiryDate || '',
10694
'The start date of your course or workshop must be within the term of your current certificate',
10795
),
10896
),
10997
Rules.conditionalWrapper(
110-
certificationStore.certificateStatus(applicationStore.draftApplication.fromCertificate) === 'Expired',
98+
!!(fromCertificate && fromCertificate.statusCode === 'Expired'),
11199
Rules.dateRuleRange(
112100
applicationStore.draftApplication.createdOn || '',
113101
5,
@@ -132,15 +120,15 @@ They should be able to confirm you completed the course or workshop."
132120
Rules.futureDateNotAllowedRule(),
133121
Rules.dateBeforeRule(professionalDevelopment.startDate || ''),
134122
Rules.conditionalWrapper(
135-
certificationStore.certificateStatus(applicationStore.draftApplication.fromCertificate) === 'Active',
123+
!!(fromCertificate && fromCertificate.statusCode === 'Active'),
136124
Rules.dateBetweenRule(
137-
certificationStore.certificationEffectiveDate(applicationStore.draftApplication.fromCertificate ?? '') || '',
138-
certificationStore.certificationExpiryDate(applicationStore.draftApplication.fromCertificate ?? '') || '',
125+
fromCertificate?.effectiveDate || '',
126+
fromCertificate?.expiryDate || '',
139127
'The end date of your course or workshop must be within the term of your current certificate',
140128
),
141129
),
142130
Rules.conditionalWrapper(
143-
certificationStore.certificateStatus(applicationStore.draftApplication.fromCertificate) === 'Expired',
131+
!!(fromCertificate && fromCertificate.statusCode === 'Expired'),
144132
Rules.dateRuleRange(
145133
applicationStore.draftApplication.createdOn || '',
146134
5,
@@ -333,6 +321,9 @@ export default defineComponent({
333321
showFileInput() {
334322
return this.professionalDevelopment.selection.includes("file");
335323
},
324+
fromCertificate() {
325+
return this.certificationStore.getCertificationById(this.applicationStore.draftApplication.fromCertificate);
326+
},
336327
},
337328
338329
methods: {

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/ApplicationCardList.stories.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,3 +855,34 @@ export const ExpiredOneYearWithExpiredFiveYearShouldAllowOneYearEdge: Story = {
855855
],
856856
},
857857
};
858+
859+
export const ExpiredAssistantMoreThan5Years: Story = {
860+
args: {
861+
certifications: [
862+
{
863+
id: "f403a278-8020-f011-998a-6045bdf9b81b",
864+
name: "KARISSA CAULKINS",
865+
number: "016359",
866+
expiryDate: getDateMinusYears(6),
867+
effectiveDate: getDateMinusYears(7),
868+
date: getTodayDate(),
869+
printDate: null,
870+
hasConditions: false,
871+
levelName: "Assistant",
872+
statusCode: "Expired",
873+
certificatePDFGeneration: "Yes",
874+
levels: [{ id: "556b387e-8020-f011-998a-7c1e52871876", type: "Assistant" }],
875+
files: [
876+
{
877+
id: "3979ff88-f262-4747-b294-c289caa2402a",
878+
url: "ecer_certificate/f403a278-8020-f011-998a-6045bdf9b81b",
879+
extention: ".pdf",
880+
size: "322.00 KB",
881+
name: "Cover Letter-016359.pdf",
882+
},
883+
],
884+
certificateConditions: [],
885+
},
886+
],
887+
},
888+
};

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

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ import { DateTime } from "luxon";
130130
import Card from "@/components/Card.vue";
131131
import type { Components } from "@/types/openapi";
132132
import { useCertificationStore } from "@/store/certification";
133+
import { hasITE, hasSNE, isEceAssistant, isEceFiveYear, isEceOneYear } from "@/utils/certification";
134+
import { expiredMoreThan5Years } from "@/utils/functions";
133135
134136
export default defineComponent({
135137
name: "ApplicationCardList",
@@ -153,46 +155,38 @@ export default defineComponent({
153155
},
154156
methods: {
155157
hasSne(activeFiveYearCertifications: Components.Schemas.Certification[]) {
156-
return activeFiveYearCertifications.some((certification) => certification.levels?.some((level) => level.type === "SNE"));
158+
return activeFiveYearCertifications.some((certification) => hasSNE(certification));
157159
},
158160
hasIte(activeFiveYearCertifications: Components.Schemas.Certification[]) {
159-
return activeFiveYearCertifications.some((certification) => certification.levels?.some((level) => level.type === "ITE"));
161+
return activeFiveYearCertifications.some((certification) => hasITE(certification));
160162
},
161163
hasBothIteAndSne(activeFiveYearCertifications: Components.Schemas.Certification[]) {
162-
return activeFiveYearCertifications.some(
163-
(certification) => certification.levels?.some((level) => level.type === "ITE") && certification.levels?.some((level) => level.type === "SNE"),
164-
);
164+
return activeFiveYearCertifications.some((certification) => hasITE(certification) && hasSNE(certification));
165165
},
166166
getActiveFiveYearCertifications() {
167-
return this.certifications.filter(
168-
(certification) => certification.levels?.some((level) => level.type === "ECE 5 YR") && certification.statusCode === "Active",
169-
);
167+
return this.certifications.filter((certification) => isEceFiveYear(certification) && certification.statusCode === "Active");
170168
},
171169
},
172170
computed: {
173171
showEceAssistantPathway() {
174172
// If the user does not have ECE assistant, or all the ECE assistant certifications have been expired for more than 5 years, show the ECE assistant pathway
175-
const eceAssistantCertifications = this.certifications.filter((certification) => certification.levels?.some((level) => level.type === "Assistant"));
173+
const eceAssistantCertifications = this.certifications.filter((certification) => isEceAssistant(certification));
176174
177-
return (
178-
eceAssistantCertifications.length === 0 ||
179-
eceAssistantCertifications.every((certification) => this.certificationStore.expiredMoreThan5Years(certification.id))
180-
);
175+
return eceAssistantCertifications.length === 0;
181176
},
182177
showEceOneYearPathway() {
183178
// If the user does not have ECE one year, or all the ECE one year certifications have been expired for more than 5 years, show the ECE one year pathway
184-
const eceOneYearCertifications = this.certifications.filter((certification) => certification.levels?.some((level) => level.type === "ECE 1 YR"));
179+
const eceOneYearCertifications = this.certifications.filter((certification) => isEceOneYear(certification));
185180
186181
return (
187182
!this.showEceOneYearEdgeCasePathway &&
188-
(eceOneYearCertifications.length === 0 ||
189-
eceOneYearCertifications.every((certification) => this.certificationStore.expiredMoreThan5Years(certification.id)))
183+
(eceOneYearCertifications.length === 0 || eceOneYearCertifications.every((certification) => expiredMoreThan5Years(certification)))
190184
);
191185
},
192186
showEceOneYearEdgeCasePathway() {
193187
// If the user has an expired ECE 5 YR certification, does not have an active ECE 1 YR certification, and is not showing standard ECE one year pathway, show the ECE one year edge case pathway
194-
const eceFiveYearCertifications = this.certifications.filter((certification) => certification.levels?.some((level) => level.type === "ECE 5 YR"));
195-
const eceOneYearCertifications = this.certifications.filter((certification) => certification.levels?.some((level) => level.type === "ECE 1 YR"));
188+
const eceFiveYearCertifications = this.certifications.filter((certification) => isEceFiveYear(certification));
189+
const eceOneYearCertifications = this.certifications.filter((certification) => isEceOneYear(certification));
196190
197191
const mostRecentFiveYearCertificate = this.certificationStore.getMostRecentCertificationByExpiryDate("ECE 5 YR");
198192
@@ -207,13 +201,13 @@ export default defineComponent({
207201
eceFiveYearCertifications.every((certification) => certification.statusCode === "Expired") &&
208202
eceOneYearCertifications.every((certification) => certification.statusCode === "Expired") &&
209203
(eceOneYearCertifications.length === 0 ||
210-
eceOneYearCertifications.every((certification) => this.certificationStore.expiredMoreThan5Years(certification.id)) ||
204+
eceOneYearCertifications.every((certification) => expiredMoreThan5Years(certification)) ||
211205
!oneYearCertificateIssuedAfterMostRecentFiveYear)
212206
);
213207
},
214208
showEceFiveYearPathway() {
215209
// If the user does not have ECE 5 YR, show the ECE 5 YR pathway
216-
return !this.certifications.some((certification) => certification.levels?.some((level) => level.type === "ECE 5 YR"));
210+
return !this.certifications.some((certification) => isEceFiveYear(certification));
217211
},
218212
showSpecializedCertificationPathway() {
219213
// If the user has an active ECE 5 YR certification, without holding ITE or SNE, show the specialized certification pathway

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55
<!-- Renewal -->
66
<template v-if="applicationStore.isDraftApplicationRenewal">
77
<ECEAssistantRenewalRequirements v-if="applicationStore.isDraftCertificateTypeEceAssistant" />
8-
<ECEOneYearRenewalRequirements
9-
v-if="applicationStore.isDraftCertificateTypeOneYear"
10-
:expired="certificationStore.certificateStatus(applicationStore.draftApplication.fromCertificate) === 'Expired'"
11-
/>
8+
<ECEOneYearRenewalRequirements v-if="applicationStore.isDraftCertificateTypeOneYear" :expired="fromCertificate?.statusCode === 'Expired'" />
129
<ECEFiveYearRenewalRequirements
1310
v-if="applicationStore.isDraftCertificateTypeFiveYears"
14-
:expired="certificationStore.certificateStatus(applicationStore.draftApplication.fromCertificate) === 'Expired'"
15-
:expired-more-than5-years="certificationStore.expiredMoreThan5Years(applicationStore.draftApplication.fromCertificate)"
11+
:expired="fromCertificate?.statusCode === 'Expired'"
12+
:expired-more-than5-years="fromCertificate && expiredMoreThan5Years(fromCertificate)"
1613
/>
1714
</template>
1815

@@ -68,6 +65,7 @@ import { useApplicationStore } from "@/store/application";
6865
import { useCertificationStore } from "@/store/certification";
6966
import { useUserStore } from "@/store/user";
7067
import type { Components } from "@/types/openapi";
68+
import { expiredMoreThan5Years } from "@/utils/functions";
7169
7270
import ECEFiveYearRegistrantRequirements from "./ECEFiveYearRegistrantRequirements.vue";
7371
import ECEIteRegistrantRequirements from "./ECEIteRegistrantRequirements.vue";
@@ -104,7 +102,7 @@ export default defineComponent({
104102
const userStore = useUserStore();
105103
const router = useRouter();
106104
107-
return { applicationStore, certificationStore, userStore, router };
105+
return { applicationStore, certificationStore, userStore, router, expiredMoreThan5Years };
108106
},
109107
data() {
110108
return {
@@ -115,6 +113,9 @@ export default defineComponent({
115113
isPostBasic() {
116114
return this.applicationStore.draftApplication.certificationTypes?.some((type) => type === "Ite" || type === "Sne");
117115
},
116+
fromCertificate() {
117+
return this.certificationStore.getCertificationById(this.applicationStore.draftApplication.fromCertificate);
118+
},
118119
},
119120
methods: {
120121
handleSpecializationSelection(payload?: Components.Schemas.CertificationType[]) {

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/CertificationCard.stories.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Meta, StoryObj } from "@storybook/vue3-vite";
22

33
import CertificationCard from "./CertificationCard.vue";
4+
import { getDateMinusYears, getTodayDate } from "@/utils/dateHelpers";
45

56
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
67
const meta = {
@@ -34,6 +35,8 @@ const meta = {
3435
],
3536
certificateConditions: [],
3637
},
38+
hasApplication: false,
39+
isLatestOfType: true,
3740
},
3841
} satisfies Meta<typeof CertificationCard>;
3942

@@ -366,3 +369,34 @@ export const HasApplication: Story = {
366369
hasApplication: true,
367370
},
368371
};
372+
373+
export const ExpiredAssistantMoreThan5Years: Story = {
374+
args: {
375+
certification: {
376+
id: "f403a278-8020-f011-998a-6045bdf9b81b",
377+
name: "KARISSA CAULKINS",
378+
number: "016359",
379+
expiryDate: getDateMinusYears(6),
380+
effectiveDate: getDateMinusYears(7),
381+
date: getTodayDate(),
382+
printDate: null,
383+
hasConditions: false,
384+
levelName: "ECE Assistant",
385+
statusCode: "Expired",
386+
certificatePDFGeneration: "Yes",
387+
levels: [{ id: "556b387e-8020-f011-998a-7c1e52871876", type: "Assistant" }],
388+
files: [
389+
{
390+
id: "3979ff88-f262-4747-b294-c289caa2402a",
391+
url: "ecer_certificate/f403a278-8020-f011-998a-6045bdf9b81b",
392+
extention: ".pdf",
393+
size: "322.00 KB",
394+
name: "Cover Letter-016359.pdf",
395+
},
396+
],
397+
certificateConditions: [],
398+
},
399+
hasApplication: false,
400+
isLatestOfType: true,
401+
},
402+
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<li>Have been completed within the last 5 years</li>
1414
<li>Be a different course than the one you previously used for ECE Assistant certification</li>
1515
<li>
16-
Be part of an early childhood education training
16+
Be part of a basic early childhood education
1717
<a href="https://www2.gov.bc.ca/gov/content?id=62102395C4F64F068A63E42921E67720">program recognized by the ECE Registry</a>
1818
</li>
1919
</ul>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<v-row>
1313
<v-col>
1414
<ECEHeader title="Education information"></ECEHeader>
15-
<p>You must have completed at least one early childhood education course in one of the following:</p>
15+
<p>You must have completed at least one basic early childhood education course in one of the following:</p>
1616
<br />
1717
<ul class="ml-10">
1818
<li>Child guidance</li>

0 commit comments

Comments
 (0)