mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
Add friendship feature with models, repository, and tests
Introduces Friendship and PrivateChat models, repository interfaces, and implementations for managing friendships. Adds validators and comprehensive unit and integration tests for friendship logic. Updates InviteUserController with new endpoints and restricts access to admin role. Removes unnecessary project references from Govor.API.csproj and registers new DbSets in GovorDbContext.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
namespace Govor.Core.Repositories.Friendships;
|
||||
|
||||
public interface IFriendshipsExist
|
||||
{
|
||||
bool Exist(Guid requesterId, Guid addresseeId);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using Govor.Core.Models;
|
||||
|
||||
namespace Govor.Core.Repositories.Friendships;
|
||||
|
||||
public interface IFriendshipsReader
|
||||
{
|
||||
Task<List<Friendship>> GetAllAsync();
|
||||
Task<Friendship> GetByIdAsync(Guid id);
|
||||
Task<List<Friendship>> FindByUserIdAsync(Guid userId);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Govor.Core.Repositories.Friendships;
|
||||
|
||||
public interface IFriendshipsRepository : IFriendshipsReader, IFriendshipsWriter, IFriendshipsExist
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using Govor.Core.Models;
|
||||
|
||||
namespace Govor.Core.Repositories.Friendships;
|
||||
|
||||
public interface IFriendshipsWriter
|
||||
{
|
||||
Task AddAsync(Friendship friendship);
|
||||
Task UpdateAsync(Friendship friendship);
|
||||
Task RemoveAsync(Friendship friendship);
|
||||
}
|
||||
Reference in New Issue
Block a user