package com.yc.ship.module.marketing.api.coupon;

import com.yc.ship.framework.common.pojo.CommonResult;
import com.yc.ship.module.marketing.api.coupon.dto.CouponCheckReqDto;
import com.yc.ship.module.marketing.api.coupon.dto.CouponRespDto;
import com.yc.ship.module.marketing.api.coupon.dto.CouponUseReqDto;
import com.yc.ship.module.marketing.api.coupon.dto.CouponUsedRespDto;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;

import javax.validation.Valid;

@Tag(name = "RPC 服务 - 优惠券")
public interface CouponApi {


    @Operation(summary = "检查优惠券并返回优惠券信息")
    CommonResult<CouponRespDto> checkCoupon(@Valid CouponCheckReqDto reqDto);

    @Operation(summary = "使用优惠券")
    CommonResult<Boolean> useCoupon(@Valid CouponUseReqDto reqDto);

    //退还优惠券
    @Operation(summary = "退还优惠券，在订单全部退款或者取消后退还优惠券")
    @Parameter(name = "orderId", description = "订单ID", required = true)
    CommonResult<Boolean> refundCoupon(Long orderId);

    //获取优惠券
    @Operation(summary = "获取使用的优惠券")
    @Parameter(name = "orderId", description = "订单ID", required = true)
    CommonResult<CouponUsedRespDto> getUsedCoupon(Long orderId);
}
