restructure

This commit is contained in:
2026-06-29 23:38:53 +02:00
parent 7faf14fb2f
commit bb17beb80d
68 changed files with 1202 additions and 1088 deletions

View File

@@ -0,0 +1,21 @@
use async_trait::async_trait;
use crate::{
errors::DomainError,
models::Goal,
value_objects::{GoalId, UserId},
};
#[async_trait]
pub trait GoalRepository: Send + Sync {
async fn save(&self, goal: &Goal) -> Result<(), DomainError>;
async fn update(&self, goal: &Goal) -> Result<(), DomainError>;
async fn delete(&self, id: &GoalId, user_id: &UserId) -> Result<(), DomainError>;
async fn find_by_user_and_year(
&self,
user_id: &UserId,
year: u16,
) -> Result<Option<Goal>, DomainError>;
async fn list_for_user(&self, user_id: &UserId) -> Result<Vec<Goal>, DomainError>;
async fn count_reviews_in_year(&self, user_id: &UserId, year: u16) -> Result<u32, DomainError>;
}