Files
bakalari-types/src/gdpr/gdpr.rs
T

78 lines
1.9 KiB
Rust
Raw Normal View History

2026-10-27 21:39:14 +01:00
use chrono::{DateTime, FixedOffset};
2026-10-25 14:31:35 +01:00
use serde::{Deserialize, Serialize};
2026-10-27 21:53:56 +01:00
use crate::UserType;
2026-10-25 14:31:35 +01:00
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
2026-10-27 21:39:14 +01:00
pub struct GdprCommissioners {
pub commissioners: Vec<GdprCommissioner>,
2026-10-25 14:31:35 +01:00
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
2026-10-27 21:39:14 +01:00
pub struct GdprCommissioner {
2026-10-25 14:31:35 +01:00
pub id: String,
pub name: String,
pub mobile: String,
pub phone: String,
pub email: String,
2026-10-27 21:39:14 +01:00
pub web: Option<String>,
pub data_box: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct GdprConsent {
pub id: i64,
2026-10-27 21:53:56 +01:00
pub person_type: UserType,
2026-10-27 21:39:14 +01:00
pub person_id: String,
pub created: DateTime<FixedOffset>,
2026-10-27 21:53:56 +01:00
pub validity: GdprValidity,
2026-10-27 21:39:14 +01:00
pub valid_from: DateTime<FixedOffset>,
2026-10-27 21:53:56 +01:00
pub state: GdprConsentState,
2026-10-27 21:39:14 +01:00
pub title: Option<String>,
pub personal_data: Option<String>,
pub usage_purpose: Option<String>,
pub valid_to: Option<DateTime<FixedOffset>>,
pub valid_years: Option<i64>,
pub rights: Option<GdprConsentRights>,
pub body: Option<String>,
}
2026-10-27 21:53:56 +01:00
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum GdprValidity {
EndOfStudy,
EndOfStudyPlusYears,
ToAppeal,
Unknown,
Validity,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum GdprConsentState {
Agreed,
Cancelled,
Disagreed,
Expired,
NewConsent,
RevokeRequested,
Revoked,
Unknown,
}
2026-10-27 21:39:14 +01:00
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct GdprConsentRights {
pub can_agree: bool,
pub can_disagree: bool,
pub can_revoke_request: bool,
2026-10-25 14:31:35 +01:00
}
2026-10-31 14:48:24 +01:00
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct GdprConsents {
pub person_consents: Vec<GdprConsent>,
}