From b845b0846834d2a441236d753681e9d97df5defc Mon Sep 17 00:00:00 2001 From: soletsdev Date: Mon, 7 Oct 2024 10:29:38 -0700 Subject: [PATCH 01/28] WIP public lookup search form completed --- .../src/components/Footer.vue | 2 +- .../src/components/LookupCertification.vue | 101 ++++++++++++++++++ .../src/router.ts | 6 ++ 3 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/Footer.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/Footer.vue index 05fbcad38..1f675be29 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/Footer.vue +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/Footer.vue @@ -71,7 +71,7 @@ export default defineComponent({ }, acceptedPaths(): boolean { const routeName = this.$route.name?.toString() || ""; - return ["login", "dashboard", "invalid-reference", "reference-submitted", "verify"].includes(routeName); + return ["login", "dashboard", "invalid-reference", "reference-submitted", "verify", "lookup-certification"].includes(routeName); }, }, }); diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue new file mode 100644 index 000000000..fed4f4df8 --- /dev/null +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue @@ -0,0 +1,101 @@ + + + diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/router.ts b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/router.ts index c84a81906..c550e3c83 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/router.ts +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/router.ts @@ -208,6 +208,12 @@ const router = createRouter({ meta: { requiresAuth: false }, name: "reference-submitted", }, + { + path: "/lookup/certification", + component: () => import("./components/LookupCertification.vue"), + meta: { requiresAuth: false }, + name: "lookup-certification", + }, { path: "/:pathMatch(.*)*", name: "not-found", component: () => import("./components/pages/PageNotFound.vue") }, ], }); From 85b08a07ef4db33c43debe9af7d940f267b795cf Mon Sep 17 00:00:00 2001 From: soletsdev Date: Tue, 8 Oct 2024 15:50:19 -0700 Subject: [PATCH 02/28] WIP lookup certification prior to vuetify upgrade --- .../src/components/LookupCertification.vue | 108 ++++++++++++++++-- .../components/LookupCertificationRecord.vue | 28 +++++ .../src/router.ts | 6 + .../src/store/lookupCertification.ts | 22 ++++ 4 files changed, 155 insertions(+), 9 deletions(-) create mode 100644 src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue create mode 100644 src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue index fed4f4df8..6db47f103 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue @@ -50,33 +50,108 @@ Search + + +

No records found

+

If you cannot find an ECE, it may be because the:

+
+
    +
  • Name was entered incorrectly - check the spelling and that you're entering their legal name
  • +
  • Person is not certified
  • +
  • Person is still in the process of applying for certification
  • +
+
+
+ + + +

{{ `${certificationSearchResults.length} record${certificationSearchResults.length === 1 ? "" : "s"} found` }}

+ + + +
+ + +

{{ `${certificationSearchResults.length} record${certificationSearchResults.length === 1 ? "" : "s"} found` }}

+ + +
+

{{ header.key }}

+ {{ header.key }} + +

{{ result[header.key] }}

