Skip to content

Commit

Permalink
refactor: make AchievementType a reusable and exported model
Browse files Browse the repository at this point in the history
  • Loading branch information
wescopeland committed Mar 3, 2024
1 parent d9095bf commit 260003d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/user/models/achievement-type.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export type AchievementType =
| "progression"
| "win_condition"
| "missable"
| null;
4 changes: 3 additions & 1 deletion src/user/models/dated-user-achievement.model.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { AchievementType } from "./achievement-type.model";

export type DatedUserAchievement = {
date: string;
hardcoreMode: boolean;
Expand All @@ -14,5 +16,5 @@ export type DatedUserAchievement = {
cumulScore: number;
badgeUrl: string;
gameUrl: string;
type: "progression" | "win_condition" | "missable" | null;
type: AchievementType;
};
4 changes: 3 additions & 1 deletion src/user/models/dated-user-achievements-response.model.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { AchievementType } from "./achievement-type.model";

interface DatedUserAchievementResponseEntity {
Date: string;
HardcoreMode: string;
Expand All @@ -14,7 +16,7 @@ interface DatedUserAchievementResponseEntity {
CumulScore: number;
BadgeURL: string;
GameURL: string;
Type: "progression" | "win_condition" | "missable" | null;
Type: AchievementType;
}

export type DatedUserAchievementsResponse =
Expand Down
1 change: 1 addition & 0 deletions src/user/models/index.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down

0 comments on commit 260003d

Please sign in to comment.