Refactored

This commit is contained in:
2026-03-04 23:12:08 +01:00
parent 88442f22dd
commit ef6305919d
31 changed files with 296 additions and 338 deletions

View File

@@ -7,6 +7,38 @@ namespace AipsCore.Domain.Models.Whiteboard.Validation;
public class WhiteboardErrors : AbstractErrors<Whiteboard, WhiteboardId>
{
public static ValidationError NotFound(WhiteboardCode whiteboardCode)
{
const string code = "not_found";
string message = $"Whiteboard with code '{whiteboardCode.CodeValue}' was not found!";
return CreateValidationError(code,message);
}
public static ValidationError CannotJoin(WhiteboardCode whiteboardCode)
{
const string code = "cannot_join_whiteboard";
string message = $"Cannot join the whiteboard with code '{whiteboardCode.CodeValue}'";
return CreateValidationError(code,message);
}
public static ValidationError UserBanned(UserId userId)
{
const string code = "user_banned_from_whiteboard";
string message = $"User with id '{userId}' is banned from this whiteboard.";
return CreateValidationError(code,message);
}
public static ValidationError UserAlreadyTryingToJoin(UserId userId)
{
const string code = "user_already_trying_to_join_whiteboard";
string message = $"User with id '{userId}' is already trying to join the whiteboard.";
return CreateValidationError(code,message);
}
public static ValidationError UserAlreadyAdded(UserId userId)
{
string code = "user_already_added";