use strum::IntoStaticStr; pub mod create_category { use model::v2::*; use crate::stocks::Error; #[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct Input { pub parent_id: Option, pub name: CategoryName, pub key: CategoryKey, pub svg: CategorySvg, } #[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct Details { pub product: Category, } pub type Output = Result; } pub mod delete_category { use model::v2::*; use crate::stocks::Error; #[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct Input { pub category_id: CategoryId, } #[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct Details {} pub type Output = Result; } pub mod update_category { use model::v2::*; use crate::stocks::Error; #[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct Input { pub id: CategoryId, pub parent_id: Option, pub name: CategoryName, pub key: CategoryKey, pub svg: CategorySvg, } #[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct Details { pub limit: Limit, pub offset: Offset, } pub type Output = Result; } pub mod all_categories { use model::v2::*; use crate::stocks::Error; #[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct Input {} #[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct Details { pub categories: Vec, } pub type Output = Result; } #[derive( Copy, Clone, Debug, PartialOrd, PartialEq, serde::Serialize, serde::Deserialize, IntoStaticStr, )] pub enum Topic { CategoryCreated, CategoryUpdated, CategoryDeleted, }