package com.bonus.canteen.core.nutrition.common.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;
import java.time.LocalDate;

@ApiModel("查询自定义菜单 入参")
public class HealthDishesDTO {
   @ApiModelProperty("人员id")
   private @NotNull(
   message = "{nutrition.analysis.custId.nonNull}"
) Long custId;
   @JsonFormat(
      pattern = "yyyy-MM-dd"
   )
   @ApiModelProperty("食用日期")
   private @NotNull(
   message = "{nutrition.dish.eatDate.nonNull}"
) LocalDate eatDate;

   public HealthDishesDTO() {
   }

   public static HealthDishesDTOBuilder builder() {
      return new HealthDishesDTOBuilder();
   }

   public Long getCustId() {
      return this.custId;
   }

   public LocalDate getEatDate() {
      return this.eatDate;
   }

   public void setCustId(final Long custId) {
      this.custId = custId;
   }

   @JsonFormat(
      pattern = "yyyy-MM-dd"
   )
   public void setEatDate(final LocalDate eatDate) {
      this.eatDate = eatDate;
   }

   public HealthDishesDTO(final Long custId, final LocalDate eatDate) {
      this.custId = custId;
      this.eatDate = eatDate;
   }

   public static class HealthDishesDTOBuilder {
      private Long custId;
      private LocalDate eatDate;

      HealthDishesDTOBuilder() {
      }

      public HealthDishesDTOBuilder custId(final Long custId) {
         this.custId = custId;
         return this;
      }

      @JsonFormat(
         pattern = "yyyy-MM-dd"
      )
      public HealthDishesDTOBuilder eatDate(final LocalDate eatDate) {
         this.eatDate = eatDate;
         return this;
      }

      public HealthDishesDTO build() {
         return new HealthDishesDTO(this.custId, this.eatDate);
      }

   }
}
