latest work #20

Merged
philipp merged 233 commits from dev into main 2020-12-09 18:49:33 +00:00
Showing only changes of commit fbbb5df64f - Show all commits

49
src/models/RunnerCard.ts Normal file
View File

@ -0,0 +1,49 @@
import { Entity, PrimaryGeneratedColumn, Column } from "typeorm";
import {
IsBoolean,
IsInt,
IsNotEmpty,
IsOptional,
IsString,
} from "class-validator";
import { Runner } from "./Runner";
/**
* Defines a card that can be scanned via a scanner station.
*/
@Entity()
export class RunnerCard {
/**
* Autogenerated unique id (primary key).
*/
@PrimaryGeneratedColumn()
@IsOptional()
@IsInt()
id: number;
/**
* The runner that is currently associated with this card.
*/
@Column()
@IsOptional()
//TODO: Relation
runner: Runner;
/**
* The card's code.
* This has to be able to being converted to something barcode compatible.
* Probably gonna be autogenerated.
*/
@Column()
@IsString()
@IsNotEmpty()
//TODO: Generate this
code: string;
/**
* Is the card enabled (for fraud reasons)?
*/
@Column()
@IsBoolean()
enabled = true;
}