Skip to main content

potree_auth/project/domain/
mod.rs

1pub mod authorization;
2
3use crate::common::domain::Group;
4use crate::common::domain::utils::new_type::new_type;
5
6/// Represents the metadata associated with a 3D model project.
7#[derive(Debug, Clone, PartialEq)]
8#[cfg_attr(any(test, feature = "fake"), derive(fake::Dummy))]
9pub struct Project {
10    pub id: ProjectId,
11
12    /// A human readable name for the project.
13    pub name: ProjectName,
14
15    /// Optional additional context about the project.
16    pub description: Option<ProjectDescription>,
17
18    /// The groups that the project is a member of.
19    pub groups: Vec<Group>,
20}
21
22new_type![
23    /// The unique identifying slug of a [`Project`].
24    #[derive(serde::Deserialize, serde::Serialize)]
25    ProjectId(String)
26];
27
28new_type![
29    /// The name of a [`Project`].
30    #[derive(serde::Deserialize, serde::Serialize)]
31    ProjectName(
32        #[cfg_attr(test, dummy(faker = "fake::faker::name::en::Name()"))]
33        String
34    )
35];
36
37new_type![
38    /// A high-level description of a [`Project`]. Gives the user more context.
39    #[derive(serde::Deserialize, serde::Serialize)]
40    ProjectDescription(String)
41];