| 1 |
use super::*; |
| 2 |
|
| 3 |
|
| 4 |
#[async_trait] |
| 5 |
pub trait WeeklyReviewRepository: Send + Sync { |
| 6 |
|
| 7 |
async fn get_for_week(&self, user_id: UserId, week_start: NaiveDate) -> Result<Option<crate::models::WeeklyReview>>; |
| 8 |
|
| 9 |
|
| 10 |
async fn upsert(&self, user_id: UserId, week_start: NaiveDate, notes: &str) -> Result<crate::models::WeeklyReview>; |
| 11 |
|
| 12 |
|
| 13 |
async fn list_all(&self, user_id: UserId) -> Result<Vec<crate::models::WeeklyReview>>; |
| 14 |
|
| 15 |
|
| 16 |
async fn is_current_week_completed(&self, user_id: UserId) -> Result<bool>; |
| 17 |
|
| 18 |
|
| 19 |
async fn set_vacation_days(&self, user_id: UserId, week_start: NaiveDate, days: &[u8]) -> Result<()>; |
| 20 |
} |
| 21 |
|
| 22 |
|
| 23 |
#[async_trait] |
| 24 |
pub trait DailyNoteRepository: Send + Sync { |
| 25 |
|
| 26 |
async fn get_by_date(&self, user_id: UserId, date: NaiveDate) -> Result<Option<crate::models::DailyNote>>; |
| 27 |
|
| 28 |
|
| 29 |
async fn upsert(&self, user_id: UserId, date: NaiveDate, went_well: &str, could_improve: &str, is_reviewed: bool) -> Result<crate::models::DailyNote>; |
| 30 |
|
| 31 |
|
| 32 |
async fn list_all(&self, user_id: UserId) -> Result<Vec<crate::models::DailyNote>>; |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
#[async_trait] |
| 37 |
pub trait MonthlyReviewRepository: Send + Sync { |
| 38 |
|
| 39 |
async fn list_goals(&self, user_id: UserId, month: &str) -> Result<Vec<crate::models::MonthlyGoal>>; |
| 40 |
|
| 41 |
|
| 42 |
async fn list_all_goals(&self, user_id: UserId) -> Result<Vec<crate::models::MonthlyGoal>>; |
| 43 |
|
| 44 |
|
| 45 |
async fn list_all_reflections(&self, user_id: UserId) -> Result<Vec<crate::models::MonthlyReflection>>; |
| 46 |
|
| 47 |
|
| 48 |
async fn upsert_goal(&self, user_id: UserId, month: &str, text: &str, position: i32) -> Result<crate::models::MonthlyGoal>; |
| 49 |
|
| 50 |
|
| 51 |
async fn update_goal_status(&self, id: crate::MonthlyGoalId, user_id: UserId, status: &crate::models::MonthlyGoalStatus) -> Result<Option<crate::models::MonthlyGoal>>; |
| 52 |
|
| 53 |
|
| 54 |
async fn delete_goal(&self, id: crate::MonthlyGoalId, user_id: UserId) -> Result<bool>; |
| 55 |
|
| 56 |
|
| 57 |
async fn get_reflection(&self, user_id: UserId, month: &str) -> Result<Option<crate::models::MonthlyReflection>>; |
| 58 |
|
| 59 |
|
| 60 |
async fn upsert_reflection(&self, user_id: UserId, month: &str, highlight: &str, change: &str) -> Result<crate::models::MonthlyReflection>; |
| 61 |
} |
| 62 |
|