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
This commit is contained in:
parent
3bf47a65d5
commit
41f9a778d1
5 changed files with 63 additions and 5 deletions
|
|
@ -58,7 +58,6 @@ pub struct InvoiceDiscount {
|
|||
pub percent_off: Option<f64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct RefundResult {
|
||||
pub id: Uuid,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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<Recording, RecordingError> {
|
||||
async fn get_recording_from_db(&self, _recording_id: Uuid) -> Result<WebinarRecording, RecordingError> {
|
||||
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(())
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue