feat: created_via for tracking how runners got into the system #212

Merged
philipp merged 6 commits from 211-created-via into dev 2025-03-28 17:05:12 +00:00
4 changed files with 16 additions and 0 deletions

View File

@ -26,6 +26,7 @@ export class CreateSelfServiceCitizenRunner extends CreateParticipant {
public async toEntity(): Promise<Runner> { public async toEntity(): Promise<Runner> {
let newRunner: Runner = new Runner(); let newRunner: Runner = new Runner();
newRunner.created_via = "selfservice";
newRunner.firstname = this.firstname; newRunner.firstname = this.firstname;
newRunner.middlename = this.middlename; newRunner.middlename = this.middlename;
newRunner.lastname = this.lastname; newRunner.lastname = this.lastname;

View File

@ -28,6 +28,7 @@ export class CreateSelfServiceRunner extends CreateParticipant {
public async toEntity(group: RunnerGroup): Promise<Runner> { public async toEntity(group: RunnerGroup): Promise<Runner> {
let newRunner: Runner = new Runner(); let newRunner: Runner = new Runner();
newRunner.created_via = "selfservice";
newRunner.firstname = this.firstname; newRunner.firstname = this.firstname;
newRunner.middlename = this.middlename; newRunner.middlename = this.middlename;
newRunner.lastname = this.lastname; newRunner.lastname = this.lastname;

View File

@ -75,6 +75,14 @@ export abstract class Participant {
@IsEmail() @IsEmail()
email?: string; email?: string;
/**
* how the participant got into the system
*/
@Column({ nullable: true, default: "backend" })
@IsOptional()
@IsEmail()
created_via?: string;
/** /**
* Turns this entity into it's response class. * Turns this entity into it's response class.
*/ */

View File

@ -50,6 +50,12 @@ export abstract class ResponseParticipant implements IResponse {
@IsString() @IsString()
email?: string; email?: string;
/**
* how the participant got into the system
*/
@IsString()
created_via?: string;
/** /**
* The participant's address. * The participant's address.
*/ */