+
+
+
+
+
diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue new file mode 100644 index 000000000..d6e684b5f --- /dev/null +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue @@ -0,0 +1,28 @@ + + + diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/router.ts b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/router.ts index 61b2d4047..24a7d0de5 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/router.ts +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/router.ts @@ -228,6 +228,12 @@ const router = createRouter({ meta: { requiresAuth: false }, name: "lookup-certification", }, + { + path: "/lookup/certification/record", + component: () => import("./components/LookupCertificationRecord.vue"), + meta: { requiresAuth: false }, + name: "lookup-certification-record", + }, { path: "/:pathMatch(.*)*", name: "not-found", component: () => import("./components/pages/PageNotFound.vue") }, ], }); diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts new file mode 100644 index 000000000..c5826a4bf --- /dev/null +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts @@ -0,0 +1,22 @@ +import { defineStore } from "pinia"; + +export interface CertificationLookupState { + certificationSearchResults: any[] | undefined; + certificationRecord: any | undefined; +} + +export const useLookupCertificationStore = defineStore("lookupCertification", { + state: (): CertificationLookupState => ({ + certificationSearchResults: undefined, + certificationRecord: undefined, + }), + getters: {}, + actions: { + setCertificationSearchResults(data: any): void { + this.certificationSearchResults = data; + }, + setCertificationRecord(record: any): void { + this.certificationRecord = record; + }, + }, +}); From ca1cec89c4964959592b2c0b677e0cd9309ef1a1 Mon Sep 17 00:00:00 2001 From: Deepak Yadav Date: Tue, 8 Oct 2024 16:36:42 -0700 Subject: [PATCH 03/28] BE: Create certification record query --- .../Certifications/CertificationsEndpoints.cs | 42 ++++++++++++++ .../Certifications/Contract.cs | 4 ++ .../CertificationHandlers.cs | 3 + .../Certifications/CertificationRepository.cs | 27 ++++++++- .../CertificationRepositoryMapper.cs | 1 + .../ICertificationRepository.cs | 4 ++ .../RegistryApi/CertificationTests.cs | 55 +++++++++++++++++++ .../RegistryPortalWebAppScenarioBase.cs | 8 ++- 8 files changed, 140 insertions(+), 4 deletions(-) diff --git a/src/ECER.Clients.RegistryPortal/ECER.Clients.RegistryPortal.Server/Certifications/CertificationsEndpoints.cs b/src/ECER.Clients.RegistryPortal/ECER.Clients.RegistryPortal.Server/Certifications/CertificationsEndpoints.cs index d8c9cb188..fb22ceed5 100644 --- a/src/ECER.Clients.RegistryPortal/ECER.Clients.RegistryPortal.Server/Certifications/CertificationsEndpoints.cs +++ b/src/ECER.Clients.RegistryPortal/ECER.Clients.RegistryPortal.Server/Certifications/CertificationsEndpoints.cs @@ -1,8 +1,11 @@ using AutoMapper; +using ECER.Clients.RegistryPortal.Server.Applications; using ECER.Managers.Registry.Contract.Certifications; using ECER.Utilities.Hosting; using ECER.Utilities.Security; using MediatR; +using Microsoft.AspNetCore.Http.HttpResults; +using Microsoft.AspNetCore.Mvc; namespace ECER.Clients.RegistryPortal.Server.Certifications; @@ -26,11 +29,39 @@ public void Register(IEndpointRouteBuilder endpointRouteBuilder) .WithOpenApi("Handles certification queries", string.Empty, "certification_get") .RequireAuthorization() .WithParameterValidation(); + + endpointRouteBuilder.MapPost("/api/certifications/lookup", async Task>, BadRequest, NotFound>> (CertificationLookupRequest request, HttpContext httpContext, CancellationToken ct, IMediator messageBus, IMapper mapper) => + { + var recaptchaResult = await messageBus.Send(new Managers.Registry.Contract.Recaptcha.VerifyRecaptchaCommand(request.RecaptchaToken), ct); + + if (!recaptchaResult.Success) + { + var problemDetails = new ProblemDetails + { + Status = StatusCodes.Status400BadRequest, + Detail = "Invalid recaptcha token", + Extensions = { ["errors"] = recaptchaResult.ErrorCodes } + }; + return TypedResults.BadRequest(problemDetails); + } + + var query = new UserCertificationQuery + { + ByCertificateNumber = request.RegistrationNumber, + ByFirstName = request.FirstName, + ByLastName = request.LastName, + }; + var results = await messageBus.Send(query); + return TypedResults.Ok(mapper.Map>(results.Items)); + }) + .WithOpenApi("Handles certifications lookup queries", string.Empty, "certifications_lookup_post") + .WithParameterValidation(); } } public record Certification(string Id) { + public string? Name { get; set; } public string? Number { get; set; } public DateTime? ExpiryDate { get; set; } public DateTime? EffectiveDate { get; set; } @@ -44,6 +75,17 @@ public record Certification(string Id) public IEnumerable Files { get; set; } = Array.Empty(); } +public record CertificationLookupRequest(string RecaptchaToken) +{ + public string? FirstName { get; set; } + public string? LastName { get; set; } + public string? RegistrationNumber { get; set; } + public int? PageSize { get; set; } + public int? PageNumber { get; set; } + public string? SortField { get; set; } + public string? SortDirection { get; set; } +} + public record CertificationLevel(string Id) { public string? Type { get; set; } diff --git a/src/ECER.Managers.Registry.Contract/Certifications/Contract.cs b/src/ECER.Managers.Registry.Contract/Certifications/Contract.cs index 6632067c2..71c98d89e 100644 --- a/src/ECER.Managers.Registry.Contract/Certifications/Contract.cs +++ b/src/ECER.Managers.Registry.Contract/Certifications/Contract.cs @@ -6,11 +6,15 @@ public record UserCertificationQuery : IRequest { public string? ById { get; set; } public string? ByApplicantId { get; set; } + public string? ByCertificateNumber { get; set; } + public string? ByFirstName { get; set; } + public string? ByLastName { get; set; } } public record CertificationsQueryResults(IEnumerable Items); public record Certification(string Id) { + public string? Name { get; set; } public string? Number { get; set; } public DateTime? ExpiryDate { get; set; } public DateTime? EffectiveDate { get; set; } diff --git a/src/ECER.Managers.Registry/CertificationHandlers.cs b/src/ECER.Managers.Registry/CertificationHandlers.cs index 746eef55d..d3428b52b 100644 --- a/src/ECER.Managers.Registry/CertificationHandlers.cs +++ b/src/ECER.Managers.Registry/CertificationHandlers.cs @@ -19,6 +19,9 @@ public async Task Handle(Contract.Certifications.Use { ById = request.ById, ByApplicantId = request.ByApplicantId, + ByCertificateNumber = request.ByCertificateNumber, + ByFirstName = request.ByFirstName, + ByLastName = request.ByLastName }); return new CertificationsQueryResults(mapper.Map>(Certifications)!); diff --git a/src/ECER.Resources.Documents/Certifications/CertificationRepository.cs b/src/ECER.Resources.Documents/Certifications/CertificationRepository.cs index ffdf1d85a..7362e9102 100644 --- a/src/ECER.Resources.Documents/Certifications/CertificationRepository.cs +++ b/src/ECER.Resources.Documents/Certifications/CertificationRepository.cs @@ -1,6 +1,7 @@ using AutoMapper; using ECER.Utilities.DataverseSdk.Model; using ECER.Utilities.DataverseSdk.Queries; +using Microsoft.Xrm.Sdk.Client; namespace ECER.Resources.Documents.Certifications; @@ -19,6 +20,7 @@ public async Task> Query(UserCertificationQuery query { await Task.CompletedTask; var Certifications = context.ecer_CertificateSet.AsQueryable(); + var Registrants = context.ContactSet.AsQueryable(); // Filtering by ID if (query.ById != null) Certifications = Certifications.Where(r => r.ecer_CertificateId == Guid.Parse(query.ById)); @@ -26,13 +28,34 @@ public async Task> Query(UserCertificationQuery query // Filtering by applicant ID if (query.ByApplicantId != null) Certifications = Certifications.Where(r => r.ecer_Registrantid.Id == Guid.Parse(query.ByApplicantId)); - Certifications = Certifications.OrderByDescending(r => r.ecer_ExpiryDate); + // Filtering by First Name + if (!string.IsNullOrEmpty(query.ByFirstName)) + { + Certifications = from cert in Certifications + join reg in Registrants on cert.ecer_Registrantid.Id equals reg.Id + where reg.FirstName == (query.ByFirstName) + select cert; + } + + // Filtering by Last Name + if (!string.IsNullOrEmpty(query.ByLastName)) + { + Certifications = from cert in Certifications + join reg in Registrants on cert.ecer_Registrantid.Id equals reg.Id + where reg.FirstName == (query.ByLastName) + select cert; + } + + // Filtering by certificate number + if (!string.IsNullOrEmpty(query.ByCertificateNumber)) + Certifications = Certifications.Where(r => r.ecer_CertificateNumber.Contains(query.ByCertificateNumber)); var results = context.From(Certifications) .Join() .Include(a => a.ecer_certifiedlevel_CertificateId) .Include(a => a.ecer_documenturl_CertificateId) - .Execute(); + .Execute().GroupBy(r => r.ecer_Registrantid.Id) // Group by unique identifier (assuming RegistrantId) + .Select(g => g.OrderByDescending(r => r.ecer_ExpiryDate).FirstOrDefault()); // Select latest by expiry date return mapper.Map>(results)!.ToList(); } diff --git a/src/ECER.Resources.Documents/Certifications/CertificationRepositoryMapper.cs b/src/ECER.Resources.Documents/Certifications/CertificationRepositoryMapper.cs index fcac3661f..f16154bb8 100644 --- a/src/ECER.Resources.Documents/Certifications/CertificationRepositoryMapper.cs +++ b/src/ECER.Resources.Documents/Certifications/CertificationRepositoryMapper.cs @@ -10,6 +10,7 @@ public CertificationRepositoryMapper() { CreateMap(MemberList.Destination) .ForMember(d => d.Id, opts => opts.MapFrom(s => s.ecer_CertificateId)) + .ForMember(d => d.Name, opts => opts.MapFrom(s => s.ecer_RegistrantidName)) .ForMember(d => d.Number, opts => opts.MapFrom(s => s.ecer_CertificateNumber)) .ForMember(d => d.ExpiryDate, opts => opts.MapFrom(s => s.ecer_ExpiryDate)) .ForMember(d => d.EffectiveDate, opts => opts.MapFrom(s => s.ecer_EffectiveDate)) diff --git a/src/ECER.Resources.Documents/Certifications/ICertificationRepository.cs b/src/ECER.Resources.Documents/Certifications/ICertificationRepository.cs index b73fe5227..9a092d279 100644 --- a/src/ECER.Resources.Documents/Certifications/ICertificationRepository.cs +++ b/src/ECER.Resources.Documents/Certifications/ICertificationRepository.cs @@ -10,10 +10,14 @@ public record UserCertificationQuery public string? ById { get; set; } public string? ByApplicantId { get; set; } public string? ByApplicationId { get; set; } + public string? ByCertificateNumber { get; set; } + public string? ByFirstName { get; set; } + public string? ByLastName { get; set; } } public record Certification(string Id) { + public string? Name { get; set; } public string? Number { get; set; } public DateTime? ExpiryDate { get; set; } public DateTime? EffectiveDate { get; set; } diff --git a/src/ECER.Tests/Integration/RegistryApi/CertificationTests.cs b/src/ECER.Tests/Integration/RegistryApi/CertificationTests.cs index f8d5f6dba..9ccb66979 100644 --- a/src/ECER.Tests/Integration/RegistryApi/CertificationTests.cs +++ b/src/ECER.Tests/Integration/RegistryApi/CertificationTests.cs @@ -1,5 +1,10 @@ using Alba; +using Bogus; +using ECER.Clients.RegistryPortal.Server.Applications; +using ECER.Clients.RegistryPortal.Server.Certifications; +using Newtonsoft.Json.Linq; using Shouldly; +using System; using Xunit.Abstractions; namespace ECER.Tests.Integration.RegistryApi; @@ -23,4 +28,54 @@ public async Task GetCertifications_ReturnsCertifications() var Certifications = await CertificationsResponse.ReadAsJsonAsync(); Certifications.ShouldNotBeNull(); } + + [Fact] + public async Task CertificationsLookup_ByName_ReturnsCertifications() + { + var faker = new Faker("en_CA"); + + var CertificationId = this.Fixture.certificationOneId; + + var CertificationsIdResponse = await Host.Scenario(_ => + { + _.WithExistingUser(this.Fixture.AuthenticatedBcscUserIdentity, this.Fixture.AuthenticatedBcscUser); + _.Get.Url($"/api/certifications/{CertificationId}"); + _.StatusCodeShouldBeOk(); + }); + + var CertificationsId = await CertificationsIdResponse.ReadAsJsonAsync().ShouldNotBeNull(); + + CertificationsId.ShouldNotBeEmpty(); + CertificationsId.ShouldHaveSingleItem(); + // Find the last space and split + int lastSpaceIndex = CertificationsId[0].Name!.LastIndexOf(' '); + + var lastName = CertificationsId[0].Name!.Substring(lastSpaceIndex + 1); + + var certificationLookupRequest = new CertificationLookupRequest(faker.Random.Word()) { LastName = lastName }; + var CertificationsResponse = await Host.Scenario(_ => + { + _.Post.Json(certificationLookupRequest).ToUrl($"/api/certifications/lookup"); + _.StatusCodeShouldBeOk(); + }); + + var Certifications = await CertificationsResponse.ReadAsJsonAsync().ShouldNotBeNull(); + Certifications.ShouldNotBeEmpty(); + Certifications.ShouldAllBe(c => c.Name != null && c.Name.EndsWith(lastName)); + } + + [Fact] + public async Task CertificationsLookup_ByRegistrationNumber_ReturnsCertifications() + { + var faker = new Faker("en_CA"); + var certificationLookupRequest = new CertificationLookupRequest(faker.Random.Word()) { RegistrationNumber = "016444" }; + var CertificationsResponse = await Host.Scenario(_ => + { + _.Post.Json(certificationLookupRequest).ToUrl($"/api/certifications/lookup"); + _.StatusCodeShouldBeOk(); + }); + + var Certifications = await CertificationsResponse.ReadAsJsonAsync(); + Certifications.ShouldNotBeNull(); + } } diff --git a/src/ECER.Tests/Integration/RegistryPortalWebAppScenarioBase.cs b/src/ECER.Tests/Integration/RegistryPortalWebAppScenarioBase.cs index 959a6f3f8..ee7cff62c 100644 --- a/src/ECER.Tests/Integration/RegistryPortalWebAppScenarioBase.cs +++ b/src/ECER.Tests/Integration/RegistryPortalWebAppScenarioBase.cs @@ -40,6 +40,7 @@ public class RegistryPortalWebAppFixture : WebAppFixtureBase private ecer_Communication testCommunication4 = null!; private ecer_Certificate testCertification = null!; + private ecer_Certificate testCertification2 = null!; private ecer_PortalInvitation testPortalInvitationOne = null!; private ecer_PortalInvitation testPortalInvitationCharacterReferenceSubmit = null!; @@ -63,6 +64,7 @@ public class RegistryPortalWebAppFixture : WebAppFixtureBase public string draftTestApplicationId => draftTestApplication.Id.ToString(); public string certificationOneId => testCertification.Id.ToString(); + public string certificationTwoId => testCertification2.Id.ToString(); public Guid portalInvitationOneId => testPortalInvitationOne.ecer_PortalInvitationId ?? Guid.Empty; public Guid portalInvitationCharacterReferenceIdSubmit => testPortalInvitationCharacterReferenceSubmit.ecer_PortalInvitationId ?? Guid.Empty; @@ -144,7 +146,8 @@ private async Task InitializeDataverseTestData(EcerContext context) testCommunication2 = GetOrAddCommunication(context, inProgressTestApplication, "comm2", null); testCommunication3 = GetOrAddCommunication(context, inProgressTestApplication, "comm3", null); testCommunication4 = GetOrAddCommunication(context, inProgressTestApplication, "comm4", null); - testCertification = GetOrAddCertification(context); + testCertification = GetOrAddCertification(context, AuthenticatedBcscUser); + testCertification2 = GetOrAddCertification(context, AuthenticatedBcscUser); previousName = GetOrAddPreviousName(context, AuthenticatedBcscUser); testPortalInvitationOne = GetOrAddPortalInvitation_CharacterReference(context, AuthenticatedBcscUser, "name1"); @@ -354,7 +357,7 @@ private ecer_Communication GetOrAddCommunication(EcerContext context, ecer_Appli return communication; } - private ecer_Certificate GetOrAddCertification(EcerContext context) + private ecer_Certificate GetOrAddCertification(EcerContext context, Contact registrant) { var certification = context.ecer_CertificateSet.FirstOrDefault(c => c.ecer_CertificateNumber == "autotest_1234"); @@ -379,6 +382,7 @@ private ecer_Certificate GetOrAddCertification(EcerContext context) context.AddLink(certification, ecer_Certificate.Fields.ecer_certifiedlevel_CertificateId, level); context.AddLink(level, ecer_CertifiedLevel.Fields.ecer_certifiedlevel_CertificateTypeId, type); + context.AddLink(certification, ecer_Certificate.Fields.ecer_certificate_Registrantid, registrant); } return certification; From a4c8ecf0dbc103e668baae829fc33d4d2a79faa8 Mon Sep 17 00:00:00 2001 From: soletsdev Date: Wed, 9 Oct 2024 12:14:58 -0700 Subject: [PATCH 04/28] upgrade vuetify and applied v-label opacity fix. Adjusted lookup to use store --- .../package-lock.json | 22 ++-- .../package.json | 2 +- .../src/components/LookupCertification.vue | 108 ++++++++---------- .../components/LookupCertificationRecord.vue | 16 ++- .../src/store/lookupCertification.ts | 6 + .../src/styles/main.scss | 2 +- .../src/styles/v-label.scss | 3 + 7 files changed, 79 insertions(+), 80 deletions(-) create mode 100644 src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/styles/v-label.scss diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/package-lock.json b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/package-lock.json index 07fb1c808..ca929155e 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/package-lock.json +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/package-lock.json @@ -19,7 +19,7 @@ "uuid": "^10.0.0", "vue": "^3.3.4", "vue-router": "^4.2.5", - "vuetify": "^3.4.6" + "vuetify": "^3.6.13" }, "devDependencies": { "@rushstack/eslint-patch": "^1.3.3", @@ -12708,9 +12708,9 @@ } }, "node_modules/vuetify": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-3.5.1.tgz", - "integrity": "sha512-fkhU4UFnX/lBARXg+n9mBCDPTaEDHoYGx9SZ5A/1LlzM7LohoqldmrNgza4WgpPTLIWqr6NvYp2NvT2IrcTfhg==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-3.7.2.tgz", + "integrity": "sha512-q0WTcRG977+a9Dqhb8TOaPm+Xmvj0oVhnBJhAdHWFSov3HhHTTxlH2nXP/GBTXZuuMHDbBeIWFuUR2/1Fx0PPw==", "engines": { "node": "^12.20 || >=14.13" }, @@ -12720,10 +12720,9 @@ }, "peerDependencies": { "typescript": ">=4.7", - "vite-plugin-vuetify": ">=1.0.0-alpha.12", + "vite-plugin-vuetify": ">=1.0.0", "vue": "^3.3.0", - "vue-i18n": "^9.0.0", - "webpack-plugin-vuetify": ">=2.0.0-alpha.11" + "webpack-plugin-vuetify": ">=2.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -12732,9 +12731,6 @@ "vite-plugin-vuetify": { "optional": true }, - "vue-i18n": { - "optional": true - }, "webpack-plugin-vuetify": { "optional": true } @@ -22134,9 +22130,9 @@ } }, "vuetify": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-3.5.1.tgz", - "integrity": "sha512-fkhU4UFnX/lBARXg+n9mBCDPTaEDHoYGx9SZ5A/1LlzM7LohoqldmrNgza4WgpPTLIWqr6NvYp2NvT2IrcTfhg==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-3.7.2.tgz", + "integrity": "sha512-q0WTcRG977+a9Dqhb8TOaPm+Xmvj0oVhnBJhAdHWFSov3HhHTTxlH2nXP/GBTXZuuMHDbBeIWFuUR2/1Fx0PPw==", "requires": {} }, "walker": { diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/package.json b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/package.json index d46ac7ddd..2ccfc381b 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/package.json +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/package.json @@ -25,7 +25,7 @@ "uuid": "^10.0.0", "vue": "^3.3.4", "vue-router": "^4.2.5", - "vuetify": "^3.4.6" + "vuetify": "^3.6.13" }, "devDependencies": { "@rushstack/eslint-patch": "^1.3.3", diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue index 6db47f103..782f1fca8 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue @@ -20,17 +20,24 @@ - + - + - + @@ -50,7 +57,7 @@ Search - +

No records found

If you cannot find an ECE, it may be because the:

@@ -62,37 +69,22 @@
- - - -

{{ `${certificationSearchResults.length} record${certificationSearchResults.length === 1 ? "" : "s"} found` }}

- - @@ -106,13 +98,12 @@ import EceRecaptcha from "./inputs/EceRecaptcha.vue"; import * as Rules from "../utils/formRules"; import { useDisplay } from "vuetify"; import { useLookupCertificationStore } from "@/store/lookupCertification"; +import { useRouter } from "vue-router"; +import { isNumber } from "@/utils/formInput"; +import { formatDate } from "@/utils/format"; interface LookupCertificationData { - firstName: string; - lastName: string; - registrationNumber: string; recaptchaToken: string; - certificationSearchResults: undefined | []; headers: ReadonlyHeaders; } @@ -125,40 +116,32 @@ export default defineComponent({ const alertStore = useAlertStore(); const lookupCertificationStore = useLookupCertificationStore(); const { mobile } = useDisplay(); + const router = useRouter(); - return { alertStore, Rules, mobile, lookupCertificationStore }; + return { alertStore, Rules, mobile, lookupCertificationStore, router, isNumber, formatDate }; }, data(): LookupCertificationData { return { - firstName: "", - lastName: "", - registrationNumber: "", recaptchaToken: "", - certificationSearchResults: [ - { name: "first last", registrationNumber: "1234", certification: "nothing", status: "fake" }, - { name: "first2 last2", registrationNumber: "1234", certification: "1nothing", status: "2fake" }, - ], headers: [ - { title: "Name", key: "name", sortable: false }, - { title: "Registration number", key: "registrationNumber", sortable: false }, - { title: "Certification", key: "certification", sortable: false }, - { title: "Registration status", key: "status", sortable: false }, + { title: "Name", key: "name" }, + { title: "Registration number", key: "registrationNumber" }, + { title: "Certification", key: "certification" }, + { title: "Registration status", key: "status" }, + { title: "Certificate expiry date", key: "expiryDate" }, ], }; }, mounted() { - this.lookupCertificationStore.setCertificationSearchResults([ - { name: "first last", registrationNumber: "1234", certification: "nothing", status: "fake" }, - { name: "first2 last2", registrationNumber: "1234", certification: "1nothing", status: "2fake" }, - ]); + // TODO REmove }, computed: {}, methods: { customAtLeastOneRule() { return () => - !!(this.firstName && this.firstName?.trim()) || - !!(this.lastName && this.lastName?.trim()) || - !!(this.registrationNumber && this.registrationNumber?.trim()); + !!(this.lookupCertificationStore.firstName && this.lookupCertificationStore.firstName?.trim()) || + !!(this.lookupCertificationStore.lastName && this.lookupCertificationStore.lastName?.trim()) || + !!(this.lookupCertificationStore.registrationNumber && this.lookupCertificationStore.registrationNumber?.trim()); }, async handleSubmit() { try { @@ -169,22 +152,23 @@ export default defineComponent({ this.alertStore.setFailureAlert("You must enter at least one option"); } } else { + if (this.lookupCertificationStore.registrationNumber) { + this.lookupCertificationStore.registrationNumber = this.lookupCertificationStore.registrationNumber.padStart(6, "0"); + } + //make api call - this.certificationSearchResults = [ - { firstName: "first", lastName: "last", registrationNumber: "1234", certification: "nothing", status: "fake" }, - { firstName: "first2", lastName: "last2", registrationNumber: "1234", certification: "1nothing", status: "2fake" }, + this.lookupCertificationStore.certificationSearchResults = [ + { name: "first last", registrationNumber: "1234", certification: "nothing", status: "fake", expiryDate: "2024-11-24" }, + { name: "first2 last2", registrationNumber: "1234", certification: "1nothing", status: "2fake", expiryDate: "2025-11-24" }, ]; } } catch (e) { console.error(e); - this.alertStore.setFailureAlert("You must enter at least one option"); } }, applicantClick(item) { - this.alertStore.setSuccessAlert(item); this.lookupCertificationStore.setCertificationRecord(item); - - + this.router.push({ name: "lookup-certification-record" }); }, }, }); diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue index d6e684b5f..29c06618e 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue @@ -2,12 +2,21 @@

Validate an ECE certificate

- {{ test }} + + + + mdi-chevron-leftBack to search + +
TODO ECER-3210
+ {{ lookupCertificationStore.certificationRecord }} +
diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts index c5826a4bf..b405517bb 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts @@ -3,12 +3,18 @@ import { defineStore } from "pinia"; export interface CertificationLookupState { certificationSearchResults: any[] | undefined; certificationRecord: any | undefined; + firstName: string; + lastName: string; + registrationNumber: string; } export const useLookupCertificationStore = defineStore("lookupCertification", { state: (): CertificationLookupState => ({ certificationSearchResults: undefined, certificationRecord: undefined, + firstName: "", + lastName: "", + registrationNumber: "", }), getters: {}, actions: { diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/styles/main.scss b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/styles/main.scss index ac82941e0..4da3fa809 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/styles/main.scss +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/styles/main.scss @@ -8,4 +8,4 @@ @import "./v-alert.scss"; @import "./v-list-item.scss"; @import "./v-stepper.scss"; - +@import "./v-label.scss"; diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/styles/v-label.scss b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/styles/v-label.scss new file mode 100644 index 000000000..9506b35e3 --- /dev/null +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/styles/v-label.scss @@ -0,0 +1,3 @@ +.v-label { + opacity: 1; +} From 529eed5600c705ff14ec7d11f487eb321947479b Mon Sep 17 00:00:00 2001 From: soletsdev Date: Wed, 9 Oct 2024 13:22:10 -0700 Subject: [PATCH 05/28] lintfix needed to include new rule tofix v-slot directive does not support any modifier --- .../.eslintrc.cjs | 1 + .../src/components/LookupCertification.vue | 21 ++++++++++--------- .../components/LookupCertificationRecord.vue | 6 +++--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/.eslintrc.cjs b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/.eslintrc.cjs index aeeedc970..617cb2dc2 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/.eslintrc.cjs +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/.eslintrc.cjs @@ -13,5 +13,6 @@ module.exports = { "simple-import-sort/imports": "error", "simple-import-sort/exports": "error", "vue/multi-word-component-names": "off", + "vue/valid-v-slot": ["error", { allowModifiers: true }], }, }; diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue index 782f1fca8..68b669735 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue @@ -35,8 +35,8 @@ hide-details="auto" variant="outlined" label="ECE registration number" - @keypress="isNumber($event)" maxlength="6" + @keypress="isNumber($event)" >
@@ -91,16 +91,17 @@ diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts index b405517bb..c3203849d 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts @@ -1,8 +1,9 @@ import { defineStore } from "pinia"; +import type { Components } from "@/types/openapi"; export interface CertificationLookupState { - certificationSearchResults: any[] | undefined; - certificationRecord: any | undefined; + certificationSearchResults: Components.Schemas.CertificationLookupResponse[] | undefined; + certificationRecord: Components.Schemas.CertificationLookupResponse | undefined; firstName: string; lastName: string; registrationNumber: string; @@ -18,10 +19,10 @@ export const useLookupCertificationStore = defineStore("lookupCertification", { }), getters: {}, actions: { - setCertificationSearchResults(data: any): void { + setCertificationSearchResults(data: Components.Schemas.CertificationLookupResponse[]): void { this.certificationSearchResults = data; }, - setCertificationRecord(record: any): void { + setCertificationRecord(record: Components.Schemas.CertificationLookupResponse): void { this.certificationRecord = record; }, }, From 7a826d4047ad5adcb3bf3d361b693054ad862a49 Mon Sep 17 00:00:00 2001 From: soletsdev Date: Wed, 16 Oct 2024 12:14:48 -0700 Subject: [PATCH 22/28] quick fixes for unused test code + comments --- .../src/components/LookupCertification.vue | 3 +-- .../src/components/LookupCertificationRecord.vue | 8 -------- .../src/store/lookupCertification.ts | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue index 4360d07b2..25bc02faa 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue @@ -170,7 +170,6 @@ export default defineComponent({ this.lookupCertificationStore.registrationNumber = this.lookupCertificationStore.registrationNumber.padStart(6, "0"); } - //make api call const { data } = await postLookupCertificate({ firstName: this.lookupCertificationStore.firstName, lastName: this.lookupCertificationStore.lastName, @@ -178,7 +177,7 @@ export default defineComponent({ recaptchaToken: this.recaptchaToken, }); - this.lookupCertificationStore.certificationSearchResults = data; + this.lookupCertificationStore.setCertificationSearchResults(data); } } catch (e) { console.error(e); diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue index 58f6615e3..2e615fe3b 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue @@ -20,14 +20,6 @@ import { useLookupCertificationStore } from "@/store/lookupCertification"; export default defineComponent({ name: "LookupCertification", - - props: { - test: { - // TODO create type for prop - type: String as PropType, - required: true, - }, - }, setup() { const lookupCertificationStore = useLookupCertificationStore(); const router = useRouter(); diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts index c3203849d..8acf0e596 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts @@ -19,7 +19,7 @@ export const useLookupCertificationStore = defineStore("lookupCertification", { }), getters: {}, actions: { - setCertificationSearchResults(data: Components.Schemas.CertificationLookupResponse[]): void { + setCertificationSearchResults(data: Components.Schemas.CertificationLookupResponse[] | undefined): void { this.certificationSearchResults = data; }, setCertificationRecord(record: Components.Schemas.CertificationLookupResponse): void { From aa84e0a61228629ad35b680c7735ff19d77ed1be Mon Sep 17 00:00:00 2001 From: soletsdev Date: Wed, 16 Oct 2024 12:17:45 -0700 Subject: [PATCH 23/28] removing .sdlintrc.cjs that was removed during upgrade --- .../.eslintrc.cjs | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/.eslintrc.cjs diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/.eslintrc.cjs b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/.eslintrc.cjs deleted file mode 100644 index 617cb2dc2..000000000 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/.eslintrc.cjs +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: ["plugin:vue/vue3-recommended", "eslint:recommended", "@vue/eslint-config-typescript", "@vue/eslint-config-prettier"], - plugins: ["unused-imports", "simple-import-sort"], - rules: { - "prettier/prettier": ["error", { endOfLine: "auto" }], - "@typescript-eslint/no-unused-vars": "off", - "unused-imports/no-unused-imports": "warn", - "unused-imports/no-unused-vars": ["warn", { vars: "all", args: "after-used", argsIgnorePattern: "^_" }], - "simple-import-sort/imports": "error", - "simple-import-sort/exports": "error", - "vue/multi-word-component-names": "off", - "vue/valid-v-slot": ["error", { allowModifiers: true }], - }, -}; From 54e02a0e5d8e5c6bcddb85080a9a32300b2b3723 Mon Sep 17 00:00:00 2001 From: soletsdev Date: Wed, 16 Oct 2024 12:21:34 -0700 Subject: [PATCH 24/28] running gen-api --- .../src/types/openapi.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/types/openapi.d.ts b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/types/openapi.d.ts index ecac12d42..166a26377 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/types/openapi.d.ts +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/types/openapi.d.ts @@ -45,6 +45,7 @@ declare namespace Components { clientAuthenticationMethods?: { [name: string]: OidcAuthenticationSettings; } | null; + version?: string | null; } export type ApplicationStatus = "Draft" | "Submitted" | "Complete" | "Reconsideration" | "Cancelled" | "Escalated" | "Decision" | "Withdrawn" | "Pending" | "Ready" | "InProgress" | "PendingQueue" | "ReconsiderationDecision" | "AppealDecision"; export type ApplicationStatusReasonDetail = "Actioned" | "BeingAssessed" | "Certified" | "Denied" | "ForReview" | "InvestigationsConsultationNeeded" | "MoreInformationRequired" | "OperationSupervisorManagerofCertificationsConsultationNeeded" | "PendingDocuments" | "ProgramAnalystReview" | "ReadyforAssessment" | "ReceivedPending" | "ReceivePhysicalTranscripts" | "SupervisorConsultationNeeded" | "ValidatingIDs"; @@ -323,7 +324,7 @@ declare namespace Components { documents?: IdentityDocument[] | null; } export type PreviousNameSources = "NameLog" | "Profile" | "Transcript" | "OutofProvinceCertificate"; - export type PreviousNameStage = "Unverified" | "ReadyforVerification" | "Verified" | "Archived"; + export type PreviousNameStage = "Archived" | "PendingforDocuments" | "ReadyforVerification" | "Unverified" | "Verified"; export interface ProblemDetails { [name: string]: any; type?: string | null; @@ -458,6 +459,8 @@ declare namespace Components { registrationNumber?: string | null; isVerified?: boolean; unreadMessagesCount?: number; // int32 + residentialAddress?: /* Address */ Address; + mailingAddress?: /* Address */ Address; isRegistrant?: boolean; } /** From dc08bf32f8eec0b002037653d0c17ec7c9223403 Mon Sep 17 00:00:00 2001 From: Deepak Yadav Date: Fri, 18 Oct 2024 13:44:18 -0700 Subject: [PATCH 25/28] ECER-3210: Display registrant details with terms and conditions --- .../.vscode/extensions.json | 8 +- .../src/components/LookupCertification.vue | 7 +- .../components/LookupCertificationRecord.vue | 81 ++++++++++++++++++- .../src/store/lookupCertification.ts | 32 +++++++- 4 files changed, 119 insertions(+), 9 deletions(-) diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/.vscode/extensions.json b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/.vscode/extensions.json index 269dc29a6..b366e5254 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/.vscode/extensions.json +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/.vscode/extensions.json @@ -1,3 +1,7 @@ { - "recommendations": ["Vue.volar", "dbaeumer.vscode-eslint"] -} + "recommendations": [ + "Vue.volar", + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode" + ] +} \ No newline at end of file diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue index 25bc02faa..27c3761b0 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue @@ -13,8 +13,11 @@ > www.gov.bc.ca/earlychildhoodeducators - to learn more about the ECE Registry, certificate types, or status information. To find an ECE, you can search by name or registration number. The - registration number is on an ECE's certificate that's posted on the wall where they work. + to learn more about the ECE Registry, certificate types, or status information. +

+ To find an ECE, you can search by name or registration number. The registration number is on an ECE's certificate that's posted on the wall where they + work. +

diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue index 2e615fe3b..5b8eaeae9 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue @@ -7,23 +7,96 @@ mdi-chevron-leftBack to search -
TODO ECER-3210
- {{ lookupCertificationStore.certificationRecord }} +
+

{{ lookupCertificationStore.certificationRecord?.name }}

+

ECE Registration Number

+ {{ lookupCertificationStore.certificationRecord?.registrationNumber }} +

Registration Status

+
+ {{ chipText }} + + + Has Terms and Conditions + +
+ + {{ + `${lookupCertificationStore.certificationRecord?.statusCode}${ + lookupCertificationStore.certificationRecord?.hasConditions ? " with Terms and Conditions" : "" + }` + }} + +

Certification

+ {{ lookupCertificationStore.certificateLevelName }} +

Certificate expiry date

+ {{ formatDate(lookupCertificationStore.certificationRecord?.expiryDate || "", "LLLL d, yyyy") }} +
+

Terms and Conditions

+
    +
  • + {{ condition.details }} +
  • +
+
+
diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue index 7ff944838..ba6e9aa5f 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertificationRecord.vue @@ -23,7 +23,7 @@

Certification

- {{ lookupCertificationStore.certificateLevelName }} + {{ lookupCertificationStore.generateCertificateLevelName(lookupCertificationStore.certificationRecord?.levels || []) }}

Certificate expiry date

{{ formatDate(lookupCertificationStore.certificationRecord?.expiryDate || "", "LLLL d, yyyy") }}
@@ -54,6 +54,12 @@ export default defineComponent({ const { mobile } = useDisplay(); return { lookupCertificationStore, router, formatDate, mobile }; }, + mounted() { + //refresh safety + if (this.lookupCertificationStore.certificationRecord === undefined) { + this.router.push({ name: "lookup-certification" }); + } + }, computed: { sortedCertificateConditions() { // Sort the conditions based on displayOrder diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts index dd37454ba..36393801a 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/lookupCertification.ts @@ -17,9 +17,15 @@ export const useLookupCertificationStore = defineStore("lookupCertification", { lastName: "", registrationNumber: "", }), - getters: { - certificateLevelName(state): string { - const levels = state.certificationRecord?.levels!; + getters: {}, + actions: { + setCertificationSearchResults(data: Components.Schemas.CertificationLookupResponse[] | undefined): void { + this.certificationSearchResults = data; + }, + setCertificationRecord(record: Components.Schemas.CertificationLookupResponse): void { + this.certificationRecord = record; + }, + generateCertificateLevelName(levels: Components.Schemas.CertificationLevel[]) { if (levels.some((level) => level.type === "ECE 1 YR")) { return "ECE One Year"; } @@ -48,12 +54,4 @@ export const useLookupCertificationStore = defineStore("lookupCertification", { return ""; }, }, - actions: { - setCertificationSearchResults(data: Components.Schemas.CertificationLookupResponse[] | undefined): void { - this.certificationSearchResults = data; - }, - setCertificationRecord(record: Components.Schemas.CertificationLookupResponse): void { - this.certificationRecord = record; - }, - }, }); From 0c721a8d70c5341516cc46e7155cf4deece4a930 Mon Sep 17 00:00:00 2001 From: Deepak Yadav Date: Tue, 22 Oct 2024 11:48:50 -0700 Subject: [PATCH 28/28] npm run gen-api --- .../src/types/openapi.d.ts | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/types/openapi.d.ts b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/types/openapi.d.ts index 0a3dce2b6..5368d7b7d 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/types/openapi.d.ts +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/types/openapi.d.ts @@ -39,6 +39,7 @@ declare namespace Components { clientAuthenticationMethods?: { [name: string]: OidcAuthenticationSettings; } | null; + version?: string | null; } export type ApplicationStatus = | "Draft" @@ -90,9 +91,18 @@ declare namespace Components { */ applicationId?: string | null; } + export interface CertificateCondition { + id?: string | null; + name?: string | null; + details?: string | null; + startDate?: string; // date-time + endDate?: string; // date-time + displayOrder?: number; // int32 + } export type CertificateStatusCode = "Active" | "Cancelled" | "Expired" | "Inactive" | "Renewed" | "Reprinted" | "Suspended"; export interface Certification { id?: string | null; + name?: string | null; number?: string | null; expiryDate?: string | null; // date-time effectiveDate?: string | null; // date-time @@ -104,6 +114,7 @@ declare namespace Components { ineligibleReference?: YesNoNull; levels?: CertificationLevel[] | null; files?: CertificationFile[] | null; + certificateConditions?: CertificateCondition[] | null; } export interface CertificationFile { id?: string | null; @@ -116,6 +127,27 @@ declare namespace Components { id?: string | null; type?: string | null; } + export interface CertificationLookupRequest { + recaptchaToken?: string | null; + firstName?: string | null; + lastName?: string | null; + registrationNumber?: string | null; + pageSize?: number; // int32 + pageNumber?: number; // int32 + sortField?: string | null; + sortDirection?: string | null; + } + export interface CertificationLookupResponse { + id?: string | null; + name?: string | null; + registrationNumber?: string | null; + statusCode?: CertificateStatusCode; + levelName?: string | null; + expiryDate?: string | null; // date-time + hasConditions?: boolean | null; + levels?: CertificationLevel[] | null; + certificateConditions?: CertificateCondition[] | null; + } export type CertificationType = "EceAssistant" | "OneYear" | "FiveYears" | "Ite" | "Sne"; export interface CharacterReference { firstName?: string | null; @@ -713,6 +745,14 @@ declare namespace Paths { export type $400 = Components.Schemas.HttpValidationProblemDetails; } } + namespace CertificationsLookupPost { + export type RequestBody = Components.Schemas.CertificationLookupRequest; + namespace Responses { + export type $200 = Components.Schemas.CertificationLookupResponse[]; + export type $400 = Components.Schemas.ProblemDetails | Components.Schemas.HttpValidationProblemDetails; + export interface $404 {} + } + } namespace CharacterReferencePost { export type RequestBody = Components.Schemas.CharacterReferenceSubmissionRequest; namespace Responses { @@ -1074,6 +1114,14 @@ export interface OperationMethods { data?: any, config?: AxiosRequestConfig, ): OperationResponse; + /** + * certifications_lookup_post - Handles certifications lookup queries + */ + "certifications_lookup_post"( + parameters?: Parameters | null, + data?: Paths.CertificationsLookupPost.RequestBody, + config?: AxiosRequestConfig, + ): OperationResponse; /** * draftapplication_put - Save a draft application for the current user */ @@ -1337,6 +1385,16 @@ export interface PathsDictionary { config?: AxiosRequestConfig, ): OperationResponse; }; + ["/api/certifications/lookup"]: { + /** + * certifications_lookup_post - Handles certifications lookup queries + */ + "post"( + parameters?: Parameters | null, + data?: Paths.CertificationsLookupPost.RequestBody, + config?: AxiosRequestConfig, + ): OperationResponse; + }; ["/api/draftapplications/{id}"]: { /** * draftapplication_put - Save a draft application for the current user @@ -1456,10 +1514,13 @@ export type ApplicationStatusReasonDetail = Components.Schemas.ApplicationStatus export type ApplicationSubmissionRequest = Components.Schemas.ApplicationSubmissionRequest; export type ApplicationTypes = Components.Schemas.ApplicationTypes; export type CancelDraftApplicationResponse = Components.Schemas.CancelDraftApplicationResponse; +export type CertificateCondition = Components.Schemas.CertificateCondition; export type CertificateStatusCode = Components.Schemas.CertificateStatusCode; export type Certification = Components.Schemas.Certification; export type CertificationFile = Components.Schemas.CertificationFile; export type CertificationLevel = Components.Schemas.CertificationLevel; +export type CertificationLookupRequest = Components.Schemas.CertificationLookupRequest; +export type CertificationLookupResponse = Components.Schemas.CertificationLookupResponse; export type CertificationType = Components.Schemas.CertificationType; export type CharacterReference = Components.Schemas.CharacterReference; export type CharacterReferenceEvaluation = Components.Schemas.CharacterReferenceEvaluation;