feat: enhance WeeklyBalanceModel with carryover and new members fields; update mappings and response DTO
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 1m55s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 1m55s
This commit is contained in:
+9
-3
@@ -35,17 +35,23 @@ public class GetMyWeeklyBalancesQueryHandler : IRequestHandler<GetMyWeeklyBalanc
|
||||
var response = await _context.Commission.GetUserWeeklyBalancesAsync(cmsRequest, cancellationToken: cancellationToken);
|
||||
|
||||
// Map list of UserWeeklyBalanceModel to DTO
|
||||
// Note: CMS proto uses LeftLegTotal/RightLegTotal (sum of NewMembers + Carryover)
|
||||
var balances = response.Models.Select(b => new WeeklyBalanceItemDto
|
||||
{
|
||||
Id = b.Id,
|
||||
WeekDefinitionId = b.WeekDefinitionId,
|
||||
WeekLabel = b.WeekDisplayName,
|
||||
LeftLegBalances = b.LeftLegBalances,
|
||||
RightLegBalances = b.RightLegBalances,
|
||||
LeftLegBalances = b.LeftLegTotal, // Changed from LeftLegBalances
|
||||
RightLegBalances = b.RightLegTotal, // Changed from RightLegBalances
|
||||
TotalBalances = b.TotalBalances,
|
||||
WeeklyPoolContribution = b.WeeklyPoolContribution,
|
||||
CalculatedAt = b.CalculatedAt?.ToDateTime(),
|
||||
IsExpired = b.IsExpired
|
||||
IsExpired = b.IsExpired,
|
||||
// New fields for carryover info
|
||||
LeftLegCarryover = b.LeftLegCarryover,
|
||||
RightLegCarryover = b.RightLegCarryover,
|
||||
LeftLegNewMembers = b.LeftLegNewMembers,
|
||||
RightLegNewMembers = b.RightLegNewMembers
|
||||
}).ToList();
|
||||
|
||||
// Calculate summary
|
||||
|
||||
+20
@@ -89,4 +89,24 @@ public class WeeklyBalanceItemDto
|
||||
/// تاریخ شمسی
|
||||
/// </summary>
|
||||
public string DatePersian { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// انتقالی پای چپ از هفته قبل
|
||||
/// </summary>
|
||||
public int LeftLegCarryover { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// انتقالی پای راست از هفته قبل
|
||||
/// </summary>
|
||||
public int RightLegCarryover { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اعضای جدید پای چپ این هفته
|
||||
/// </summary>
|
||||
public int LeftLegNewMembers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اعضای جدید پای راست این هفته
|
||||
/// </summary>
|
||||
public int RightLegNewMembers { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user