# `TCC.Transaction`
[🔗](https://github.com/vcnovaes/toccata/blob/v0.1.0/lib/tcc/transaction.ex#L1)

Core transaction coordinator for TCC protocol.

Manages the lifecycle of a distributed transaction, coordinating the
Try, Confirm, and Cancel phases across multiple services.

# `t`
[🔗](https://github.com/vcnovaes/toccata/blob/v0.1.0/lib/tcc/transaction.ex#L11)

```elixir
@type t() :: %TCC.Transaction{
  actions: [TCC.Action.t()],
  final_hooks: MapSet.t(),
  on_cancel_error: :raise | module(),
  opts: map(),
  tracers: MapSet.t(),
  transaction_id: String.t()
}
```

# `add_action`
[🔗](https://github.com/vcnovaes/toccata/blob/v0.1.0/lib/tcc/transaction.ex#L50)

```elixir
@spec add_action(t(), TCC.Action.t()) :: t()
```

Adds an action to the transaction.

# `execute`
[🔗](https://github.com/vcnovaes/toccata/blob/v0.1.0/lib/tcc/transaction.ex#L60)

```elixir
@spec execute(t(), any()) :: {:ok, map(), any()} | {:error, atom(), any(), map()}
```

Executes the transaction following the TCC protocol.

# `new`
[🔗](https://github.com/vcnovaes/toccata/blob/v0.1.0/lib/tcc/transaction.ex#L38)

```elixir
@spec new(keyword()) :: t()
```

Creates a new transaction.

---

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