diff --git a/src/models/actions/create/CreateSelfServiceCitizenRunner.ts b/src/models/actions/create/CreateSelfServiceCitizenRunner.ts index d3a9d12..93ad392 100644 --- a/src/models/actions/create/CreateSelfServiceCitizenRunner.ts +++ b/src/models/actions/create/CreateSelfServiceCitizenRunner.ts @@ -26,6 +26,7 @@ export class CreateSelfServiceCitizenRunner extends CreateParticipant { public async toEntity(): Promise { let newRunner: Runner = new Runner(); + newRunner.created_via = "selfservice"; newRunner.firstname = this.firstname; newRunner.middlename = this.middlename; newRunner.lastname = this.lastname; diff --git a/src/models/actions/create/CreateSelfServiceRunner.ts b/src/models/actions/create/CreateSelfServiceRunner.ts index 953db43..163a16d 100644 --- a/src/models/actions/create/CreateSelfServiceRunner.ts +++ b/src/models/actions/create/CreateSelfServiceRunner.ts @@ -28,6 +28,7 @@ export class CreateSelfServiceRunner extends CreateParticipant { public async toEntity(group: RunnerGroup): Promise { let newRunner: Runner = new Runner(); + newRunner.created_via = "selfservice"; newRunner.firstname = this.firstname; newRunner.middlename = this.middlename; newRunner.lastname = this.lastname; diff --git a/src/models/entities/Participant.ts b/src/models/entities/Participant.ts index ccf7656..ba0c741 100644 --- a/src/models/entities/Participant.ts +++ b/src/models/entities/Participant.ts @@ -75,6 +75,14 @@ export abstract class Participant { @IsEmail() 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. */ diff --git a/src/models/responses/ResponseParticipant.ts b/src/models/responses/ResponseParticipant.ts index b5ca124..5262f89 100644 --- a/src/models/responses/ResponseParticipant.ts +++ b/src/models/responses/ResponseParticipant.ts @@ -50,6 +50,12 @@ export abstract class ResponseParticipant implements IResponse { @IsString() email?: string; + /** + * how the participant got into the system + */ + @IsString() + created_via?: string; + /** * The participant's address. */