package com.bonus.core.order.common.model;

import com.baomidou.mybatisplus.annotation.TableName;
import com.bonus.core.common.enums.DeliveryTypeEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.time.LocalDateTime;

@TableName("order_delivery")
public class OrderDelivery {
   private Long deliveryId;
   @DateTimeFormat(
      pattern = "yyyy-MM-dd"
   )
   @JsonFormat(
      pattern = "yyyy-MM-dd"
   )
   private LocalDate orderDate;
   private Long orderId;
   private String deliveryCode;
   private String consigneeName;
   private String consigneeMobile;
   private String consigneeAddress;
   private Long deliveryRelatedId;
   private String deliveryUserId;
   private String deliveryName;
   private String deliveryMobile;
   @DateTimeFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   @JsonFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   private LocalDateTime deliveryTime;
   private Integer deliveryType;
   @DateTimeFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   @JsonFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   private LocalDateTime deliveryFinishTime;
   @DateTimeFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   @JsonFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   private LocalDateTime crtime;
   @DateTimeFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   @JsonFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   private LocalDateTime uptime;

   public static OrderDelivery newDefaultInstance() {
      OrderDelivery orderDelivery = new OrderDelivery();
      orderDelivery.setDeliveryType(DeliveryTypeEnum.SELF_TAKE.getKey());
      return orderDelivery;
   }

   public Long getDeliveryId() {
      return this.deliveryId;
   }

   public LocalDate getOrderDate() {
      return this.orderDate;
   }

   public Long getOrderId() {
      return this.orderId;
   }

   public String getDeliveryCode() {
      return this.deliveryCode;
   }

   public String getConsigneeName() {
      return this.consigneeName;
   }

   public String getConsigneeMobile() {
      return this.consigneeMobile;
   }

   public String getConsigneeAddress() {
      return this.consigneeAddress;
   }

   public Long getDeliveryRelatedId() {
      return this.deliveryRelatedId;
   }

   public String getDeliveryUserId() {
      return this.deliveryUserId;
   }

   public String getDeliveryName() {
      return this.deliveryName;
   }

   public String getDeliveryMobile() {
      return this.deliveryMobile;
   }

   public LocalDateTime getDeliveryTime() {
      return this.deliveryTime;
   }

   public Integer getDeliveryType() {
      return this.deliveryType;
   }

   public LocalDateTime getDeliveryFinishTime() {
      return this.deliveryFinishTime;
   }

   public LocalDateTime getCrtime() {
      return this.crtime;
   }

   public LocalDateTime getUptime() {
      return this.uptime;
   }

   public void setDeliveryId(final Long deliveryId) {
      this.deliveryId = deliveryId;
   }

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

   public void setOrderId(final Long orderId) {
      this.orderId = orderId;
   }

   public void setDeliveryCode(final String deliveryCode) {
      this.deliveryCode = deliveryCode;
   }

   public void setConsigneeName(final String consigneeName) {
      this.consigneeName = consigneeName;
   }

   public void setConsigneeMobile(final String consigneeMobile) {
      this.consigneeMobile = consigneeMobile;
   }

   public void setConsigneeAddress(final String consigneeAddress) {
      this.consigneeAddress = consigneeAddress;
   }

   public void setDeliveryRelatedId(final Long deliveryRelatedId) {
      this.deliveryRelatedId = deliveryRelatedId;
   }

   public void setDeliveryUserId(final String deliveryUserId) {
      this.deliveryUserId = deliveryUserId;
   }

   public void setDeliveryName(final String deliveryName) {
      this.deliveryName = deliveryName;
   }

   public void setDeliveryMobile(final String deliveryMobile) {
      this.deliveryMobile = deliveryMobile;
   }

   @JsonFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   public void setDeliveryTime(final LocalDateTime deliveryTime) {
      this.deliveryTime = deliveryTime;
   }

   public void setDeliveryType(final Integer deliveryType) {
      this.deliveryType = deliveryType;
   }

   @JsonFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   public void setDeliveryFinishTime(final LocalDateTime deliveryFinishTime) {
      this.deliveryFinishTime = deliveryFinishTime;
   }

   @JsonFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   public void setCrtime(final LocalDateTime crtime) {
      this.crtime = crtime;
   }

   @JsonFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   public void setUptime(final LocalDateTime uptime) {
      this.uptime = uptime;
   }

}
