Skip to content

Commit 1a2c937

Browse files
committed
WIP fixed multiple drafts being created. TODO country is strange
1 parent 44e52e9 commit 1a2c937

File tree

6 files changed

+26
-14
lines changed

6 files changed

+26
-14
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,14 @@
3131
</v-col>
3232
</v-row>
3333
</v-form>
34-
<v-btn class="mt-6" rounded="lg" color="primary" :loading="loadingStore.isLoading('draftapplication_put')" @click="continueClick" id="btnContinue">
34+
<v-btn
35+
class="mt-6"
36+
rounded="lg"
37+
color="primary"
38+
:loading="loadingStore.isLoading('draftapplication_put') || loadingStore.isLoading('icra_put')"
39+
@click="continueClick"
40+
id="btnContinue"
41+
>
3542
Continue
3643
</v-btn>
3744
</v-container>

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,17 @@ export default defineComponent({
372372
certificateTitle: "",
373373
issueDate: "",
374374
expiryDate: "",
375+
files: [],
376+
newFiles: [],
377+
deletedFiles: [],
378+
//extended file data
379+
newFilesWithData: [],
375380
//name fields
376381
previousNameRadio: undefined,
377382
otherFirstName: "",
378383
otherMiddleName: "",
379384
otherLastName: "",
380-
certificateHasOtherName: false,
385+
hasOtherName: false,
381386
//other data
382387
383388
internationalCertificationFormMode: undefined,
@@ -483,10 +488,10 @@ export default defineComponent({
483488
this.otherFirstName = internationalCertification.otherFirstName;
484489
this.otherMiddleName = internationalCertification.otherMiddleName;
485490
this.otherLastName = internationalCertification.otherLastName;
486-
this.certificateHasOtherName = internationalCertification.certificateHasOtherName;
491+
this.hasOtherName = internationalCertification.hasOtherName;
487492
488493
//set the radio button for previous names and field buttons correctly
489-
if (internationalCertification.certificateHasOtherName) {
494+
if (internationalCertification.hasOtherName) {
490495
let index = this.applicantNameRadioOptions.findIndex((option) => option.value === "other");
491496
this.previousNameRadio = this.applicantNameRadioOptions[index]?.value;
492497
} else {
@@ -530,7 +535,7 @@ export default defineComponent({
530535
otherFirstName: this.otherFirstName,
531536
otherMiddleName: this.otherMiddleName,
532537
otherLastName: this.otherLastName,
533-
certificateHasOtherName: this.certificateHasOtherName,
538+
hasOtherName: this.hasOtherName,
534539
};
535540
let updatedModelValue = this.modelValue?.slice() || []; //create a copy of the array
536541
@@ -614,7 +619,7 @@ export default defineComponent({
614619
this.otherFirstName = "";
615620
this.otherMiddleName = "";
616621
this.otherLastName = "";
617-
this.certificateHasOtherName = false;
622+
this.hasOtherName = false;
618623
//selection
619624
620625
this.internationalCertificationFormMode = undefined;
@@ -630,12 +635,12 @@ export default defineComponent({
630635
this.otherFirstName = "";
631636
this.otherMiddleName = "";
632637
this.otherLastName = "";
633-
this.certificateHasOtherName = true;
638+
this.hasOtherName = true;
634639
} else {
635640
this.otherFirstName = option.firstName;
636641
this.otherMiddleName = option.middleName;
637642
this.otherLastName = option.lastName;
638-
this.certificateHasOtherName = false;
643+
this.hasOtherName = false;
639644
}
640645
},
641646
},

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/icra.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ export const useIcraStore = defineStore("icra", {
7272
const internationalCertificationId = wizardStore.wizardConfig?.steps?.internationalCertification?.form?.inputs?.internationalCertification?.id;
7373
const employmentExperienceId = wizardStore.wizardConfig?.steps?.employmentExperience?.form?.inputs?.employmentExperience?.id;
7474

75-
console.log(internationalCertificationId);
76-
console.log(employmentExperienceId);
77-
7875
// Set wizard stage to the current step stage
7976
this.draftIcraEligibility.portalStage = wizardStore.currentStepStage as IcraEligibilityStage;
8077

@@ -121,6 +118,7 @@ export const useIcraStore = defineStore("icra", {
121118
},
122119
async saveDraft(): Promise<Components.Schemas.DraftICRAEligibilityResponse | null | undefined> {
123120
this.prepareDraftIcraEligibilityFromWizard();
121+
console.log("Draft ICRA Eligibility to be saved:", this.draftIcraEligibility);
124122
return await this.upsertDraftIcraEligibility();
125123
},
126124
async patchDraft(draftIcraEligibility: Components.Schemas.ICRAEligibility): Promise<Components.Schemas.DraftICRAEligibilityResponse | null | undefined> {

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/types/openapi.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ declare namespace Components {
339339
otherFirstName?: string | null;
340340
otherMiddleName?: string | null;
341341
otherLastName?: string | null;
342-
certificateHasOtherName?: boolean | null;
342+
hasOtherName?: boolean;
343343
countryId?: string | null;
344344
nameOfRegulatoryAuthority?: string | null;
345345
emailOfRegulatoryAuthority?: string | null;

src/ECER.Resources.Documents/ICRA/ICRARepository.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ public async Task<string> Save(ICRAEligibility iCRAEligibility, CancellationToke
7878
if (icraEligibility.ecer_DateSigned.HasValue && existingIcraEligibility.ecer_DateSigned.HasValue) icraEligibility.ecer_DateSigned = existingIcraEligibility.ecer_DateSigned;
7979

8080
icraEligibility.ecer_ICRAEligibilityAssessmentId = existingIcraEligibility.ecer_ICRAEligibilityAssessmentId;
81+
context.Detach(existingIcraEligibility);
82+
context.Attach(icraEligibility);
8183
context.UpdateObject(icraEligibility);
8284
}
8385
// Update international certifications and their files

src/ECER.Resources.Documents/ICRA/ICRARepositoryMapper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public ICRARepositoryMapper()
1313
.ForSourceMember(s => s.ApplicantId, opts => opts.DoNotValidate())
1414
.ForSourceMember(s => s.CreatedOn, opts => opts.DoNotValidate())
1515
.ForSourceMember(s => s.InternationalCertifications, opts => opts.DoNotValidate())
16-
.ForMember(d => d.Id, opts => opts.MapFrom(s => s.Id))
16+
.ForMember(d => d.ecer_ICRAEligibilityAssessmentId, opts => opts.MapFrom(s => s.Id))
1717
.ForMember(d => d.ecer_PortalStage, opts => opts.MapFrom(s => s.PortalStage))
1818
.ForMember(d => d.StatusCode, opts => opts.MapFrom(s => s.Status))
1919
.ForMember(d => d.ecer_DateSigned, opts => opts.MapFrom(s => s.SignedDate))
@@ -47,7 +47,7 @@ public ICRARepositoryMapper()
4747
.ForMember(d => d.OtherMiddleName, opts => opts.MapFrom(s => s.ecer_OtherMiddleName))
4848
.ForMember(d => d.OtherLastName, opts => opts.MapFrom(s => s.ecer_OtherLastName))
4949
.ForMember(d => d.HasOtherName, opts => opts.MapFrom(s => s.ecer_CertificateHasOtherName))
50-
.ForMember(d => d.CountryId, opts => opts.MapFrom(s => s.ecer_internationalcertification_CountryId != null ? s.ecer_internationalcertification_CountryId.ecer_CountryId.ToString() : null))
50+
.ForMember(d => d.CountryId, opts => opts.MapFrom(s => s.ecer_CountryId != null ? s.ecer_CountryId.Id.ToString() : null))
5151
.ForMember(d => d.NameOfRegulatoryAuthority, opts => opts.MapFrom(s => s.ecer_AuthorityName))
5252
.ForMember(d => d.EmailOfRegulatoryAuthority, opts => opts.MapFrom(s => s.ecer_AuthorityEmail))
5353
.ForMember(d => d.PhoneOfRegulatoryAuthority, opts => opts.MapFrom(s => s.ecer_AuthorityPhone))

0 commit comments

Comments
 (0)