Added SharePermissions, 'ShareContent and Share` types

This commit is contained in:
Philip (a-0) 2024-04-14 16:13:37 +02:00
parent 43006e9a53
commit 3589be0a3b
2 changed files with 25 additions and 0 deletions

View file

@ -31,5 +31,8 @@ pub use pot_id::PotId;
mod pot;
pub use pot::Pot;
mod share;
pub use share::{ShareContent, SharePermissions, Share};
mod tag;
pub use tag::Tag;

View file

@ -0,0 +1,22 @@
use std::collections::HashMap;
use serde::{Deserialize, Serialize};
use super::{FamilyId, PotId};
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct ShareContent {
pub pots: Vec<PotId>,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub enum SharePermissions {
Read,
ReadWrite,
Owner
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct Share {
pub content: ShareContent,
pub members: HashMap<FamilyId, SharePermissions>,
}