rename IInventoryResponse to IInventoryClient
This commit is contained in:
parent
79cf50b9ae
commit
394dc4c304
@ -4,7 +4,7 @@ import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
|
|||||||
import { config } from "@/src/services/configService";
|
import { config } from "@/src/services/configService";
|
||||||
import allDialogue from "@/static/fixed_responses/allDialogue.json";
|
import allDialogue from "@/static/fixed_responses/allDialogue.json";
|
||||||
import { ILoadoutDatabase } from "@/src/types/saveLoadoutTypes";
|
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 { IPolarity, ArtifactPolarity, EquipmentFeatures } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import {
|
import {
|
||||||
ExportCustoms,
|
ExportCustoms,
|
||||||
@ -55,7 +55,7 @@ export const inventoryController: RequestHandler = async (request, response) =>
|
|||||||
const inventoryWithLoadOutPresetsAndShips = await inventoryWithLoadOutPresets.populate<{ Ships: IShipInventory }>(
|
const inventoryWithLoadOutPresetsAndShips = await inventoryWithLoadOutPresets.populate<{ Ships: IShipInventory }>(
|
||||||
"Ships"
|
"Ships"
|
||||||
);
|
);
|
||||||
const inventoryResponse = inventoryWithLoadOutPresetsAndShips.toJSON<IInventoryResponse>();
|
const inventoryResponse = inventoryWithLoadOutPresetsAndShips.toJSON<IInventoryClient>();
|
||||||
|
|
||||||
if (config.infiniteCredits) {
|
if (config.infiniteCredits) {
|
||||||
inventoryResponse.RegularCredits = 999999999;
|
inventoryResponse.RegularCredits = 999999999;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { importInventory } from "@/src/services/importService";
|
import { importInventory } from "@/src/services/importService";
|
||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { IInventoryResponse } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { IInventoryClient } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
export const importController: RequestHandler = async (req, res) => {
|
export const importController: RequestHandler = async (req, res) => {
|
||||||
@ -13,5 +13,5 @@ export const importController: RequestHandler = async (req, res) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
interface IImportRequest {
|
interface IImportRequest {
|
||||||
inventory: IInventoryResponse;
|
inventory: IInventoryClient;
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import {
|
|||||||
IMiscItem,
|
IMiscItem,
|
||||||
IInventoryDatabase,
|
IInventoryDatabase,
|
||||||
IBooster,
|
IBooster,
|
||||||
IInventoryResponse,
|
IInventoryClient,
|
||||||
ISlots,
|
ISlots,
|
||||||
IMailbox,
|
IMailbox,
|
||||||
IDuviriInfo,
|
IDuviriInfo,
|
||||||
@ -1142,7 +1142,7 @@ inventorySchema.set("toJSON", {
|
|||||||
delete returnedObject.accountOwnerId;
|
delete returnedObject.accountOwnerId;
|
||||||
|
|
||||||
const inventoryDatabase = returnedObject as IInventoryDatabase;
|
const inventoryDatabase = returnedObject as IInventoryDatabase;
|
||||||
const inventoryResponse = returnedObject as IInventoryResponse;
|
const inventoryResponse = returnedObject as IInventoryClient;
|
||||||
|
|
||||||
inventoryResponse.TrainingDate = toMongoDate(inventoryDatabase.TrainingDate);
|
inventoryResponse.TrainingDate = toMongoDate(inventoryDatabase.TrainingDate);
|
||||||
inventoryResponse.Created = toMongoDate(inventoryDatabase.Created);
|
inventoryResponse.Created = toMongoDate(inventoryDatabase.Created);
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { IEquipmentClient, IEquipmentDatabase } from "../types/inventoryTypes/commonInventoryTypes";
|
import { IEquipmentClient, IEquipmentDatabase } from "../types/inventoryTypes/commonInventoryTypes";
|
||||||
import { IMongoDate } from "../types/commonTypes";
|
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";
|
import { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel";
|
||||||
|
|
||||||
const convertDate = (value: IMongoDate): Date => {
|
const convertDate = (value: IMongoDate): Date => {
|
||||||
@ -40,7 +40,7 @@ const replaceArray = <T>(arr: T[], replacement: T[]): void => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const importInventory = (db: TInventoryDatabaseDocument, client: IInventoryResponse): void => {
|
export const importInventory = (db: TInventoryDatabaseDocument, client: IInventoryClient): void => {
|
||||||
replaceArray<IEquipmentDatabase>(db.Suits, client.Suits.map(convertEquipment));
|
replaceArray<IEquipmentDatabase>(db.Suits, client.Suits.map(convertEquipment));
|
||||||
replaceArray<IWeaponSkinDatabase>(db.WeaponSkins, client.WeaponSkins.map(convertWeaponSkin));
|
replaceArray<IWeaponSkinDatabase>(db.WeaponSkins, client.WeaponSkins.map(convertWeaponSkin));
|
||||||
};
|
};
|
||||||
|
@ -13,7 +13,7 @@ import {
|
|||||||
|
|
||||||
export interface IInventoryDatabase
|
export interface IInventoryDatabase
|
||||||
extends Omit<
|
extends Omit<
|
||||||
IInventoryResponse,
|
IInventoryClient,
|
||||||
| "TrainingDate"
|
| "TrainingDate"
|
||||||
| "LoadOutPresets"
|
| "LoadOutPresets"
|
||||||
| "Mailbox"
|
| "Mailbox"
|
||||||
@ -129,7 +129,7 @@ export interface IDailyAffiliations {
|
|||||||
DailyAffiliationHex: number;
|
DailyAffiliationHex: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IInventoryResponse extends IDailyAffiliations {
|
export interface IInventoryClient extends IDailyAffiliations {
|
||||||
Horses: IEquipmentDatabase[];
|
Horses: IEquipmentDatabase[];
|
||||||
DrifterMelee: IEquipmentDatabase[];
|
DrifterMelee: IEquipmentDatabase[];
|
||||||
DrifterGuns: IEquipmentDatabase[];
|
DrifterGuns: IEquipmentDatabase[];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user