# `PhoenixKitCatalogue.Schemas.Pdf`
[🔗](https://github.com/BeamLabEU/phoenix_kit_catalogue/blob/0.8.0/lib/phoenix_kit_catalogue/schemas/pdf.ex#L1)

Per-upload row in the catalogue's PDF library.

Thin layer on top of `phoenix_kit_files` (core's storage). One row
per "user uploaded this name". Two uploads of identical content with
different filenames produce two rows sharing one `file_uuid` (and
one extraction, and one set of cached page rows).

Lifecycle (`status` column, workspace soft-delete convention):
`"active"` — visible in the library
`"trashed"` — moved to trash; `trashed_at` set; rows hidden by
              default but recoverable.

The `file_uuid` FK is `ON DELETE RESTRICT` — core's prune cannot
remove a file referenced by any catalogue row. Catalogue's
permanent-delete flow checks the per-file refcount and only hands
off to core's `Storage.trash_file/1` when no PDF row remains.

# `t`

```elixir
@type t() :: %PhoenixKitCatalogue.Schemas.Pdf{
  __meta__: term(),
  byte_size: term(),
  extraction: term(),
  file_uuid: term(),
  inserted_at: term(),
  original_filename: term(),
  status: term(),
  trashed_at: term(),
  updated_at: term(),
  uuid: term()
}
```

# `changeset`

```elixir
@spec changeset(
  t()
  | %PhoenixKitCatalogue.Schemas.Pdf{
      __meta__: term(),
      byte_size: term(),
      extraction: term(),
      file_uuid: term(),
      inserted_at: term(),
      original_filename: term(),
      status: term(),
      trashed_at: term(),
      updated_at: term(),
      uuid: term()
    },
  map()
) :: Ecto.Changeset.t(t())
```

# `restore_changeset`

```elixir
@spec restore_changeset(t()) :: Ecto.Changeset.t(t())
```

# `statuses`

```elixir
@spec statuses() :: [String.t()]
```

# `trash_changeset`

```elixir
@spec trash_changeset(t()) :: Ecto.Changeset.t(t())
```

---

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