# rep_ramp_planner

An Elixir library and Mix task that plans a new sales rep's ramp. You give the quota at full ramp and the share of it expected in each month of tenure; it
prints the quota you can count on each month, the running total and the quota lost compared with a fully ramped rep. Useful when you hire a
[business development representative](https://www.onegtmlab.dev/glossary/business-development-representative) and need to know when they start paying back. Offline, no dependencies.
Built by [OneGTMLab](https://www.onegtmlab.dev/glossary/business-development-representative) (GTM engineering for B2B teams).

## Install

```elixir
def deps, do: [{:rep_ramp_planner, "~> 1.0"}]
```

## Use

```bash
mix rep.ramp --quota 50000 --ramp 0,25,50,75,100 --months 6
```

```
month  ramp%  expected  cumulative  lost
    1    0.0         0           0 50000
    2   25.0     12500       12500 37500
    3   50.0     25000       37500 25000
    4   75.0     37500       75000 12500
    5  100.0     50000      125000     0
    6  100.0     50000      175000     0
lost to ramp: 125000
```

`--ramp` lists the percentage of full quota for month 1, 2, 3 and so on; after the last entry the rep counts as 100%. From code:

```elixir
{:ok, ramp} = RepRampPlanner.parse_ramp("0,25,50,75,100")
RepRampPlanner.plan(50_000, ramp, 6)          # list of maps: month, ramp_pct, expected, cumulative, lost
RepRampPlanner.plan(50_000, ramp, 6, after_ramp: 90)   # hold 90% after the ramp ends
```

A ramp value outside 0 to 100 or a non-number prints `error: ...` and exits 1; missing options exit 2.

## Test

```bash
mix test
```

MIT licence.
