From 1d17e805bbbb408e1cb11d6a75a0e4cbadb74201 Mon Sep 17 00:00:00 2001 From: Wes Copeland Date: Sun, 3 Mar 2024 16:47:42 -0500 Subject: [PATCH] refactor: make AchievementType a reusable and exported model (#85) --- src/user/models/achievement-type.model.ts | 5 +++++ src/user/models/dated-user-achievement.model.ts | 4 +++- src/user/models/dated-user-achievements-response.model.ts | 4 +++- src/user/models/index.ts | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 src/user/models/achievement-type.model.ts diff --git a/src/user/models/achievement-type.model.ts b/src/user/models/achievement-type.model.ts new file mode 100644 index 0000000..7b0473e --- /dev/null +++ b/src/user/models/achievement-type.model.ts @@ -0,0 +1,5 @@ +export type AchievementType = + | "progression" + | "win_condition" + | "missable" + | null; diff --git a/src/user/models/dated-user-achievement.model.ts b/src/user/models/dated-user-achievement.model.ts index 07df1c3..ce6396b 100644 --- a/src/user/models/dated-user-achievement.model.ts +++ b/src/user/models/dated-user-achievement.model.ts @@ -1,3 +1,5 @@ +import type { AchievementType } from "./achievement-type.model"; + export type DatedUserAchievement = { date: string; hardcoreMode: boolean; @@ -14,5 +16,5 @@ export type DatedUserAchievement = { cumulScore: number; badgeUrl: string; gameUrl: string; - type: "progression" | "win_condition" | "missable" | null; + type: AchievementType; }; diff --git a/src/user/models/dated-user-achievements-response.model.ts b/src/user/models/dated-user-achievements-response.model.ts index f464155..f00ce8f 100644 --- a/src/user/models/dated-user-achievements-response.model.ts +++ b/src/user/models/dated-user-achievements-response.model.ts @@ -1,3 +1,5 @@ +import type { AchievementType } from "./achievement-type.model"; + interface DatedUserAchievementResponseEntity { Date: string; HardcoreMode: string; @@ -14,7 +16,7 @@ interface DatedUserAchievementResponseEntity { CumulScore: number; BadgeURL: string; GameURL: string; - Type: "progression" | "win_condition" | "missable" | null; + Type: AchievementType; } export type DatedUserAchievementsResponse = diff --git a/src/user/models/index.ts b/src/user/models/index.ts index b0f5ab6..76add39 100644 --- a/src/user/models/index.ts +++ b/src/user/models/index.ts @@ -1,3 +1,4 @@ +export * from "./achievement-type.model"; export * from "./award-type.model"; export * from "./dated-user-achievement.model"; export * from "./dated-user-achievements-response.model";