package com.pressing.domain.pickup;

import com.pressing.common.entity.BaseEntity;
import com.pressing.domain.invoice.InvoiceLine;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name = "pickup_lines")
public class PickupLine extends BaseEntity {

    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(name = "pickup_id")
    private Pickup pickup;

    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(name = "invoice_line_id")
    private InvoiceLine invoiceLine;

    @Column(nullable = false)
    private int quantity;

    @Column(nullable = false, length = 200)
    private String designation;
}
