feat: Implement Commission and Network Statistics Pages with DTOs and Services
- Added CommissionDashboardPage and CommissionHistoryPage for displaying commission payouts and history. - Implemented WeeklyBalancePage to show weekly balance details. - Created NetworkStatisticsPage to display network statistics and tree structure. - Developed corresponding services (CommissionService, NetworkMembershipService) for data retrieval. - Introduced DTOs for Commission and Network data structures (CommissionPayoutDto, WeeklyBalanceDto, NetworkStatisticsDto). - Added mock data generation for testing purposes in services. - Enhanced UI with MudBlazor components for better user experience.
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
namespace FrontOffice.Main.Utilities;
|
||||
|
||||
/// <summary>
|
||||
/// DTO for Commission Payout
|
||||
/// </summary>
|
||||
public class CommissionPayoutDto
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public int WeekNumber { get; set; }
|
||||
public string WeekLabel { get; set; } = string.Empty;
|
||||
public int BalancesEarned { get; set; }
|
||||
public long TotalAmount { get; set; }
|
||||
public string AmountFormatted { get; set; } = string.Empty;
|
||||
public string Status { get; set; } = string.Empty;
|
||||
public string StatusBadgeColor { get; set; } = string.Empty;
|
||||
public string DatePersian { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Response for paginated commission payouts
|
||||
/// </summary>
|
||||
public class CommissionPayoutsResponseDto
|
||||
{
|
||||
public List<CommissionPayoutDto> Payouts { get; set; } = new();
|
||||
public int TotalCount { get; set; }
|
||||
public int PageNumber { get; set; }
|
||||
public int PageSize { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DTO for Weekly Balance details
|
||||
/// </summary>
|
||||
public class WeeklyBalanceDto
|
||||
{
|
||||
public int WeekNumber { get; set; }
|
||||
public string WeekLabel { get; set; } = string.Empty;
|
||||
public long LeftBalance { get; set; }
|
||||
public long RightBalance { get; set; }
|
||||
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 DateTime StartDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
|
||||
// Formatted properties
|
||||
public string LeftBalanceFormatted => $"{LeftBalance:N0} تومان";
|
||||
public string RightBalanceFormatted => $"{RightBalance:N0} تومان";
|
||||
public string MinBalanceFormatted => $"{MinBalance:N0} تومان";
|
||||
public string CalculatedCommissionFormatted => $"{CalculatedCommission:N0} تومان";
|
||||
public string LeftCarryoverFormatted => $"{LeftCarryover:N0} تومان";
|
||||
public string RightCarryoverFormatted => $"{RightCarryover:N0} تومان";
|
||||
public string StartDatePersian => StartDate.ToString("yyyy/MM/dd");
|
||||
public string EndDatePersian => EndDate.ToString("yyyy/MM/dd");
|
||||
}
|
||||
Reference in New Issue
Block a user