import { IsString } from 'class-validator';
import { NotAcceptableError, NotFoundError } from 'routing-controllers';

/**
 * Error to throw when no group name is set.
 */
export class GroupNameNeededError extends NotFoundError {
	@IsString()
	name = "GroupNameNeededError"

	@IsString()
	message = "No name is set for this group!"
}

/**
 * Error to throw when a user group couldn't be found.
 */
export class UserGroupNotFoundError extends NotFoundError {
	@IsString()
	name = "UserGroupNotFoundError"

	@IsString()
	message = "User Group not found!"
}

/**
 * Error to throw when two user groups' ids don't match.
 * Usually occurs when a user tries to change a user groups's id.
 */
export class UserGroupIdsNotMatchingError extends NotAcceptableError {
	@IsString()
	name = "UserGroupIdsNotMatchingError"

	@IsString()
	message = "The ids don't match!! \n If you wanted to change a user group's id: This isn't allowed!"
}