framework-cqrs-lib 0.4.0

handle state-machine with data persist in journal and store mongo for restfull actix api
Documentation
use std::collections::HashMap;

use serde::{Deserialize, Serialize};
use utoipa::ToSchema;

#[derive(Serialize, Deserialize, Clone, ToSchema, Debug)]
pub struct EntityView<T>
where
    T: Serialize + Clone,
{
    pub r#type: String,
    pub id: String,
    pub attributes: T,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub links: Option<LinksEntityView>,
}

#[derive(Serialize, Deserialize, Clone, ToSchema, Debug)]
pub struct LinksEntityView {
    #[serde(flatten)]
    pub links: HashMap<String, String>,
}