# Team mapping for headcount plan reconciliation
#
# The reconciliation flow joins three sources (plan, ATS, HRIS) by team. Each
# source uses its own team labels. This file maps each source's labels to a
# canonical team identifier the flow uses for joining.
#
# Without this mapping, every team surfaces as an anomaly cell. With it,
# ongoing maintenance is low — only when teams are created, renamed, or
# merged.
#
# Save this file as /data/team_mapping.yml (or whatever path TEAM_MAPPING_PATH
# env var in n8n points to).

teams:
  Engineering:
    canonical: engineering
    aliases:
      plan: ["Engineering", "Eng"]
      ashby: ["Engineering", "Engineering Department"]
      hris: ["ENGINEERING", "Engineering"]

  Product:
    canonical: product
    aliases:
      plan: ["Product"]
      ashby: ["Product"]
      hris: ["Product Management", "PM"]

  Design:
    canonical: design
    aliases:
      plan: ["Design"]
      ashby: ["Product Design", "Design"]
      hris: ["Design"]

  Sales:
    canonical: sales
    aliases:
      plan: ["Sales", "Revenue"]
      ashby: ["Sales", "Revenue"]
      hris: ["Sales", "Account Executives"]

  Sales Development:
    canonical: sales-development
    aliases:
      plan: ["SDR", "Sales Development"]
      ashby: ["Sales Development", "BDR"]
      hris: ["Sales Development", "SDR"]

  Customer Success:
    canonical: customer-success
    aliases:
      plan: ["CS", "Customer Success"]
      ashby: ["Customer Success", "Customer Experience"]
      hris: ["Customer Success", "CS"]

  Marketing:
    canonical: marketing
    aliases:
      plan: ["Marketing"]
      ashby: ["Marketing"]
      hris: ["Marketing"]

  Recruiting:
    canonical: recruiting
    aliases:
      plan: ["Recruiting", "TA"]
      ashby: ["Talent Acquisition"]
      hris: ["People Ops - Talent", "TA"]

  People Ops:
    canonical: people-ops
    aliases:
      plan: ["People", "People Ops"]
      ashby: ["People Operations"]
      hris: ["People Ops", "Human Resources"]

  Finance:
    canonical: finance
    aliases:
      plan: ["Finance"]
      ashby: ["Finance & Accounting"]
      hris: ["Finance", "Accounting"]

  Legal:
    canonical: legal
    aliases:
      plan: ["Legal"]
      ashby: ["Legal"]
      hris: ["Legal Department"]

  IT:
    canonical: it
    aliases:
      plan: ["IT"]
      ashby: ["IT", "Information Technology"]
      hris: ["IT"]

# When you create a new team, add it here BEFORE the first req goes into Ashby.
# When you rename a team, ADD the new alias to the existing entry — don't delete
# the old one until the historical reqs and hires under the old name have been
# migrated.
# When you merge two teams, point both old `canonical` values to the merged
# team's canonical; keep the old ones around until the historical data has
# settled.
