remove IConsumable in favour of ITypeCount

This commit is contained in:
Sainan 2025-03-16 16:06:33 +01:00
parent c3a9b42fa2
commit d16bf5a308
2 changed files with 10 additions and 16 deletions

View File

@ -8,7 +8,6 @@ import { HydratedDocument, Types } from "mongoose";
import { SlotNames, IInventoryChanges, IBinChanges, slotNames } from "@/src/types/purchaseTypes"; import { SlotNames, IInventoryChanges, IBinChanges, slotNames } from "@/src/types/purchaseTypes";
import { import {
IChallengeProgress, IChallengeProgress,
IConsumable,
IFlavourItem, IFlavourItem,
IMiscItem, IMiscItem,
IMission, IMission,
@ -378,7 +377,7 @@ export const addItem = async (
{ {
ItemType: typeName, ItemType: typeName,
ItemCount: quantity ItemCount: quantity
} satisfies IConsumable } satisfies ITypeCount
]; ];
addConsumables(inventory, consumablesChanges); addConsumables(inventory, consumablesChanges);
return { return {
@ -1102,7 +1101,7 @@ export const addMiscItems = (inventory: TInventoryDatabaseDocument, itemsArray:
}); });
}; };
export const addShipDecorations = (inventory: TInventoryDatabaseDocument, itemsArray: IConsumable[]): void => { export const addShipDecorations = (inventory: TInventoryDatabaseDocument, itemsArray: ITypeCount[]): void => {
const { ShipDecorations } = inventory; const { ShipDecorations } = inventory;
itemsArray.forEach(({ ItemCount, ItemType }) => { itemsArray.forEach(({ ItemCount, ItemType }) => {
@ -1116,7 +1115,7 @@ export const addShipDecorations = (inventory: TInventoryDatabaseDocument, itemsA
}); });
}; };
export const addConsumables = (inventory: TInventoryDatabaseDocument, itemsArray: IConsumable[]): void => { export const addConsumables = (inventory: TInventoryDatabaseDocument, itemsArray: ITypeCount[]): void => {
const { Consumables } = inventory; const { Consumables } = inventory;
itemsArray.forEach(({ ItemCount, ItemType }) => { itemsArray.forEach(({ ItemCount, ItemType }) => {

View File

@ -236,8 +236,8 @@ export interface IInventoryClient extends IDailyAffiliations, InventoryClientEqu
FusionTreasures: IFusionTreasure[]; FusionTreasures: IFusionTreasure[];
WebFlags: IWebFlags; WebFlags: IWebFlags;
CompletedAlerts: string[]; CompletedAlerts: string[];
Consumables: IConsumable[]; Consumables: ITypeCount[];
LevelKeys: IConsumable[]; LevelKeys: ITypeCount[];
TauntHistory?: ITaunt[]; TauntHistory?: ITaunt[];
StoryModeChoice: string; StoryModeChoice: string;
PeriodicMissionCompletions: IPeriodicMissionCompletionDatabase[]; PeriodicMissionCompletions: IPeriodicMissionCompletionDatabase[];
@ -265,7 +265,7 @@ export interface IInventoryClient extends IDailyAffiliations, InventoryClientEqu
Drones: IDroneClient[]; Drones: IDroneClient[];
StepSequencers: IStepSequencer[]; StepSequencers: IStepSequencer[];
ActiveAvatarImageType: string; ActiveAvatarImageType: string;
ShipDecorations: IConsumable[]; ShipDecorations: ITypeCount[];
DiscoveredMarkers: IDiscoveredMarker[]; DiscoveredMarkers: IDiscoveredMarker[];
CompletedJobs: ICompletedJob[]; CompletedJobs: ICompletedJob[];
FocusAbility?: string; FocusAbility?: string;
@ -293,7 +293,7 @@ export interface IInventoryClient extends IDailyAffiliations, InventoryClientEqu
Settings: ISettings; Settings: ISettings;
PersonalTechProjects: IPersonalTechProject[]; PersonalTechProjects: IPersonalTechProject[];
PlayerSkills: IPlayerSkills; PlayerSkills: IPlayerSkills;
CrewShipAmmo: IConsumable[]; CrewShipAmmo: ITypeCount[];
CrewShipSalvagedWeaponSkins: IUpgradeClient[]; CrewShipSalvagedWeaponSkins: IUpgradeClient[];
CrewShipWeapons: ICrewShipWeaponClient[]; CrewShipWeapons: ICrewShipWeaponClient[];
CrewShipSalvagedWeapons: IEquipmentClient[]; CrewShipSalvagedWeapons: IEquipmentClient[];
@ -303,7 +303,7 @@ export interface IInventoryClient extends IDailyAffiliations, InventoryClientEqu
SubscribedToEmailsPersonalized: number; SubscribedToEmailsPersonalized: number;
InfestedFoundry?: IInfestedFoundryClient; InfestedFoundry?: IInfestedFoundryClient;
BlessingCooldown?: IMongoDate; BlessingCooldown?: IMongoDate;
CrewShipRawSalvage: IConsumable[]; CrewShipRawSalvage: ITypeCount[];
CrewMembers: ICrewMember[]; CrewMembers: ICrewMember[];
LotusCustomization: ILotusCustomization; LotusCustomization: ILotusCustomization;
UseAdultOperatorLoadout?: boolean; UseAdultOperatorLoadout?: boolean;
@ -417,11 +417,6 @@ export interface ICompletedJob {
StageCompletions: number[]; StageCompletions: number[];
} }
export interface IConsumable {
ItemCount: number;
ItemType: string;
}
export interface ICrewMember { export interface ICrewMember {
ItemType: string; ItemType: string;
NemesisFingerprint: number; NemesisFingerprint: number;
@ -891,7 +886,7 @@ export enum GettingSlotOrderInfo {
} }
export interface IGiving { export interface IGiving {
RawUpgrades: IConsumable[]; RawUpgrades: ITypeCount[];
_SlotOrderInfo: GivingSlotOrderInfo[]; _SlotOrderInfo: GivingSlotOrderInfo[];
} }
@ -924,7 +919,7 @@ export interface IPersonalTechProject {
State: number; State: number;
ReqCredits: number; ReqCredits: number;
ItemType: string; ItemType: string;
ReqItems: IConsumable[]; ReqItems: ITypeCount[];
CompletionDate?: IMongoDate; CompletionDate?: IMongoDate;
ItemId: IOid; ItemId: IOid;
ProductCategory?: string; ProductCategory?: string;