# bookclerk_library::entities::notifications

SeaORM entity for `notifications`: one notification the router
accepted, rendered once for every destination and the inbox.

| 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). |

## Structs

### Model

```rust
pub struct Model {
    pub id: String,
    pub notification_type: String,
    pub audience: String,
    pub severity: String,
    pub title: String,
    pub body_text: String,
    pub link_path: Option<String>,
    pub fields_json: String,
    pub group_key: Option<String>,
    pub alert_action: String,
    pub alert_key: Option<String>,
    pub source: String,
    pub user_id: Option<i64>,
    pub created_at: String,
}
```

Row shape for this table (`DeriveEntityModel`).

**Fields**

- `id`: Random UUID; the `notificationId` every copy carries.
- `notification_type`: Qualified notification type.
- `audience`: `operational`, `patron` or `account`.
- `severity`: `info`, `warning` or `critical`.
- `title`: Short title.
- `body_text`: Plain-text body.
- `link_path`: Path inside the library the notification links to; the send job
  prefixes the public origin.
- `fields_json`: JSON array of `{name, value}` fields.
- `group_key`: Grouping key, when the raiser gave one.
- `alert_action`: `none`, `trigger` or `resolve`.
- `alert_key`: Alert key; set exactly when `alert_action` is not `none`.
- `source`: Empty for a host type, else the raising plugin's id.
- `user_id`: Patron a patron-audience notification is for.
- `created_at`: RFC 3339 creation time.

#### Model::into_ex

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

Generated by sea-orm-macros

Implements: `Clone`, `Debug`, `Eq`, `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 id: ActiveValue<String>,
    pub notification_type: ActiveValue<String>,
    pub audience: ActiveValue<String>,
    pub severity: ActiveValue<String>,
    pub title: ActiveValue<String>,
    pub body_text: ActiveValue<String>,
    pub link_path: ActiveValue<Option<String>>,
    pub fields_json: ActiveValue<String>,
    pub group_key: ActiveValue<Option<String>>,
    pub alert_action: ActiveValue<String>,
    pub alert_key: ActiveValue<Option<String>>,
    pub source: ActiveValue<String>,
    pub user_id: ActiveValue<Option<i64>>,
    pub created_at: ActiveValue<String>,
}
```

Generated by sea-orm-macros

**Fields**

- `id`: Generated by sea-orm-macros
- `notification_type`: Generated by sea-orm-macros
- `audience`: Generated by sea-orm-macros
- `severity`: Generated by sea-orm-macros
- `title`: Generated by sea-orm-macros
- `body_text`: Generated by sea-orm-macros
- `link_path`: Generated by sea-orm-macros
- `fields_json`: Generated by sea-orm-macros
- `group_key`: Generated by sea-orm-macros
- `alert_action`: Generated by sea-orm-macros
- `alert_key`: Generated by sea-orm-macros
- `source`: Generated by sea-orm-macros
- `user_id`: Generated by sea-orm-macros
- `created_at`: 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 {
    Id,
    NotificationType,
    Audience,
    Severity,
    Title,
    BodyText,
    LinkPath,
    FieldsJson,
    GroupKey,
    AlertAction,
    AlertKey,
    Source,
    UserId,
    CreatedAt,
}
```

Generated by sea-orm-macros

**Variants**

- `Id`: Generated by sea-orm-macros
- `NotificationType`: Generated by sea-orm-macros
- `Audience`: Generated by sea-orm-macros
- `Severity`: Generated by sea-orm-macros
- `Title`: Generated by sea-orm-macros
- `BodyText`: Generated by sea-orm-macros
- `LinkPath`: Generated by sea-orm-macros
- `FieldsJson`: Generated by sea-orm-macros
- `GroupKey`: Generated by sea-orm-macros
- `AlertAction`: Generated by sea-orm-macros
- `AlertKey`: Generated by sea-orm-macros
- `Source`: Generated by sea-orm-macros
- `UserId`: Generated by sea-orm-macros
- `CreatedAt`: Generated by sea-orm-macros

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

### PrimaryKey

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

Generated by sea-orm-macros

**Variants**

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

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

### Relation

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

Declared SeaORM relations (none).

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