From c7f818bf34d4c74ccbd51ab369b7d570f4692cc6 Mon Sep 17 00:00:00 2001 From: Sainan Date: Sat, 29 Jun 2024 09:15:59 +0200 Subject: [PATCH 1/2] feat: track LastRegionPlayed --- src/services/inventoryService.ts | 5 +++++ src/types/inventoryTypes/inventoryTypes.ts | 4 +++- src/types/requestTypes.ts | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index d5a4edb9..5fe79dda 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -669,6 +669,11 @@ export const missionInventoryUpdate = async (data: IMissionInventoryUpdateReques } } + // LastRegionPlayed + if (data.LastRegionPlayed) { + inventory.LastRegionPlayed = data.LastRegionPlayed; + } + // other addMods(inventory, RawUpgrades); addMiscItems(inventory, MiscItems); diff --git a/src/types/inventoryTypes/inventoryTypes.ts b/src/types/inventoryTypes/inventoryTypes.ts index f0ad1ec9..8bf0b48e 100644 --- a/src/types/inventoryTypes/inventoryTypes.ts +++ b/src/types/inventoryTypes/inventoryTypes.ts @@ -86,6 +86,8 @@ export interface IMailbox { LastInboxId: IOid; } +export type TSolarMapRegion = "Earth" | "Ceres" | "Eris" | "Europa" | "Jupiter" | "Mars" | "Mercury" | "Neptune" | "Phobos" | "Pluto" | "Saturn" | "Sedna" | "Uranus" | "Venus" | "Void" | "SolarMapDeimosName"; + //TODO: perhaps split response and database into their own files export interface IPendingRecipeResponse extends Omit { @@ -142,7 +144,7 @@ export interface IInventoryResponse { CurrentLoadOutIds: Array; Missions: IMission[]; RandomUpgradesIdentified?: number; - LastRegionPlayed: string; + LastRegionPlayed: TSolarMapRegion; XPInfo: ITypeXPItem[]; Recipes: ITypeCount[]; WeaponSkins: IWeaponSkinClient[]; diff --git a/src/types/requestTypes.ts b/src/types/requestTypes.ts index 3fc4c0f6..361f347f 100644 --- a/src/types/requestTypes.ts +++ b/src/types/requestTypes.ts @@ -11,6 +11,7 @@ import { IMission, IRawUpgrade, ISeasonChallenge, + TSolarMapRegion, TEquipmentKey } from "./inventoryTypes/inventoryTypes"; @@ -57,6 +58,7 @@ export interface IMissionInventoryUpdateRequest { RewardInfo?: IMissionInventoryUpdateRequestRewardInfo; Missions?: IMission; EvolutionProgress?: IEvolutionProgress[]; + LastRegionPlayed?: TSolarMapRegion; FusionPoints?: number; // Not a part of the request, but we put it in this struct as an intermediate storage. } -- 2.47.2 From f0944412e7e72523069941b04ed2399d91bade60 Mon Sep 17 00:00:00 2001 From: Sainan Date: Sat, 29 Jun 2024 07:16:22 +0000 Subject: [PATCH 2/2] Apply prettier changes --- src/types/inventoryTypes/inventoryTypes.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/types/inventoryTypes/inventoryTypes.ts b/src/types/inventoryTypes/inventoryTypes.ts index 8bf0b48e..7242ad2e 100644 --- a/src/types/inventoryTypes/inventoryTypes.ts +++ b/src/types/inventoryTypes/inventoryTypes.ts @@ -86,7 +86,23 @@ export interface IMailbox { LastInboxId: IOid; } -export type TSolarMapRegion = "Earth" | "Ceres" | "Eris" | "Europa" | "Jupiter" | "Mars" | "Mercury" | "Neptune" | "Phobos" | "Pluto" | "Saturn" | "Sedna" | "Uranus" | "Venus" | "Void" | "SolarMapDeimosName"; +export type TSolarMapRegion = + | "Earth" + | "Ceres" + | "Eris" + | "Europa" + | "Jupiter" + | "Mars" + | "Mercury" + | "Neptune" + | "Phobos" + | "Pluto" + | "Saturn" + | "Sedna" + | "Uranus" + | "Venus" + | "Void" + | "SolarMapDeimosName"; //TODO: perhaps split response and database into their own files -- 2.47.2