feat: backend MVP (auth/rbac, catalog, orders, fulfillment, invoices) + specs + scaffolds

This commit is contained in:
Chengdong Zhang
2026-09-17 12:43:22 +08:00
commit dc9fd31c5e
96 changed files with 17550 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
use serde::Serialize;
#[derive(Debug, Serialize)]
pub struct Paged<T: Serialize> {
pub items: Vec<T>,
pub total: i64,
pub page: i64,
pub per_page: i64,
}
pub fn clamp_page(page: Option<i64>) -> i64 {
page.unwrap_or(1).max(1)
}
pub fn clamp_per_page(per_page: Option<i64>) -> i64 {
per_page.unwrap_or(20).clamp(1, 100)
}