# `GeoGenius.Registration`
[🔗](https://github.com/agoodway/geo_genius/blob/main/lib/geo_genius/registration.ex#L1)

Translates the catalog's exact-candidate lifecycle decision into the public
Elixir result vocabulary.

Registration and run claiming are one database statement. The statement
has committed before this module returns, so callers may enqueue only an
`:enqueue` result without exposing partially registered catalog state.

# `accepted`

```elixir
@type accepted() :: %{
  run_id: Ecto.UUID.t(),
  release_id: Ecto.UUID.t(),
  attempt: pos_integer(),
  reason: accepted_reason()
}
```

# `accepted_reason`

```elixir
@type accepted_reason() :: :registered | :retried | :same_owner | :completed
```

# `result`

```elixir
@type result() ::
  {:enqueue, accepted()}
  | {:existing, accepted()}
  | {:error, GeoGenius.CandidateError.t()}
```

# `prepare_import`

```elixir
@spec prepare_import(GeoGenius.Context.t(), GeoGenius.Manifest.t(), map()) :: result()
```

Atomically registers one exact manifest or diagnoses its existing import attempt.

# `retry_failed`

```elixir
@spec retry_failed(
  GeoGenius.Context.t(),
  Ecto.UUID.t(),
  GeoGenius.Manifest.t(),
  map()
) :: result()
```

Atomically replaces one failed latest attempt with an exact corrected manifest.

---

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