Add relationships feature and EF migration
This commit is contained in:
35
src/RecNet.Domain/Profiles/Relationship.cs
Normal file
35
src/RecNet.Domain/Profiles/Relationship.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using RecNet.Domain.Exceptions;
|
||||
|
||||
namespace RecNet.Domain.Profiles;
|
||||
|
||||
public class Relationship
|
||||
{
|
||||
public Guid OwnerProfileId { get; private set; }
|
||||
|
||||
public Guid ProfileId { get; private set; }
|
||||
|
||||
public bool Muted { get; private set; }
|
||||
public bool Ignored { get; private set; }
|
||||
|
||||
private Relationship()
|
||||
{
|
||||
}
|
||||
|
||||
public static Relationship Create(Guid ownerProfileId, Guid profileId)
|
||||
{
|
||||
if (ownerProfileId == Guid.Empty || profileId == Guid.Empty)
|
||||
throw new DomainException("Profile IDs cannot be null.");
|
||||
|
||||
return new Relationship
|
||||
{
|
||||
OwnerProfileId = ownerProfileId,
|
||||
ProfileId = profileId
|
||||
};
|
||||
}
|
||||
|
||||
public void Mutate(bool muted, bool ignored)
|
||||
{
|
||||
Muted = muted;
|
||||
Ignored = ignored;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user