feat: update commission protobuf version; enhance weekly balance display with new member counts and carryover logic
Build and Deploy / build (push) Successful in 1m26s
Build and Deploy / build (push) Successful in 1m26s
This commit is contained in:
@@ -63,8 +63,10 @@ public class WeeklyBalanceDto
|
||||
public long MinBalance { get; set; }
|
||||
public int BalanceCount { get; set; }
|
||||
public long CalculatedCommission { get; set; }
|
||||
public long LeftCarryover { get; set; }
|
||||
public long RightCarryover { get; set; }
|
||||
public int LeftCarryover { get; set; }
|
||||
public int RightCarryover { get; set; }
|
||||
public int LeftNewMembers { get; set; }
|
||||
public int RightNewMembers { get; set; }
|
||||
public DateTime StartDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
|
||||
@@ -75,6 +77,8 @@ public class WeeklyBalanceDto
|
||||
public string CalculatedCommissionFormatted => $"{CalculatedCommission:N0} ";
|
||||
public string LeftCarryoverFormatted => $"{LeftCarryover:N0} ";
|
||||
public string RightCarryoverFormatted => $"{RightCarryover:N0} ";
|
||||
public string LeftNewMembersFormatted => $"{LeftNewMembers:N0}";
|
||||
public string RightNewMembersFormatted => $"{RightNewMembers:N0}";
|
||||
public string StartDatePersian => StartDate.MiladiToJalali();
|
||||
public string EndDatePersian => EndDate.MiladiToJalali();
|
||||
}
|
||||
|
||||
@@ -159,6 +159,9 @@ public class CommissionService
|
||||
if (weekDefinitionId.HasValue)
|
||||
{
|
||||
request.WeekDefinitionId = weekDefinitionId.Value;
|
||||
}else
|
||||
{
|
||||
request.WeekDefinitionId=7;
|
||||
}
|
||||
|
||||
var response = await _client.GetMyWeeklyBalancesAsync(request);
|
||||
@@ -175,8 +178,10 @@ public class CommissionService
|
||||
MinBalance = Math.Min(balance.LeftLegBalances, balance.RightLegBalances),
|
||||
BalanceCount = balance.TotalBalances,
|
||||
CalculatedCommission = balance.WeeklyPoolContribution,
|
||||
LeftCarryover = Math.Max(0, balance.LeftLegBalances - balance.RightLegBalances),
|
||||
RightCarryover = Math.Max(0, balance.RightLegBalances - balance.LeftLegBalances),
|
||||
LeftCarryover = balance.LeftLegCarryover,
|
||||
RightCarryover = balance.RightLegCarryover,
|
||||
LeftNewMembers = balance.LeftLegNewMembers,
|
||||
RightNewMembers = balance.RightLegNewMembers,
|
||||
StartDate = balance.CalculatedAt?.ToDateTime().AddDays(-7) ?? DateTime.Now.AddDays(-7),
|
||||
EndDate = balance.CalculatedAt?.ToDateTime() ?? DateTime.Now
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user