Skip to content

Commit

Permalink
fix(logements): ajout localisation
Browse files Browse the repository at this point in the history
Ajout de la localisation pour permettre la recherche d'un logement par code postal ou ville
  • Loading branch information
SEFR authored and Sefrancois committed Jan 23, 2023
1 parent d537333 commit 8ffd7e6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ describe("AnnonceDeLogementTransformation", () => {
meuble: true,
localisation: {
ville: "Paris",
codePostal: 75001,
codePostal: "75001",
},
sourceCreatedAt: "2022-09-01",
sourceUpdatedAt: "2022-12-12T01:30:00.000Z",
Expand Down Expand Up @@ -287,10 +287,13 @@ describe("AnnonceDeLogementTransformation", () => {
imagesUrl: ["http://some.url/1", "http://some.url/2"],
sourceUpdatedAt: "2022-12-12T01:30:00.000Z",
localisationAAfficher: "75001 - Paris",
localisation: {
ville: "Paris",
codePostal: "75001",
},
};

// When
// @ts-ignore
const resultat = transformerAnnonceDeLogement(entry);

// Then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export function transformerAnnonceDeLogement({ entry }: { entry: AnnonceDeLogeme
imagesUrl: entry.imagesUrl?.map(imageUrl => imageUrl.value) || [],
sourceUpdatedAt: entry.sourceUpdatedAt,
localisationAAfficher: getLocalisationToDisplay(entry.localisation),
localisation: entry.localisation && {
ville: entry.localisation?.ville || "",
codePostal: entry.localisation?.codePostal || "",
},
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ export interface AnnonceDeLogementMeilisearch {
imagesUrl: Array<string>;
sourceUpdatedAt: string;
localisationAAfficher: string;
localisation: {
ville: string,
codePostal: string,
},
}

export enum TypeBien {
Expand Down

0 comments on commit 8ffd7e6

Please sign in to comment.