package com.haha.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.haha.entity.TimedDiscountActivity;
import com.haha.entity.TimedDiscountRecord;
import com.haha.entity.TimedDiscountStatistics;
import com.haha.entity.PriceAdjustmentLog;
import com.haha.entity.dto.TimedDiscountCreateDTO;
import com.haha.entity.dto.TimedDiscountQueryDTO;
import com.haha.entity.dto.TimedDiscountRecordQueryDTO;
import com.haha.entity.dto.TimedDiscountUpdateDTO;

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

public interface TimedDiscountService extends IService<TimedDiscountActivity> {

    IPage<TimedDiscountActivity> getPage(TimedDiscountQueryDTO queryDTO);

    TimedDiscountActivity getDetail(Long id);

    TimedDiscountActivity create(TimedDiscountCreateDTO dto, Long creatorId, String creatorName);

    TimedDiscountActivity update(TimedDiscountUpdateDTO dto);

    boolean updateStatus(Long id, Integer status);

    boolean deleteActivity(Long id);

    List<Long> getActivityShopIds(Long activityId);

    List<String> getActivityDeviceIds(Long activityId);

    List<Long> getActivityProductIds(Long activityId);

    List<TimedDiscountActivity> getEnabledActivities();

    IPage<TimedDiscountRecord> getRecordPage(TimedDiscountRecordQueryDTO queryDTO);

    TimedDiscountRecord getRecordDetail(Long recordId);

    IPage<PriceAdjustmentLog> getPriceAdjustmentLogs(Long recordId, int page, int pageSize);

    IPage<TimedDiscountStatistics> getStatisticsPage(Long activityId, int page, int pageSize);

    Map<String, Object> getActivityStatistics(Long activityId);

    void executeDiscountActivity(Long activityId);

    void executeAllEnabledActivities();

    void restorePrices();

    void updateSalesStatistics();
}
