From 92939e2f9a2c8ddc5a5b099b7afb4fe3d49877ab Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Wed, 30 Mar 2022 04:00:41 +0100 Subject: [PATCH] Change goalsubdocuments to use parentMilestones --- common/src/types.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/common/src/types.ts b/common/src/types.ts index 074305c4f..f319a2936 100644 --- a/common/src/types.ts +++ b/common/src/types.ts @@ -577,19 +577,6 @@ export interface MilestoneImportInfo { new: MilestoneImportStat; } -export type GoalOrigin = - | { - // The user set this goal by hand - origin: "manual"; - } - | { - // This goal was set for the user by part of a milestone. - // If a goal in a milestone was already set for whatever reason - // that origin takes priority. - origin: "milestone"; - milestoneID: string; - }; - export type GoalSubscriptionDocument = MongoDBDocument & { goalID: string; userID: integer; @@ -601,7 +588,9 @@ export type GoalSubscriptionDocument = MongoDBDocument & { progressHuman: string; outOf: number; outOfHuman: string; - from: GoalOrigin; + // An array of milestoneIDs that this goal has came from. If empty, the goal is + // a manually assigned one (or orphaned). + parentMilestones: string[]; wasInstantlyAchieved: boolean; } & ( | {