diff --git a/src/structures/interfaces/structure-formatted.interface.ts b/src/structures/interfaces/structure-formatted.interface.ts index 4f1963f21e83fc0a32a17a4028b54d53bd700944..94bb4e31dc00f6f0efbb284c67865f38b7901b60 100644 --- a/src/structures/interfaces/structure-formatted.interface.ts +++ b/src/structures/interfaces/structure-formatted.interface.ts @@ -16,7 +16,7 @@ export interface StructureFormatted extends Partial<Structure>, Partial<Document courriel?: string; latitude?: number; longitude?: number; - presentation_resume?: string; + presentation_detail?: string; publics_accueillis?: string; site_web?: string; telephone?: string; diff --git a/src/structures/services/structures-export.service.ts b/src/structures/services/structures-export.service.ts index ca4b0613b579f2e02d051ad79ca700efc101f4f9..ebb42cba36f4874073da2c1da313efab4ed85072 100644 --- a/src/structures/services/structures-export.service.ts +++ b/src/structures/services/structures-export.service.ts @@ -23,7 +23,7 @@ export class StructuresExportService { const structures = await this.structureModel .find({ deletedAt: { $exists: false }, accountVerified: true, $where: 'this.dataShareConsentDate != null' }) .populate('personalOffers') - .select('-_id -accountVerified -otherDescription -dataShareConsentDate') + .select('-accountVerified -otherDescription -dataShareConsentDate') .exec(); return structures.map((structure) => { @@ -33,14 +33,13 @@ export class StructuresExportService { structure.categories.onlineProcedures = structure.categoriesWithPersonalOffers.onlineProcedures; structure.categories.baseSkills = structure.categoriesWithPersonalOffers.baseSkills; structure.categories.advancedSkills = structure.categoriesWithPersonalOffers.advancedSkills; - const formatted: StructureFormatted = { // TODO add antenne field + id: structure.id, adresse: this.formatAddress(structure.address), code_postal: structure.address?.postcode, commune: structure.address?.commune, date_maj: this.formatDate(structure.updatedAt), - id: structure.id, nom: structure.structureName, pivot: '00000000000000', // for now we don't have a pivot services: this.formatServices(structure.categories), @@ -50,7 +49,7 @@ export class StructuresExportService { ...(structure.contactMail && { courriel: structure.contactMail }), ...(structure.coord && { longitude: structure.coord[0] }), ...(structure.coord && { latitude: structure.coord[1] }), - ...(structure.description && { presentation_resume: structure.description }), + ...(structure.description && { presentation_detail: structure.description }), ...((structure.categories.age || structure.categories.handicaps || structure.categories.languageAndIlliteracy || diff --git a/src/structures/services/structures-import.service.ts b/src/structures/services/structures-import.service.ts index fa83a7ecca1efe6fa82603c11bf9795db13f8c45..65f794483fce47d7126f0528fbcbf26a67e00625 100644 --- a/src/structures/services/structures-import.service.ts +++ b/src/structures/services/structures-import.service.ts @@ -117,7 +117,7 @@ export class StructuresImportService { structure.publics_accueillis ), coord: [structure.longitude, structure.latitude], - description: structure.presentation_resume ?? null, + description: structure.presentation_detail ?? null, contactPhone: structure.telephone ?? null, contactMail: structure.courriel ?? null, hours: this.convertFromOSMFormat(structure.horaires), diff --git a/test/mock/services/structures-export.mock.service.ts b/test/mock/services/structures-export.mock.service.ts index dc93f9affa7729b00c6aab1c72f43c28a7a0eccc..29fb852807860a68f9244d51ac300bc5d8bbbc90 100644 --- a/test/mock/services/structures-export.mock.service.ts +++ b/test/mock/services/structures-export.mock.service.ts @@ -23,7 +23,7 @@ export const mockFormattedStructures: Array<StructureFormatted> = [ courriel: 'adzadadzadazd@pimms.org', longitude: 4.8608585, latitude: 45.7086482, - presentation_resume: + presentation_detail: "Entreprise de médiation numérique assurant l'animation d'atelier numériques en collectif ou l'accompagnement au numérique des particuliers en individuel. Structure agréée APTIC sur la métropole de Lyon, acceptant à ce titre le règlement de ses prestations en chèque PASS NUMERIQUE", publics_accueillis: 'Jeunes (16-26 ans);Seniors (+ 65 ans);Uniquement femmes', site_web: 'http://lesonduclic.fr/site1/',