Skip to content

Commit

Permalink
Merge pull request #171 from partio-scout/technical/family-camp-agegr…
Browse files Browse the repository at this point in the history
…oup-label

Change family camp group label in kuksa import
  • Loading branch information
pompost authored Jul 22, 2016
2 parents 16941a9 + 0caa4c8 commit e06aaaf
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/kuksa-integration/rebuild-tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ function rebuildParticipantsTable() {
return _.get(participant, 'subCamp.name') || 'Muu';
}

function getAgeGroup(participant) {
const ageGroup = getSelectionForGroup(participant, 'Osallistun seuraavan ikäkauden ohjelmaan:') || 'Muu';
if (ageGroup === 'perheleirin ohjelmaan (0-11v.), muistathan merkitä lisätiedot osallistumisesta \"vain perheleirin osallistujille\" -osuuteen.') {
return 'perheleiri (0-11v.)';
} else {
return ageGroup;
}
}

console.log('Rebuilding participants table...');

return findKuksaParticipants({
Expand Down Expand Up @@ -107,7 +116,7 @@ function rebuildParticipantsTable() {
subCamp: getSubCamp(participant),
village: _.get(participant, 'village.name') || 'Muu',
country: _.get(participant, 'localGroup.country') || 'Suomi',
ageGroup: getSelectionForGroup(participant, 'Osallistun seuraavan ikäkauden ohjelmaan:') || 'Muu',
ageGroup: getAgeGroup(participant),
// Not a scout if a) no finnish member number 2) not part of international group ("local group")
nonScout: !participant.memberNumber && !_.get(participant, 'localGroup.name'),
staffPosition: getInfoForField(participant, 'Pesti'),
Expand Down Expand Up @@ -238,4 +247,3 @@ function buildOptionTable() {
}));
}
}

0 comments on commit e06aaaf

Please sign in to comment.