Refactored
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user