From 2e742629dd6410e41ab414e5f4f9cd0a6f43a81f Mon Sep 17 00:00:00 2001 From: YK Date: Sat, 20 Sep 2025 10:59:52 +0300 Subject: [PATCH] `InventoryKind` entity definition and `Display` impl --- src/entities/mod.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/entities/mod.rs b/src/entities/mod.rs index 9ce32bd..29b4e8f 100644 --- a/src/entities/mod.rs +++ b/src/entities/mod.rs @@ -1,3 +1,5 @@ +use std::fmt::Display; + use chrono::{ NaiveDate, NaiveDateTime }; use reactive_stores::Store; @@ -226,3 +228,19 @@ impl Name { pub struct Settings { } + + +#[derive(Clone, Debug, Store)] +pub enum InventoryKind { + Personal, + Common +} + +impl Display for InventoryKind { + fn fmt (&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", match self { + Self::Personal => "Личный", + Self::Common => "Общий", + }) + } +}