|
|
@@ -0,0 +1,33 @@
|
|
|
+package pl.dmss.vmaneliuk.database.model;
|
|
|
+
|
|
|
+import jakarta.persistence.*;
|
|
|
+
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+
|
|
|
+@Entity
|
|
|
+@Table(name = "users")
|
|
|
+public class User {
|
|
|
+ @Id
|
|
|
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
+ private Long userId;
|
|
|
+
|
|
|
+
|
|
|
+ @Column(nullable = false)
|
|
|
+ private String fullName;
|
|
|
+
|
|
|
+ @Column(nullable = false)
|
|
|
+ private String email;
|
|
|
+
|
|
|
+ @Column(nullable = false)
|
|
|
+ private String passwordHash;
|
|
|
+
|
|
|
+ private String accountStatus;
|
|
|
+ private LocalDateTime memberSince;
|
|
|
+ private BigDecimal walletBalance;
|
|
|
+ private BigDecimal totalSpent;
|
|
|
+
|
|
|
+ @OneToOne(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.LAZY )
|
|
|
+ private Library library;
|
|
|
+}
|
|
|
+
|