Skip to content

Commit

Permalink
Merge pull request #2410 from ytqsl/release/R3.4.0
Browse files Browse the repository at this point in the history
EMBCESSMOD-5643: etransfer supports are stuck in pending
  • Loading branch information
ytqsl authored Jul 23, 2024
2 parents 4f03d80 + c6bf8bc commit 4ecc058
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 16 deletions.
6 changes: 3 additions & 3 deletions ess/src/API/EMBC.ESS/Managers/Events/EventsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public async Task<string> Handle(SubmitEvacuationFileCommand cmd)
if (evacuee == null) throw new NotFoundException($"Registrant not found '{file.PrimaryRegistrantId}'", file.PrimaryRegistrantId);
file.PrimaryRegistrantId = evacuee.Id;

var caseId = (await evacuationRepository.Manage(new SubmitEvacuationFileNeedsAssessment { EvacuationFile = file })).Id;
var fileId = (await evacuationRepository.Manage(new SubmitEvacuationFileNeedsAssessment { EvacuationFile = file })).Id;

var shouldEmailNotification = string.IsNullOrEmpty(file.Id) && !string.IsNullOrEmpty(evacuee.Email) && string.IsNullOrEmpty(file.ManualFileId);
if (shouldEmailNotification)
Expand All @@ -98,10 +98,10 @@ await SendEmailNotification(
SubmissionTemplateType.NewEvacuationFileSubmission,
email: evacuee.Email,
name: $"{evacuee.LastName}, {evacuee.FirstName}",
tokens: new[] { KeyValuePair.Create("fileNumber", caseId) });
tokens: new[] { KeyValuePair.Create("fileNumber", fileId) });
}

return caseId;
return fileId;
}

