forge
Explore
Log in

Don't you dare go Hollow

hezarfen_backend

Clone
★ 0

0 watching0 forksRust8.3 MiB6d68754Ahmet Kaan Gümüş2 months ago566 commits

profile.rs20 lines, 697 bytesHistoryRawDownload
1//! Profile workflows: the aggregate stats read behind a profile response.
2//! There is no decision and no lock here — the query itself is the whole
3//! story, so this wraps [`crate::db::profile::load`] for the web layer.
4
5use crate::database::Database;
6use crate::db::profile;
7use crate::domain::profile::ProfileStats;
8use crate::domain::user::UserId;
9use crate::error::AppError;
10
11/// One round trip for a profile's motivational counters; `courses` and
12/// `classes` arrive from the caller's own paged reads.
13pub async fn load(
14 db: &Database,
15 user: &UserId,
16 courses: i64,
17 classes: i64,
18) -> Result<ProfileStats, AppError> {
19 profile::load(db, user, courses, classes).await
20}