From d6755ed134071df635bc9d5821ceb2396c0f1d22 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Tue, 8 Apr 2025 21:04:38 +0200 Subject: [PATCH] feat(runners): Allow created via being set via api --- src/models/actions/create/CreateParticipant.ts | 7 +++++++ src/models/actions/create/CreateRunner.ts | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/models/actions/create/CreateParticipant.ts b/src/models/actions/create/CreateParticipant.ts index 8e008e7..fbd63d0 100644 --- a/src/models/actions/create/CreateParticipant.ts +++ b/src/models/actions/create/CreateParticipant.ts @@ -50,4 +50,11 @@ export abstract class CreateParticipant { @IsOptional() @IsObject() address?: Address; + + /** + * how the participant got into the system + */ + @IsOptional() + @IsString() + created_via?: string; } \ No newline at end of file diff --git a/src/models/actions/create/CreateRunner.ts b/src/models/actions/create/CreateRunner.ts index 63871e3..a761239 100644 --- a/src/models/actions/create/CreateRunner.ts +++ b/src/models/actions/create/CreateRunner.ts @@ -32,6 +32,9 @@ export class CreateRunner extends CreateParticipant { newRunner.email = this.email; newRunner.group = await this.getGroup(); newRunner.address = this.address; + if (this.created_via) { + newRunner.created_via = this.created_via; + } Address.validate(newRunner.address); return newRunner;