package com.ai.da.service;

import com.ai.da.mapper.primary.entity.ProductCoupons;
import com.ai.da.mapper.primary.entity.SubscriptionInfo;
import com.ai.da.model.dto.CreateCouponDTO;
import com.ai.da.model.dto.ProductPurchaseDTO;
import com.ai.da.model.dto.QueryCouponsPageDTO;
import com.ai.da.model.vo.CheckCouponsVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.stripe.exception.StripeException;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

public interface StripeService {

    String pay(ProductPurchaseDTO productPurchaseDTO, HttpServletRequest request);

    Boolean notify(HttpServletRequest request);

    SubscriptionInfo getLatestSubscriptionInfoByAccountId(Long accountId);

    String refund(String amount, String orderId, String reason);

    void checkOrderStatus(String orderNo);

    List<String> getSubscriptionIds(String name, String userEmail) throws StripeException;

    Map<String, String> getPaymentMethodByInvoiceId(String invoiceId);

    void cancelSubscription(String orderNo, String cancelReason);

    void cancelSubscriptionTemp(String subscriptionId);

    Map<String, String> getPaymentMethod(String paymentMethodId);

    boolean sendEmail(String subscriptionId, String type, String orderNo);

    String getLanguage(String language, String country, String type);

    /*void updateSubscription(String subscriptionId);

    void resume(String subscriptionId);*/

//    void subscriptionReminder();

    void checkSubscriptionExpiration();

    String createSubscriptionTemp(String name, String email);

    String changeCustomerPayment(String name, String email);

    boolean sendRenewalFailEmail(String invoiceId, String subscriptionId, String orderNo);

    List<Map<String,String>> getCustomerPaymentMethod(String name, String email);

    String detachCustomerAllPaymentMethod(String name, String email);

//    Map getIp(HttpServletRequest request);

    String getStackTrace(Exception e, int maxLines);

    String createCoupon(CreateCouponDTO createCouponDTO);

    CheckCouponsVO checkProductCoupon(String promotionCode, Long price);

    ProductCoupons updateCouponsInfo(Long id, String paidCommission, String cooperator, String remark, Long startTime);

    ProductCoupons getProductCoupon(String promotionCode, String promotionCodeId);

    String retrieveCoupon(String couponId);

    String retrievePromotionCode(String promotionCode);

    IPage<ProductCoupons> getAllCoupons(QueryCouponsPageDTO queryCouponsPageDTO);

    void deleteCoupon(Long id);
}
