Created all endpoints to manage groups

This commit is contained in:
2026-02-22 18:39:41 +01:00
parent c67cdf8dd8
commit 9301800d0b
15 changed files with 418 additions and 1 deletions
@@ -0,0 +1,14 @@
using Ardalis.Specification;
using BeReadyBackend.Models;
namespace BeReadyBackend.Specifications.Groups;
public class GetGroupRankSpec : Specification<UserGroup>
{
public GetGroupRankSpec(int id)
{
Query
.Where(x => x.GroupId == id)
.OrderByDescending(x => x.Score);
}
}
@@ -0,0 +1,13 @@
using Ardalis.Specification;
using BeReadyBackend.Models;
namespace BeReadyBackend.Specifications.Groups;
public class GetUserGroupDetailsByIdSpec : Specification<UserGroup>
{
public GetUserGroupDetailsByIdSpec(int groupId)
{
Query
.Where(x => x.GroupId == groupId);
}
}
@@ -0,0 +1,14 @@
using Ardalis.Specification;
using BeReadyBackend.Models;
namespace BeReadyBackend.Specifications.Groups;
public class GetUserInGroupByIdsSpec : SingleResultSpecification<UserGroup>
{
public GetUserInGroupByIdsSpec(int groupId, int userId)
{
Query
.Include(x => x.Group)
.Where(x => x.GroupId == groupId && x.UserId == userId);
}
}