wip(core): preserve local broad Core refactor + inventory service
Divergent development line off origin/main (11a811d): a broad refactor across routes/services/models/app + a large integration_test expansion (+1000), plus an untracked game-independent inventory query service and Docker files. Preserved verbatim before moving the canonical Core checkout to the committed migration trunk (66c88fb). Reconciling this refactor with the migration trunk is a separate user decision; nothing here is lost.
This commit is contained in:
+14
-12
@@ -7,7 +7,9 @@ use serde_json::{json, Value};
|
||||
use crate::{
|
||||
app::AppState,
|
||||
error::{AppError, AppResult},
|
||||
services::{club as club_svc, notification as notif_svc, objective as obj_svc, profile as profile_svc},
|
||||
services::{
|
||||
club as club_svc, notification as notif_svc, objective as obj_svc, profile as profile_svc,
|
||||
},
|
||||
};
|
||||
|
||||
/// GET /notifications
|
||||
@@ -92,14 +94,16 @@ pub async fn get_notifications(State(state): State<AppState>) -> AppResult<Json<
|
||||
// Use "type" key for compatibility with dashboard and existing tests.
|
||||
let all: Vec<Value> = persistent
|
||||
.iter()
|
||||
.map(|n| json!({
|
||||
"id": n.id,
|
||||
"type": n.kind,
|
||||
"title": n.title,
|
||||
"body": n.body,
|
||||
"is_read": n.is_read,
|
||||
"created_at": n.created_at,
|
||||
}))
|
||||
.map(|n| {
|
||||
json!({
|
||||
"id": n.id,
|
||||
"type": n.kind,
|
||||
"title": n.title,
|
||||
"body": n.body,
|
||||
"is_read": n.is_read,
|
||||
"created_at": n.created_at,
|
||||
})
|
||||
})
|
||||
.chain(dynamic.iter().cloned())
|
||||
.collect();
|
||||
|
||||
@@ -124,9 +128,7 @@ pub async fn mark_notification_read(
|
||||
}
|
||||
|
||||
/// POST /notifications/read-all
|
||||
pub async fn mark_all_notifications_read(
|
||||
State(state): State<AppState>,
|
||||
) -> AppResult<Json<Value>> {
|
||||
pub async fn mark_all_notifications_read(State(state): State<AppState>) -> AppResult<Json<Value>> {
|
||||
let count = notif_svc::mark_all_read(&state.pool).await?;
|
||||
Ok(Json(json!({ "marked_read": count })))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user