feat: implement filament and spool preset services with CRUD operations

- Add `FilamentService` for managing filament inventory, including creation, retrieval, updating, and deletion of filaments.
- Introduce `SpoolPresetService` for handling spool presets, allowing users to create, update, and delete their custom presets.
- Create domain models for `Filament` and `SpoolPreset` with necessary fields and methods.
- Define repository interfaces for filament and spool preset persistence.
- Implement application configuration management from environment variables.
- Set up error handling with a centralized `AppError` type.
- Build the Axum router with public and protected routes for user authentication and resource management.
This commit is contained in:
2026-03-14 09:38:28 -03:00
parent c90d2f920b
commit abdc2fe8ce
67 changed files with 7832 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
use async_trait::async_trait;
use uuid::Uuid;
use crate::{domain::user::User, error::AppError};
/// Port (interface) para operações de persistência de usuários.
/// Implementado pelo adapter `PostgresUserRepository`.
#[async_trait]
pub trait UserRepository: Send + Sync {
async fn find_by_id(&self, id: Uuid) -> Result<Option<User>, AppError>;
async fn find_by_email(&self, email: &str) -> Result<Option<User>, AppError>;
async fn find_by_google_id(&self, google_id: &str) -> Result<Option<User>, AppError>;
async fn create(&self, user: &User) -> Result<User, AppError>;
async fn update(&self, user: &User) -> Result<User, AppError>;
async fn verify_email(&self, id: Uuid) -> Result<(), AppError>;
}