From 394dc4c3043115613109f9b38e86f08355e33d41 Mon Sep 17 00:00:00 2001 From: Sainan Date: Sun, 19 Jan 2025 17:05:58 +0100 Subject: [PATCH] rename IInventoryResponse to IInventoryClient --- src/controllers/api/inventoryController.ts | 4 ++-- src/controllers/custom/importController.ts | 4 ++-- src/models/inventoryModels/inventoryModel.ts | 4 ++-- src/services/importService.ts | 4 ++-- src/types/inventoryTypes/inventoryTypes.ts | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/controllers/api/inventoryController.ts b/src/controllers/api/inventoryController.ts index 5b143728..0b495ed6 100644 --- a/src/controllers/api/inventoryController.ts +++ b/src/controllers/api/inventoryController.ts @@ -4,7 +4,7 @@ import { Inventory } from "@/src/models/inventoryModels/inventoryModel"; import { config } from "@/src/services/configService"; import allDialogue from "@/static/fixed_responses/allDialogue.json"; import { ILoadoutDatabase } from "@/src/types/saveLoadoutTypes"; -import { IInventoryResponse, IShipInventory, equipmentKeys } from "@/src/types/inventoryTypes/inventoryTypes"; +import { IInventoryClient, IShipInventory, equipmentKeys } from "@/src/types/inventoryTypes/inventoryTypes"; import { IPolarity, ArtifactPolarity, EquipmentFeatures } from "@/src/types/inventoryTypes/commonInventoryTypes"; import { ExportCustoms, @@ -55,7 +55,7 @@ export const inventoryController: RequestHandler = async (request, response) => const inventoryWithLoadOutPresetsAndShips = await inventoryWithLoadOutPresets.populate<{ Ships: IShipInventory }>( "Ships" ); - const inventoryResponse = inventoryWithLoadOutPresetsAndShips.toJSON(); + const inventoryResponse = inventoryWithLoadOutPresetsAndShips.toJSON(); if (config.infiniteCredits) { inventoryResponse.RegularCredits = 999999999; diff --git a/src/controllers/custom/importController.ts b/src/controllers/custom/importController.ts index c1511444..d61eea04 100644 --- a/src/controllers/custom/importController.ts +++ b/src/controllers/custom/importController.ts @@ -1,7 +1,7 @@ import { importInventory } from "@/src/services/importService"; import { getInventory } from "@/src/services/inventoryService"; import { getAccountIdForRequest } from "@/src/services/loginService"; -import { IInventoryResponse } from "@/src/types/inventoryTypes/inventoryTypes"; +import { IInventoryClient } from "@/src/types/inventoryTypes/inventoryTypes"; import { RequestHandler } from "express"; export const importController: RequestHandler = async (req, res) => { @@ -13,5 +13,5 @@ export const importController: RequestHandler = async (req, res) => { }; interface IImportRequest { - inventory: IInventoryResponse; + inventory: IInventoryClient; } diff --git a/src/models/inventoryModels/inventoryModel.ts b/src/models/inventoryModels/inventoryModel.ts index d3b6b33b..80486a9c 100644 --- a/src/models/inventoryModels/inventoryModel.ts +++ b/src/models/inventoryModels/inventoryModel.ts @@ -6,7 +6,7 @@ import { IMiscItem, IInventoryDatabase, IBooster, - IInventoryResponse, + IInventoryClient, ISlots, IMailbox, IDuviriInfo, @@ -1142,7 +1142,7 @@ inventorySchema.set("toJSON", { delete returnedObject.accountOwnerId; const inventoryDatabase = returnedObject as IInventoryDatabase; - const inventoryResponse = returnedObject as IInventoryResponse; + const inventoryResponse = returnedObject as IInventoryClient; inventoryResponse.TrainingDate = toMongoDate(inventoryDatabase.TrainingDate); inventoryResponse.Created = toMongoDate(inventoryDatabase.Created); diff --git a/src/services/importService.ts b/src/services/importService.ts index d5f4fffc..2afa5313 100644 --- a/src/services/importService.ts +++ b/src/services/importService.ts @@ -3,7 +3,7 @@ import { Types } from "mongoose"; import { IEquipmentClient, IEquipmentDatabase } from "../types/inventoryTypes/commonInventoryTypes"; import { IMongoDate } from "../types/commonTypes"; -import { IInventoryResponse, IWeaponSkinClient, IWeaponSkinDatabase } from "../types/inventoryTypes/inventoryTypes"; +import { IInventoryClient, IWeaponSkinClient, IWeaponSkinDatabase } from "../types/inventoryTypes/inventoryTypes"; import { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel"; const convertDate = (value: IMongoDate): Date => { @@ -40,7 +40,7 @@ const replaceArray = (arr: T[], replacement: T[]): void => { }); }; -export const importInventory = (db: TInventoryDatabaseDocument, client: IInventoryResponse): void => { +export const importInventory = (db: TInventoryDatabaseDocument, client: IInventoryClient): void => { replaceArray(db.Suits, client.Suits.map(convertEquipment)); replaceArray(db.WeaponSkins, client.WeaponSkins.map(convertWeaponSkin)); }; diff --git a/src/types/inventoryTypes/inventoryTypes.ts b/src/types/inventoryTypes/inventoryTypes.ts index c1685b2f..34185a27 100644 --- a/src/types/inventoryTypes/inventoryTypes.ts +++ b/src/types/inventoryTypes/inventoryTypes.ts @@ -13,7 +13,7 @@ import { export interface IInventoryDatabase extends Omit< - IInventoryResponse, + IInventoryClient, | "TrainingDate" | "LoadOutPresets" | "Mailbox" @@ -129,7 +129,7 @@ export interface IDailyAffiliations { DailyAffiliationHex: number; } -export interface IInventoryResponse extends IDailyAffiliations { +export interface IInventoryClient extends IDailyAffiliations { Horses: IEquipmentDatabase[]; DrifterMelee: IEquipmentDatabase[]; DrifterGuns: IEquipmentDatabase[];