package com.style24.core.biz.dao;

import com.style24.core.support.annotation.ShopDs;
import com.style24.persistence.domain.*;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.Collection;

/**
 * 쿠폰 DAO
 * @author bin2107
 * @since  2021-02-09
 */
@ShopDs
@Repository
public interface TscCouponDao {
    /**
     * 쿠폰 리스트 조회
     * @param  param
     * @return ArrayList<Coupon>
     * @author xyzp1539
     * @since 2020-12-22
     */
    ArrayList<Coupon> getCouponList(Coupon param);

    /**
     * 쿠폰 리스트 카운트 조회
     * @param  param
     * @return int
     * @author xyzp1539
     * @since 2020-12-22
     */
    int getCouponListCnt(Coupon param);

    /**
     * 쿠폰 발급개수 조회
     * @param  cpnId
     * @return int
     * @author xyzp1539
     * @since 2021-01-15
     */
    int getCouponIssueCnt(int cpnId);

    /**
     * 쿠폰 상세 조회
     * @param  cpnId
     * @return Coupon
     * @author xyzp1539
     * @since 2021-01-15
     */
    Coupon getCouponDetail(int cpnId);

    /**
     * 쿠폰 적용 대상 - 공급처
     * @param cpnRefval
     * @return Coupon
     * @author xyzp1539
     * @since 2021-01-18
     */
    ArrayList<CouponRefval> getCouponRefvalSupplyCompList(CouponRefval cpnRefval);

    /**
     * 쿠폰 적용 대상 - 적용/제외상품
     * @param  cpnRefval
     * @return Coupon
     * @author xyzp1539
     * @since 2021-01-18
     */
    ArrayList<CouponRefval> getCouponRefvalGoodsList(CouponRefval cpnRefval);

    /**
     * 쿠폰 적용 대상 - 카테고리
     * @param cpnRefval
     * @return Coupon
     * @author xyzp1539
     * @since 2021-01-18
     */
    ArrayList<CouponRefval> getCouponRefvalCategoryList(CouponRefval cpnRefval);

    /**
     * 쿠폰 적용 대상 - 브랜드
     * @param cpnRefval
     * @return Coupon
     * @author xyzp1539
     * @since 2021-01-18
     */
    ArrayList<CouponRefval> getCouponRefvalBrandList(CouponRefval cpnRefval);

    /**
     * 쿠폰 입점업쳅 분담율 조회
     * @param cpnId
     * @return  Coupon
     * @author xyzp1539
     * @since 2021-01-18
     */
    ArrayList<Coupon> getCouponBurdenList(int cpnId);

    /**
     * 동일 쿠폰명이 존재하는지 확인
     * @param cpnId
     * @author xodud1202
     * @since 2021. 01. 26
     */
    ArrayList<CustCoupon> getRandomCouponInfo(int cpnId);

    /**
     * 쿠폰사용가능고객구분 조회
     * @param cpnId
     * @author bin2107
     * @since 2021. 02. 02
     */
    ArrayList<Coupon> getCouponCustGbList(int cpnId);

    /**
     * 쿠폰사용가능고객등급 조회
     * @param cpnId
     * @author bin2107
     * @since 2021. 02. 02
     */
    ArrayList<Coupon> getCouponCustGradeList(int cpnId);

    /**
     * 쿠폰사용가능결제수단 조회
     * @param cpnId
     * @author bin2107
     * @since 2021. 02. 02
     */
    ArrayList<Coupon> getCouponPayTypeList(int cpnId);

    /**
     * 선착순쿠폰 조회
     * @param cpnId
     * @author bin2107
     * @since 2021. 02. 05
     */
    ArrayList<Coupon> getLimitedTimeCouponList(int cpnId);

    /**
     * 쿠폰 제휴채널 조회
     * @param cpnId
     * @author bin2107
     * @since 2021. 04. 22
     */
    ArrayList<Coupon> getCouponAfChannelList(int cpnId);
    
    /**
     * 공급업체목록으로 브랜정보목록 조회
     * @param Coupon
     * @author jsh77b
     * @since 2021. 08. 23
     */
    ArrayList<Coupon> getSupplyCompCdAndBrandCdList(Coupon coupon);
    
    /**
     * 브랜드목록으로 공급업체정보목록 조회
     * @param Coupon
     * @author jsh77b
     * @since 2021. 08. 23
     */
    ArrayList<Coupon> getBrandCdAndSupplyCompList(Coupon coupon);

    /**
     * 쿠폰 마스터 수정
     * @param
     * @author bin2107
     * @since 2021. 2. 5
     */
    void updateCouponMstInfo(Coupon coupon);

    /**
     * 쿠폰 회원 구분 수정
     * @param
     * @author bin2107
     * @since 2021. 2. 5
     */
    void deleteCouponCustGubun(Coupon coupon);

    /**
     * 쿠폰 회원 등급 수정
     * @param
     * @author bin2107
     * @since 2021. 2. 5
     */
    void deleteCouponCustGrade(Coupon coupon);

    /**
     * 쿠폰 회원 결제 수정
     * @param
     * @author bin2107
     * @since 2021. 2. 5
     */
    void deleteCouponPayType(Coupon coupon);

    /**
     * 쿠폰 공급업체,브랜드,상품값 수정
     * @param
     * @author bin2107
     * @since 2021. 2. 5
     */
    void deleteCouponRefVal(Coupon coupon);

