package com.ruoyi.dashboard.domain.platformIncomeDaily;

import java.time.LocalDate;
import java.util.List;

import org.springframework.format.annotation.DateTimeFormat;

import com.ruoyi.bst.bonus.domain.BonusQuery;
import com.ruoyi.bst.bonus.domain.enums.BonusArrivalType;
import com.ruoyi.bst.bonus.domain.enums.BonusStatus;
import com.ruoyi.bst.bonusRefund.domain.BonusRefundQuery;
import com.ruoyi.bst.withdraw.domain.WithdrawQuery;
import com.ruoyi.bst.withdraw.domain.enums.WithdrawStatus;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class PlatformDailyIncomeQuery {
    
    @ApiModelProperty("日期范围")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private List<LocalDate> dateRange;

    public BonusQuery toBonusQuery() {
        BonusQuery query = new BonusQuery();
        query.setWaitDateRange(dateRange);
        query.setStatusList(BonusStatus.settle());
        query.setArrivalTypes(BonusArrivalType.platformList());
        return query;
    }

    public BonusRefundQuery toBonusRefundQuery() {
        BonusRefundQuery query = new BonusRefundQuery();
        query.setCreateDateRange(dateRange);
        query.setBonusStatusList(BonusStatus.valid());
        query.setBonusArrivalTypes(BonusArrivalType.platformList());
        return query;
    }

    public WithdrawQuery toWithdrawQuery() {
        WithdrawQuery query = new WithdrawQuery();
        query.setCreateDateRange(dateRange);
        query.setStatus(WithdrawStatus.SUCCESS.getCode());
        return query;
    }
    
}
