From 96925699531b7e66424480a4781c37b2fb86bdfc Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Fri, 28 Mar 2025 12:05:23 +0100 Subject: [PATCH 1/5] add created_via to participant entity ref #211 --- src/models/entities/Participant.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/models/entities/Participant.ts b/src/models/entities/Participant.ts index ccf7656..b279e64 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 }) + @IsOptional() + @IsEmail() + created_via?: string; + /** * Turns this entity into it's response class. */ -- 2.49.1 From d62ef99e9d424fa21ee4ac3fdac46574708af385 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Fri, 28 Mar 2025 12:06:09 +0100 Subject: [PATCH 2/5] add created_via = "selfservice" to CreateSelfServiceCitizenRunner --- src/models/actions/create/CreateSelfServiceCitizenRunner.ts | 1 + 1 file changed, 1 insertion(+) 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; -- 2.49.1 From fcccf82d480e2e85d5c7b0e1faffda9038731d8c Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Fri, 28 Mar 2025 12:06:17 +0100 Subject: [PATCH 3/5] add created_via = "selfservice" to CreateSelfServiceRunner --- src/models/actions/create/CreateSelfServiceRunner.ts | 1 + 1 file changed, 1 insertion(+) 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; -- 2.49.1 From f95b61441015c74c11489862b3dd7f36541d39d8 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Fri, 28 Mar 2025 12:08:21 +0100 Subject: [PATCH 4/5] default created_via="backend" --- src/models/entities/Participant.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/entities/Participant.ts b/src/models/entities/Participant.ts index b279e64..ba0c741 100644 --- a/src/models/entities/Participant.ts +++ b/src/models/entities/Participant.ts @@ -78,7 +78,7 @@ export abstract class Participant { /** * how the participant got into the system */ - @Column({ nullable: true }) + @Column({ nullable: true, default: "backend" }) @IsOptional() @IsEmail() created_via?: string; -- 2.49.1 From 294ce3fc5ac8d6874ba34418c7269cfb741bd7f9 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Fri, 28 Mar 2025 17:46:53 +0100 Subject: [PATCH 5/5] add created_via to ResponseParticipant --- src/models/responses/ResponseParticipant.ts | 6 ++++++ 1 file changed, 6 insertions(+) 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. */ -- 2.49.1