# bookclerk_library::entities::edition_acquisitions

SeaORM entity for `edition_acquisitions`: each edition's acquire state.

Files belong to editions, so one acquire serves every title an account
holds of the edition. Written beside the title's own status by
[`crate::LibraryStore::set_acquire_status`](/docs/internals/crates/bookclerk_library/index.md#librarystoreset_acquire_status) (audio) and
[`crate::LibraryStore::set_pdf_status`](/docs/internals/crates/bookclerk_library/index.md#librarystoreset_pdf_status) (companion PDF); an edition with
no row is not acquired.

| Item | Kind | Summary |
| --- | --- | --- |
| [`Model`](#model) | struct | Row shape for this table (`DeriveEntityModel`). |
| [`ColumnIter`](#columniter) | struct | An iterator over the variants of [Column] |
| [`Entity`](#entity) | struct | Generated by sea-orm-macros |
| [`PrimaryKeyIter`](#primarykeyiter) | struct | An iterator over the variants of [PrimaryKey] |
| [`ActiveModel`](#activemodel) | struct | Generated by sea-orm-macros |
| [`RelationIter`](#relationiter) | struct | An iterator over the variants of [Relation] |
| [`Column`](#column) | enum | Generated by sea-orm-macros |
| [`PrimaryKey`](#primarykey) | enum | Generated by sea-orm-macros |
| [`Relation`](#relation) | enum | Declared SeaORM relations (none unless FK edges are modeled). |

## Structs

### Model

```rust
pub struct Model {
    pub edition_id: String,
    pub status: String,
    pub storage_key: Option<String>,
    pub error_message: Option<String>,
    pub holding_id: String,
    pub updated_at: String,
    pub pdf_status: String,
    pub pdf_storage_key: Option<String>,
    pub pdf_holding_id: Option<String>,
}
```

Row shape for this table (`DeriveEntityModel`).

**Fields**

- `edition_id`: The edition (`editions.id`).
- `status`: Acquire state (`AcquireStatus::as_str`): `not_acquired`, `queued`,
  `downloading`, `acquired` or `error`.
- `storage_key`: Primary destination key of the edition's audio once acquired.
- `error_message`: Last acquire failure message for operators.
- `holding_id`: The account holding (`holdings.id`) whose title's write set this
  row; while the holding exists, only its writes change an acquired
  edition.
- `updated_at`: RFC 3339 timestamp when the row was last modified.
- `pdf_status`: Companion PDF state (`AcquireStatus::as_str`), `not_acquired` until
  a PDF write.
- `pdf_storage_key`: Primary destination key of the edition's companion PDF once
  acquired.
- `pdf_holding_id`: The account holding (`holdings.id`) whose title's write set the
  PDF state; while the holding exists, only its writes change an
  acquired PDF. `None` before any PDF write.

#### Model::into_ex

```rust
pub fn into_ex(self) -> Self
```

Generated by sea-orm-macros

Implements: `Clone`, `Debug`, `From<Model>`, `FromQueryResult`, `IntoActiveModel<ActiveModel>`, `ModelTrait`, `PartialEq`, `TryFrom<ActiveModel>`, `TryIntoModel<Model>`

### ColumnIter

```rust
pub struct ColumnIter {
    /* private fields */
}
```

An iterator over the variants of [Column](#column)

Implements: `Clone`, `Debug`, `DoubleEndedIterator`, `ExactSizeIterator`, `FusedIterator`, `Iterator`

### Entity

```rust
pub struct Entity;
```

Generated by sea-orm-macros

Implements: `Clone`, `Copy`, `Debug`, `Default`, `EntityName`, `EntityTrait`, `Iden`, `IdenStatic`

### PrimaryKeyIter

```rust
pub struct PrimaryKeyIter {
    /* private fields */
}
```

An iterator over the variants of [PrimaryKey](#primarykey)

Implements: `Clone`, `Debug`, `DoubleEndedIterator`, `ExactSizeIterator`, `FusedIterator`, `Iterator`

### ActiveModel

```rust
pub struct ActiveModel {
    pub edition_id: ActiveValue<String>,
    pub status: ActiveValue<String>,
    pub storage_key: ActiveValue<Option<String>>,
    pub error_message: ActiveValue<Option<String>>,
    pub holding_id: ActiveValue<String>,
    pub updated_at: ActiveValue<String>,
    pub pdf_status: ActiveValue<String>,
    pub pdf_storage_key: ActiveValue<Option<String>>,
    pub pdf_holding_id: ActiveValue<Option<String>>,
}
```

Generated by sea-orm-macros

**Fields**

- `edition_id`: Generated by sea-orm-macros
- `status`: Generated by sea-orm-macros
- `storage_key`: Generated by sea-orm-macros
- `error_message`: Generated by sea-orm-macros
- `holding_id`: Generated by sea-orm-macros
- `updated_at`: Generated by sea-orm-macros
- `pdf_status`: Generated by sea-orm-macros
- `pdf_storage_key`: Generated by sea-orm-macros
- `pdf_holding_id`: Generated by sea-orm-macros

Implements: `ActiveModelBehavior`, `ActiveModelTrait`, `Clone`, `Debug`, `Default`, `From<Model>`, `IntoActiveModel<ActiveModel>`, `PartialEq`, `TryFrom<ActiveModel>`, `TryIntoModel<Model>`

### RelationIter

```rust
pub struct RelationIter {
    /* private fields */
}
```

An iterator over the variants of [Relation](#relation)

Implements: `Clone`, `Debug`, `DoubleEndedIterator`, `ExactSizeIterator`, `FusedIterator`, `Iterator`

## Enums

### Column

```rust
pub enum Column {
    EditionId,
    Status,
    StorageKey,
    ErrorMessage,
    HoldingId,
    UpdatedAt,
    PdfStatus,
    PdfStorageKey,
    PdfHoldingId,
}
```

Generated by sea-orm-macros

**Variants**

- `EditionId`: Generated by sea-orm-macros
- `Status`: Generated by sea-orm-macros
- `StorageKey`: Generated by sea-orm-macros
- `ErrorMessage`: Generated by sea-orm-macros
- `HoldingId`: Generated by sea-orm-macros
- `UpdatedAt`: Generated by sea-orm-macros
- `PdfStatus`: Generated by sea-orm-macros
- `PdfStorageKey`: Generated by sea-orm-macros
- `PdfHoldingId`: Generated by sea-orm-macros

Implements: `Clone`, `ColumnTrait`, `Copy`, `Debug`, `FromStr`, `Iden`, `IdenStatic`, `IntoEnumIterator`

### PrimaryKey

```rust
pub enum PrimaryKey {
    EditionId,
}
```

Generated by sea-orm-macros

**Variants**

- `EditionId`: Generated by sea-orm-macros

Implements: `Clone`, `Copy`, `Debug`, `Iden`, `IdenStatic`, `IntoEnumIterator`, `PrimaryKeyToColumn`, `PrimaryKeyTrait`

### Relation

```rust
pub enum Relation {}
```

Declared SeaORM relations (none unless FK edges are modeled).

Implements: `Clone`, `Copy`, `Debug`, `IntoEnumIterator`, `RelationTrait`
