refinement phase 3

This commit is contained in:
hamid
2026-07-13 11:26:39 +03:30
parent 1ce36f9414
commit 314763f764
194 changed files with 24211 additions and 274 deletions
@@ -54,19 +54,23 @@ internal sealed class SqlNurseSearch(ApplicationDbContext db) : INurseSearch
.Take(criteria.PageSize)
.Select(r => new Row(
r.VariantId, r.NurseId, r.ServiceCategoryId, r.Price, r.PriceUnit, r.NurseGender,
r.AverageRating, r.TotalReviews, r.TotalCompletedBookings, r.CityId, r.DistrictId))
r.AverageRating, r.TotalReviews, r.TotalCompletedBookings, r.CityId, r.DistrictId,
r.NurseName, r.AvatarUrl))
.ToListAsync(cancellationToken);
// Format price to a digit string in memory (no long.ToString translation required in SQL).
// DistanceKm is null: the covering index carries no coordinate, so distance is not derivable here.
var items = rows.Select(r => new NurseSearchResultDto(
r.VariantId, r.NurseId, r.ServiceCategoryId,
r.Price.ToString(CultureInfo.InvariantCulture), r.PriceUnit, r.NurseGender,
r.AverageRating, r.TotalReviews, r.TotalCompletedBookings, r.CityId, r.DistrictId)).ToList();
r.AverageRating, r.TotalReviews, r.TotalCompletedBookings, r.CityId, r.DistrictId,
r.NurseName, r.AvatarUrl, null)).ToList();
return new PagedResult<NurseSearchResultDto>(items, total, criteria.Page, criteria.PageSize);
}
private sealed record Row(
long VariantId, long NurseId, long ServiceCategoryId, long Price, string PriceUnit, string NurseGender,
decimal AverageRating, int TotalReviews, int TotalCompletedBookings, long CityId, long? DistrictId);
decimal AverageRating, int TotalReviews, int TotalCompletedBookings, long CityId, long? DistrictId,
string NurseName, string AvatarUrl);
}