package com.sifang.modules.supply.order.request;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.Valid;
import java.util.List;

/**
 * 发货单分配请求模型
 */
public class AllocationReq {

    /**
     * 发货单id
     */
    @NotBlank(message = "发货单id不能为空")
    private String id;

    /**
     * 发货单位：供应链是a，供应商是id
     */
    @NotBlank(message = "发货单位不能为空")
    private String deliverId;

    /**
     * 发货仓库：发货单位是供应链时必填
     */
    private String outWarehouseId;

    /**
     * 分配说明
     */
    private String allocationRemark;

    @Valid
    @NotEmpty(message = "分配明细不能为空")
    private List<AllocationDetailReq> details;

    private List<TraderOrderDetailReq> splitDetails;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDeliverId() {
        return deliverId;
    }

    public void setDeliverId(String deliverId) {
        this.deliverId = deliverId;
    }

    public String getOutWarehouseId() {
        return outWarehouseId;
    }

    public void setOutWarehouseId(String outWarehouseId) {
        this.outWarehouseId = outWarehouseId;
    }

    public String getAllocationRemark() {
        return allocationRemark;
    }

    public void setAllocationRemark(String allocationRemark) {
        this.allocationRemark = allocationRemark;
    }

    public List<AllocationDetailReq> getDetails() {
        return details;
    }

    public void setDetails(List<AllocationDetailReq> details) {
        this.details = details;
    }

    public List<TraderOrderDetailReq> getSplitDetails() {
        return splitDetails;
    }

    public void setSplitDetails(List<TraderOrderDetailReq> splitDetails) {
        this.splitDetails = splitDetails;
    }

    @Override
    public String toString() {
        return "AllocationReq{" +
                "id='" + id + '\'' +
                ", deliverId='" + deliverId + '\'' +
                ", outWarehouseId='" + outWarehouseId + '\'' +
                ", allocationRemark='" + allocationRemark + '\'' +
                ", details=" + details +
                ", splitDetails=" + splitDetails +
                '}';
    }
}
