mirror of
https://github.com/D4M13N-D3V/comissions-app-core-api.git
synced 2025-03-14 10:04:55 +00:00
fix: added a property to model for number of paid for requests
This commit is contained in:
parent
559f24b8d8
commit
a4a7af32a7
@ -13,6 +13,7 @@ public class AdminUserModel
|
|||||||
public int NumberOfBans { get; set; } = 0;
|
public int NumberOfBans { get; set; } = 0;
|
||||||
public int NumberOfReviews { get; set; } = 0;
|
public int NumberOfReviews { get; set; } = 0;
|
||||||
public decimal AmountSpent { get; set; } = 0;
|
public decimal AmountSpent { get; set; } = 0;
|
||||||
|
public int NumberOfPaid { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class AdminUserModelExtensions
|
public static class AdminUserModelExtensions
|
||||||
@ -29,6 +30,7 @@ public static class AdminUserModelExtensions
|
|||||||
NumberOfSuspensions = user.Suspensions.Count,
|
NumberOfSuspensions = user.Suspensions.Count,
|
||||||
NumberOfBans = user.Bans.Count,
|
NumberOfBans = user.Bans.Count,
|
||||||
NumberOfReviews = user.Requests.Count(x => x.Reviewed),
|
NumberOfReviews = user.Requests.Count(x => x.Reviewed),
|
||||||
|
NumberOfPaid = user.Requests.Count(x => x.Paid),
|
||||||
AmountSpent = user.Requests.Sum(r => r.Amount)
|
AmountSpent = user.Requests.Sum(r => r.Amount)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user