package com.bonus.canteen.core.menu.vo;

import cn.hutool.core.collection.CollUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalTime;
import java.util.List;

@ApiModel("获取当餐点餐食堂档口列表(食堂嵌套档口版)")
@Data
public class AppletCurrentCanteenVO {
   @ApiModelProperty("食堂id")
   private Long canteenId;
   @ApiModelProperty("食堂名称")
   private String canteenName;
   @ApiModelProperty("月销量")
   private Integer monthlySales;
   @ApiModelProperty("营业开始时间")
   private LocalTime startBusinessTime;
   @ApiModelProperty("营业结束时间")
   private LocalTime endBusinessTime;
   @ApiModelProperty("食堂营业状态")
   private Integer businessState;
   @ApiModelProperty("档口菜谱")
   private List<AppletCurrentStallVO> stallList;

   public Integer getMonthlySales() {
      return CollUtil.isNotEmpty(this.stallList) ? this.stallList.stream().mapToInt(AppletCurrentStallVO::getMonthlySales).sum() : 0;
   }
}
