package it.bgates.remotebe.entities; import com.fasterxml.jackson.annotation.JsonIgnore; import it.bgates.remotebe.entities.enums.BillingType; import jakarta.persistence.*; import lombok.Getter; import lombok.Setter; import java.time.LocalDateTime; @Getter @Setter @Entity @Table(name = "billings") public class Billing { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; private LocalDateTime billingDate; private BillingType type; @Column(length = 200) private String description; private Integer gtcoinCost; private Double gtcoinPrice; private Double totalCost; @JsonIgnore @ManyToOne @JoinColumn(name = "user_id", foreignKey = @ForeignKey(name = "FK_USER_BILLING")) private User user; @JsonIgnore @ManyToOne @JoinColumn(name = "device_id", foreignKey = @ForeignKey(name = "FK_DEVICE_BILLING")) private Device device; }