From f6c13155dc6d0d24117d3be8dae11139d520a658 Mon Sep 17 00:00:00 2001 From: shruthi-rapala Date: Fri, 20 Dec 2024 14:18:59 -0800 Subject: [PATCH] EMCRI # 843 Portal: On submitted Claim, don't display certain values until claim BPF has reached Decision Made - Added stage and substage fields in the dynamisc gate way - Added stage and status fields to the entity - Updated the recovery claims mappings - Updated the logic to show the decisions only if tehy are in approved states --- .../Models/Dynamics/DynamicsGateway.cs | 5 ++++- .../ConfigurationModule/Models/Dynamics/Entities.cs | 3 +++ .../EMBC.DFA.PUBLIC.API/Controllers/SharedModels.cs | 2 ++ .../src/API/EMBC.DFA.PUBLIC.API/Mappers/Mappings.cs | 7 +++++-- .../src/app/core/api/models/recovery-claim.ts | 2 ++ .../recovery-claim/recovery-claim.component.html | 2 ++ .../recovery-claim/recovery-claim.component.ts | 11 ++++++++++- 7 files changed, 28 insertions(+), 4 deletions(-) diff --git a/dfa-public/src/API/EMBC.DFA.PUBLIC.API/ConfigurationModule/Models/Dynamics/DynamicsGateway.cs b/dfa-public/src/API/EMBC.DFA.PUBLIC.API/ConfigurationModule/Models/Dynamics/DynamicsGateway.cs index 95ab14310..e598c6237 100644 --- a/dfa-public/src/API/EMBC.DFA.PUBLIC.API/ConfigurationModule/Models/Dynamics/DynamicsGateway.cs +++ b/dfa-public/src/API/EMBC.DFA.PUBLIC.API/ConfigurationModule/Models/Dynamics/DynamicsGateway.cs @@ -1250,7 +1250,7 @@ public async Task GetClaimDetailsAsync(string claimId) "dfa_finalclaim", "createdon", "dfa_claimreceivedbyemcrdate", "dfa_totaleligiblegst", "dfa_totaloftotaleligible", "dfa_totalapproved", "dfa_lessfirst1000", "dfa_costsharing", "dfa_eligiblepayable", "dfa_totalpaid", "dfa_claimpaiddate", - "dfa_claimtotal", "dfa_paidclaimamount", "dfa_onetimedeductionamount" + "dfa_claimtotal", "dfa_paidclaimamount", "dfa_onetimedeductionamount", "dfa_claimbpfstages", "dfa_claimbpfsubstages" }, Filter = $"dfa_projectclaimid eq {claimId}" }); @@ -1274,6 +1274,9 @@ public async Task GetClaimDetailsAsync(string claimId) dfa_totalpaid = objApp.dfa_totalpaid, dfa_claimtotal = objApp.dfa_claimtotal, dfa_paidclaimamount = objApp.dfa_paidclaimamount, + dfa_claimbpfstages = objApp.dfa_claimbpfstages, + dfa_claimbpfsubstages = objApp.dfa_claimbpfsubstages + }).AsEnumerable().OrderByDescending(m => m.createdon); return lstApps.FirstOrDefault(); diff --git a/dfa-public/src/API/EMBC.DFA.PUBLIC.API/ConfigurationModule/Models/Dynamics/Entities.cs b/dfa-public/src/API/EMBC.DFA.PUBLIC.API/ConfigurationModule/Models/Dynamics/Entities.cs index c29f9eea7..ca6cd2e02 100644 --- a/dfa-public/src/API/EMBC.DFA.PUBLIC.API/ConfigurationModule/Models/Dynamics/Entities.cs +++ b/dfa-public/src/API/EMBC.DFA.PUBLIC.API/ConfigurationModule/Models/Dynamics/Entities.cs @@ -305,6 +305,9 @@ public class dfa_claim_retrieve public string? dfa_claimtotal { get; set; } public string? dfa_paidclaimamount { get; set; } public string? dfa_onetimedeductionamount { get; set; } + public string? dfa_claimbpfstages { get; set; } + public string? dfa_claimbpfsubstages { get; set; } + } public class dfa_appapplicationmain_retrieve diff --git a/dfa-public/src/API/EMBC.DFA.PUBLIC.API/Controllers/SharedModels.cs b/dfa-public/src/API/EMBC.DFA.PUBLIC.API/Controllers/SharedModels.cs index c6e8a290e..158ebf173 100644 --- a/dfa-public/src/API/EMBC.DFA.PUBLIC.API/Controllers/SharedModels.cs +++ b/dfa-public/src/API/EMBC.DFA.PUBLIC.API/Controllers/SharedModels.cs @@ -591,6 +591,8 @@ public class RecoveryClaim public string? paidClaimDate { get; set; } public string? claimReceivedByEMCRDate { get; set; } public Invoice[]? invoices { get; set; } + public string stage { get; set; } + public string status { get; set; } } public class Invoice diff --git a/dfa-public/src/API/EMBC.DFA.PUBLIC.API/Mappers/Mappings.cs b/dfa-public/src/API/EMBC.DFA.PUBLIC.API/Mappers/Mappings.cs index c3ce74ff9..d9b4dc902 100644 --- a/dfa-public/src/API/EMBC.DFA.PUBLIC.API/Mappers/Mappings.cs +++ b/dfa-public/src/API/EMBC.DFA.PUBLIC.API/Mappers/Mappings.cs @@ -561,8 +561,11 @@ public Mappings() .ForMember(d => d.paidClaimAmount, opts => opts.MapFrom(s => string.IsNullOrEmpty(s.dfa_paidclaimamount) ? "0" : s.dfa_paidclaimamount)) .ForMember(d => d.claimReceivedByEMCRDate, opts => opts.MapFrom(s => Convert.ToDateTime(s.dfa_claimreceivedbyemcrdate).Year < 2020 ? "Date Not Set" : Convert.ToDateTime(s.dfa_claimreceivedbyemcrdate).ToString("MM/dd/yyyy", CultureInfo.InvariantCulture))) .ForMember(d => d.paidClaimDate, opts => opts.MapFrom(s => Convert.ToDateTime(s.dfa_claimpaiddate).Year < 2020 ? "Date Not Set" : Convert.ToDateTime(s.dfa_claimpaiddate).ToString("MM/dd/yyyy", CultureInfo.InvariantCulture))) - - ; + .ForMember(d => d.status, opts => opts.MapFrom(s => !string.IsNullOrEmpty(s.dfa_claimbpfstages) ? GetEnumDescription((ClaimStages)Convert.ToInt32(s.dfa_claimbpfstages)) : null)) + .ForMember(d => d.stage, opts => opts.MapFrom(s => !string.IsNullOrEmpty(s.dfa_claimbpfsubstages) ? + (Convert.ToInt32(s.dfa_claimbpfstages) == Convert.ToInt32(ClaimStages.Draft) ? null : GetEnumDescription((ClaimSubStages)Convert.ToInt32(s.dfa_claimbpfsubstages))) + : null)); + CreateMap() .ForMember(d => d.DateOfDamage, opts => opts.MapFrom(s => s.dfa_dateofdamage)) diff --git a/dfa-public/src/UI/embc-dfa/src/app/core/api/models/recovery-claim.ts b/dfa-public/src/UI/embc-dfa/src/app/core/api/models/recovery-claim.ts index 6dbb41393..21c8e971c 100644 --- a/dfa-public/src/UI/embc-dfa/src/app/core/api/models/recovery-claim.ts +++ b/dfa-public/src/UI/embc-dfa/src/app/core/api/models/recovery-claim.ts @@ -19,6 +19,8 @@ export interface RecoveryClaim { isThisFinalClaim?: null | boolean; paidClaimAmount?: null | string; paidClaimDate?: null | string; + stage?: string; + status?: string; totalActualClaim?: null | string; totalInvoicesBeingClaimed?: null | string; } diff --git a/dfa-public/src/UI/embc-dfa/src/app/sharedModules/forms/dfa-claim-main-forms/recovery-claim/recovery-claim.component.html b/dfa-public/src/UI/embc-dfa/src/app/sharedModules/forms/dfa-claim-main-forms/recovery-claim/recovery-claim.component.html index 32ea0b883..d87277d17 100644 --- a/dfa-public/src/UI/embc-dfa/src/app/sharedModules/forms/dfa-claim-main-forms/recovery-claim/recovery-claim.component.html +++ b/dfa-public/src/UI/embc-dfa/src/app/sharedModules/forms/dfa-claim-main-forms/recovery-claim/recovery-claim.component.html @@ -197,6 +197,7 @@
+ @if(recoveryClaim.claim.stage == DecisionEnum.Approved || recoveryClaim.claim.stage == DecisionEnum.ApprovedwithExclusions){
Decision @@ -365,6 +366,7 @@
+ } diff --git a/dfa-public/src/UI/embc-dfa/src/app/sharedModules/forms/dfa-claim-main-forms/recovery-claim/recovery-claim.component.ts b/dfa-public/src/UI/embc-dfa/src/app/sharedModules/forms/dfa-claim-main-forms/recovery-claim/recovery-claim.component.ts index 2851e78e1..8ebd3f040 100644 --- a/dfa-public/src/UI/embc-dfa/src/app/sharedModules/forms/dfa-claim-main-forms/recovery-claim/recovery-claim.component.ts +++ b/dfa-public/src/UI/embc-dfa/src/app/sharedModules/forms/dfa-claim-main-forms/recovery-claim/recovery-claim.component.ts @@ -24,7 +24,7 @@ import { MatRadioModule } from '@angular/material/radio'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatInputModule } from '@angular/material/input'; import { DFAApplicationMainDataService } from 'src/app/feature-components/dfa-application-main/dfa-application-main-data.service'; -import { ApplicantOption, ApplicantSubtypeSubCategories } from 'src/app/core/api/models'; +import { ApplicantOption, ApplicantSubtypeSubCategories, DfaClaimMain } from 'src/app/core/api/models'; import { MatTableModule } from '@angular/material/table'; import { CustomPipeModule } from 'src/app/core/pipe/customPipe.module'; import { DFADeleteConfirmDialogComponent } from '../../../../core/components/dialog-components/dfa-confirm-delete-dialog/dfa-confirm-delete.component'; @@ -42,6 +42,7 @@ import { MAT_TOOLTIP_DEFAULT_OPTIONS, MatTooltipDefaultOptions } from '@angular/ import { DFAClaimMainDataService } from '../../../../feature-components/dfa-claim-main/dfa-claim-main-data.service'; import { DFAClaimMainMappingService } from '../../../../feature-components/dfa-claim-main/dfa-claim-main-mapping.service'; import { ActivatedRoute } from '@angular/router'; +import { Decision } from 'src/app/models/decision.enum'; export const myCustomTooltipDefaults: MatTooltipDefaultOptions = { showDelay: 0, @@ -58,6 +59,9 @@ export const myCustomTooltipDefaults: MatTooltipDefaultOptions = { providers: [{ provide: MAT_TOOLTIP_DEFAULT_OPTIONS, useValue: myCustomTooltipDefaults }] }) export default class RecoveryClaimComponent implements OnInit, OnDestroy { + + DecisionEnum = Decision; + //@ViewChild('projectName') projectName: ElementRef; message : string = ''; recoveryClaimForm: UntypedFormGroup; @@ -86,6 +90,8 @@ export default class RecoveryClaimComponent implements OnInit, OnDestroy { /\d/ ]; + recoveryClaim?: DfaClaimMain; + constructor( @Inject('formBuilder') formBuilder: UntypedFormBuilder, @Inject('formCreationService') formCreationService: FormCreationService, @@ -237,10 +243,13 @@ export default class RecoveryClaimComponent implements OnInit, OnDestroy { } } + + getRecoveryClaim(claimId: string) { if (claimId) { this.claimService.claimGetClaimMain({ claimId: claimId }).subscribe({ next: (dfaClaimMain) => { + this.recoveryClaim = dfaClaimMain; this.dfaClaimMainMapping.mapDFAClaimMain(dfaClaimMain); },