package cn.reghao.tnb.file.app.zorder.model.po;

import cn.reghao.file.api.dto.BuyDto;
import cn.reghao.jutil.jdk.web.db.BaseObject;
import cn.reghao.tnb.file.app.zorder.model.constant.OrderStatus;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author reghao
 * @date 2024-04-16 10:56:56
 */
@NoArgsConstructor
@AllArgsConstructor
@Setter
@Getter
@Deprecated
public class Order extends BaseObject<Integer> {
    private Long orderId;
    private Long deliveryId;
    private Long productId;
    private Double price;
    private Integer amount;
    private Long owner;
    private Integer status;

    public Order(long orderId, BuyDto buyDto) {
        this.orderId = orderId;
        this.deliveryId = buyDto.getDeliveryId();
        this.productId = buyDto.getProductId();
        this.price = buyDto.getPrice();
        this.amount = buyDto.getAmount();
        this.owner = buyDto.getOwner();
        this.status = OrderStatus.toPay.getCode();
    }
}
