mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
Add username validation and initial friends feature
Introduced a UsernameValidator with Cyrillic and length checks, integrated into AuthService and registration flow. Added InvalidUsernameException and related interface. Updated User model to support friend requests, added FriendsController (stub), and configured Friendship entity in EF Core. Adjusted UserValidator max name length and removed navigation properties from PrivateChat.
This commit is contained in:
@@ -6,7 +6,7 @@ namespace Govor.Core.Infrastructure.Validators;
|
||||
public class UserValidator : IObjectValidator<User>
|
||||
{
|
||||
public const int MIN_LENGHT_OF_NAME = 4;
|
||||
public const int MAX_LENGHT_OF_NAME = 50;
|
||||
public const int MAX_LENGHT_OF_NAME = 44;
|
||||
|
||||
public void Validate(User user)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,5 @@ public class PrivateChat
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserAId { get; set; }
|
||||
public Guid UserBId { get; set; }
|
||||
public User UserA { get; set; }
|
||||
public User UserB { get; set; }
|
||||
public List<Message> Messages { get; set; } = new List<Message>();
|
||||
}
|
||||
@@ -13,4 +13,6 @@ public class User
|
||||
public DateTime WasOnline {get; set;}
|
||||
public Guid InviteId {get; set;}
|
||||
public Invitation? Invite { get; set; }
|
||||
public List<Friendship> SentFriendRequests { get; set; } = new();
|
||||
public List<Friendship> ReceivedFriendRequests { get; set; } = new();
|
||||
}
|
||||
Reference in New Issue
Block a user