feat: handle acquisition of EmailItems
All checks were successful
Build / build (18) (push) Successful in 52s
Build / build (22) (push) Successful in 1m0s
Build / build (20) (push) Successful in 58s
Build / build (18) (pull_request) Successful in 52s
Build / build (20) (pull_request) Successful in 54s
Build / build (22) (pull_request) Successful in 57s
All checks were successful
Build / build (18) (push) Successful in 52s
Build / build (22) (push) Successful in 1m0s
Build / build (20) (push) Successful in 58s
Build / build (18) (pull_request) Successful in 52s
Build / build (20) (pull_request) Successful in 54s
Build / build (22) (pull_request) Successful in 57s
This commit is contained in:
parent
839ddd6a40
commit
60cae3d5de
@ -35,7 +35,7 @@ import {
|
||||
IUpdateChallengeProgressRequest
|
||||
} from "../types/requestTypes";
|
||||
import { logger } from "@/src/utils/logger";
|
||||
import { getExalted, getKeyChainItems } from "@/src/services/itemDataService";
|
||||
import { convertInboxMessage, getExalted, getKeyChainItems } from "@/src/services/itemDataService";
|
||||
import {
|
||||
EquipmentFeatures,
|
||||
IEquipmentClient,
|
||||
@ -47,6 +47,7 @@ import {
|
||||
ExportBundles,
|
||||
ExportCustoms,
|
||||
ExportDrones,
|
||||
ExportEmailItems,
|
||||
ExportEnemies,
|
||||
ExportFlavour,
|
||||
ExportFusionBundles,
|
||||
@ -71,6 +72,7 @@ import { addQuestKey, completeQuest } from "@/src/services/questService";
|
||||
import { handleBundleAcqusition } from "./purchaseService";
|
||||
import libraryDailyTasks from "@/static/fixed_responses/libraryDailyTasks.json";
|
||||
import { getRandomElement, getRandomInt } from "./rngService";
|
||||
import { createMessage } from "./inboxService";
|
||||
|
||||
export const createInventory = async (
|
||||
accountOwnerId: Types.ObjectId,
|
||||
@ -425,6 +427,13 @@ export const addItem = async (
|
||||
InventoryChanges: inventoryChanges
|
||||
};
|
||||
}
|
||||
if (typeName in ExportEmailItems) {
|
||||
const emailItem = ExportEmailItems[typeName];
|
||||
await createMessage(inventory.accountOwnerId.toString(), [convertInboxMessage(emailItem.message)]);
|
||||
return {
|
||||
InventoryChanges: {}
|
||||
};
|
||||
}
|
||||
|
||||
// Path-based duck typing
|
||||
switch (typeName.substr(1).split("/")[1]) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user