refactor: remove serde from domain entities for Clean Architecture compliance

- Remove Serialize/Deserialize from File, Folder, Session, User, Contact entities
- Create contact_persistence_dto.rs for JSONB persistence in infrastructure layer
- Update contact_pg_repository to use persistence DTOs
- Fix dependency on zip crate (downgrade from 7.2.0 to 2.1.0)
- Fix unused variable warnings in main.rs
- Move PathService import from domain to infrastructure
- Add missing fields to CoreServices and RepositoryServices
- Create proper service initialization in main.rs

Clean Architecture improvements:
- Domain layer no longer depends on serde framework
- Persistence concerns isolated to infrastructure layer
- TokenClaims in auth_service.rs is only exception (required for JWT)
This commit is contained in:
Dionisio
2026-02-02 23:56:40 +01:00
parent 6aceb07f3f
commit 52840e57df
88 changed files with 4286 additions and 4847 deletions
+3 -6
View File
@@ -48,7 +48,6 @@ impl CalDavAdapter {
let mut in_sync_collection = false;
let mut in_prop = false;
let mut in_filter = false;
let mut in_time_range = false;
let mut start_time: Option<DateTime<Utc>> = None;
let mut end_time: Option<DateTime<Utc>> = None;
let mut props = Vec::new();
@@ -68,8 +67,6 @@ impl CalDavAdapter {
s if s == "prop" || s.ends_with(":prop") => in_prop = true,
s if s == "filter" || s.ends_with(":filter") => in_filter = true,
s if s == "time-range" || s.ends_with(":time-range") => {
in_time_range = true;
// Parse time-range attributes
for attr in e.attributes() {
if let Ok(attr) = attr {
@@ -106,7 +103,7 @@ impl CalDavAdapter {
}
},
Ok(Event::Text(e)) => {
let text = e.unescape().unwrap_or_default();
let text = e.decode().unwrap_or_default();
// Check if we're in sync-token element
if in_sync_collection && !in_prop && !in_filter {
@@ -128,7 +125,7 @@ impl CalDavAdapter {
s if s == "sync-collection" || s.ends_with(":sync-collection") => in_sync_collection = false,
s if s == "prop" || s.ends_with(":prop") => in_prop = false,
s if s == "filter" || s.ends_with(":filter") => in_filter = false,
s if s == "time-range" || s.ends_with(":time-range") => in_time_range = false,
s if s == "time-range" || s.ends_with(":time-range") => { /* time-range end, attributes already parsed */ },
_ => ()
}
},
@@ -771,7 +768,7 @@ impl CalDavAdapter {
}
},
Ok(Event::Text(e)) => {
let text = e.unescape().unwrap_or_default();
let text = e.decode().unwrap_or_default();
if in_displayname {
displayname = text.to_string();
+2 -2
View File
@@ -685,7 +685,7 @@ impl WebDavAdapter {
},
Ok(Event::Text(e)) => {
if current_prop.is_some() {
current_text.push_str(&e.unescape().unwrap_or_default());
current_text.push_str(&e.decode().unwrap_or_default());
}
},
Ok(Event::End(ref e)) => {
@@ -879,7 +879,7 @@ impl WebDavAdapter {
},
Ok(Event::Text(e)) => {
if in_owner {
owner_text.push_str(&e.unescape().unwrap_or_default());
owner_text.push_str(&e.decode().unwrap_or_default());
}
},
Ok(Event::End(ref e)) => {