Server/project/src/callbacks/RepairCallbacks.ts
Alex d13e86ba46 Rebranding to SPT (!345)
Rebranded src code and scripts to SPT

Co-authored-by: clodan <clodan@clodan.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/345
Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com>
Co-committed-by: Alex <clodan@noreply.dev.sp-tarkov.com>
2024-05-21 17:59:04 +00:00

48 lines
1.6 KiB
TypeScript

import { inject, injectable } from "tsyringe";
import { RepairController } from "@spt/controllers/RepairController";
import { IPmcData } from "@spt/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
import { IRepairActionDataRequest } from "@spt/models/eft/repair/IRepairActionDataRequest";
import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRepairActionDataRequest";
@injectable()
export class RepairCallbacks
{
constructor(@inject("RepairController") protected repairController: RepairController)
{}
/**
* Handle TraderRepair event
* use trader to repair item
* @param pmcData Player profile
* @param traderRepairRequest Request object
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
public traderRepair(
pmcData: IPmcData,
traderRepairRequest: ITraderRepairActionDataRequest,
sessionID: string,
): IItemEventRouterResponse
{
return this.repairController.traderRepair(sessionID, traderRepairRequest, pmcData);
}
/**
* Handle Repair event
* Use repair kit to repair item
* @param pmcData Player profile
* @param repairRequest Request object
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
public repair(
pmcData: IPmcData,
repairRequest: IRepairActionDataRequest,
sessionID: string,
): IItemEventRouterResponse
{
return this.repairController.repairWithKit(sessionID, repairRequest, pmcData);
}
}