diff --git a/src/models/entities/Runner.ts b/src/models/entities/Runner.ts index ad16eae..87ef38d 100644 --- a/src/models/entities/Runner.ts +++ b/src/models/entities/Runner.ts @@ -1,5 +1,5 @@ -import { IsInt, IsNotEmpty } from "class-validator"; -import { ChildEntity, ManyToOne, OneToMany } from "typeorm"; +import { IsInt, IsNotEmpty, IsOptional, IsString } from "class-validator"; +import { ChildEntity, Column, ManyToOne, OneToMany } from "typeorm"; import { ResponseRunner } from '../responses/ResponseRunner'; import { DistanceDonation } from "./DistanceDonation"; import { Participant } from "./Participant"; @@ -43,6 +43,15 @@ export class Runner extends Participant { @OneToMany(() => Scan, scan => scan.runner, { nullable: true }) scans: Scan[]; + /** + * The last time the runner requested a selfservice link. + * Used to prevent spamming of the selfservice link forgotten route. + */ + @Column({ nullable: true, unique: false }) + @IsString() + @IsOptional() + resetRequestedTimestamp?: number; + /** * Returns all valid scans associated with this runner. * This is implemented here to avoid duplicate code in other files.