package com.bytesw.bytebot.model;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.*;

@Entity
@Table(name = "AVB_COST")
@NamedQuery(name = "Cost.findByPK", query = "Select u from Cost u where u.id = ?1")
@Getter
@Setter
@EqualsAndHashCode
@ToString(exclude = "id")
public class Cost {
    @Id
    @Column(name = "cost_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "cost_airline", nullable = false)
    private String airline;

    @ManyToOne
    private Flight flight;

    @Column(name = "cost_from_date", nullable = false)
    private String fromDate;

    @Column(name = "cost_to_date", nullable = false)
    private String toDate;

    @Column(name = "cost_amount", nullable = false)
    private Integer amount;
}
