Skip to content

Commit

Permalink
Update exportSitra.server.model.js
Browse files Browse the repository at this point in the history
  • Loading branch information
idfr authored Nov 28, 2022
1 parent 98f3dbb commit 4638903
Showing 1 changed file with 47 additions and 5 deletions.
52 changes: 47 additions & 5 deletions modules/products/server/models/exportSitra.server.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,19 @@ function __buildSubType(product, root, rootFieldList, unwantedTypes) {
blockCategory + '.' + blockField + '.referencesTopoguides'
);
}
if (itinerary.referencesCartographiques) {
blockItinerary.referencesCartographiques = {
libelleFr: product.itinerary.referencesCartographiques,
libelleEn: product.itinerary.referencesCartographiques,
libelleEs: product.itinerary.referencesCartographiques,
libelleIt: product.itinerary.referencesCartographiques,
libelleDe: product.itinerary.referencesCartographiques,
libelleNl: product.itinerary.referencesCartographiques
};
fieldList.push(
blockCategory + '.' + blockField + '.referencesCartographiques'
);
}
if (Object.keys(blockItinerary).length) {
blockData[blockField] = blockItinerary;
}
Expand Down Expand Up @@ -3683,11 +3696,6 @@ function __buildPrestation(product, root, rootFieldList, unwantedTypes) {
);
root.informationsPrestataireActivites.prestataireActivites = true;
}
if (root.informationsPrestataireActivites.prestataireActivites) {
rootFieldList.push(
'informationsPrestataireActivites.prestataireActivites'
);
}
}

if (product.language && product.language.length) {
Expand Down Expand Up @@ -3733,6 +3741,40 @@ function __buildPrestation(product, root, rootFieldList, unwantedTypes) {
rootFieldList.push('prestations.tailleGroupeMax');
}

if (root.informationsPrestataireActivites &&
root.informationsPrestataireActivites.prestataireActivites
) {
if (!root.informationsPrestataireActivites) {
root.informationsPrestataireActivites = {};
}
root.informationsPrestataireActivites.prestataireActivites = true;
rootFieldList.push('informationsPrestataireActivites.prestataireActivites');
}

if (product.isActivityProvider){
root.informationsPrestataireActivites = {};
root.informationsPrestataireActivites.prestataireActivites = true;
rootFieldList.push('informationsPrestataireActivites.prestataireActivites');
// Prestation
if (product.prestation && product.prestation.length) {
root.informationsPrestataireActivites.activitesSportives = __buildTypeKeyArray(
product.prestation,
['ActiviteSportivePrestation'],
unwantedTypes
);
}
rootFieldList.push('informationsPrestataireActivites.activitesSportives');
// Prestation
if (product.prestation && product.prestation.length) {
root.informationsPrestataireActivites.activitesCulturelles = __buildTypeKeyArray(
product.prestation,
['ActiviteCulturellePrestation'],
unwantedTypes
);
}
rootFieldList.push('informationsPrestataireActivites.activitesCulturelles');
}

if (Object.keys(prestation).length) {
root.prestations = prestation;
} else {
Expand Down

0 comments on commit 4638903

Please sign in to comment.