# `MishkaGervaz.Table.Entities.BulkAction`
[🔗](https://github.com/mishka-group/mishka_gervaz/blob/v0.0.1-alpha.3/lib/mishka_gervaz/table/entities/bulk_action.ex#L1)

Entity struct for bulk action configuration.

See `MishkaGervaz.Table.Dsl.BulkActions`,
`MishkaGervaz.Table.Entities.BulkAction.Ui`,
`MishkaGervaz.Table.Entities.RowAction` (per-row counterpart),
`MishkaGervaz.Table.Types.Action` (type registry), and
`MishkaGervaz.Table.Web.Events.BulkActionHandler`.

# `action_type`

```elixir
@type action_type() :: :event | :destroy | :update | :unarchive | :permanent_destroy
```

# `handler`

```elixir
@type handler() ::
  :parent
  | {:type, action_type()}
  | (list() | :all | {:all_except, list()}, map() -&gt;
       {:ok, map()} | {:error, term()})
  | atom()
  | {atom(), atom()}
```

# `t`

```elixir
@type t() :: %MishkaGervaz.Table.Entities.BulkAction{
  __identifier__: term(),
  __spark_metadata__: map() | nil,
  action: atom() | {atom(), atom()} | nil,
  confirm: boolean() | String.t() | nil,
  event: atom() | nil,
  handler: handler() | nil,
  name: atom(),
  payload: (MapSet.t() -&gt; map()) | nil,
  restricted: boolean(),
  type: action_type() | nil,
  ui: MishkaGervaz.Table.Entities.BulkAction.Ui.t() | nil,
  visible: :active | :archived | (map() -&gt; boolean())
}
```

# `transform`

Transform the bulk action after DSL compilation.

Two promotion rules apply, in order:

  1. If `type:` is set and `handler:` is still the default `:parent`, mark the
     handler as type-based: `handler: {:type, type}`.
  2. If `handler:` is one of the built-in type atoms
     (`:event`, `:destroy`, `:update`, `:unarchive`, `:permanent_destroy`),
     it is treated as a type token, not a literal Ash action name. This keeps
     `type: :destroy` and `handler: :destroy` behaving identically — both
     route through the master/tenant resolver.

---

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