package card_info_apple

import (
	"context"
	"kami/api/commonApi"
	"kami/internal/model/entity"
	"kami/internal/service"

	"kami/api/card_info_apple/v1"
)

func (c *ControllerV1) RechargeHistoryList(ctx context.Context, req *v1.RechargeHistoryListReq) (res *v1.RechargeHistoryListRes, err error) {
	rechargeService := service.AppleOrder()
	_, list, err := rechargeService.GetRechargeDetails(ctx, req.OrderNo)
	if err != nil {
		return
	}
	res = &v1.RechargeHistoryListRes{
		CommonDataRes: commonApi.CommonDataRes[entity.V1CardAppleHistoryInfo]{
			List: list,
		},
	}
	return
}