public async Task<string> Handle(SaveRegistrantCommand cmd)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public async Task<string> Create(EssContext essContext, EvacuationFile evacuatio
public async Task<string> Update(EssContext essContext, EvacuationFile evacuationFile, CancellationToken ct)
{
var currentFile = await essContext.era_evacuationfiles
.Expand(f => f.era_CurrentNeedsAssessmentid)
.Expand(f => f.era_TaskId)
.Expand(f => f.era_era_evacuationfile_era_householdmember_EvacuationFileid)
.Expand(f => f.era_era_evacuationfile_era_animal_ESSFileid)
Expand All @@ -128,6 +129,7 @@ public async Task<string> Update(EssContext essContext, EvacuationFile evacuatio
file.era_evacuationfileid = currentFile.era_evacuationfileid;
file.era_TaskId = currentFile.era_TaskId;
file.era_era_evacuationfile_era_householdmember_EvacuationFileid = currentFile.era_era_evacuationfile_era_householdmember_EvacuationFileid;
file.era_CurrentNeedsAssessmentid.era_needsassessmenttype = (int)(file.statuscode == (int)EvacuationFileStatus.Pending ? NeedsAssessmentTypeOptionSet.Preliminary : NeedsAssessmentTypeOptionSet.Assessed);

essContext.AttachTo(nameof(essContext.era_evacuationfiles), file);
essContext.SetLink(file, nameof(era_evacuationfile.era_EvacuatedFromID), essContext.LookupJurisdictionByCode(file._era_evacuatedfromid_value?.ToString()));
Expand All @@ -137,7 +139,7 @@ public async Task<string> Update(EssContext essContext, EvacuationFile evacuatio

AddNeedsAssessment(essContext, file, file.era_CurrentNeedsAssessmentid);

AssignToTask(essContext, file, evacuationFile.TaskId);
AssignToTask(essContext, file, evacuationFile.TaskId ?? currentFile.era_TaskId?.era_name);

await essContext.SaveChangesAsync(ct);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AfterViewChecked, AfterViewInit, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup, UntypedFormGroup } from '@angular/forms';
import { AfterViewChecked, AfterViewInit, ChangeDetectorRef, Component, input, OnInit, ViewChild } from '@angular/core';
import { FormGroup, UntypedFormGroup } from '@angular/forms';
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { ComponentMetaDataModel } from '../../core/model/componentMetaData.model';
import { ComponentCreationService, NeedsAssessmentSteps } from '../../core/services/componentCreation.service';
Expand All @@ -12,7 +12,7 @@ import { NonVerifiedRegistrationService } from '../non-verified-registration/non
import { NeedsAssessmentService } from './needs-assessment.service';
import { EvacuationFileDataService } from '../../sharedModules/components/evacuation-file/evacuation-file-data.service';
import * as globalConst from '../../core/services/globalConstants';
import { switchMap, take, tap } from 'rxjs/operators';
import { switchMap, tap } from 'rxjs/operators';
import { CaptchaResponse, CaptchaResponseType } from 'src/app/core/components/captcha-v2/captcha-v2.component';
import { AppLoaderComponent } from '../../core/components/app-loader/app-loader.component';
import { AlertComponent } from '../../core/components/alert/alert.component';
Expand All @@ -21,8 +21,6 @@ import { MatButtonModule } from '@angular/material/button';
import { ComponentWrapperComponent } from '../../sharedModules/components/component-wrapper/component-wrapper.component';
import { DraftSupports, EligibilityCheck, EvacuationFileStatus } from 'src/app/core/api/models';
import { SupportsService } from 'src/app/core/api/services';
import { input } from '@angular/core';
import { CustomValidationService } from 'src/app/core/services/customValidation.service';
import IdentifyNeedsComponent from 'src/app/sharedModules/forms/needs-assessment-forms/identify-needs/identify-needs.component';

@Component({
Expand Down Expand Up @@ -251,18 +249,21 @@ export class NeedsAssessmentComponent implements OnInit, AfterViewInit, AfterVie
this.evacuationFileDataService.evacuatedAddress = this.form.get('evacuatedFromAddress').value;
this.needsAssessmentService.insurance = this.form.get('insurance').value;
break;

case NeedsAssessmentSteps.FamilyAndPetsInformation:
this.needsAssessmentService.setHouseHoldMembers(this.form.get('householdMemberForm').value.householdMembers);

this.needsAssessmentService.pets = this.form.get('petsForm').value.pets;
break;

case NeedsAssessmentSteps.IdentifyNeeds:
this.needsAssessmentService.setNeedsDetails(this.form);
break;

case NeedsAssessmentSteps.Secret:
this.evacuationFileDataService.secretPhrase = this.form.get('secretPhrase').value;
this.evacuationFileDataService.secretPhraseEdited = true;
break;

default:
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { ReferralDetailsComponent } from '../referral-details/referral-details.c
import { ReviewComponent } from '../../../../feature-components/review/review.component';
import { MatCardModule } from '@angular/material/card';
import { MatButtonModule } from '@angular/material/button';
import { EvacuationFileMappingService } from '../evacuation-file-mapping.service';

@Component({
selector: 'app-evacuation-details',
Expand Down Expand Up @@ -51,7 +52,8 @@ export class EvacuationDetailsComponent implements OnInit, AfterViewInit {
private router: Router,
public evacuationFileDataService: EvacuationFileDataService,
private datePipe: DatePipe,
private cd: ChangeDetectorRef
private cd: ChangeDetectorRef,
private evacuationFileMappingService: EvacuationFileMappingService
) {}

ngOnInit(): void {
Expand Down Expand Up @@ -93,11 +95,19 @@ export class EvacuationDetailsComponent implements OnInit, AfterViewInit {
}

gotoUpdateDetails() {
this.router.navigate([
'/verified-registration/needs-assessment',
this.evacuationFileDataService.essFileId,
'update'
]);
this.evacuationFilesService.getCurrentEvacuationFiles().subscribe((files) => {
const file = files.find((f) => f.fileId === this.evacuationFileDataService.essFileId);
if (!file) {
console.error('No current evacuation file found');
return;
}
this.evacuationFileMappingService.mapEvacuationFile(file);
this.router.navigate([
'/verified-registration/needs-assessment',
this.evacuationFileDataService.essFileId,
'update'
]);
});
}

allowEdition(): boolean {
Expand Down

0 comments on commit 4ecc058

Please sign in to comment.