From 74951f34dcca1cc9de47088749161de1e8a283df Mon Sep 17 00:00:00 2001 From: RidhamShah Date: Tue, 3 Oct 2023 16:01:24 +0530 Subject: [PATCH] make assignmentAlogrithm optional --- backend/packages/Upgrade/src/api/DTO/ExperimentDTO.ts | 2 +- backend/packages/Upgrade/src/api/models/Experiment.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/packages/Upgrade/src/api/DTO/ExperimentDTO.ts b/backend/packages/Upgrade/src/api/DTO/ExperimentDTO.ts index 28a7b36c5f..c7a6e4b778 100644 --- a/backend/packages/Upgrade/src/api/DTO/ExperimentDTO.ts +++ b/backend/packages/Upgrade/src/api/DTO/ExperimentDTO.ts @@ -361,7 +361,7 @@ export class ExperimentDTO { @IsOptional() @IsEnum(ASSIGNMENT_ALGORITHM) - public assignmentAlgorithm: ASSIGNMENT_ALGORITHM; + public assignmentAlgorithm?: ASSIGNMENT_ALGORITHM; // TODO add conditional validity here ie endOn is null @IsOptional() diff --git a/backend/packages/Upgrade/src/api/models/Experiment.ts b/backend/packages/Upgrade/src/api/models/Experiment.ts index 80d18e0f16..2ccfecd5bf 100644 --- a/backend/packages/Upgrade/src/api/models/Experiment.ts +++ b/backend/packages/Upgrade/src/api/models/Experiment.ts @@ -113,6 +113,7 @@ export class Experiment extends BaseModel { @Column({ type: 'enum', enum: ASSIGNMENT_ALGORITHM, + default: ASSIGNMENT_ALGORITHM.RANDOM, }) public assignmentAlgorithm: ASSIGNMENT_ALGORITHM;