Code + comment cleanup for the entities

ref #39
This commit is contained in:
2020-12-21 15:29:32 +01:00
parent a03f1a438d
commit d20d738218
21 changed files with 156 additions and 87 deletions

View File

@@ -11,7 +11,9 @@ import { Runner } from "./Runner";
import { TrackScan } from "./TrackScan";
/**
* Defines a card that can be scanned via a scanner station.
* Defines the RunnerCard entity.
* A runnerCard is a physical representation for a runner.
* It can be associated with a runner to create scans via the scan station's.
*/
@Entity()
export class RunnerCard {
@@ -23,7 +25,8 @@ export class RunnerCard {
id: number;
/**
* The runner that is currently associated with this card.
* The card's currently associated runner.
* To increase reusability a card can be reassigned.
*/
@IsOptional()
@ManyToOne(() => Runner, runner => runner.cards, { nullable: true })
@@ -32,7 +35,7 @@ export class RunnerCard {
/**
* The card's code.
* This has to be able to being converted to something barcode compatible.
* could theoretically be autogenerated
* Will get automaticlly generated (not implemented yet).
*/
@Column()
@IsEAN()
@@ -49,7 +52,8 @@ export class RunnerCard {
enabled: boolean = true;
/**
* Used to link cards to a track scans.
* The card's associated scans.
* Used to link cards to track scans.
*/
@OneToMany(() => TrackScan, scan => scan.track, { nullable: true })
scans: TrackScan[];