From 41f9a778d17cbe3b8d496226ffd460480c615872 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Thu, 8 Jan 2026 17:25:25 -0300 Subject: [PATCH] fix: Add more missing types and fix duplicate derives - Add ExportBounds and ExportError in whiteboard_export.rs - Add RekognitionError in rekognition.rs - Fix duplicate derive attributes on RefundResult and FallbackAttemptTracker - Fix Recording -> WebinarRecording type references --- src/billing/invoice.rs | 1 - src/botmodels/rekognition.rs | 29 +++++++++++++++++++++++++++++ src/meet/recording.rs | 6 +++--- src/meet/whiteboard_export.rs | 31 +++++++++++++++++++++++++++++++ src/security/passkey.rs | 1 - 5 files changed, 63 insertions(+), 5 deletions(-) diff --git a/src/billing/invoice.rs b/src/billing/invoice.rs index ec4e7bf77..ac69d4f2d 100644 --- a/src/billing/invoice.rs +++ b/src/billing/invoice.rs @@ -58,7 +58,6 @@ pub struct InvoiceDiscount { pub percent_off: Option, } -#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)] pub struct RefundResult { pub id: Uuid, diff --git a/src/botmodels/rekognition.rs b/src/botmodels/rekognition.rs index 97073b050..20b6e2463 100644 --- a/src/botmodels/rekognition.rs +++ b/src/botmodels/rekognition.rs @@ -5,6 +5,35 @@ use std::sync::Arc; use tokio::sync::RwLock; use uuid::Uuid; +#[derive(Debug, Clone)] +pub enum RekognitionError { + ConfigError(String), + AwsError(String), + InvalidImage(String), + FaceNotFound, + CollectionNotFound, + QuotaExceeded, + ServiceUnavailable, + Unauthorized, +} + +impl std::fmt::Display for RekognitionError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ConfigError(s) => write!(f, "Config error: {s}"), + Self::AwsError(s) => write!(f, "AWS error: {s}"), + Self::InvalidImage(s) => write!(f, "Invalid image: {s}"), + Self::FaceNotFound => write!(f, "Face not found"), + Self::CollectionNotFound => write!(f, "Collection not found"), + Self::QuotaExceeded => write!(f, "Quota exceeded"), + Self::ServiceUnavailable => write!(f, "Service unavailable"), + Self::Unauthorized => write!(f, "Unauthorized"), + } + } +} + +impl std::error::Error for RekognitionError {} + #[derive(Debug, Clone, Serialize, Deserialize)] pub struct RekognitionConfig { pub region: String, diff --git a/src/meet/recording.rs b/src/meet/recording.rs index 516e1f8ab..8c3bf20ab 100644 --- a/src/meet/recording.rs +++ b/src/meet/recording.rs @@ -876,16 +876,16 @@ impl RecordingService { // Database helper methods (stubs - implement with actual queries) - async fn create_recording_in_db(&self, _recording: &Recording) -> Result<(), RecordingError> { + async fn create_recording_in_db(&self, _recording: &WebinarRecording) -> Result<(), RecordingError> { // Implementation would insert into database Ok(()) } - async fn get_recording_from_db(&self, _recording_id: Uuid) -> Result { + async fn get_recording_from_db(&self, _recording_id: Uuid) -> Result { Err(RecordingError::NotFound) } - async fn update_recording_in_db(&self, _recording: &Recording) -> Result<(), RecordingError> { + async fn update_recording_in_db(&self, _recording: &WebinarRecording) -> Result<(), RecordingError> { Ok(()) } diff --git a/src/meet/whiteboard_export.rs b/src/meet/whiteboard_export.rs index 7de7c2fd1..c8319a36c 100644 --- a/src/meet/whiteboard_export.rs +++ b/src/meet/whiteboard_export.rs @@ -6,6 +6,37 @@ use std::sync::Arc; use tokio::sync::RwLock; use uuid::Uuid; +#[derive(Debug, Clone)] +pub struct ExportBounds { + pub x: f32, + pub y: f32, + pub width: f32, + pub height: f32, +} + +#[derive(Debug, Clone)] +pub enum ExportError { + InvalidFormat(String), + RenderError(String), + IoError(String), + EmptyCanvas, + InvalidDimensions, +} + +impl std::fmt::Display for ExportError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::InvalidFormat(s) => write!(f, "Invalid format: {s}"), + Self::RenderError(s) => write!(f, "Render error: {s}"), + Self::IoError(s) => write!(f, "IO error: {s}"), + Self::EmptyCanvas => write!(f, "Empty canvas"), + Self::InvalidDimensions => write!(f, "Invalid dimensions"), + } + } +} + +impl std::error::Error for ExportError {} + #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "snake_case")] pub enum ExportFormat { diff --git a/src/security/passkey.rs b/src/security/passkey.rs index 0e4338a1e..026062cae 100644 --- a/src/security/passkey.rs +++ b/src/security/passkey.rs @@ -23,7 +23,6 @@ use crate::shared::utils::DbPool; const CHALLENGE_TIMEOUT_SECONDS: i64 = 300; const PASSKEY_NAME_MAX_LENGTH: usize = 64; -#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone)] struct FallbackAttemptTracker { attempts: u32,