chore(api): apply rustfmt across modules and tests

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Chengdong Zhang
2026-09-21 18:52:52 +08:00
co-authored by Cursor
parent 6c1357ec4d
commit a4ef6ca49e
46 changed files with 495 additions and 334 deletions
+3 -16
View File
@@ -58,12 +58,7 @@ async fn credit_points(state: &AppState, user_id: Uuid, amount: i64) {
tx.commit().await.unwrap();
}
async fn redeem(
app: &TestApp,
token: &str,
product_id: &str,
qty: i32,
) -> reqwest::Response {
async fn redeem(app: &TestApp, token: &str, product_id: &str, qty: i32) -> reqwest::Response {
client()
.post(app.url("/api/points/redemptions"))
.bearer_auth(token)
@@ -295,11 +290,7 @@ async fn fulfillment_transitions_are_validated() {
let (token, user_id) = register_customer(&app, "pm-flow").await;
credit_points(&app.state, uuid(&user_id), 2_000).await;
let first: serde_json::Value = redeem(&app, &token, &id, 1)
.await
.json()
.await
.unwrap();
let first: serde_json::Value = redeem(&app, &token, &id, 1).await.json().await.unwrap();
let first_id = first["id"].as_str().unwrap().to_string();
let res = client()
@@ -329,11 +320,7 @@ async fn fulfillment_transitions_are_validated() {
assert_eq!(res.status(), 409);
// A pending order can be cancelled once.
let second: serde_json::Value = redeem(&app, &token, &id, 1)
.await
.json()
.await
.unwrap();
let second: serde_json::Value = redeem(&app, &token, &id, 1).await.json().await.unwrap();
let second_id = second["id"].as_str().unwrap().to_string();
let res = client()
.post(app.url(&format!("/api/admin/points/orders/{second_id}/cancel")))