From cc6f1b249fe51f433783e842c78d028cdc112bd7 Mon Sep 17 00:00:00 2001 From: Maria Martinez Date: Fri, 4 Oct 2024 11:15:32 -0700 Subject: [PATCH] feat(FSADT1-1519): Predictive search endpoint #1 --- frontend/src/dto/CommonTypesDto.ts | 2 +- frontend/src/pages/SearchPage.vue | 4 +- .../response-client-predictive-search.json | 194 ++++++++++++++++++ .../mappings/client_predictive_search.json | 28 +++ 4 files changed, 225 insertions(+), 3 deletions(-) create mode 100644 frontend/stub/__files/response-client-predictive-search.json create mode 100644 frontend/stub/mappings/client_predictive_search.json diff --git a/frontend/src/dto/CommonTypesDto.ts b/frontend/src/dto/CommonTypesDto.ts index fc61aa3afd..5c02924080 100644 --- a/frontend/src/dto/CommonTypesDto.ts +++ b/frontend/src/dto/CommonTypesDto.ts @@ -178,7 +178,7 @@ export interface SubmissionList { export interface ClientList { clientNumber: string - acronym: string + clientAcronym: string clientName: string clientType: string city: string diff --git a/frontend/src/pages/SearchPage.vue b/frontend/src/pages/SearchPage.vue index 87299ff036..9c45f9827b 100644 --- a/frontend/src/pages/SearchPage.vue +++ b/frontend/src/pages/SearchPage.vue @@ -27,7 +27,7 @@ const fullSearchKeyword = ref(""); const predictiveSearchUri = computed( () => - `/api/clients/predictive-search?page=${pageNumber.value - 1}&size=${pageSize.value}&keyword=${encodeURIComponent(predictiveSearchKeyword.value)}${tableReference.value || ''}` + `/api/clients/predictive-search?keyword=${encodeURIComponent(predictiveSearchKeyword.value)}${tableReference.value || ''}` ); const fullSearchUri = computed( @@ -100,7 +100,7 @@ const paginate = (event: any) => { {{ row.clientNumber }} - {{ row.acronym }} + {{ row.clientAcronym }} {{ row.clientName }} {{ row.clientType }} {{ row.city }} diff --git a/frontend/stub/__files/response-client-predictive-search.json b/frontend/stub/__files/response-client-predictive-search.json new file mode 100644 index 0000000000..299ebe1081 --- /dev/null +++ b/frontend/stub/__files/response-client-predictive-search.json @@ -0,0 +1,194 @@ +[ + { + "clientNumber": "00001009", + "clientAcronym": "AINSLC", + "clientName": "AINSWORTH LUMBER CO. LTD.", + "clientType": "Corporation", + "city": "100 MILE HOUSE", + "clientStatus": "Deactivated" + }, + { + "clientNumber": "00001012", + "clientAcronym": "BELL", + "clientName": "BELL LUMBER & POLE CANADA, ULC", + "clientType": "Corporation", + "city": "VERNON", + "clientStatus": "Active" + }, + { + "clientNumber": "00001056", + "clientAcronym": "APOLLOFP", + "clientName": "APOLLO FOREST PRODUCTS LTD.", + "clientType": "Corporation", + "city": "FORT ST JAMES", + "clientStatus": "Active" + }, + { + "clientNumber": "00001064", + "clientAcronym": "ASPEN2", + "clientName": "ASPEN PLANERS LTD.", + "clientType": "Corporation", + "city": "SURREY", + "clientStatus": "Active" + }, + { + "clientNumber": "00001065", + "clientAcronym": "ATCOLTD", + "clientName": "ATCO LUMBER LTD.", + "clientType": "Corporation", + "city": "FRUITVALE", + "clientStatus": "Active" + }, + { + "clientNumber": "00001071", + "clientAcronym": "BCHYDRO", + "clientName": "BRITISH COLUMBIA HYDRO AND POWER AUTHORITY", + "clientType": "Government", + "city": "BURNABY", + "clientStatus": "Active" + }, + { + "clientNumber": "00001074", + "clientAcronym": "FCC", + "clientName": "NORSKE SKOG CANADA LIMITED", + "clientType": "Corporation", + "city": "VANCOUVER", + "clientStatus": "Deactivated" + }, + { + "clientNumber": "00001086", + "clientAcronym": "TOLKOL", + "clientName": "TOLKO INDUSTRIES LTD.", + "clientType": "Corporation", + "city": "KAMLOOPS", + "clientStatus": "Deactivated" + }, + { + "clientNumber": "00001109", + "clientAcronym": "LPENG", + "clientName": "LP ENGINEERED WOOD PRODUCTS LTD", + "clientType": "Corporation", + "city": "GOLDEN", + "clientStatus": "Deactivated" + }, + { + "clientNumber": "00001166", + "clientAcronym": "BBROS", + "clientName": "BOND BROTHERS SAWMILL LTD.", + "clientType": "Corporation", + "city": "HOUSTON", + "clientStatus": "Deactivated" + }, + { + "clientNumber": "00001188", + "clientAcronym": "BD", + "clientName": "BOYLE & DEAN LOGGING LTD.", + "clientType": "Corporation", + "city": "LANGLEY", + "clientStatus": "Deactivated" + }, + { + "clientNumber": "00001216", + "clientAcronym": "FBROUGHT", + "clientName": "BROUGHTON", + "clientType": "Individual", + "city": "QUESNEL", + "clientStatus": "Active" + }, + { + "clientNumber": "00001227", + "clientAcronym": "WFML", + "clientName": "WEST FRASER MILLS LTD.", + "clientType": "Corporation", + "city": "QUESNEL", + "clientStatus": "Deactivated" + }, + { + "clientNumber": "00001238", + "clientAcronym": "BUECKERT", + "clientName": "BUECKERT", + "clientType": "Individual", + "city": "CECIL LAKE", + "clientStatus": "Deceased" + }, + { + "clientNumber": "00001255", + "clientAcronym": "CRBLOG", + "clientName": "C.R.B. LOGGING CO. LTD.", + "clientType": "Corporation", + "city": "SQUAMISH", + "clientStatus": "Deactivated" + }, + { + "clientNumber": "00001271", + "clientAcronym": "CANFOR", + "clientName": "CANADIAN FOREST PRODUCTS LTD.", + "clientType": "Corporation", + "city": "VANCOUVER", + "clientStatus": "Active" + }, + { + "clientNumber": "00001278", + "clientAcronym": "WESTAR", + "clientName": "WESTAR TIMBER LTD.", + "clientType": "Corporation", + "city": "TERRACE", + "clientStatus": "Deactivated" + }, + { + "clientNumber": "00001294", + "clientAcronym": "CARNEY", + "clientName": "B.J. CARNEY & COMPANY, LIMITED", + "clientType": "Corporation", + "city": "CHASE", + "clientStatus": "Active" + }, + { + "clientNumber": "00001297", + "clientAcronym": "CARIER", + "clientName": "CARRIER LUMBER LTD.", + "clientType": "Corporation", + "city": "PRINCE GEORGE", + "clientStatus": "Active" + }, + { + "clientNumber": "00001302", + "clientAcronym": "CARTER", + "clientName": "CARTER", + "clientType": "Individual", + "city": "MISSION", + "clientStatus": "Active" + }, + { + "clientNumber": "00001310", + "clientAcronym": "CATERM", + "clientName": "CATTERMOLE TIMBER LTD.", + "clientType": "Corporation", + "city": "VANCOUVER", + "clientStatus": "Active" + }, + { + "clientNumber": "00001318", + "clientAcronym": "CELCREST", + "clientName": "CELCREST TIMBER LTD", + "clientType": "Corporation", + "city": "WYNNDEL", + "clientStatus": "Deactivated" + }, + { + "clientNumber": "00001391", + "clientAcronym": "COULSO", + "clientName": "COULSON FOREST PRODUCTS LIMITED", + "clientType": "Corporation", + "city": "PORT ALBERNI", + "clientStatus": "Suspended" + }, + { + "clientNumber": "00001402", + "clientAcronym": "TEMBEC", + "clientName": "TEMBEC INDUSTRIES INC.", + "clientType": "Corporation", + "city": "FERNIE", + "clientStatus": "Deactivated" + } +] diff --git a/frontend/stub/mappings/client_predictive_search.json b/frontend/stub/mappings/client_predictive_search.json new file mode 100644 index 0000000000..fe53b76877 --- /dev/null +++ b/frontend/stub/mappings/client_predictive_search.json @@ -0,0 +1,28 @@ +{ + "mappings": [ + { + "request": { + "urlPattern": "/api/clients/predictive-search", + "method": "GET", + "queryParameters": { + "keyword": { + "matches": "^(.*)$" + } + } + }, + "response": { + "status": 200, + "headers": { + "x-total-count": "57", + "content-type": "application/json;charset=UTF-8", + "Access-Control-Expose-Headers": "x-total-count" + }, + "bodyFileName": "response-predictive-search.json", + "transformers": [ + "response-template" + ], + "fixedDelayMilliseconds": 2500 + } + } + ] +}