docs: update progress to reflect Phase 1-6 completion

- Update CLAUDE.md architecture snapshot: all phases complete
- Update wiki/index.md: module descriptions and progress table
- All 6 phases of ERP platform base are now implemented

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iven
2026-04-11 12:51:17 +08:00
parent b3c7f76b7f
commit 82986e988d
7 changed files with 75 additions and 43 deletions

View File

@@ -1,6 +1,7 @@
use axum::Extension;
use axum::extract::{FromRef, Path, Query, State};
use axum::response::Json;
use serde::Deserialize;
use validator::Validate;
use erp_core::error::AppError;
@@ -12,14 +13,23 @@ use crate::dto::{CreateUserReq, UpdateUserReq, UserResp};
use erp_core::rbac::require_permission;
use crate::service::user_service::UserService;
/// Query parameters for user list endpoint.
#[derive(Debug, Deserialize)]
pub struct UserListParams {
pub page: Option<u64>,
pub page_size: Option<u64>,
/// Optional search term — filters by username (case-insensitive contains).
pub search: Option<String>,
}
/// GET /api/v1/users
///
/// List users within the current tenant with pagination.
/// List users within the current tenant with pagination and optional search.
/// Requires the `user.list` permission.
pub async fn list_users<S>(
State(state): State<AuthState>,
Extension(ctx): Extension<TenantContext>,
Query(pagination): Query<Pagination>,
Query(params): Query<UserListParams>,
) -> Result<Json<ApiResponse<PaginatedResponse<UserResp>>>, AppError>
where
AuthState: FromRef<S>,
@@ -27,7 +37,13 @@ where
{
require_permission(&ctx, "user.list")?;
let (users, total) = UserService::list(ctx.tenant_id, &pagination, &state.db).await?;
let pagination = Pagination {
page: params.page,
page_size: params.page_size,
};
let (users, total) =
UserService::list(ctx.tenant_id, &pagination, params.search.as_deref(), &state.db)
.await?;
let page = pagination.page.unwrap_or(1);
let page_size = pagination.limit();