import {ApiCall} from "tsrpc";
import {ReqOpen, ResOpen} from "../../../shared/protocols/event/yuandan/PtlOpen";
import {HuoDongFun} from "../../../public/huodongfun";
import {PayFun} from "../../../public/pay";
import {Yuandanfun} from "./fun";

export default async function (call: ApiCall<ReqOpen, ResOpen>) {
    let _hd = await Yuandanfun.getCon(call)

    let payIds = _hd.data.gift.filter(i => i.payid).map(i => i.payid)

    call.succ({
        data: await Yuandanfun.getData(call, _hd.hdid),
        payLog: await PayFun.getPayLogs(call.uid, payIds)
    })
}