From 16cfac8d8fa70cd199710c9ddc4f1fdb1d320e72 Mon Sep 17 00:00:00 2001 From: zkldi Date: Sun, 9 May 2021 20:08:41 +0100 Subject: [PATCH] milestoneimportinfo --- common/js/types.d.ts | 12 ++++++++++-- common/src/types.ts | 14 ++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/common/js/types.d.ts b/common/js/types.d.ts index 8508e4ef6..3eca2a57b 100644 --- a/common/js/types.d.ts +++ b/common/js/types.d.ts @@ -433,6 +433,7 @@ export interface ImportDocument extends MongoDBDocument { importType: ImportTypes; classDeltas: ClassDelta[]; goalInfo: GoalImportInfo[]; + milestoneInfo: MilestoneImportInfo[]; /** * Whether the user deliberately imported this through an action (i.e. uploaded a file personally) [true] * or was imported on their behalf through a service (i.e. fervidex) @@ -445,6 +446,12 @@ export interface GoalImportInfo { old: GoalImportStat; new: GoalImportStat; } +export declare type MilestoneImportStat = Pick; +export interface MilestoneImportInfo { + milestoneID: string; + old: GoalImportStat; + new: GoalImportStat; +} export interface UserGoalDocument extends MongoDBDocument { goalID: string; userID: integer; @@ -473,8 +480,9 @@ export interface MilestoneDocument extends MongoDBDocument { playtype: Playtypes[Game]; criteria: { /** - * All: All goals must be achieved in order for the milestone to be complete - * Count: Goals achieved must be greater than or equal to criteria.value. + * all: All goals must be achieved in order for the milestone to be complete + * abs: Goals achieved must be greater than or equal to criteria.value. + * proportion: Goals achieved must be greater than or equal to criteria.value * total_goals. */ type: "all" | "abs" | "proportion"; value: number | null; diff --git a/common/src/types.ts b/common/src/types.ts index 78c5698d1..3103be507 100644 --- a/common/src/types.ts +++ b/common/src/types.ts @@ -600,6 +600,7 @@ export interface ImportDocument extends MongoDBDocument { importType: ImportTypes; classDeltas: ClassDelta[]; goalInfo: GoalImportInfo[]; + milestoneInfo: MilestoneImportInfo[]; /** * Whether the user deliberately imported this through an action (i.e. uploaded a file personally) [true] * or was imported on their behalf through a service (i.e. fervidex) @@ -618,6 +619,14 @@ export interface GoalImportInfo { new: GoalImportStat; } +export type MilestoneImportStat = Pick; + +export interface MilestoneImportInfo { + milestoneID: string; + old: GoalImportStat; + new: GoalImportStat; +} + export interface UserGoalDocument extends MongoDBDocument { goalID: string; userID: integer; @@ -649,8 +658,9 @@ export interface MilestoneDocument extends MongoDBDocument { playtype: Playtypes[Game]; criteria: { /** - * All: All goals must be achieved in order for the milestone to be complete - * Count: Goals achieved must be greater than or equal to criteria.value. + * all: All goals must be achieved in order for the milestone to be complete + * abs: Goals achieved must be greater than or equal to criteria.value. + * proportion: Goals achieved must be greater than or equal to criteria.value * total_goals. */ type: "all" | "abs" | "proportion"; value: number | null;