package org.hso.ecommerce.entities.warehouse;

import org.hso.ecommerce.entities.shop.CustomerOrder;
import org.hso.ecommerce.entities.supplier.SupplierOrder;

import javax.persistence.*;

@Entity
@Table(name = "warehouse_booking_reasons")
public class WarehouseBookingReason {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic
    public long id;

    public String comment;

    @ManyToOne(optional = true)
    public SupplierOrder causeSupplierOrder;

    @ManyToOne(optional = true)
    public CustomerOrder customerOrder;

    public boolean isManuel;

    // Default Constructor is needed for construction by ORM
    public WarehouseBookingReason() {
    }

    public WarehouseBookingReason(CustomerOrder order) {
        this.customerOrder = order;
    }
}
