From 989d66780dc5401e6fb3d316d8bcfc4fd704331b Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 22 Oct 2024 19:08:22 +0100 Subject: [PATCH] add timestamp to additional data --- projects/backend/src/service/score.service.ts | 1 + .../model/additional-score-data/additional-score-data.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/projects/backend/src/service/score.service.ts b/projects/backend/src/service/score.service.ts index 7b258c8..ec1d70e 100644 --- a/projects/backend/src/service/score.service.ts +++ b/projects/backend/src/service/score.service.ts @@ -211,6 +211,7 @@ export class ScoreService { left: score.accLeft, right: score.accRight, }, + timestamp: new Date(score.timeset), } as AdditionalScoreData; if (rawScoreImprovement && rawScoreImprovement.score > 0) { data.scoreImprovement = { diff --git a/projects/common/src/model/additional-score-data/additional-score-data.ts b/projects/common/src/model/additional-score-data/additional-score-data.ts index 580597d..98f79a6 100644 --- a/projects/common/src/model/additional-score-data/additional-score-data.ts +++ b/projects/common/src/model/additional-score-data/additional-score-data.ts @@ -120,6 +120,12 @@ export class AdditionalScoreData { */ handAccuracy: HandAccuracy; }; + + /** + * The date the score was set on. + */ + @prop({ required: true, index: true }) + public timestamp!: Date; } export type AdditionalScoreDataDocument = AdditionalScoreData & Document;