# `AccountOwnerConflicts`
[🔗](https://github.com/jaizendra-netizen/account_owner_conflicts/blob/main/lib/account_owner_conflicts.ex#L1)

List the accounts that name two or more owners in a CSV you supply.

Input columns: `account` and `owner` (labels). Labels are trimmed and compared
case-insensitively; the first spelling seen is the one shown. The same account and owner
pair on two rows counts once, and the number of such repeated rows is reported. Extra
columns are ignored.

The library lists where your own file names two owners. It cannot tell which owner is right.

# `row`

```elixir
@type row() :: %{row: pos_integer(), account: String.t(), owner: String.t()}
```

# `analyze`

```elixir
@spec analyze([row()]) :: map()
```

Analyse the rows. Returns a map with `:rows`, `:repeated`, `:accounts`, `:owners`,
`:single`, `:conflicts` (list of `{account, [owner]}`, accounts and owners sorted
case-insensitively) and `:per_owner` (list of `{owner, accounts, shared}`).

# `conflicts?`

```elixir
@spec conflicts?(map()) :: boolean()
```

True when at least one account names two or more owners.

# `parse`

```elixir
@spec parse(String.t()) :: {:ok, [row()]} | {:error, String.t()}
```

Parse CSV text into rows. Errors name the row (data rows are counted from 1, header excluded).

# `pct`

```elixir
@spec pct(non_neg_integer(), non_neg_integer()) :: String.t()
```

Percentage with one decimal, rounded half up, as text such as `42.9%`.

# `render`

```elixir
@spec render(map()) :: String.t()
```

Render the analysis as text.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
