2024-05-21 17:59:04 +00:00
|
|
|
import { WishlistController } from "@spt/controllers/WishlistController";
|
|
|
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
|
|
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
2024-07-05 15:06:43 +01:00
|
|
|
import { IAddToWishlistRequest } from "@spt/models/eft/wishlist/IAddToWishlistRequest";
|
|
|
|
import { IChangeWishlistItemCategoryRequest } from "@spt/models/eft/wishlist/IChangeWishlistItemCategoryRequest";
|
|
|
|
import { IRemoveFromWishlistRequest } from "@spt/models/eft/wishlist/IRemoveFromWishlistRequest";
|
2024-07-23 11:12:53 -04:00
|
|
|
import { inject, injectable } from "tsyringe";
|
2023-03-03 15:23:46 +00:00
|
|
|
|
|
|
|
@injectable()
|
2024-07-23 11:12:53 -04:00
|
|
|
export class WishlistCallbacks {
|
|
|
|
constructor(@inject("WishlistController") protected wishlistController: WishlistController) {}
|
2023-03-03 15:23:46 +00:00
|
|
|
|
2023-07-15 14:49:25 +01:00
|
|
|
/** Handle AddToWishList event */
|
2024-07-05 15:06:43 +01:00
|
|
|
public addToWishlist(
|
|
|
|
pmcData: IPmcData,
|
|
|
|
request: IAddToWishlistRequest,
|
|
|
|
sessionID: string,
|
2024-07-23 11:12:53 -04:00
|
|
|
): IItemEventRouterResponse {
|
2024-07-05 15:06:43 +01:00
|
|
|
return this.wishlistController.addToWishList(pmcData, request, sessionID);
|
2023-03-03 15:23:46 +00:00
|
|
|
}
|
|
|
|
|
2023-07-15 14:49:25 +01:00
|
|
|
/** Handle RemoveFromWishList event */
|
2024-05-17 15:32:41 -04:00
|
|
|
public removeFromWishlist(
|
|
|
|
pmcData: IPmcData,
|
2024-07-05 15:06:43 +01:00
|
|
|
request: IRemoveFromWishlistRequest,
|
|
|
|
sessionID: string,
|
2024-07-23 11:12:53 -04:00
|
|
|
): IItemEventRouterResponse {
|
2024-07-05 15:06:43 +01:00
|
|
|
return this.wishlistController.removeFromWishList(pmcData, request, sessionID);
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Handle ChangeWishlistItemCategory */
|
|
|
|
changeWishlistItemCategory(
|
|
|
|
pmcData: IPmcData,
|
|
|
|
request: IChangeWishlistItemCategoryRequest,
|
2024-05-17 15:32:41 -04:00
|
|
|
sessionID: string,
|
2024-07-23 11:12:53 -04:00
|
|
|
): IItemEventRouterResponse {
|
2024-07-05 15:06:43 +01:00
|
|
|
return this.wishlistController.changeWishlistItemCategory(pmcData, request, sessionID);
|
2023-03-03 15:23:46 +00:00
|
|
|
}
|
2023-11-15 20:35:05 -05:00
|
|
|
}
|