Billing.java 933 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package it.bgates.remotebe.entities;
  2. import com.fasterxml.jackson.annotation.JsonIgnore;
  3. import it.bgates.remotebe.entities.enums.BillingType;
  4. import jakarta.persistence.*;
  5. import lombok.Getter;
  6. import lombok.Setter;
  7. import java.time.LocalDateTime;
  8. @Getter
  9. @Setter
  10. @Entity
  11. @Table(name = "billings")
  12. public class Billing {
  13. @Id
  14. @GeneratedValue(strategy = GenerationType.IDENTITY)
  15. private Integer id;
  16. private LocalDateTime billingDate;
  17. private BillingType type;
  18. @Column(length = 200)
  19. private String description;
  20. private Integer gtcoinCost;
  21. private Double gtcoinPrice;
  22. private Double totalCost;
  23. @JsonIgnore
  24. @ManyToOne
  25. @JoinColumn(name = "user_id", foreignKey = @ForeignKey(name = "FK_USER_BILLING"))
  26. private User user;
  27. @JsonIgnore
  28. @ManyToOne
  29. @JoinColumn(name = "device_id", foreignKey = @ForeignKey(name = "FK_DEVICE_BILLING"))
  30. private Device device;
  31. }