Skip to main content

artifacts/models/
purchase_type.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4/// PurchaseType : Type of purchase in history.
5/// Type of purchase in history.
6#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
7#[cfg_attr(feature = "specta", derive(specta::Type))]
8#[derive(Default)]
9pub enum PurchaseType {
10    #[serde(rename = "subscription")]
11    #[default]
12    Subscription,
13    #[serde(rename = "gem_pack")]
14    GemPack,
15}
16
17impl std::fmt::Display for PurchaseType {
18    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19        match self {
20            Self::Subscription => write!(f, "subscription"),
21            Self::GemPack => write!(f, "gem_pack"),
22        }
23    }
24}