1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//! [`RelationType`] enum.

use diesel_derive_enum::DbEnum;
use serde::{Deserialize, Serialize};
use typeshare::typeshare;
use utoipa::ToSchema;

/// Specifies the type of relation between two plants.
#[typeshare]
#[derive(Debug, Clone, Serialize, Deserialize, DbEnum, ToSchema)]
#[ExistingTypePath = "crate::schema::sql_types::RelationType"]
pub enum RelationType {
    /// If a plant works well with another plant.
    #[serde(rename = "companion")]
    #[db_rename = "companion"]
    Companion,

    /// If a plant is known to be neutral with another plant.
    #[serde(rename = "neutral")]
    #[db_rename = "neutral"]
    Neutral,

    /// If a plant doesn't work well with another plant.
    #[serde(rename = "antagonist")]
    #[db_rename = "antagonist"]
    Antagonist,
}