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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user