    /**
     * 쿠폰  입점업체 분담율 수정
     * @param
     * @author bin2107
     * @since 2021. 2. 5
     */
    void deleteCouponBurden(Coupon coupon);

    /**
     * 선착순 쿠폰 삭제
     * @param
     * @author bin2107
     * @since 2021. 2. 5
     */
    void deleteLimitedTimeCoupon(Coupon coupon);

    /**
     * 쿠폰 제휴링크 삭제
     * @param
     * @author bin2107
     * @since 2021. 4. 22
     */
    void deleteCouponAfChannel(Coupon coupon);

    /**
     * 쿠폰 등록
     * @param params
     * @author xyzp1539
     * @since  2021-01-12
     */
    void couponInsert(Coupon params);

    /**
     * 쿠폰사용가능고객등급
     * @param params
     * @author bin2107
     * @since 2021. 02. 02
     */
    void createCouponCustGubun(Coupon params);

    /**
     * 쿠폰사용가능고객등급
     * @param params
     * @author bin2107
     * @since 2021. 02. 02
     */
    void createCouponCustGrade(Coupon params);

    /**
     * 쿠폰사용가능결제수단
     * @param params
     * @author bin2107
     * @since 2021. 02. 02
     */
    void createCouponPayType(Coupon params);

    /**
     * 쿠폰 적용대상 등록
     * @param supplyComp
     * @author xyzp1539
     * @since  2021-01-14
     */
    void saveCouponRefVal(CouponRefval supplyComp);

    /**
     * 쿠폰 입점업체 분담 등록
     * @param burden
     * @author xyzp1539
     * @since  2021-01-14
     */
    void saveCouponBurden(CouponBurden burden);

    /**
     * 선착순 쿠폰 저장
     * @param couponLimitedTime
     * @author bin2107
     * @since 2021. 02. 04
     */
    void createLimitedTimeCoupon(CouponLimitedTime couponLimitedTime);

    /**
     * 쿠폰 제휴링크 저장
     * @param couponLimitedTime
     * @author bin2107
     * @since 2021. 04. 22
     */
    void createCouponAfChannel(CouponAfChannel couponAfChannel);

    /**
     * 특정 쿠폰 발급받은 고객 조회
     * @param  custCoupon
     * @return
     * @author xyzp1539
     * @since 2021-01-21
     */
    ArrayList<CustCoupon> getCouponIssueCustList(CustCoupon custCoupon);

    /**
     * 발급받은 쿠폰 유효기간 변경
     * @param
     * @return
     * @author xyzp1539
     * @since 2021-01-21
     */
    void updateCustCouponAvailEddt(CustCoupon issueCust);

    /**
     * 동일 쿠폰명이 같은 기간에 존재하는지 확인
     * @param param
     * @author xodud1202
     * @since 2021. 01. 26
     */
    int getSerialOverlapCheck(Coupon param);

    /**
     * 난수, 시리얼 쿠폰 등록
     * @param param
     * @author xodud1202
     * @since 2021. 01. 26
     */
    void createRandomCouponInfo(Coupon param);

    /**
     * 동일 쿠폰명이 존재하는지 확인
     * @param param
     * @author xodud1202
     * @since 2021. 01. 27
     */
    int getRandomCouponNmCnt(String param);

    /**
     * 쿠폰 적용대상 삭제
     * @param  couponRefval
     * @return
     * @author xyzp1539
     * @since 2021-01-19
     */
    void updateCouponRefval(CouponRefval couponRefval);

    /**
     * 쿠폰 적용 대상 - 제외상품
     * @param  cpnRefval
     * @return Coupon
     * @author xyzp1539
     * @since 2021-01-18
     */
    ArrayList<CouponRefval> getCouponRefvalExceptGoodsList(CouponRefval cpnRefval);

    /**
     * 고객 쿠폰 발행
     * @param  custPub
     * @return
     * @author xyzp1539
     * @since 2021-01-21
     */
    int saveCouponCustPub(CustCoupon custPub);

    /**
     * 쿠폰발급받은 회원리스트 팝업
     * @param
     * @return
     * @author bin2107
     * @since 2021-02-03
     */
    Collection<Coupon> getCpnPubCustList(int cpnId);

    /**
     * 선착순 쿠폰 삭제
     * @param couponLimitedTime
     * @author bin2107
     * @since 2021. 02. 05
     */
    void updateLimitedTimeCouponList(CouponLimitedTime couponLimitedTime);

    /**
     * 쿠폰 상태 변경
     * @param
     * @author bin2107
     * @since 2021. 2. 5
     */
    void updateCouponStat(Coupon coupon);

    /**
     * 쿠폰조회 목록
     * @param coupon - 쿠폰 정보
     * @return
     * @author gagamel
     * @since 2021. 1. 8
     */
    Collection<Coupon> getCouponRetrieveList(Coupon coupon);

    /**
     * 랜덤 쿠폰 지급
     * @param coupon - 쿠폰 정보
     * @return
     * @author gagamel
     * @since 2021. 1. 8
     */
    void updateGiveRandomCoupon(CustCoupon coupon);

    /**
     * 쿠폰지급 - pdGb 별 쿠폰 지급
     * @param custCoupon
     * @return int
     * @author jsshin
     * @since 2021. 4. 15
     */
    int createCustCoupon(CustCoupon custCoupon);
}
