Merge branch 'dev' of https://git.odit.services/lfk/backend into dev
This commit is contained in:
18
src/errors/AddressErrors.ts
Normal file
18
src/errors/AddressErrors.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { IsString } from 'class-validator';
|
||||
import { NotAcceptableError, NotFoundError } from 'routing-controllers';
|
||||
|
||||
export class AddressWrongTypeError extends NotAcceptableError {
|
||||
@IsString()
|
||||
name = "AddressWrongTypeError"
|
||||
|
||||
@IsString()
|
||||
message = "The address must be an existing adress's id. \n You provided a object of another type."
|
||||
}
|
||||
|
||||
export class AddressNotFoundError extends NotFoundError {
|
||||
@IsString()
|
||||
name = "AddressNotFoundError"
|
||||
|
||||
@IsString()
|
||||
message = "The address you provided couldn't be located in the system. \n Please check your request."
|
||||
}
|
||||
18
src/errors/GroupContactErrors.ts
Normal file
18
src/errors/GroupContactErrors.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { IsString } from 'class-validator';
|
||||
import { NotAcceptableError, NotFoundError } from 'routing-controllers';
|
||||
|
||||
export class GroupContactWrongTypeError extends NotAcceptableError {
|
||||
@IsString()
|
||||
name = "GroupContactWrongTypeError"
|
||||
|
||||
@IsString()
|
||||
message = "The groupContact must be an existing groupContact's id. \n You provided a object of another type."
|
||||
}
|
||||
|
||||
export class GroupContactNotFoundError extends NotFoundError {
|
||||
@IsString()
|
||||
name = "GroupContactNotFoundError"
|
||||
|
||||
@IsString()
|
||||
message = "The groupContact you provided couldn't be located in the system. \n Please check your request."
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import { IsString } from 'class-validator';
|
||||
import { NotAcceptableError, NotFoundError } from 'routing-controllers';
|
||||
|
||||
export class ParticipantOnlyOneAddressAllowedError extends NotAcceptableError {
|
||||
@IsString()
|
||||
name = "ParticipantOnlyOneAddressAllowedError"
|
||||
|
||||
@IsString()
|
||||
message = "Participant's can only have one address! \n You provided an id and address object.."
|
||||
}
|
||||
|
||||
export class ParticipantAddressNotFoundError extends NotFoundError {
|
||||
@IsString()
|
||||
name = "ParticipantAddressNotFoundError"
|
||||
|
||||
@IsString()
|
||||
message = "The address you provided couldn't be located in the system. \n Please check your request."
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { JsonController, Param, Body, Get, Post, Put, Delete, NotFoundError, OnUndefined, NotAcceptableError } from 'routing-controllers';
|
||||
import { IsInt, IsNotEmpty, IsPositive, IsString } from 'class-validator';
|
||||
import { IsString } from 'class-validator';
|
||||
import { NotAcceptableError, NotFoundError } from 'routing-controllers';
|
||||
|
||||
/**
|
||||
* Error to throw when a runner couldn't be found.
|
||||
|
||||
@@ -48,4 +48,12 @@ export class RunnerOrganisationHasTeamsError extends NotAcceptableError {
|
||||
|
||||
@IsString()
|
||||
message = "This organisation still has teams associated with it. \n If you want to delete this organisation with all it's runners and teams ass `?force` to your query."
|
||||
}
|
||||
}
|
||||
|
||||
export class RunnerOrganisationWrongTypeError extends NotAcceptableError {
|
||||
@IsString()
|
||||
name = "RunnerOrganisationWrongTypeError"
|
||||
|
||||
@IsString()
|
||||
message = "The runner organisation must be an existing organisation's id. \n You provided a object of another type."
|
||||
}
|
||||
|
||||
@@ -36,4 +36,16 @@ export class RunnerTeamHasRunnersError extends NotAcceptableError {
|
||||
|
||||
@IsString()
|
||||
message = "This team still has runners associated with it. \n If you want to delete this team with all it's runners and teams ass `?force` to your query."
|
||||
}
|
||||
|
||||
/**
|
||||
* Error to throw when a team still has runners associated.
|
||||
* Implemented this waysto work with the json-schema conversion for openapi.
|
||||
*/
|
||||
export class RunnerTeamNeedsParentError extends NotAcceptableError {
|
||||
@IsString()
|
||||
name = "RunnerTeamNeedsParentError"
|
||||
|
||||
@IsString()
|
||||
message = "You provided no runner organisation as this team's parent group."
|
||||
}
|
||||
Reference in New Issue
Block a user