feat(commission): add per-package filtering to commission pages
- CommissionDtos: add PackageId + PackageTitle to CommissionPayoutDto and WeeklyBalanceDto - CommissionService: add packageId parameter to GetMyCommissionPayoutsAsync and GetMyWeeklyBalanceAsync - CommissionDashboardPage: add package filter dropdown + package column in desktop/mobile views - WeeklyBalancePage: add package filter dropdown + package chip in balance info section - Update NuGet Foursat.CMSMicroservice.Protobuf to v0.0.187
This commit is contained in:
@@ -15,6 +15,8 @@ public class CommissionPayoutDto
|
||||
public string AmountFormatted { get; set; } = string.Empty;
|
||||
public int Status { get; set; }
|
||||
public string DatePersian { get; set; } = string.Empty;
|
||||
public long PackageId { get; set; }
|
||||
public string PackageTitle { get; set; } = string.Empty;
|
||||
|
||||
// Computed properties for UI
|
||||
public string StatusText => Status switch
|
||||
@@ -69,6 +71,8 @@ public class WeeklyBalanceDto
|
||||
public int RightNewMembers { get; set; }
|
||||
public DateTime StartDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
public long PackageId { get; set; }
|
||||
public string PackageTitle { get; set; } = string.Empty;
|
||||
|
||||
// Formatted properties
|
||||
public string LeftBalanceFormatted => $"{LeftBalance:N0} ";
|
||||
|
||||
@@ -78,7 +78,8 @@ public class CommissionService
|
||||
long? weekDefinitionId,
|
||||
string? status,
|
||||
int pageNumber,
|
||||
int pageSize)
|
||||
int pageSize,
|
||||
long? packageId = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -107,6 +108,11 @@ public class CommissionService
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
|
||||
if (packageId.HasValue && packageId.Value > 0)
|
||||
{
|
||||
request.PackageId = packageId.Value;
|
||||
}
|
||||
|
||||
var response = await _client.GetMyCommissionPayoutsAsync(request);
|
||||
|
||||
@@ -121,7 +127,9 @@ public class CommissionService
|
||||
TotalAmount = p.TotalAmount,
|
||||
AmountFormatted = p.AmountFormatted,
|
||||
Status = p.Status,
|
||||
DatePersian = p.DatePersian
|
||||
DatePersian = p.DatePersian,
|
||||
PackageId = p.PackageId,
|
||||
PackageTitle = p.PackageTitle
|
||||
}).ToList(),
|
||||
TotalCount = (int)(response.MetaData?.TotalCount ?? 0),
|
||||
PageNumber = pageNumber,
|
||||
@@ -145,7 +153,7 @@ public class CommissionService
|
||||
/// Get weekly balance details for a specific week
|
||||
/// Maps to: CommissionCQ.GetMyWeeklyBalances
|
||||
/// </summary>
|
||||
public async Task<WeeklyBalanceDto> GetMyWeeklyBalanceAsync(long? weekDefinitionId = null)
|
||||
public async Task<WeeklyBalanceDto> GetMyWeeklyBalanceAsync(long? weekDefinitionId = null, long? packageId = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -163,6 +171,11 @@ public class CommissionService
|
||||
{
|
||||
request.WeekDefinitionId=7;
|
||||
}
|
||||
|
||||
if (packageId.HasValue && packageId.Value > 0)
|
||||
{
|
||||
request.PackageId = packageId.Value;
|
||||
}
|
||||
|
||||
var response = await _client.GetMyWeeklyBalancesAsync(request);
|
||||
|
||||
@@ -183,7 +196,9 @@ public class CommissionService
|
||||
LeftNewMembers = balance.LeftLegNewMembers,
|
||||
RightNewMembers = balance.RightLegNewMembers,
|
||||
StartDate = balance.CalculatedAt?.ToDateTime().AddDays(-7) ?? DateTime.Now.AddDays(-7),
|
||||
EndDate = balance.CalculatedAt?.ToDateTime() ?? DateTime.Now
|
||||
EndDate = balance.CalculatedAt?.ToDateTime() ?? DateTime.Now,
|
||||
PackageId = balance.PackageId,
|
||||
PackageTitle = balance.PackageTitle
|
||||
};
|
||||
}
|
||||
|
||||
@@ -227,7 +242,9 @@ public class CommissionService
|
||||
TotalAmount = p.TotalAmount,
|
||||
AmountFormatted = p.AmountFormatted,
|
||||
Status = p.Status,
|
||||
DatePersian = p.DatePersian
|
||||
DatePersian = p.DatePersian,
|
||||
PackageId = p.PackageId,
|
||||
PackageTitle = p.PackageTitle
|
||||
}).ToList();
|
||||
}
|
||||
catch
|
||||
|
||||
Reference in New Issue
Block a user