timesheetlib/enums/
bonus_type.rs1use postgres_types::{FromSql, ToSql};
2use serde::{Deserialize, Serialize};
3use std::fmt;
4use std::fmt::Formatter;
5use std::str;
6
7
8#[derive(
9 Serialize,
10 Deserialize,
11 Debug,
12 ToSql,
13 FromSql,
14 PartialEq,
15 Clone
16)]
17#[postgres(name = "bonus_type")]
18pub enum BonusType {
19 Performance,
20 Scheduled,
21 Other,
22 Undefined,
23
24}
25impl fmt::Display for BonusType {
26 fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
27 write!(f, "{:?}", self)
28 }
29}
30impl Default for BonusType {
31 fn default() -> Self {
32 BonusType::Undefined
33 }
34}