diff --git a/responders/src/API/EMBC.Responders.API/Configuration.cs b/responders/src/API/EMBC.Responders.API/Configuration.cs index 1072f8920..44a2858b5 100644 --- a/responders/src/API/EMBC.Responders.API/Configuration.cs +++ b/responders/src/API/EMBC.Responders.API/Configuration.cs @@ -1,15 +1,16 @@ using System; using System.Reflection; using System.Security.Claims; -using System.Threading.Tasks; +using System.Text.Json; +using System.Text.Json.Serialization; using EMBC.Responders.API.Services; using EMBC.Utilities.Configuration; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; using Microsoft.IdentityModel.Logging; using Microsoft.IdentityModel.Tokens; using Microsoft.OpenApi.Models; @@ -23,6 +24,12 @@ public void ConfigureServices(ConfigurationServices configurationServices) { var services = configurationServices.Services; + services.Configure(opts => + { + opts.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()); + opts.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase; + }); + services.AddAuthentication(options => { options.DefaultScheme = JwtBearerDefaults.AuthenticationScheme; @@ -52,7 +59,7 @@ public void ConfigureServices(ConfigurationServices configurationServices) var userService = c.HttpContext.RequestServices.GetRequiredService(); c.Principal = await userService.GetPrincipal(c.Principal); } - }; + }; options.Validate(); }); services.AddAuthorization(options => @@ -94,7 +101,6 @@ public void ConfigureServices(ConfigurationServices configurationServices) }); opts.CustomOperationIds(apiDesc => apiDesc.TryGetMethodInfo(out MethodInfo methodInfo) ? $"{apiDesc.ActionDescriptor.RouteValues["controller"]}{methodInfo.Name}" : null); opts.OperationFilter(); - opts.UseOneOfForPolymorphism(); opts.UseAllOfForInheritance(); }); diff --git a/responders/src/API/EMBC.Responders.API/Controllers/RegistrationsController.Supports.cs b/responders/src/API/EMBC.Responders.API/Controllers/RegistrationsController.Supports.cs index 17682c708..2110f0275 100644 --- a/responders/src/API/EMBC.Responders.API/Controllers/RegistrationsController.Supports.cs +++ b/responders/src/API/EMBC.Responders.API/Controllers/RegistrationsController.Supports.cs @@ -14,6 +14,7 @@ using EMBC.Utilities.Extensions; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using Swashbuckle.AspNetCore.Annotations; namespace EMBC.Responders.API.Controllers; @@ -179,11 +180,13 @@ public async Task> ReprintSupport(str /// evacuation file number /// print request id /// Blob of the print request results + [SwaggerResponse((int)HttpStatusCode.OK, "GetPrint", typeof(FileContentResult))] [HttpGet("files/{fileId}/supports/print/{printRequestId}")] public async Task GetPrint(string fileId, string printRequestId) { var result = await messagingClient.Send(new PrintRequestQuery { PrintRequestId = printRequestId, RequestingUserId = currentUserId }); Response.Headers.Append("Content-Disposition", "attachment;filename=" + result.FileName); + Response.Headers.Append("Content-Type", "application/octet-stream"); return new FileContentResult(result.Content, result.ContentType); } diff --git a/responders/src/API/EMBC.Responders.API/EMBC.Responders.API.csproj b/responders/src/API/EMBC.Responders.API/EMBC.Responders.API.csproj index 28bb60303..e0aab6fc6 100644 --- a/responders/src/API/EMBC.Responders.API/EMBC.Responders.API.csproj +++ b/responders/src/API/EMBC.Responders.API/EMBC.Responders.API.csproj @@ -23,6 +23,7 @@ + diff --git a/responders/src/UI/embc-responder/src/app/core/api/fn/configuration/configuration-get-codes.ts b/responders/src/UI/embc-responder/src/app/core/api/fn/configuration/configuration-get-codes.ts index d47784dcc..599f0ce8e 100644 --- a/responders/src/UI/embc-responder/src/app/core/api/fn/configuration/configuration-get-codes.ts +++ b/responders/src/UI/embc-responder/src/app/core/api/fn/configuration/configuration-get-codes.ts @@ -7,7 +7,6 @@ import { StrictHttpResponse } from '../../strict-http-response'; import { RequestBuilder } from '../../request-builder'; import { Code } from '../../models/code'; -import { CommunityCode } from '../../models/community-code'; export interface ConfigurationGetCodes$Params { forEnumType?: string; @@ -18,7 +17,7 @@ export function configurationGetCodes( rootUrl: string, params?: ConfigurationGetCodes$Params, context?: HttpContext -): Observable>> { +): Observable>> { const rb = new RequestBuilder(rootUrl, configurationGetCodes.PATH, 'get'); if (params) { rb.query('forEnumType', params.forEnumType, {}); @@ -27,7 +26,7 @@ export function configurationGetCodes( return http.request(rb.build({ responseType: 'json', accept: 'application/json', context })).pipe( filter((r: any): r is HttpResponse => r instanceof HttpResponse), map((r: HttpResponse) => { - return r as StrictHttpResponse>; + return r as StrictHttpResponse>; }) ); } diff --git a/responders/src/UI/embc-responder/src/app/core/api/fn/registrations/registrations-get-print.ts b/responders/src/UI/embc-responder/src/app/core/api/fn/registrations/registrations-get-print.ts index 6d8cfa6c8..e437c9eb3 100644 --- a/responders/src/UI/embc-responder/src/app/core/api/fn/registrations/registrations-get-print.ts +++ b/responders/src/UI/embc-responder/src/app/core/api/fn/registrations/registrations-get-print.ts @@ -7,14 +7,7 @@ import { StrictHttpResponse } from '../../strict-http-response'; import { RequestBuilder } from '../../request-builder'; export interface RegistrationsGetPrint$Params { - /** - * evacuation file number - */ fileId: string; - - /** - * print request id - */ printRequestId: string; } @@ -30,7 +23,7 @@ export function registrationsGetPrint( rb.path('printRequestId', params.printRequestId, {}); } - return http.request(rb.build({ responseType: 'blob', accept: 'application/octet-stream', context })).pipe( + return http.request(rb.build({ responseType: 'blob', accept: 'application/json', context })).pipe( filter((r: any): r is HttpResponse => r instanceof HttpResponse), map((r: HttpResponse) => { return r as StrictHttpResponse; diff --git a/responders/src/UI/embc-responder/src/app/core/api/fn/registrations/registrations-search-supports.ts b/responders/src/UI/embc-responder/src/app/core/api/fn/registrations/registrations-search-supports.ts index 952828cea..33110d0cd 100644 --- a/responders/src/UI/embc-responder/src/app/core/api/fn/registrations/registrations-search-supports.ts +++ b/responders/src/UI/embc-responder/src/app/core/api/fn/registrations/registrations-search-supports.ts @@ -6,16 +6,7 @@ import { filter, map } from 'rxjs/operators'; import { StrictHttpResponse } from '../../strict-http-response'; import { RequestBuilder } from '../../request-builder'; -import { ClothingSupport } from '../../models/clothing-support'; -import { FoodGroceriesSupport } from '../../models/food-groceries-support'; -import { FoodRestaurantSupport } from '../../models/food-restaurant-support'; -import { IncidentalsSupport } from '../../models/incidentals-support'; -import { LodgingAllowanceSupport } from '../../models/lodging-allowance-support'; -import { LodgingBilletingSupport } from '../../models/lodging-billeting-support'; -import { LodgingGroupSupport } from '../../models/lodging-group-support'; -import { LodgingHotelSupport } from '../../models/lodging-hotel-support'; -import { TransportationOtherSupport } from '../../models/transportation-other-support'; -import { TransportationTaxiSupport } from '../../models/transportation-taxi-support'; +import { Support } from '../../models/support'; export interface RegistrationsSearchSupports$Params { manualReferralId?: string; @@ -27,22 +18,7 @@ export function registrationsSearchSupports( rootUrl: string, params?: RegistrationsSearchSupports$Params, context?: HttpContext -): Observable< - StrictHttpResponse< - Array< - | ClothingSupport - | IncidentalsSupport - | FoodGroceriesSupport - | FoodRestaurantSupport - | LodgingHotelSupport - | LodgingBilletingSupport - | LodgingGroupSupport - | LodgingAllowanceSupport - | TransportationTaxiSupport - | TransportationOtherSupport - > - > -> { +): Observable>> { const rb = new RequestBuilder(rootUrl, registrationsSearchSupports.PATH, 'get'); if (params) { rb.query('manualReferralId', params.manualReferralId, {}); @@ -52,20 +28,7 @@ export function registrationsSearchSupports( return http.request(rb.build({ responseType: 'json', accept: 'application/json', context })).pipe( filter((r: any): r is HttpResponse => r instanceof HttpResponse), map((r: HttpResponse) => { - return r as StrictHttpResponse< - Array< - | ClothingSupport - | IncidentalsSupport - | FoodGroceriesSupport - | FoodRestaurantSupport - | LodgingHotelSupport - | LodgingBilletingSupport - | LodgingGroupSupport - | LodgingAllowanceSupport - | TransportationTaxiSupport - | TransportationOtherSupport - > - >; + return r as StrictHttpResponse>; }) ); } diff --git a/responders/src/UI/embc-responder/src/app/core/api/models/code.ts b/responders/src/UI/embc-responder/src/app/core/api/models/code.ts index 293b7944e..f1b545b0b 100644 --- a/responders/src/UI/embc-responder/src/app/core/api/models/code.ts +++ b/responders/src/UI/embc-responder/src/app/core/api/models/code.ts @@ -1,10 +1,9 @@ /* tslint:disable */ /* eslint-disable */ -import { CommunityCode } from '../models/community-code'; export interface Code { description?: string | null; isActive?: boolean; - parentCode?: (Code | CommunityCode) | null; + parentCode?: Code; type?: string | null; value?: string | null; } diff --git a/responders/src/UI/embc-responder/src/app/core/api/models/evacuation-file.ts b/responders/src/UI/embc-responder/src/app/core/api/models/evacuation-file.ts index f2b425fd2..44aa338d0 100644 --- a/responders/src/UI/embc-responder/src/app/core/api/models/evacuation-file.ts +++ b/responders/src/UI/embc-responder/src/app/core/api/models/evacuation-file.ts @@ -1,21 +1,12 @@ /* tslint:disable */ /* eslint-disable */ import { Address } from '../models/address'; -import { ClothingSupport } from '../models/clothing-support'; import { EvacuationFileHouseholdMember } from '../models/evacuation-file-household-member'; import { EvacuationFileStatus } from '../models/evacuation-file-status'; import { EvacuationFileTask } from '../models/evacuation-file-task'; -import { FoodGroceriesSupport } from '../models/food-groceries-support'; -import { FoodRestaurantSupport } from '../models/food-restaurant-support'; -import { IncidentalsSupport } from '../models/incidentals-support'; -import { LodgingAllowanceSupport } from '../models/lodging-allowance-support'; -import { LodgingBilletingSupport } from '../models/lodging-billeting-support'; -import { LodgingGroupSupport } from '../models/lodging-group-support'; -import { LodgingHotelSupport } from '../models/lodging-hotel-support'; import { NeedsAssessment } from '../models/needs-assessment'; import { Note } from '../models/note'; -import { TransportationOtherSupport } from '../models/transportation-other-support'; -import { TransportationTaxiSupport } from '../models/transportation-taxi-support'; +import { Support } from '../models/support'; export interface EvacuationFile { completedBy?: string | null; completedOn?: string | null; @@ -35,17 +26,6 @@ export interface EvacuationFile { securityPhrase?: string | null; securityPhraseEdited?: boolean | null; status?: EvacuationFileStatus; - supports?: Array< - | ClothingSupport - | IncidentalsSupport - | FoodGroceriesSupport - | FoodRestaurantSupport - | LodgingHotelSupport - | LodgingBilletingSupport - | LodgingGroupSupport - | LodgingAllowanceSupport - | TransportationTaxiSupport - | TransportationOtherSupport - > | null; + supports?: Array | null; task: EvacuationFileTask; } diff --git a/responders/src/UI/embc-responder/src/app/core/api/models/process-digital-supports-request.ts b/responders/src/UI/embc-responder/src/app/core/api/models/process-digital-supports-request.ts index f182a9814..a5995bd96 100644 --- a/responders/src/UI/embc-responder/src/app/core/api/models/process-digital-supports-request.ts +++ b/responders/src/UI/embc-responder/src/app/core/api/models/process-digital-supports-request.ts @@ -3,5 +3,5 @@ import { Support } from '../models/support'; export interface ProcessDigitalSupportsRequest { includeSummaryInPrintRequest?: boolean; - supports?: Array; + supports?: Array | null; } diff --git a/responders/src/UI/embc-responder/src/app/core/api/models/process-paper-referrals-request.ts b/responders/src/UI/embc-responder/src/app/core/api/models/process-paper-referrals-request.ts index 66b15bd03..cb8264ef6 100644 --- a/responders/src/UI/embc-responder/src/app/core/api/models/process-paper-referrals-request.ts +++ b/responders/src/UI/embc-responder/src/app/core/api/models/process-paper-referrals-request.ts @@ -2,5 +2,5 @@ /* eslint-disable */ import { Support } from '../models/support'; export interface ProcessPaperReferralsRequest { - referrals?: Array; + referrals?: Array | null; } diff --git a/responders/src/UI/embc-responder/src/app/core/api/models/support-sub-category.ts b/responders/src/UI/embc-responder/src/app/core/api/models/support-sub-category.ts index ce725a1f5..6327fbd1d 100644 --- a/responders/src/UI/embc-responder/src/app/core/api/models/support-sub-category.ts +++ b/responders/src/UI/embc-responder/src/app/core/api/models/support-sub-category.ts @@ -2,12 +2,12 @@ /* eslint-disable */ export enum SupportSubCategory { None = 'None', - Lodging_Hotel = 'Lodging_Hotel', - Lodging_Billeting = 'Lodging_Billeting', - Lodging_Group = 'Lodging_Group', - Lodging_Allowance = 'Lodging_Allowance', - Food_Groceries = 'Food_Groceries', - Food_Restaurant = 'Food_Restaurant', - Transportation_Taxi = 'Transportation_Taxi', - Transportation_Other = 'Transportation_Other' + LodgingHotel = 'Lodging_Hotel', + LodgingBilleting = 'Lodging_Billeting', + LodgingGroup = 'Lodging_Group', + LodgingAllowance = 'Lodging_Allowance', + FoodGroceries = 'Food_Groceries', + FoodRestaurant = 'Food_Restaurant', + TransportationTaxi = 'Transportation_Taxi', + TransportationOther = 'Transportation_Other' } diff --git a/responders/src/UI/embc-responder/src/app/core/api/services/configuration.service.ts b/responders/src/UI/embc-responder/src/app/core/api/services/configuration.service.ts index b2a6e5afb..e7aba1089 100644 --- a/responders/src/UI/embc-responder/src/app/core/api/services/configuration.service.ts +++ b/responders/src/UI/embc-responder/src/app/core/api/services/configuration.service.ts @@ -79,7 +79,7 @@ export class ConfigurationService extends BaseService { configurationGetCodes$Response( params?: ConfigurationGetCodes$Params, context?: HttpContext - ): Observable>> { + ): Observable>> { return configurationGetCodes(this.http, this.rootUrl, params, context); } @@ -89,12 +89,9 @@ export class ConfigurationService extends BaseService { * * This method doesn't expect any request body. */ - configurationGetCodes( - params?: ConfigurationGetCodes$Params, - context?: HttpContext - ): Observable> { + configurationGetCodes(params?: ConfigurationGetCodes$Params, context?: HttpContext): Observable> { return this.configurationGetCodes$Response(params, context).pipe( - map((r: StrictHttpResponse>): Array => r.body) + map((r: StrictHttpResponse>): Array => r.body) ); } diff --git a/responders/src/UI/embc-responder/src/app/core/api/services/registrations.service.ts b/responders/src/UI/embc-responder/src/app/core/api/services/registrations.service.ts index 1310d9732..b40b4eac4 100644 --- a/responders/src/UI/embc-responder/src/app/core/api/services/registrations.service.ts +++ b/responders/src/UI/embc-responder/src/app/core/api/services/registrations.service.ts @@ -9,19 +9,11 @@ import { BaseService } from '../base-service'; import { ApiConfiguration } from '../api-configuration'; import { StrictHttpResponse } from '../strict-http-response'; -import { ClothingSupport } from '../models/clothing-support'; import { EvacuationFile } from '../models/evacuation-file'; import { EvacuationFileSearchResult } from '../models/evacuation-file-search-result'; import { EvacuationFileSummary } from '../models/evacuation-file-summary'; -import { FoodGroceriesSupport } from '../models/food-groceries-support'; -import { FoodRestaurantSupport } from '../models/food-restaurant-support'; import { GetSecurityPhraseResponse } from '../models/get-security-phrase-response'; import { GetSecurityQuestionsResponse } from '../models/get-security-questions-response'; -import { IncidentalsSupport } from '../models/incidentals-support'; -import { LodgingAllowanceSupport } from '../models/lodging-allowance-support'; -import { LodgingBilletingSupport } from '../models/lodging-billeting-support'; -import { LodgingGroupSupport } from '../models/lodging-group-support'; -import { LodgingHotelSupport } from '../models/lodging-hotel-support'; import { ReferralPrintRequestResponse } from '../models/referral-print-request-response'; import { RegistrantProfile } from '../models/registrant-profile'; import { RegistrantProfileSearchResult } from '../models/registrant-profile-search-result'; @@ -85,8 +77,7 @@ import { RegistrationsVerifySecurityQuestions$Params } from '../fn/registrations import { registrationsVoidSupport } from '../fn/registrations/registrations-void-support'; import { RegistrationsVoidSupport$Params } from '../fn/registrations/registrations-void-support'; import { SearchResults } from '../models/search-results'; -import { TransportationOtherSupport } from '../models/transportation-other-support'; -import { TransportationTaxiSupport } from '../models/transportation-taxi-support'; +import { Support } from '../models/support'; import { VerifySecurityPhraseResponse } from '../models/verify-security-phrase-response'; import { VerifySecurityQuestionsResponse } from '../models/verify-security-questions-response'; @@ -959,22 +950,7 @@ export class RegistrationsService extends BaseService { registrationsSearchSupports$Response( params?: RegistrationsSearchSupports$Params, context?: HttpContext - ): Observable< - StrictHttpResponse< - Array< - | ClothingSupport - | IncidentalsSupport - | FoodGroceriesSupport - | FoodRestaurantSupport - | LodgingHotelSupport - | LodgingBilletingSupport - | LodgingGroupSupport - | LodgingAllowanceSupport - | TransportationTaxiSupport - | TransportationOtherSupport - > - > - > { + ): Observable>> { return registrationsSearchSupports(this.http, this.rootUrl, params, context); } @@ -987,50 +963,9 @@ export class RegistrationsService extends BaseService { registrationsSearchSupports( params?: RegistrationsSearchSupports$Params, context?: HttpContext - ): Observable< - Array< - | ClothingSupport - | IncidentalsSupport - | FoodGroceriesSupport - | FoodRestaurantSupport - | LodgingHotelSupport - | LodgingBilletingSupport - | LodgingGroupSupport - | LodgingAllowanceSupport - | TransportationTaxiSupport - | TransportationOtherSupport - > - > { + ): Observable> { return this.registrationsSearchSupports$Response(params, context).pipe( - map( - ( - r: StrictHttpResponse< - Array< - | ClothingSupport - | IncidentalsSupport - | FoodGroceriesSupport - | FoodRestaurantSupport - | LodgingHotelSupport - | LodgingBilletingSupport - | LodgingGroupSupport - | LodgingAllowanceSupport - | TransportationTaxiSupport - | TransportationOtherSupport - > - > - ): Array< - | ClothingSupport - | IncidentalsSupport - | FoodGroceriesSupport - | FoodRestaurantSupport - | LodgingHotelSupport - | LodgingBilletingSupport - | LodgingGroupSupport - | LodgingAllowanceSupport - | TransportationTaxiSupport - | TransportationOtherSupport - > => r.body - ) + map((r: StrictHttpResponse>): Array => r.body) ); } } diff --git a/responders/src/UI/embc-responder/src/app/core/services/compute/computeFeatures.service.ts b/responders/src/UI/embc-responder/src/app/core/services/compute/computeFeatures.service.ts index 92257953b..de3334ab3 100644 --- a/responders/src/UI/embc-responder/src/app/core/services/compute/computeFeatures.service.ts +++ b/responders/src/UI/embc-responder/src/app/core/services/compute/computeFeatures.service.ts @@ -43,14 +43,13 @@ export class ComputeFeaturesService implements Compute { etransferStatus: ETransferStatus.unavailable }; } else if ( - this.appBaseService?.appModel?.supportProperties?.selectedSupport?.value === SupportSubCategory.Lodging_Hotel || + this.appBaseService?.appModel?.supportProperties?.selectedSupport?.value === SupportSubCategory.LodgingHotel || this.appBaseService?.appModel?.supportProperties?.selectedSupport?.value === - SupportSubCategory.Lodging_Billeting || - this.appBaseService?.appModel?.supportProperties?.selectedSupport?.value === SupportSubCategory.Lodging_Group || + SupportSubCategory.LodgingBilleting || + this.appBaseService?.appModel?.supportProperties?.selectedSupport?.value === SupportSubCategory.LodgingGroup || this.appBaseService?.appModel?.supportProperties?.selectedSupport?.value === - SupportSubCategory.Transportation_Other || - this.appBaseService?.appModel?.supportProperties?.selectedSupport?.value === - SupportSubCategory.Transportation_Taxi + SupportSubCategory.TransportationOther || + this.appBaseService?.appModel?.supportProperties?.selectedSupport?.value === SupportSubCategory.TransportationTaxi ) { this.appBaseService.etransferProperties = { etransferStatus: ETransferStatus.notAllowed diff --git a/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-details/ess-file-details.component.scss b/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-details/ess-file-details.component.scss index 3b9fcb1fb..748ca9636 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-details/ess-file-details.component.scss +++ b/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-details/ess-file-details.component.scss @@ -83,7 +83,6 @@ } @media (max-width: 1200px) { - .col-md-4, .col-md-8, .col-4, diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members/household-members.component.scss b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members/household-members.component.scss index fe9756fd3..4c73d7e6b 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members/household-members.component.scss +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members/household-members.component.scss @@ -233,6 +233,5 @@ .button-justify { justify-content: start; padding-bottom: 20px; - } } diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/notes-components/add-notes/add-notes.component.scss b/responders/src/UI/embc-responder/src/app/feature-components/wizard/notes-components/add-notes/add-notes.component.scss index 949807ff9..ce5a5f904 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/notes-components/add-notes/add-notes.component.scss +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/notes-components/add-notes/add-notes.component.scss @@ -2,25 +2,26 @@ width: 100%; } :host { -background-color: #f2f2f2; -padding: 20px; -display: flex; -flex-direction: column; + background-color: #f2f2f2; + padding: 20px; + display: flex; + flex-direction: column; } -::ng-deep { +::ng-deep { .mdc-switch.mdc-switch--unselected:enabled .mdc-switch__handle::after, .mdc-switch.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after, - .mdc-switch__handle::before, .mdc-switch__handle::after, - .mdc-switch .mdc-switch__handle::before{ + .mdc-switch__handle::before, + .mdc-switch__handle::after, + .mdc-switch .mdc-switch__handle::before { background: #f2f2f2 !important; } .mdc-switch .mdc-switch__track { height: 19px !important; -} -.mdc-switch__track::after { - background-color: rgba(22, 155, 213, 1) !important; -} -.mdc-switch:enabled .mdc-switch__track::before { - background-color: #c9c9c9 !important; -} + } + .mdc-switch__track::after { + background-color: rgba(22, 155, 213, 1) !important; + } + .mdc-switch:enabled .mdc-switch__track::before { + background-color: #c9c9c9 !important; + } } diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-supports/referral-creation.service.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-supports/referral-creation.service.ts index 06b9a8868..589fc69a0 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-supports/referral-creation.service.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-supports/referral-creation.service.ts @@ -176,7 +176,7 @@ export class ReferralCreationService { numberOfBreakfastsPerPerson: (supportDetails.referral as RestaurantMeal).noOfBreakfast, numberOfDinnersPerPerson: (supportDetails.referral as RestaurantMeal).noOfDinners, numberOfLunchesPerPerson: (supportDetails.referral as RestaurantMeal).noOfLunches, - subCategory: SupportSubCategory.Food_Restaurant, + subCategory: SupportSubCategory.FoodRestaurant, totalAmount: (supportDetails.referral as RestaurantMeal).totalAmount }; this.mealReferral = mealReferral; @@ -187,7 +187,7 @@ export class ReferralCreationService { ...referral, category: SupportCategory.Food, numberOfDays: (supportDetails.referral as Groceries).noOfMeals, - subCategory: SupportSubCategory.Food_Groceries, + subCategory: SupportSubCategory.FoodGroceries, totalAmount: this.parseTextNumber( (supportDetails.referral as Groceries).userTotalAmount ? (supportDetails.referral as Groceries).userTotalAmount @@ -204,7 +204,7 @@ export class ReferralCreationService { category: SupportCategory.Transportation, fromAddress: (supportDetails.referral as Taxi).fromAddress, toAddress: (supportDetails.referral as Taxi).toAddress, - subCategory: SupportSubCategory.Transportation_Taxi + subCategory: SupportSubCategory.TransportationTaxi }; this.taxiReferral = taxiReferral; } @@ -215,7 +215,7 @@ export class ReferralCreationService { category: SupportCategory.Transportation, transportMode: (supportDetails.referral as OtherTransport).transportMode, totalAmount: this.parseTextNumber((supportDetails.referral as OtherTransport).totalAmount), - subCategory: SupportSubCategory.Transportation_Other + subCategory: SupportSubCategory.TransportationOther }; this.otherReferral = otherReferral; } @@ -226,7 +226,7 @@ export class ReferralCreationService { category: SupportCategory.Lodging, numberOfNights: (supportDetails.referral as HotelMotel).noOfNights, numberOfRooms: (supportDetails.referral as HotelMotel).noOfRooms, - subCategory: SupportSubCategory.Lodging_Hotel + subCategory: SupportSubCategory.LodgingHotel }; this.hotelReferral = hotelMotelReferral; } @@ -240,7 +240,7 @@ export class ReferralCreationService { ...referral, category: SupportCategory.Lodging, numberOfNights: (supportDetails.referral as HotelMotel).noOfNights, - subCategory: SupportSubCategory.Lodging_Billeting, + subCategory: SupportSubCategory.LodgingBilleting, hostName: supportDelivery.details.hostName, hostAddress: supportDelivery.details.hostAddress, hostCity: supportDelivery.details.hostCity as string, @@ -259,7 +259,7 @@ export class ReferralCreationService { ...referral, category: SupportCategory.Lodging, numberOfNights: (supportDetails.referral as HotelMotel).noOfNights, - subCategory: SupportSubCategory.Lodging_Group, + subCategory: SupportSubCategory.LodgingGroup, facilityAddress: supportDelivery.details.hostAddress, facilityCity: this.parseCommunityName(supportDelivery.details.hostCity as Community), facilityCommunityCode: this.parseCommunityCode(supportDelivery.details.hostCommunityCode as Community), @@ -285,7 +285,7 @@ export class ReferralCreationService { ? (supportDetails.referral as ShelterAllowance).totalAmount : 0 ), - subCategory: SupportSubCategory.Lodging_Allowance + subCategory: SupportSubCategory.LodgingAllowance }; this.lodgingAllowanceReferral = lodgingAllowanceReferral; } diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-supports/step-supports.service.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-supports/step-supports.service.ts index 18a0dc8fe..2fe360578 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-supports/step-supports.service.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-supports/step-supports.service.ts @@ -162,7 +162,7 @@ export class StepSupportsService { ? 'R' + this.supportDetails.externalReferenceId : '', issuedToPersonName: - this.supportTypeToAdd.value === SupportSubCategory.Lodging_Allowance + this.supportTypeToAdd.value === SupportSubCategory.LodgingAllowance ? this.supportDelivery.details.hostName : (this.supportDelivery.issuedTo as any) !== 'Someone else' ? this.supportDelivery.issuedTo.lastName + ', ' + this.supportDelivery.issuedTo.firstName @@ -194,21 +194,21 @@ export class StepSupportsService { supportDelivery: referral }; - if (this.supportTypeToAdd.value === SupportSubCategory.Food_Restaurant) { + if (this.supportTypeToAdd.value === SupportSubCategory.FoodRestaurant) { this.referralService.createMealReferral(support, this.supportDetails); - } else if (this.supportTypeToAdd.value === SupportSubCategory.Food_Groceries) { + } else if (this.supportTypeToAdd.value === SupportSubCategory.FoodGroceries) { this.referralService.createGroceriesReferral(support, this.supportDetails); - } else if (this.supportTypeToAdd.value === SupportSubCategory.Transportation_Taxi) { + } else if (this.supportTypeToAdd.value === SupportSubCategory.TransportationTaxi) { this.referralService.createTaxiReferral(support, this.supportDetails); - } else if (this.supportTypeToAdd.value === SupportSubCategory.Transportation_Other) { + } else if (this.supportTypeToAdd.value === SupportSubCategory.TransportationOther) { this.referralService.createOtherReferral(support, this.supportDetails); - } else if (this.supportTypeToAdd.value === SupportSubCategory.Lodging_Billeting) { + } else if (this.supportTypeToAdd.value === SupportSubCategory.LodgingBilleting) { this.referralService.createBilletingReferral(support, this.supportDetails, this.supportDelivery); - } else if (this.supportTypeToAdd.value === SupportSubCategory.Lodging_Allowance) { + } else if (this.supportTypeToAdd.value === SupportSubCategory.LodgingAllowance) { this.referralService.createShelterAllowanceReferral(support, this.supportDetails, this.supportDelivery); - } else if (this.supportTypeToAdd.value === SupportSubCategory.Lodging_Group) { + } else if (this.supportTypeToAdd.value === SupportSubCategory.LodgingGroup) { this.referralService.createGroupLodgingReferral(support, this.supportDetails, this.supportDelivery); - } else if (this.supportTypeToAdd.value === SupportSubCategory.Lodging_Hotel) { + } else if (this.supportTypeToAdd.value === SupportSubCategory.LodgingHotel) { this.referralService.createHotelMotelReferral(support, this.supportDetails); } else if (this.supportTypeToAdd.value === SupportCategory.Incidentals) { this.referralService.createIncidentalsReferral(support, this.supportDetails); @@ -218,19 +218,19 @@ export class StepSupportsService { } getRateSheetContent(): DialogContent { - if (this.supportTypeToAdd.value === SupportSubCategory.Food_Restaurant) { + if (this.supportTypeToAdd.value === SupportSubCategory.FoodRestaurant) { return globalConst.mealRateSheet; - } else if (this.supportTypeToAdd.value === SupportSubCategory.Food_Groceries) { + } else if (this.supportTypeToAdd.value === SupportSubCategory.FoodGroceries) { return globalConst.groceriesRateSheet; - } else if (this.supportTypeToAdd.value === SupportSubCategory.Transportation_Taxi) { + } else if (this.supportTypeToAdd.value === SupportSubCategory.TransportationTaxi) { return globalConst.taxiRateSheet; - } else if (this.supportTypeToAdd.value === SupportSubCategory.Transportation_Other) { + } else if (this.supportTypeToAdd.value === SupportSubCategory.TransportationOther) { return globalConst.otherRateSheet; - } else if (this.supportTypeToAdd.value === SupportSubCategory.Lodging_Billeting) { + } else if (this.supportTypeToAdd.value === SupportSubCategory.LodgingBilleting) { return globalConst.billetingRateSheet; - } else if (this.supportTypeToAdd.value === SupportSubCategory.Lodging_Hotel) { + } else if (this.supportTypeToAdd.value === SupportSubCategory.LodgingHotel) { return globalConst.hotelRateSheet; - } else if (this.supportTypeToAdd.value === SupportSubCategory.Lodging_Allowance) { + } else if (this.supportTypeToAdd.value === SupportSubCategory.LodgingAllowance) { return globalConst.needsShelterAllowanceRateSheet; } else if (this.supportTypeToAdd.value === SupportCategory.Incidentals) { return globalConst.incidentalsRateSheet; diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/clone-support-details.service.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/clone-support-details.service.ts index 998fde2bb..9a2108ac2 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/clone-support-details.service.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/clone-support-details.service.ts @@ -124,7 +124,7 @@ export class CloneSupportDetailsService { * @returns */ createDeliveryDetails(selectedSupport: Support): SupplierDetailsModel { - if (selectedSupport.subCategory === SupportSubCategory.Lodging_Billeting) { + if (selectedSupport.subCategory === SupportSubCategory.LodgingBilleting) { return { hostName: (selectedSupport as LodgingBilletingSupport).hostName, hostAddress: (selectedSupport as LodgingBilletingSupport).hostAddress, @@ -132,7 +132,7 @@ export class CloneSupportDetailsService { hostPhone: (selectedSupport as LodgingBilletingSupport).hostPhone, emailAddress: (selectedSupport as LodgingBilletingSupport).hostEmail }; - } else if (selectedSupport.subCategory === SupportSubCategory.Lodging_Group) { + } else if (selectedSupport.subCategory === SupportSubCategory.LodgingGroup) { return { hostName: (selectedSupport as LodgingGroupSupport).facilityName, hostAddress: (selectedSupport as LodgingGroupSupport).facilityAddress, @@ -161,39 +161,39 @@ export class CloneSupportDetailsService { | HotelMotel | Incidentals | Clothing { - if (selectedSupport.subCategory === SupportSubCategory.Food_Restaurant) { + if (selectedSupport.subCategory === SupportSubCategory.FoodRestaurant) { return { noOfBreakfast: 1, noOfLunches: 1, noOfDinners: 1, totalAmount: null }; - } else if (selectedSupport.subCategory === SupportSubCategory.Food_Groceries) { + } else if (selectedSupport.subCategory === SupportSubCategory.FoodGroceries) { return { noOfMeals: 1, totalAmount: null, userTotalAmount: null, approverName: null }; - } else if (selectedSupport.subCategory === SupportSubCategory.Transportation_Taxi) { + } else if (selectedSupport.subCategory === SupportSubCategory.TransportationTaxi) { return { fromAddress: (selectedSupport as TransportationTaxiSupport).fromAddress, toAddress: (selectedSupport as TransportationTaxiSupport).toAddress }; - } else if (selectedSupport.subCategory === SupportSubCategory.Transportation_Other) { + } else if (selectedSupport.subCategory === SupportSubCategory.TransportationOther) { return { transportMode: (selectedSupport as TransportationOtherSupport).transportMode, totalAmount: null }; - } else if (selectedSupport.subCategory === SupportSubCategory.Lodging_Billeting) { + } else if (selectedSupport.subCategory === SupportSubCategory.LodgingBilleting) { return { noOfNights: 1 }; - } else if (selectedSupport.subCategory === SupportSubCategory.Lodging_Group) { + } else if (selectedSupport.subCategory === SupportSubCategory.LodgingGroup) { return { noOfNights: 1 }; - } else if (selectedSupport.subCategory === SupportSubCategory.Lodging_Allowance) { + } else if (selectedSupport.subCategory === SupportSubCategory.LodgingAllowance) { return { noOfNights: 1, totalAmount: null, @@ -201,7 +201,7 @@ export class CloneSupportDetailsService { contactPhone: null, fullName: null }; - } else if (selectedSupport.subCategory === SupportSubCategory.Lodging_Hotel) { + } else if (selectedSupport.subCategory === SupportSubCategory.LodgingHotel) { return { noOfNights: 1, noOfRooms: (selectedSupport as LodgingHotelSupport).numberOfRooms diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.component.ts index bf0a7a221..11d44078d 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.component.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.component.ts @@ -103,11 +103,11 @@ export class ExistingSupportDetailsComponent implements OnInit { } canExtendSupport(): boolean { - return this.selectedSupport?.subCategory !== SupportSubCategory.Lodging_Billeting; + return this.selectedSupport?.subCategory !== SupportSubCategory.LodgingBilleting; } canEditSupport(): boolean { - return this.selectedSupport?.subCategory !== SupportSubCategory.Lodging_Billeting; + return this.selectedSupport?.subCategory !== SupportSubCategory.LodgingBilleting; } checkGroceryMaxRate(): boolean { diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.service.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.service.ts index d28de0d18..61a59bb6b 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.service.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.service.ts @@ -212,7 +212,7 @@ export class ExistingSupportDetailsService { * @returns */ createDeliveryDetails(selectedSupport: Support): SupplierDetailsModel { - if (selectedSupport.subCategory === SupportSubCategory.Lodging_Billeting) { + if (selectedSupport.subCategory === SupportSubCategory.LodgingBilleting) { return { hostName: (selectedSupport as LodgingBilletingSupport).hostName, hostAddress: (selectedSupport as LodgingBilletingSupport).hostAddress, @@ -220,14 +220,14 @@ export class ExistingSupportDetailsService { hostPhone: (selectedSupport as LodgingBilletingSupport).hostPhone, emailAddress: (selectedSupport as LodgingBilletingSupport).hostEmail }; - } else if (selectedSupport.subCategory === SupportSubCategory.Lodging_Group) { + } else if (selectedSupport.subCategory === SupportSubCategory.LodgingGroup) { return { hostName: (selectedSupport as LodgingGroupSupport).facilityName, hostAddress: (selectedSupport as LodgingGroupSupport).facilityAddress, hostCity: this.parseCommunityString((selectedSupport as LodgingGroupSupport).facilityCommunityCode), hostPhone: (selectedSupport as LodgingGroupSupport).facilityContactPhone }; - } else if (selectedSupport.subCategory === SupportSubCategory.Lodging_Allowance) { + } else if (selectedSupport.subCategory === SupportSubCategory.LodgingAllowance) { return { hostName: ((selectedSupport as LodgingAllowanceSupport).supportDelivery as Referral).issuedToPersonName, hostPhone: (selectedSupport as LodgingAllowanceSupport).contactPhone, @@ -255,44 +255,44 @@ export class ExistingSupportDetailsService { | HotelMotel | Incidentals | Clothing { - if (selectedSupport.subCategory === SupportSubCategory.Food_Restaurant) { + if (selectedSupport.subCategory === SupportSubCategory.FoodRestaurant) { return { noOfBreakfast: (selectedSupport as FoodRestaurantSupport).numberOfBreakfastsPerPerson, noOfLunches: (selectedSupport as FoodRestaurantSupport).numberOfLunchesPerPerson, noOfDinners: (selectedSupport as FoodRestaurantSupport).numberOfDinnersPerPerson, totalAmount: (selectedSupport as FoodRestaurantSupport).totalAmount }; - } else if (selectedSupport.subCategory === SupportSubCategory.Food_Groceries) { + } else if (selectedSupport.subCategory === SupportSubCategory.FoodGroceries) { return { noOfMeals: (selectedSupport as FoodGroceriesSupport).numberOfDays, totalAmount: (selectedSupport as FoodGroceriesSupport).totalAmount, userTotalAmount: (selectedSupport as FoodGroceriesSupport).totalAmount, approverName: (selectedSupport as FoodGroceriesSupport).approverName }; - } else if (selectedSupport.subCategory === SupportSubCategory.Transportation_Taxi) { + } else if (selectedSupport.subCategory === SupportSubCategory.TransportationTaxi) { return { fromAddress: (selectedSupport as TransportationTaxiSupport).fromAddress, toAddress: (selectedSupport as TransportationTaxiSupport).toAddress }; - } else if (selectedSupport.subCategory === SupportSubCategory.Transportation_Other) { + } else if (selectedSupport.subCategory === SupportSubCategory.TransportationOther) { return { transportMode: (selectedSupport as TransportationOtherSupport).transportMode, totalAmount: (selectedSupport as TransportationOtherSupport).totalAmount }; - } else if (selectedSupport.subCategory === SupportSubCategory.Lodging_Billeting) { + } else if (selectedSupport.subCategory === SupportSubCategory.LodgingBilleting) { return { noOfNights: (selectedSupport as LodgingBilletingSupport).numberOfNights }; - } else if (selectedSupport.subCategory === SupportSubCategory.Lodging_Group) { + } else if (selectedSupport.subCategory === SupportSubCategory.LodgingGroup) { return { noOfNights: (selectedSupport as LodgingGroupSupport).numberOfNights }; - } else if (selectedSupport.subCategory === SupportSubCategory.Lodging_Hotel) { + } else if (selectedSupport.subCategory === SupportSubCategory.LodgingHotel) { return { noOfNights: (selectedSupport as LodgingHotelSupport).numberOfNights, noOfRooms: (selectedSupport as LodgingHotelSupport).numberOfRooms }; - } else if (selectedSupport.subCategory === SupportSubCategory.Lodging_Allowance) { + } else if (selectedSupport.subCategory === SupportSubCategory.LodgingAllowance) { return { noOfNights: (selectedSupport as LodgingAllowanceSupport).numberOfNights, totalAmount: (selectedSupport as LodgingAllowanceSupport).totalAmount, diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/select-support/select-support.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/select-support/select-support.component.ts index 9c8f922f1..256ba52cf 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/select-support/select-support.component.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/select-support/select-support.component.ts @@ -57,7 +57,7 @@ export class SelectSupportComponent implements OnInit { .filter( (element) => element.description !== '' && - element.value !== SupportSubCategory.Lodging_Billeting && + element.value !== SupportSubCategory.LodgingBilleting && element.value !== SupportCategory.Lodging ); this.stepSupportsService.supportDetails = null; diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/support-delivery.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/support-delivery.component.ts index c04e60764..7f2f0d68c 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/support-delivery.component.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/support-delivery.component.ts @@ -298,7 +298,7 @@ export class SupportDeliveryComponent implements OnInit, AfterViewChecked { } hideRateSheet(): boolean { - return this.stepSupportsService?.supportTypeToAdd?.value !== SupportSubCategory.Lodging_Group; + return this.stepSupportsService?.supportTypeToAdd?.value !== SupportSubCategory.LodgingGroup; } setSupportMethod(method: SupportMethod) { diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.component.scss b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.component.scss index b70ecd083..af156a50b 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.component.scss +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.component.scss @@ -89,5 +89,8 @@ -ms-transform: translateY(-50%); transform: translateY(-50%); } -::ng-deep .error-wrapper{ - .mat-mdc-form-field-error-wrapper{ padding:0px 0px 0px 10px; } } \ No newline at end of file +::ng-deep .error-wrapper { + .mat-mdc-form-field-error-wrapper { + padding: 0px 0px 0px 10px; + } +} diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.component.ts index 8a06e1b1e..df1ea4ebd 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.component.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.component.ts @@ -408,7 +408,7 @@ export class SupportDetailsComponent implements OnInit, OnDestroy { } hideRateSheet(): boolean { - return this.stepSupportsService?.supportTypeToAdd?.value !== SupportSubCategory.Lodging_Group; + return this.stepSupportsService?.supportTypeToAdd?.value !== SupportSubCategory.LodgingGroup; } /** @@ -469,9 +469,13 @@ export class SupportDetailsComponent implements OnInit, OnDestroy { const thisSupport = this.supportDetailsForm.getRawValue(); const from = moment(this.dateConversionService.createDateTimeString(thisSupport.fromDate, thisSupport.fromTime)); const to = moment(this.dateConversionService.createDateTimeString(thisSupport.toDate, thisSupport.toTime)); + const selectedSubCategory = Object.keys(SupportSubCategory).find( + (key) => SupportSubCategory[key] === this.stepSupportsService.supportTypeToAdd.value + ); + const category: SupportCategory = - SupportCategory[this.stepSupportsService.supportTypeToAdd.value] || - this.mapSubCategoryToCategory(SupportSubCategory[this.stepSupportsService.supportTypeToAdd.value]); + SupportCategory[selectedSubCategory as keyof typeof SupportCategory] || + this.mapSubCategoryToCategory(SupportSubCategory[selectedSubCategory]); const hasConflict = existingSupports.some((s) => { const sFrom = moment(s.from); @@ -506,21 +510,21 @@ export class SupportDetailsComponent implements OnInit, OnDestroy { mapSubCategoryToCategory(subCategory: SupportSubCategory): SupportCategory { switch (subCategory) { - case SupportSubCategory.Food_Groceries: + case SupportSubCategory.FoodGroceries: return SupportCategory.Food; - case SupportSubCategory.Food_Restaurant: + case SupportSubCategory.FoodRestaurant: return SupportCategory.Food; - case SupportSubCategory.Lodging_Hotel: + case SupportSubCategory.LodgingHotel: return SupportCategory.Lodging; - case SupportSubCategory.Lodging_Billeting: + case SupportSubCategory.LodgingBilleting: return SupportCategory.Lodging; - case SupportSubCategory.Lodging_Group: + case SupportSubCategory.LodgingGroup: return SupportCategory.Lodging; - case SupportSubCategory.Lodging_Allowance: + case SupportSubCategory.LodgingAllowance: return SupportCategory.Lodging; - case SupportSubCategory.Transportation_Taxi: + case SupportSubCategory.TransportationTaxi: return SupportCategory.Transportation; - case SupportSubCategory.Transportation_Other: + case SupportSubCategory.TransportationOther: return SupportCategory.Transportation; default: @@ -632,10 +636,13 @@ export class SupportDetailsComponent implements OnInit, OnDestroy { (x) => x.status !== SupportStatus.Cancelled.toString() && x.status !== SupportStatus.Void.toString() ); - const category: SupportCategory = - SupportCategory[this.stepSupportsService.supportTypeToAdd.value] || - this.mapSubCategoryToCategory(SupportSubCategory[this.stepSupportsService.supportTypeToAdd.value]); + const selectedSubCategory = Object.keys(SupportSubCategory).find( + (key) => SupportSubCategory[key] === this.stepSupportsService.supportTypeToAdd.value + ); + const category: SupportCategory = + SupportCategory[selectedSubCategory as keyof typeof SupportCategory] || + this.mapSubCategoryToCategory(SupportSubCategory[selectedSubCategory]); let largestTo = existingSupports .filter((support) => support.category === category) .reduce( @@ -645,6 +652,7 @@ export class SupportDetailsComponent implements OnInit, OnDestroy { }, new Date(this.dateConversionService.convertStringToDate(this.datePipe.transform(Date.now(), 'dd-MMM-yyyy'))) ); + const taskTo = moment(this.evacueeSessionService?.evacFile?.task?.to); if (moment(largestTo).isAfter(taskTo)) { @@ -659,9 +667,13 @@ export class SupportDetailsComponent implements OnInit, OnDestroy { (x) => x.status !== SupportStatus.Cancelled.toString() && x.status !== SupportStatus.Void.toString() ); + const selectedSubCategory = Object.keys(SupportSubCategory).find( + (key) => SupportSubCategory[key] === this.stepSupportsService.supportTypeToAdd.value + ); + const category: SupportCategory = - SupportCategory[this.stepSupportsService.supportTypeToAdd.value] || - this.mapSubCategoryToCategory(SupportSubCategory[this.stepSupportsService.supportTypeToAdd.value]); + SupportCategory[selectedSubCategory as keyof typeof SupportCategory] || + this.mapSubCategoryToCategory(SupportSubCategory[selectedSubCategory]); const maxToDate = existingSupports .filter((support) => support.category === category) .map((support) => new Date(support.to)) // Convert to Date objects diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.service.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.service.ts index 986c25cf8..6728af667 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.service.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.service.ts @@ -31,21 +31,21 @@ export class SupportDetailsService { ) {} generateDynamicForm(supportType: string): UntypedFormGroup { - if (supportType === SupportSubCategory.Food_Restaurant) { + if (supportType === SupportSubCategory.FoodRestaurant) { return this.mealForm(); - } else if (supportType === SupportSubCategory.Food_Groceries) { + } else if (supportType === SupportSubCategory.FoodGroceries) { return this.groceriesForm(); - } else if (supportType === SupportSubCategory.Transportation_Taxi) { + } else if (supportType === SupportSubCategory.TransportationTaxi) { return this.taxiForm(); - } else if (supportType === SupportSubCategory.Transportation_Other) { + } else if (supportType === SupportSubCategory.TransportationOther) { return this.otherTransportForm(); - } else if (supportType === SupportSubCategory.Lodging_Hotel) { + } else if (supportType === SupportSubCategory.LodgingHotel) { return this.hotelMotelForm(); - } else if (supportType === SupportSubCategory.Lodging_Billeting) { + } else if (supportType === SupportSubCategory.LodgingBilleting) { return this.billetingForm(); - } else if (supportType === SupportSubCategory.Lodging_Group) { + } else if (supportType === SupportSubCategory.LodgingGroup) { return this.groupLodgingForm(); - } else if (supportType === SupportSubCategory.Lodging_Allowance) { + } else if (supportType === SupportSubCategory.LodgingAllowance) { return this.shelterAllowanceLodgingForm(); } else if (supportType === SupportCategory.Incidentals) { return this.incidentalsForm(); diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/view-supports/supports-table/supports-table.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/view-supports/supports-table/supports-table.component.ts index a65c09e2f..a5da562fb 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/view-supports/supports-table/supports-table.component.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/view-supports/supports-table/supports-table.component.ts @@ -104,11 +104,11 @@ export class SupportsTableComponent implements OnInit, AfterViewInit, OnChanges case 'supplierName': if (item.method === SupportMethod.ETransfer) { return item.method.toLowerCase(); - } else if (item.subCategory === SupportSubCategory.Lodging_Billeting) { + } else if (item.subCategory === SupportSubCategory.LodgingBilleting) { return (item as LodgingBilletingSupport).hostName.toLowerCase(); - } else if (item.subCategory === SupportSubCategory.Lodging_Group) { + } else if (item.subCategory === SupportSubCategory.LodgingGroup) { return (item as LodgingGroupSupport).facilityName.toLowerCase(); - } else if (item.subCategory === SupportSubCategory.Lodging_Allowance) { + } else if (item.subCategory === SupportSubCategory.LodgingAllowance) { return (item.supportDelivery as Referral).issuedToPersonName.toLowerCase(); } else { return (item.supportDelivery as Referral).supplierName.toLowerCase(); @@ -204,11 +204,11 @@ export class SupportsTableComponent implements OnInit, AfterViewInit, OnChanges if (element.method === SupportMethod.ETransfer) { return 'e-Transfer'; } - if (element.subCategory === SupportSubCategory.Lodging_Billeting) { + if (element.subCategory === SupportSubCategory.LodgingBilleting) { return (element as LodgingBilletingSupport).hostName; - } else if (element.subCategory === SupportSubCategory.Lodging_Group) { + } else if (element.subCategory === SupportSubCategory.LodgingGroup) { return (element as LodgingGroupSupport).facilityName; - } else if (element.subCategory === SupportSubCategory.Lodging_Allowance) { + } else if (element.subCategory === SupportSubCategory.LodgingAllowance) { return (element.supportDelivery as Referral).issuedToPersonName; } else { return (element.supportDelivery as Referral).supplierName; @@ -237,7 +237,7 @@ export class SupportsTableComponent implements OnInit, AfterViewInit, OnChanges return incidentalsSupport.totalAmount > rate; } case SupportCategory.Food: { - if (element?.subCategory === SupportSubCategory.Food_Groceries) { + if (element?.subCategory === SupportSubCategory.FoodGroceries) { const foodGroceriesSupport = element as FoodGroceriesSupport; rate = globalConst.groceriesRate.rate * diff --git a/responders/src/UI/embc-responder/src/app/unit-tests/mockStepEssFile.service.ts b/responders/src/UI/embc-responder/src/app/unit-tests/mockStepEssFile.service.ts index 0f53ad480..b9e537e69 100644 --- a/responders/src/UI/embc-responder/src/app/unit-tests/mockStepEssFile.service.ts +++ b/responders/src/UI/embc-responder/src/app/unit-tests/mockStepEssFile.service.ts @@ -181,7 +181,7 @@ export class MockStepEssFileService extends StepEssFileService { supports: [ { category: SupportCategory.Food, - subCategory: SupportSubCategory.Food_Groceries, + subCategory: SupportSubCategory.FoodGroceries, id: 'D2035834', fileId: '154150', createdOn: '2022-03-28T23:53:59Z', diff --git a/responders/src/UI/embc-responder/src/app/unit-tests/mockStepSupport.service.ts b/responders/src/UI/embc-responder/src/app/unit-tests/mockStepSupport.service.ts index 9ab97e177..05c6dc990 100644 --- a/responders/src/UI/embc-responder/src/app/unit-tests/mockStepSupport.service.ts +++ b/responders/src/UI/embc-responder/src/app/unit-tests/mockStepSupport.service.ts @@ -33,7 +33,7 @@ export class MockStepSupportsService extends StepSupportsService { public selectedSupport: Support = { category: SupportCategory.Food, - subCategory: SupportSubCategory.Food_Groceries, + subCategory: SupportSubCategory.FoodGroceries, id: 'D2035834', fileId: '154150', createdOn: '2022-03-28T23:53:59Z',