# inbound_lead_aging

An Elixir library and Mix task that buckets untouched [inbound leads](https://www.onegtmlab.dev/glossary/inbound-lead) by age (under 1 hour,
1 to 4 hours, 4 to 24 hours, 1 to 3 days, over 3 days) and lists the five oldest, so the leads going cold get worked first.
Leads that already have a first touch are counted and left out. Offline, no dependencies.
Built by [OneGTMLab](https://www.onegtmlab.dev/glossary/inbound-lead) (GTM engineering for B2B teams).

```elixir
{:inbound_lead_aging, "~> 1.0"}
```

```csv
lead,created_at,first_touch_at
a,2026-11-28T11:30:00Z,
b,2026-11-28T09:00:00Z,
f,2026-11-28T10:00:00Z,2026-11-28T10:05:00Z
```

```bash
mix inbound.lead_aging leads.csv --now 2026-11-28T12:00:00Z
# under 1 hour   1
# 1 to 4 hours   1
# 4 to 24 hours  0
# 1 to 3 days    0
# over 3 days    0
# oldest untouched: b (3h 0m), a (0h 30m)
# already touched: 1
```

Timestamps are RFC 3339; the CSV reader does not handle quoted commas. See the
[inbound lead glossary entry](https://www.onegtmlab.dev/glossary/inbound-lead).

## Test

```bash
mix test
```
