message: location2region synonym
diff: import * as algoliasearch from "algoliasearch";
  import { env } from "../config";
  -
  +import * as _ from "lodash";
  const client = algoliasearch(env.algolia.app, env.algolia.key);
  const generateAlgoliaKey = (fieldName: string, value: string) =>
  @@ -19,6 +19,22 @@ const tableConnect2ids = records => records.map(r => r.snapshot.objectID);
  const cohort2region = (cohort: string) =>
  cohort.toUpperCase().replace(/\d+.*$/, "");
  +const locations = [
  + { location: "Sydney", region: "SYD" },
  + { location: "Singapore", region: "SG" },
  + { location: "Amsterdam", region: "AMS" },
  + { location: "Oslo", region: "OSL" },
  + { location: "New York", region: "NYC" },
  + { location: "London", region: "LON" },
  + { location: "Nairobi", region: "NAI" },
  + { location: "Stockholm", region: "STO" },
  +];
  +
  +const location2region = (location: string) => {
  + const _location = _.find(locations, { location });
  +
  + return _location ? _location.region : "GLOBAL";
  +};
  const cohort2location = (cohort: string) => {
  const _region = cohort2region(cohort);
  switch (_region) {
  @@ -56,6 +72,16 @@ const cohort2regionCollections = (collections: string[]) =>
  }));
  const config = [
  + {
  + name: "advisors",
  + groups: [
  + {
  + listenerField: "location",
  + synonymField: "region",
  + transformer: location2region,
  + },
  + ],
  + },
  {
  name: "icManagement/{icId}/icMembers/{memberId}/votes",
  groups: [
  