fix: add paid info to stats endpoint

This commit is contained in:
Damien Ostler 2024-02-25 00:58:02 -05:00
parent 892de2aaac
commit 9973a31561
2 changed files with 3 additions and 1 deletions

View File

@ -13,7 +13,8 @@ public static class ArtistModelExtensions
DeclinedRequests = sellerProfile.Requests.Where(x=>x.Declined).Count(),
CompletedRequests = sellerProfile.Requests.Where(x=>x.Completed).Count(),
PendingRequests = sellerProfile.Requests.Where(x=>!x.Accepted && !x.Declined && !x.Completed).Count(),
Revenue = sellerProfile.Requests.Sum(x=>x.Amount)
Revenue = sellerProfile.Requests.Where(x=>x.Paid).Sum(x=>x.Amount),
PaidRequests = sellerProfile.Requests.Where(x=>x.Paid).Count()
};
}
public static ArtistModel ToModel(this UserArtist sellerProfile)

View File

@ -7,4 +7,5 @@ public class ArtistStatsModel
public int CompletedRequests { get; set; }
public int PendingRequests { get; set; }
public decimal Revenue { get; set; }
public int PaidRequests { get; set; }
}