inventorylib/enums/
room_type.rs

1use std::fmt;
2use std::fmt::Formatter;
3use std::str;
4use strum_macros::EnumString;
5use postgres_types::{FromSql, ToSql};
6use serde::{Deserialize, Serialize};
7
8#[derive(
9    Serialize,
10    Deserialize,
11    Debug,
12    EnumString,
13    ToSql,
14    FromSql,
15    PartialEq,
16    Clone
17)]
18#[postgres(name = "room_type")]
19pub enum RoomType {
20    Educational ,
21    Medical,
22    Stuff,
23    Administrative,
24    Admenistrative,//todo: fix - update db floor-json_schema
25    Technical,
26    Common,
27    Comman, //todo: fix - update db floor-json_schema
28    Canteen,
29    Undefined,
30
31}
32impl fmt::Display for RoomType {
33    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
34        write!(f, "{:?}", self)
35    }
36}
37impl Default for RoomType {
38    fn default() -> Self {
39        RoomType::Undefined
40    }
41}