package com.jeesharp.business.modules.coupon.application.api;

import com.jeesharp.business.modules.coupon.api.MemberCouponMobileApi;
import com.jeesharp.business.modules.coupon.application.MemberCouponApplicationService;
import com.jeesharp.business.modules.coupon.dto.CouponCheckoutContextDTO;
import com.jeesharp.business.modules.coupon.entity.MemberCoupon;
import com.jeesharp.business.modules.coupon.vo.CouponCheckoutListVO;
import com.jeesharp.business.modules.coupon.vo.CouponDemoVO;
import com.jeesharp.business.modules.coupon.vo.CouponTemplateQueryVO;
import com.jeesharp.business.modules.coupon.vo.MemberCouponInfoVO;
import com.jeesharp.business.modules.coupon.vo.MemberCouponListVO;
import com.jeesharp.business.modules.coupon.vo.MemberCouponQueryVO;
import com.jeesharp.framework.pojo.Page;
import com.jeesharp.framework.pojo.query.PageRespVO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * {@link MemberCouponMobileApi} 实现，委托 {@link MemberCouponApplicationService}。
 *
 * @author jeesharp
 * @since 2026-06-08
 */
@Service
@AllArgsConstructor
public class MemberCouponMobileApiImpl implements MemberCouponMobileApi {

    private final MemberCouponApplicationService memberCouponApplicationService;

    @Override
    public PageRespVO<CouponDemoVO> pageTemplateDemos(String memberId, CouponTemplateQueryVO pageParam) {
        return memberCouponApplicationService.pageTemplateDemos(memberId, pageParam);
    }

    @Override
    public List<CouponDemoVO> listPublishedTemplatesForDemo(String memberId) {
        return memberCouponApplicationService.listPublishedTemplatesForDemo(memberId);
    }

    @Override
    public CouponDemoVO getTemplateDemo(String templateId, String memberId) {
        return memberCouponApplicationService.getTemplateDemo(templateId, memberId);
    }

    @Override
    public CouponDemoVO getMemberCouponDemo(String memberCouponId, String memberId) {
        return memberCouponApplicationService.getMemberCouponDemo(memberCouponId, memberId);
    }

    @Override
    public PageRespVO<MemberCouponListVO> pageMyCoupons(String memberId, Page<MemberCoupon> page, MemberCouponQueryVO query) {
        return memberCouponApplicationService.pageMyCoupons(memberId, page, query);
    }

    @Override
    public MemberCouponInfoVO getMemberCouponInfo(String memberId, String couponId) {
        return memberCouponApplicationService.getMemberCouponInfo(memberId, couponId);
    }

    @Override
    public Map<String, Object> receiveManual(String memberId, String templateId) {
        return memberCouponApplicationService.receiveManual(memberId, templateId);
    }

    @Override
    public Map<String, Object> exchangeByPoints(String memberId, String templateId) {
        return memberCouponApplicationService.exchangeByPoints(memberId, templateId);
    }

    @Override
    public CouponCheckoutListVO usableForCheckout(CouponCheckoutContextDTO context) {
        return memberCouponApplicationService.usableForCheckout(context);
    }

    @Override
    public PageRespVO<CouponDemoVO> pageStoreOfflineTemplates(String memberId, String tenantId, CouponTemplateQueryVO pageParam) {
        return memberCouponApplicationService.pageStoreOfflineTemplates(memberId, tenantId, pageParam);
    }

    @Override
    public Map<String, Object> receiveStoreOfflineCoupon(String memberId, String tenantId, String templateId) {
        return memberCouponApplicationService.receiveStoreOfflineCoupon(memberId, tenantId, templateId);
    }

    @Override
    public PageRespVO<MemberCouponListVO> pageStoreOfflineMyCoupons(String memberId, String tenantId, Page<MemberCoupon> page, MemberCouponQueryVO query) {
        return memberCouponApplicationService.pageStoreOfflineMyCoupons(memberId, tenantId, page, query);
    }

    @Override
    public MemberCouponInfoVO getStoreOfflineMemberCouponInfo(String memberId, String tenantId, String memberCouponId) {
        return memberCouponApplicationService.getStoreOfflineMemberCouponInfo(memberId, tenantId, memberCouponId);
    }

    @Override
    public CouponDemoVO getStoreOfflineMemberCouponDemo(String memberId, String tenantId, String memberCouponId) {
        return memberCouponApplicationService.getStoreOfflineMemberCouponDemo(memberId, tenantId, memberCouponId);
    }
}
