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AAsBM,QACxCC,KAAKsE,MAAYC,KAA2B,CAAED,gBAalD,EA/JOvC,SAAU,oCAAVA,GAAUyC,wEAAVzC,EAAU,wBAAVA,EAAUnC,QAAVmC,EAAU,YAAVA,CAAU,mBCZhB,IAAM0C,EAAS,MAAhB,MAAOA,YAAS,oCAATA,EAAS,EAATA,EAAS,sBAATA,MAAS,0BANlBC,KACA7C,EACA8C,gBAAuBC,IAAeC,MACtCC,gBAAyB,CAAC/C,OAGjB0C,CAAS","names":["QuestionIds","QuestionIdsSL","FitDataService","constructor","http","loadData","form","data","Object","keys","forEach","id","v","push","questionId","parseInt","answers","Array","isArray","submitForm","this","post","submitPublicForm","corrId","contactInfo","fitSearchQuestions","PUBLIC_ENDPOINTS","updateServiceListingForm","clientId","clientServiceId","put","submitServiceListingForm","getSearchResult","searchId","get","params","getPublicSearchResult","downloadResults","observe","responseType","downloadPublicSearchResponses","contactSuppliers","supplierIds","contactPublicSearchSuppliers","getFitSearchHistory","checkSearchExpiry","_angular_core__WEBPACK_IMPORTED_MODULE_1__","factory","FitQuestionsService","getQuestions","pipe","map","questions","q","display","getPublicSearchQuestions","getListing","findChoiceId","selectedAnswer","choiceId","find","sa","getServiceListingQuestions","convertResponseOptions","responseOptions","options","key","value","text","_angular_core__WEBPACK_IMPORTED_MODULE_2__","routes","path","pathMatch","redirectTo","loadChildren","Promise","then","m","FitWizardModule","FitResultsModule","FitRoutingModule","RouterModule","FitEffects","actions$","fitQuestionsService","store","router","fitDataService","downloader","createEffect","ofType","loadQuestions","switchMap","loadQuestionsSuccess","loadPublicSearchQuestions","loadPublicSearchQuestionsSuccess","submitWizard","withLatestFrom","select","selectRouteParams","tap","_","navigateByUrl","submitWizardSuccess","submitPublicWizard","submitPublicWizardSuccess","loadSearchResults","result","loadSearchResultsSuccess","loadPublicSearchResults","loadPublicSearchResultsSuccess","expired","checkSearchExpirySucess","action","dispatch","downloadFitResults","concatMap","results","downloadBlob","body","downloadPublicSearchFitResponses","history","getFitSearchHistorySuccess","core","FitModule","CommonModule","StoreModule","fitFeatureKey","reducer","EffectsModule"],"sourceRoot":"webpack:///","sources":["./src/app/fit-wizard/models/question.model.ts","./src/app/fit-wizard/services/fit-data/fit-data.service.ts","./src/app/fit-wizard/services/fit-questions/fit-questions.service.ts","./src/app/fit/fit-routing.module.ts","./src/app/fit/store/fit.effects.ts","./src/app/fit/fit.module.ts"],"sourcesContent":["import { IResponseOption, ISelectedAnswerOption, ResponseTypes } from '../services/fit-questions/fit-questions.service';\r\n\r\nexport interface IBaseQuestionConfig {\r\n order: number;\r\n question: string;\r\n questionId: number;\r\n display: boolean;\r\n choiceId?: number;\r\n selectedAnswer?: ISelectedAnswerOption[];\r\n responseOptions: IResponseOption[];\r\n}\r\n\r\nexport interface IRadioQuestion extends IBaseQuestionConfig {\r\n responseType: ResponseTypes.single;\r\n}\r\n\r\nexport interface ITextQuestion extends IBaseQuestionConfig {\r\n responseType: ResponseTypes.text;\r\n}\r\nexport interface IRankedQuestion extends IBaseQuestionConfig {\r\n responseType: ResponseTypes.ranked;\r\n}\r\nexport interface IMultipleQuestion extends IBaseQuestionConfig {\r\n responseType: ResponseTypes.multiple;\r\n}\r\n\r\nexport type QuestionTypes = IRadioQuestion | ITextQuestion | IRankedQuestion | IMultipleQuestion;\r\n\r\nexport enum QuestionIds {\r\n serviceType = 68,\r\n technologySolution=69,\r\n numberEmployees = 70,\r\n serviceLocation=71,\r\n primaryService = 79,\r\n hasIntegrations = 88,\r\n importantIntegrations = 98,\r\n makePayments = 101,\r\n paymentPreference = 102,\r\n whichIntegrations = 174,\r\n}\r\n\r\n\r\nexport enum QuestionIdsSL {\r\n serviceType = 106,\r\n technologyServices = 107,\r\n handleService = 110,\r\n handlesCash = 116,\r\n dataGov = 130,\r\n respManagement = 132,\r\n disasterPlan = 133,\r\n mobileAppTeam = 144,\r\n mobileAppEmployee = 145,\r\n whichIntegrations = 152,\r\n techProprietary = 175,\r\n useTech = 178,\r\n appName = 192,\r\n email = 194,\r\n}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { AnswerTypes } from '../../models/answer.model';\r\nimport { IFitSearch } from '../../models/search-history.model';\r\nimport { PUBLIC_ENDPOINTS } from '@shared';\r\nimport { IContactInfo, IPublicQuestionsWithContactInfo } from '../../models/contact-info.model';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class FitDataService {\r\n\r\n constructor(private http: HttpClient) { }\r\n\r\n private loadData(form: { [id: string]: AnswerTypes | AnswerTypes[] }) {\r\n const data: IFitSearchQuestionDto[] = [];\r\n Object.keys(form).forEach((id) => {\r\n const v = form[id];\r\n data.push({\r\n questionId: parseInt(id, 10),\r\n answers: Array.isArray(v) ? v : [v]\r\n })\r\n });\r\n\r\n return data;\r\n }\r\n\r\n submitForm(form: { [id: string]: AnswerTypes | AnswerTypes[] }) {\r\n return this.http.post('fit/search', this.loadData(form));\r\n }\r\n\r\n submitPublicForm(form: { [id: string]: AnswerTypes | AnswerTypes[] }, corrId: string, contactInfo: IContactInfo) {\r\n const data: IPublicQuestionsWithContactInfo = {\r\n corrId: corrId,\r\n contactInfo: contactInfo,\r\n fitSearchQuestions: this.loadData(form)\r\n };\r\n return this.http.post(`${PUBLIC_ENDPOINTS.submitPublicFitSearch}`, data);\r\n }\r\n\r\n updateServiceListingForm(\r\n clientId: string,\r\n form: { [id: number]: AnswerTypes | AnswerTypes[] },\r\n clientServiceId: number\r\n ) {\r\n return this.http.put(\r\n `clients/${clientId}/servicelisting?clientServiceId=${clientServiceId}`,\r\n this.loadData(form)\r\n );\r\n }\r\n\r\n submitServiceListingForm(clientId: string, form: { [id: number]: AnswerTypes | AnswerTypes[] }) {\r\n return this.http.post(`clients/${clientId}/servicelisting`, this.loadData(form));\r\n }\r\n\r\n getSearchResult(searchId: number) {\r\n return this.http.get('fit/fitsearchresult', { params: { searchId } })\r\n }\r\n\r\n getPublicSearchResult(searchId: number, corrId: string) {\r\n return this.http.get(PUBLIC_ENDPOINTS.loadPublicFitResults, { params: { searchId, corrId } })\r\n }\r\n\r\n downloadResults(clientId: string, searchId: number) {\r\n return this.http.get(`profiles/${clientId}/employer/downloadresponses/${searchId}`, {\r\n observe: 'response',\r\n responseType: 'blob'\r\n });\r\n }\r\n\r\n downloadPublicSearchResponses(corrId: string) {\r\n return this.http.get(`${PUBLIC_ENDPOINTS.downloadPublicSearchResponses}/${corrId}`, {\r\n observe: 'response',\r\n responseType: 'blob'\r\n });\r\n }\r\n\r\n contactSuppliers(supplierIds: string[], searchId: number) {\r\n return this.http.post(`fit/contactsuppliers`, { searchId, supplierIds })\r\n }\r\n\r\n contactPublicSearchSuppliers(supplierIds: string[], corrId: string) {\r\n return this.http.post(PUBLIC_ENDPOINTS.contactPublicSearchSuppliers, { corrId, supplierIds })\r\n }\r\n\r\n getFitSearchHistory() {\r\n return this.http.get(`/fit/searchhistory`)\r\n }\r\n\r\n checkSearchExpiry(corrId: string) {\r\n return this.http.get(PUBLIC_ENDPOINTS.checkSearchExpiry, { params: { corrId } })\r\n }\r\n}\r\n\r\nexport interface ProfileIntegrationsDTO {\r\n hris: string;\r\n payroll: string;\r\n rmc: string;\r\n expense: string;\r\n travel: string;\r\n costOfLiving: string;\r\n immigration: string;\r\n tax: string;\r\n stockPlan: string;\r\n}\r\n\r\nexport interface IFitSearchQuestionDto {\r\n questionId: number;\r\n answers: AnswerTypes[];\r\n}\r\n\r\nexport interface FitResultSupplier {\r\n supplierName: string;\r\n fitResult: number;\r\n quality: number;\r\n value: number;\r\n technology: number;\r\n capability: number;\r\n serviceDelivery: number;\r\n supplierId: string;\r\n email: string;\r\n selected: boolean;\r\n websiteUrl: string;\r\n linkedInUrl: string;\r\n}\r\n\r\nexport interface FitResultDto {\r\n criteria: string[],\r\n suppliers: FitResultSupplier[],\r\n}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { map } from 'rxjs/operators';\r\nimport { QuestionTypes } from '../../models/question.model';\r\nimport { Observable } from 'rxjs';\r\nimport { PUBLIC_ENDPOINTS } from '@shared';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class FitQuestionsService {\r\n constructor(private http: HttpClient) { }\r\n\r\n getQuestions(): Observable {\r\n return this.http.get('fit/fitquestions').pipe(\r\n map(questions => questions.map(q =>\r\n ({\r\n ...q,\r\n display: true,\r\n })\r\n )),\r\n );\r\n }\r\n\r\n getPublicSearchQuestions(): Observable {\r\n return this.http.get(PUBLIC_ENDPOINTS.loadPublicSearchQuestions).pipe(\r\n map(questions => questions.map(q =>\r\n ({\r\n ...q,\r\n display: true,\r\n })\r\n )),\r\n );\r\n }\r\n\r\n getListing(clientId: string, clientServiceId: number): Observable {\r\n const findChoiceId = (selectedAnswer: { choiceId?: number }[]): number => {\r\n const chosenAnswers = selectedAnswer.find((sa) => sa.choiceId);\r\n const choiceId = chosenAnswers?.choiceId;\r\n\r\n return choiceId ? choiceId : 0;\r\n };\r\n return this.http.get(`clients/${clientId}/servicelisting?clientServiceId=${clientServiceId}`)\r\n .pipe(\r\n map(questions => questions.map((q) =>\r\n ({\r\n ...q,\r\n display: true,\r\n choiceId: findChoiceId(q.selectedAnswer),\r\n })\r\n )\r\n ),\r\n )\r\n }\r\n\r\n getServiceListingQuestions(): Observable {\r\n return this.http.get(`/fit/slquestions`).pipe(\r\n map(questions => questions.map((q) =>\r\n ({\r\n ...q,\r\n display: true,\r\n })\r\n )),\r\n );\r\n }\r\n\r\n private convertResponseOptions(responseOptions: []): IResponseOption[] {\r\n const options: IResponseOption[] = [];\r\n\r\n responseOptions.forEach(({ key, value }) => {\r\n options.push({\r\n value: key,\r\n text: value\r\n });\r\n });\r\n\r\n return options;\r\n }\r\n}\r\n\r\nexport interface IResponseOptionDto {\r\n key: number;\r\n value: string;\r\n}\r\n\r\nexport interface IGetFitQuestionsDto {\r\n order: number;\r\n question: string;\r\n questionId: number;\r\n responseType: ResponseTypes;\r\n responseOptions: [];\r\n}\r\n\r\nexport interface GetClientServiceanswersDto extends IGetFitQuestionsDto {\r\n selectedAnswer: ISelectedAnswerOption[];\r\n}\r\n\r\nexport interface IResponseOption {\r\n value: number;\r\n text: string;\r\n}\r\n\r\nexport enum ResponseTypes {\r\n single = 'single',\r\n text = 'text',\r\n ranked = 'ranked',\r\n multiple = 'multiple',\r\n}\r\n\r\nexport interface ISelectedAnswerOption extends IResponseOption {\r\n choiceId?: number;\r\n rank: number;\r\n text: string;\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { RouterModule, Routes } from '@angular/router';\r\n\r\nconst routes: Routes = [\r\n {\r\n path: '',\r\n pathMatch: 'full',\r\n redirectTo: 'supplier-matching'\r\n },\r\n\r\n {\r\n path: 'supplier-matching',\r\n loadChildren: () => import('../fit-wizard/fit-wizard.module').then(m => m.FitWizardModule)\r\n },\r\n\r\n {\r\n path: 'fit-results',\r\n loadChildren: () => import('../pages/fit-results/fit-results.module').then((m) => m.FitResultsModule)\r\n }\r\n];\r\n\r\n@NgModule({\r\n imports: [RouterModule.forChild(routes)],\r\n exports: [RouterModule]\r\n})\r\nexport class FitRoutingModule { }\r\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\r\nimport { Injectable } from '@angular/core';\r\nimport { switchMap, map, tap, concatMap, withLatestFrom, filter } from 'rxjs/operators';\r\nimport {\r\n loadPublicSearchQuestions,\r\n loadPublicSearchQuestionsSuccess,\r\n loadQuestions,\r\n loadQuestionsSuccess,\r\n} from './actions/load-questions.actions';\r\nimport { FitQuestionsService } from '../../fit-wizard/services/fit-questions/fit-questions.service';\r\nimport {\r\n submitWizard,\r\n submitWizardSuccess,\r\n submitPublicWizard,\r\n submitPublicWizardSuccess\r\n} from './actions/submit-wizard.actions';\r\nimport { Router } from '@angular/router';\r\nimport { FitDataService } from '../../fit-wizard/services/fit-data/fit-data.service';\r\nimport { loadSearchResults, loadSearchResultsSuccess, loadPublicSearchResults, loadPublicSearchResultsSuccess, checkSearchExpiry, checkSearchExpirySucess } from './actions/load-search-results';\r\nimport { contactPublicSearchSuppliers, contactSuppliers } from './actions/contact-supplier.actions';\r\nimport {\r\n downloadFitResults, downloadPublicSearchFitResponses,\r\n} from './actions/download-results.actions';\r\nimport { DownloaderService, RootState, selectRouteParams } from '@core';\r\nimport {\r\n getFitSearchHistory,\r\n getFitSearchHistorySuccess,\r\n} from './actions/get-search-history.actions';\r\nimport { Store } from '@ngrx/store';\r\n\r\n@Injectable()\r\nexport class FitEffects {\r\n loadQuestions$ = createEffect(() =>\r\n this.actions$.pipe(\r\n ofType(loadQuestions),\r\n switchMap(() =>\r\n this.fitQuestionsService.getQuestions().pipe(\r\n map((questions) => loadQuestionsSuccess({ questions }))\r\n )\r\n )\r\n )\r\n );\r\n\r\n loadPublicSearchQuestions$ = createEffect(() =>\r\n this.actions$.pipe(\r\n ofType(loadPublicSearchQuestions),\r\n switchMap(() =>\r\n this.fitQuestionsService.getPublicSearchQuestions().pipe(\r\n map((questions) => loadPublicSearchQuestionsSuccess({ questions }))\r\n )\r\n )\r\n )\r\n );\r\n\r\n submitWizard$ = createEffect(() =>\r\n this.actions$.pipe(\r\n ofType(submitWizard),\r\n withLatestFrom(this.store.select(selectRouteParams)),\r\n tap(([_, { clientId }]) => {\r\n this.router.navigateByUrl(`app/${clientId}/fit/supplier-matching/results`);\r\n }),\r\n switchMap(([{ form }, _]) =>\r\n this.fitDataService.submitForm(form).pipe(\r\n map((searchId) => submitWizardSuccess({ searchId }))\r\n )\r\n )\r\n )\r\n );\r\n\r\n submitPublicWizard$ = createEffect(() =>\r\n this.actions$.pipe(\r\n ofType(submitPublicWizard),\r\n withLatestFrom(this.store.select(selectRouteParams)),\r\n tap(([{ corrId }, { }]) => {\r\n this.router.navigateByUrl(`public/search/fit-results?corrId=${corrId}`);\r\n }),\r\n switchMap(([{ form, corrId, contactInfo }, _]) =>\r\n this.fitDataService.submitPublicForm(form, corrId, contactInfo).pipe(\r\n map((searchId) => submitPublicWizardSuccess({ searchId }))\r\n )\r\n )\r\n )\r\n );\r\n\r\n loadSearchResults$ = createEffect(() =>\r\n this.actions$.pipe(\r\n ofType(loadSearchResults),\r\n withLatestFrom(this.store.select(selectRouteParams)),\r\n switchMap(([_, { searchId }]) =>\r\n this.fitDataService.getSearchResult(searchId).pipe(\r\n map((result) => loadSearchResultsSuccess({ result }))\r\n )\r\n )\r\n )\r\n );\r\n\r\n loadPublicSearchResults$ = createEffect(() =>\r\n this.actions$.pipe(\r\n ofType(loadPublicSearchResults),\r\n switchMap(({ corrId, searchId }) =>\r\n this.fitDataService.getPublicSearchResult(searchId, corrId).pipe(\r\n map((result) => loadPublicSearchResultsSuccess({ result }))\r\n )\r\n )\r\n )\r\n );\r\n\r\n checkSearchExpiry$ = createEffect(() =>\r\n this.actions$.pipe(\r\n ofType(checkSearchExpiry),\r\n switchMap(({ corrId }) =>\r\n this.fitDataService.checkSearchExpiry(corrId).pipe(\r\n map((expired) => checkSearchExpirySucess({ expired }))\r\n )\r\n )\r\n )\r\n );\r\n\r\n contactSuppliers$ = createEffect(\r\n () =>\r\n this.actions$.pipe(\r\n ofType(contactSuppliers),\r\n withLatestFrom(this.store.select(selectRouteParams)),\r\n switchMap(([action, { clientId, searchId }]) =>\r\n this.fitDataService.contactSuppliers(action.supplierIds, searchId).pipe(\r\n tap(_ => this.router.navigateByUrl(`app/${clientId}/fit/fit-results/next-steps`))\r\n )\r\n )\r\n ),\r\n { dispatch: false }\r\n );\r\n\r\n contactPubliSearchSuppliers$ = createEffect(\r\n () =>\r\n this.actions$.pipe(\r\n ofType(contactPublicSearchSuppliers),\r\n withLatestFrom(this.store.select(selectRouteParams)),\r\n switchMap(([action, { corrId }]) =>\r\n this.fitDataService.contactPublicSearchSuppliers(action.supplierIds, action.corrId).pipe(\r\n tap(_ => this.router.navigateByUrl('/public/searchresults/next-steps'))\r\n )\r\n )\r\n ),\r\n { dispatch: false }\r\n );\r\n\r\n downloadResults$ = createEffect(() =>\r\n this.actions$.pipe(\r\n ofType(downloadFitResults),\r\n withLatestFrom(this.store.select(selectRouteParams)),\r\n concatMap(([_, { clientId, searchId }]) =>\r\n this.fitDataService.downloadResults(clientId, searchId).pipe(\r\n tap((results) => this.downloader.downloadBlob(results.body, 'fit_results.xlsx'))\r\n )\r\n )\r\n ),\r\n { dispatch: false }\r\n );\r\n\r\n downloadPublicSearchResponses$ = createEffect(() =>\r\n this.actions$.pipe(\r\n ofType(downloadPublicSearchFitResponses),\r\n withLatestFrom(this.store.select(selectRouteParams)),\r\n concatMap(([{ corrId }, _]) =>\r\n this.fitDataService.downloadPublicSearchResponses(corrId).pipe(\r\n tap((results) => this.downloader.downloadBlob(results.body, 'fit_results.xlsx'))\r\n )\r\n )\r\n ),\r\n { dispatch: false }\r\n );\r\n\r\n getFitSearchHistory$ = createEffect(() =>\r\n this.actions$.pipe(\r\n ofType(getFitSearchHistory),\r\n switchMap(() =>\r\n this.fitDataService.getFitSearchHistory().pipe(\r\n map((history) => getFitSearchHistorySuccess({ history }))\r\n )\r\n )\r\n )\r\n );\r\n\r\n constructor(\r\n private actions$: Actions,\r\n private fitQuestionsService: FitQuestionsService,\r\n private store: Store,\r\n private router: Router,\r\n private fitDataService: FitDataService,\r\n private downloader: DownloaderService\r\n ) { }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { FitRoutingModule } from './fit-routing.module';\r\nimport { StoreModule } from '@ngrx/store';\r\nimport { EffectsModule } from '@ngrx/effects';\r\nimport { FitEffects } from './store/fit.effects';\r\nimport { fitFeatureKey, reducer } from './store/fit.reducers';\r\n\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule,\r\n FitRoutingModule,\r\n StoreModule.forFeature(fitFeatureKey, reducer),\r\n EffectsModule.forFeature([FitEffects])\r\n ]\r\n})\r\nexport class FitModule { }\r\n"],"x_google_ignoreList":[]}