Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: LBA-2475 correction de la mauvaise géolocalisation des formations #1503

Merged
merged 3 commits into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions server/src/services/formation.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const minimalDataMongoFields = {
lieu_formation_geo_coordonnees: 1,
localite: 1,
distance: 1,
lieu_formation_geopoint: 1,
}

/**
Expand Down Expand Up @@ -332,8 +333,8 @@ const transformFormations = (rawFormations: IFormationCatalogue[], isMinimalData
* Adaptation au modèle LBAC et conservation des seules infos utilisées des formations
*/
const transformFormation = (rawFormation: IFormationCatalogue): ILbaItemFormation => {
const latOpt = rawFormation.lieu_formation_geopoint?.coordinates[0] ?? null
const longOpt = rawFormation.lieu_formation_geopoint?.coordinates[1] ?? null
const latOpt = rawFormation.lieu_formation_geopoint?.coordinates[1] ?? null
const longOpt = rawFormation.lieu_formation_geopoint?.coordinates[0] ?? null
const sessions = setSessions(rawFormation)
const duration = getDurationFromSessions(sessions)

Expand Down Expand Up @@ -417,8 +418,8 @@ const transformFormation = (rawFormation: IFormationCatalogue): ILbaItemFormatio
* Adaptation au modèle LBAC et conservation des seules infos utilisées des formations
*/
const transformFormationV2 = (rawFormation: IFormationCatalogue): ILbaItemFormation2 => {
const latOpt = rawFormation.lieu_formation_geopoint?.coordinates[0] ?? null
const longOpt = rawFormation.lieu_formation_geopoint?.coordinates[1] ?? null
const latOpt = rawFormation.lieu_formation_geopoint?.coordinates[1] ?? null
const longOpt = rawFormation.lieu_formation_geopoint?.coordinates[0] ?? null

const sessions = setSessions(rawFormation)
const duration = getDurationFromSessions(sessions)
Expand Down Expand Up @@ -493,8 +494,8 @@ const transformFormationV2 = (rawFormation: IFormationCatalogue): ILbaItemFormat
}

const transformFormationWithMinimalDataV2 = (rawFormation: IFormationCatalogue): ILbaItemFormation2 => {
const latOpt = rawFormation.lieu_formation_geopoint?.coordinates[0] ?? null
const longOpt = rawFormation.lieu_formation_geopoint?.coordinates[1] ?? null
const latOpt = rawFormation.lieu_formation_geopoint?.coordinates[1] ?? null
const longOpt = rawFormation.lieu_formation_geopoint?.coordinates[0] ?? null

const resultFormation: ILbaItemFormation2 = {
type: LBA_ITEM_TYPE.FORMATION,
Expand Down Expand Up @@ -526,8 +527,8 @@ const transformFormationWithMinimalDataV2 = (rawFormation: IFormationCatalogue):
* Adaptation au modèle LBAC et conservation des seules infos utilisées des formations
*/
const transformFormationWithMinimalData = (rawFormation: IFormationCatalogue): ILbaItemFormation => {
const latOpt = rawFormation.lieu_formation_geopoint?.coordinates[0] ?? null
const longOpt = rawFormation.lieu_formation_geopoint?.coordinates[1] ?? null
const latOpt = rawFormation.lieu_formation_geopoint?.coordinates[1] ?? null
const longOpt = rawFormation.lieu_formation_geopoint?.coordinates[0] ?? null

const resultFormation: ILbaItemFormation = {
ideaType: LBA_ITEM_TYPE_OLD.FORMATION,
Expand Down
Loading