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

@@ -122,18 +122,30 @@ impl UserService {
Ok(model_to_resp(&user_model, roles))
}
/// List users within a tenant with pagination.
/// List users within a tenant with pagination and optional search.
///
/// Returns `(users, total_count)`.
/// Returns `(users, total_count)`. When `search` is provided, filters
/// by username using case-insensitive substring match.
pub async fn list(
tenant_id: Uuid,
pagination: &Pagination,
search: Option<&str>,
db: &sea_orm::DatabaseConnection,
) -> AuthResult<(Vec<UserResp>, u64)> {
let paginator = user::Entity::find()
let mut query = user::Entity::find()
.filter(user::Column::TenantId.eq(tenant_id))
.filter(user::Column::DeletedAt.is_null())
.paginate(db, pagination.limit());
.filter(user::Column::DeletedAt.is_null());
if let Some(term) = search {
if !term.is_empty() {
use sea_orm::sea_query::Expr;
query = query.filter(
Expr::col(user::Column::Username).like(format!("%{}%", term)),
);
}
}
let paginator = query.paginate(db, pagination.limit());
let total = paginator
.num_items()