Implmented the EAN generation

ref #77
This commit is contained in:
2021-01-09 12:24:05 +01:00
parent df39166279
commit 860680d001
3 changed files with 41 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ export class RunnerCardIdsNotMatchingError extends NotAcceptableError {
}
/**
* Error to throw when a station still has scans associated.
* Error to throw when a card still has scans associated.
*/
export class RunnerCardHasScansError extends NotAcceptableError {
@IsString()
@@ -34,3 +34,15 @@ export class RunnerCardHasScansError extends NotAcceptableError {
@IsString()
message = "This card still has scans associated with it. \n If you want to delete this card with all it's scans add `?force` to your query. \n Otherwise please consider just diableing it."
}
/**
* Error to throw when a card's id is too big to generate a ean-13 barcode for it.
* This error should never reach a enduser.
*/
export class RunnerCardIdOutOfRangeError extends Error {
@IsString()
name = "RunnerCardIdOutOfRangeError"
@IsString()
message = "The card's id is too big to fit into a ean-13 barcode. \n This has a very low probability of happening but means that you might want to switch your barcode format for something that can accept numbers over 9999999999."
}