feat: add search text filter for user query
All checks were successful
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 2m40s

This commit is contained in:
masoodafar-web
2025-12-12 03:18:18 +03:30
parent 12749ccb01
commit bb6b7c709c
5 changed files with 24 additions and 16 deletions

View File

@@ -10,6 +10,8 @@ public record GetAllUserByFilterQuery : IRequest<GetAllUserByFilterResponseDto>
}public class GetAllUserByFilterFilter }public class GetAllUserByFilterFilter
{ {
//جستجوی متنی (نام، نام خانوادگی، موبایل، کدملی)
public string? SearchText { get; set; }
//شناسه //شناسه
public long? Id { get; set; } public long? Id { get; set; }
//نام //نام

View File

@@ -17,6 +17,11 @@ public class GetAllUserByFilterQueryHandler : IRequestHandler<GetAllUserByFilter
if (request.Filter is not null) if (request.Filter is not null)
{ {
query = query query = query
.Where(x => request.Filter.SearchText == null ||
x.FirstName.Contains(request.Filter.SearchText) ||
x.LastName.Contains(request.Filter.SearchText) ||
x.Mobile.Contains(request.Filter.SearchText) ||
x.NationalCode.Contains(request.Filter.SearchText))
.Where(x => request.Filter.Id == null || x.Id == request.Filter.Id) .Where(x => request.Filter.Id == null || x.Id == request.Filter.Id)
.Where(x => request.Filter.FirstName == null || x.FirstName.Contains(request.Filter.FirstName)) .Where(x => request.Filter.FirstName == null || x.FirstName.Contains(request.Filter.FirstName))
.Where(x => request.Filter.LastName == null || x.LastName.Contains(request.Filter.LastName)) .Where(x => request.Filter.LastName == null || x.LastName.Contains(request.Filter.LastName))

View File

@@ -3,7 +3,7 @@
<TargetFramework>net9.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<Version>0.0.146</Version> <Version>0.0.147</Version>
<DebugType>None</DebugType> <DebugType>None</DebugType>
<DebugSymbols>False</DebugSymbols> <DebugSymbols>False</DebugSymbols>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild> <GeneratePackageOnBuild>False</GeneratePackageOnBuild>

View File

@@ -129,20 +129,21 @@ message GetAllUserByFilterRequest
} }
message GetAllUserByFilterFilter message GetAllUserByFilterFilter
{ {
google.protobuf.Int64Value id = 1; google.protobuf.StringValue search_text = 1;
google.protobuf.StringValue first_name = 2; google.protobuf.Int64Value id = 2;
google.protobuf.StringValue last_name = 3; google.protobuf.StringValue first_name = 3;
google.protobuf.StringValue mobile = 4; google.protobuf.StringValue last_name = 4;
google.protobuf.StringValue national_code = 5; google.protobuf.StringValue mobile = 5;
google.protobuf.StringValue avatar_path = 6; google.protobuf.StringValue national_code = 6;
google.protobuf.Int64Value parent_id = 7; google.protobuf.StringValue avatar_path = 7;
google.protobuf.StringValue referral_code = 8; google.protobuf.Int64Value parent_id = 8;
google.protobuf.BoolValue is_mobile_verified = 9; google.protobuf.StringValue referral_code = 9;
google.protobuf.Timestamp mobile_verified_at = 10; google.protobuf.BoolValue is_mobile_verified = 10;
google.protobuf.BoolValue email_notifications = 11; google.protobuf.Timestamp mobile_verified_at = 11;
google.protobuf.BoolValue sms_notifications = 12; google.protobuf.BoolValue email_notifications = 12;
google.protobuf.BoolValue push_notifications = 13; google.protobuf.BoolValue sms_notifications = 13;
google.protobuf.Timestamp birth_date = 14; google.protobuf.BoolValue push_notifications = 14;
google.protobuf.Timestamp birth_date = 15;
} }
message GetAllUserByFilterResponse message GetAllUserByFilterResponse
{ {

View File

@@ -114,7 +114,7 @@ public class DayaLoanCheckWorker
recurringJobManager.AddOrUpdate<DayaLoanCheckWorker>( recurringJobManager.AddOrUpdate<DayaLoanCheckWorker>(
"daya-loan-check", "daya-loan-check",
worker => worker.ExecuteAsync(), worker => worker.ExecuteAsync(),
"*/01 * * * *", // هر 15 دقیقه "*/20 * * * *", // هر 15 دقیقه
TimeZoneInfo.Local TimeZoneInfo.Local
); );
} }