package com.bonus.canteen.core.order.common.query;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.text.CharSequenceUtil;

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

public interface OrderQueryParam {
   default String getMacOrderId() {
      return null;
   }

   default boolean containsAvailableMacOrderId() {
      return CharSequenceUtil.isNotBlank(this.getMacOrderId());
   }

   default Long getCustId() {
      return null;
   }

   default boolean containsAvailableCustId() {
      return this.getCustId() != null;
   }

   default String getMachineSn() {
      return null;
   }

   default boolean containsAvailableMachineSn() {
      return CharSequenceUtil.isNotBlank(this.getMachineSn());
   }

   default LocalDate getOrderDate() {
      return null;
   }

   default LocalDate getStartDate() {
      return null;
   }

   default void setStartDate(LocalDate orderDate) {
   }

   default LocalDate getEndDate() {
      return null;
   }

   default void setEndDate(LocalDate orderDate) {
   }

   default boolean containsAvailableOrderDate() {
      return this.getOrderDate() != null || this.getStartDate() != null || this.getEndDate() != null;
   }

   default Integer getOrderType() {
      return null;
   }

   default List<Integer> getOrderTypeList() {
      return ListUtil.empty();
   }

   default void setOrderTypeList(List<Integer> orderTypeList) {
   }

   default List<Integer> availableOrderTypeList() {
      if (CollUtil.isNotEmpty(this.getOrderTypeList())) {
         return this.getOrderTypeList();
      } else {
         return (List)(this.getOrderType() != null ? CollUtil.toList(new Integer[]{this.getOrderType()}) : ListUtil.empty());
      }
   }

   default boolean containsAvailableOrderType() {
      return CollUtil.isNotEmpty(this.availableOrderTypeList());
   }

   default Integer getMealtimeType() {
      return null;
   }

   default List<Integer> getMealtimeTypeList() {
      return ListUtil.empty();
   }

   default void setMealtimeTypeList(List<Integer> mealtimeTypeList) {
   }

   default List<Integer> availableMealtimeTypeList() {
      if (CollUtil.isNotEmpty(this.getMealtimeTypeList())) {
         return this.getMealtimeTypeList();
      } else {
         return (List)(this.getMealtimeType() != null ? CollUtil.toList(new Integer[]{this.getMealtimeType()}) : ListUtil.empty());
      }
   }

   default boolean containsAvailableMealtimeType() {
      return CollUtil.isNotEmpty(this.availableMealtimeTypeList());
   }

   default Long getCanteenId() {
      return null;
   }

   default List<Long> getCanteenIdList() {
      return ListUtil.empty();
   }

   default void setCanteenIdList(List<Long> canteenIdList) {
   }

   default List<Long> availableCanteenIdList() {
      if (CollUtil.isNotEmpty(this.getCanteenIdList())) {
         return this.getCanteenIdList();
      } else {
         return (List)(this.getCanteenId() != null ? CollUtil.toList(new Long[]{this.getCanteenId()}) : ListUtil.empty());
      }
   }

   default boolean containsAvailableCanteenId() {
      return CollUtil.isNotEmpty(this.availableCanteenIdList());
   }

   default Long getStallId() {
      return null;
   }

   default void setStallId(Long stallId) {
   }

   default List<Long> getStallIdList() {
      return ListUtil.empty();
   }

   default void setStallIdList(List<Long> stallIdList) {
   }

   default List<Long> availableStallIdList() {
      if (CollUtil.isNotEmpty(this.getStallIdList())) {
         return this.getStallIdList();
      } else {
         return (List)(this.getStallId() != null ? CollUtil.toList(new Long[]{this.getStallId()}) : ListUtil.empty());
      }
   }

   default boolean containsAvailableStallId() {
      return CollUtil.isNotEmpty(this.availableStallIdList());
   }

   default Long getRoomId() {
      return null;
   }

   default List<Long> getRoomIdList() {
      return ListUtil.empty();
   }

   default void setRoomIdList(List<Long> roomIdList) {
   }

   default List<Long> availableRoomIdList() {
      if (CollUtil.isNotEmpty(this.getRoomIdList())) {
         return this.getRoomIdList();
      } else {
         return (List)(this.getRoomId() != null ? CollUtil.toList(new Long[]{this.getRoomId()}) : ListUtil.empty());
      }
   }

   default boolean containsAvailableRoomId() {
      return CollUtil.isNotEmpty(this.availableRoomIdList());
   }

   default LocalDateTime getStartOrderTime() {
      return null;
   }

   default void setStartOrderTime(LocalDateTime startOrderTime) {
   }

   default LocalDateTime getEndOrderTime() {
      return null;
   }

   default void setEndOrderTime(LocalDateTime endOrderTime) {
   }

   default boolean containsAvailableOrderTime() {
      return this.getStartOrderTime() != null || this.getEndOrderTime() != null;
   }

   default LocalDateTime getStartPayTime() {
      return null;
   }

   default void setStartPayTime(LocalDateTime startPayTime) {
   }

   default LocalDateTime getEndPayTime() {
      return null;
   }

   default void setEndPayTime(LocalDateTime endPayTime) {
   }

   default boolean containsAvailablePayTime() {
      return this.getStartPayTime() != null || this.getEndPayTime() != null;
   }
}
