Skip to content

Commit

Permalink
feat(FSADT1-1519): Predictive search endpoint #1
Browse files Browse the repository at this point in the history
  • Loading branch information
mamartinezmejia committed Oct 4, 2024
1 parent 9b989dc commit cc6f1b2
Show file tree
Hide file tree
Showing 4 changed files with 225 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/dto/CommonTypesDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export interface SubmissionList {

export interface ClientList {
clientNumber: string
acronym: string
clientAcronym: string
clientName: string
clientType: string
city: string
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/SearchPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -100,7 +100,7 @@ const paginate = (event: any) => {
<cds-table-row v-for="row in tableData" :key="row.clientNumber" @click="selectEntry(row)">
<cds-table-cell />
<cds-table-cell><span>{{ row.clientNumber }}</span></cds-table-cell>
<cds-table-cell><span>{{ row.acronym }}</span></cds-table-cell>
<cds-table-cell><span>{{ row.clientAcronym }}</span></cds-table-cell>
<cds-table-cell><span>{{ row.clientName }}</span></cds-table-cell>
<cds-table-cell><span>{{ row.clientType }}</span></cds-table-cell>
<cds-table-cell><span>{{ row.city }}</span></cds-table-cell>
Expand Down
194 changes: 194 additions & 0 deletions frontend/stub/__files/response-client-predictive-search.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
28 changes: 28 additions & 0 deletions frontend/stub/mappings/client_predictive_search.json
Original file line number Diff line number Diff line change
@@ -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
}
}
]
}

0 comments on commit cc6f1b2

Please sign in to comment.