787 B · text History 7def6a5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

/// A restaurant an outing has shown. `active` ones are the current ballot;
/// rolled-away ones stay so later re-rolls can avoid showing them again.
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "outing_options")]
pub struct Model {
    #[sea_orm(primary_key, auto_increment = false)]
    pub outing_id: Uuid,
    #[sea_orm(primary_key, auto_increment = false)]
    pub restaurant_id: Uuid,
    /// Which roll drew it.
    pub roll: i32,
    /// Its odds in the field it was drawn from.
    pub probability: f64,
    pub active: bool,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}

impl ActiveModelBehavior for ActiveModel {}