Merge branch 'master' into security_branch
This commit is contained in:
@@ -1,35 +1,35 @@
|
||||
package com.faf223.expensetrackerfaf.model;
|
||||
package com.faf223.expensetrackerfaf.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Entity(name = "credentials")
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Credential {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long credentialId;
|
||||
@Data
|
||||
@Entity(name = "credentials")
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Credential {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long credentialId;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_uuid")
|
||||
private User user;
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_uuid")
|
||||
private User user;
|
||||
|
||||
private String email;
|
||||
private String password;
|
||||
private String email;
|
||||
private String password;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private Role role;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private Role role;
|
||||
|
||||
public Credential(User user, String email, String password) {
|
||||
this.user = user;
|
||||
this.email = email;
|
||||
this.password = password;
|
||||
public Credential(User user, String email, String password) {
|
||||
this.user = user;
|
||||
this.email = email;
|
||||
this.password = password;
|
||||
|
||||
this.role = Role.ROLE_USER;
|
||||
}
|
||||
this.role = Role.ROLE_USER;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
package com.faf223.expensetrackerfaf.model;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Entity(name = "expense_categories")
|
||||
public class ExpenseCategory {
|
||||
public class ExpenseCategory implements IMoneyTransactionCategory {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long categoryId;
|
||||
@Column(name = "category_id")
|
||||
private Long id;
|
||||
|
||||
private String categoryName;
|
||||
@Column(name = "category_name")
|
||||
private String name;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.faf223.expensetrackerfaf.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
public interface IMoneyTransaction {
|
||||
|
||||
Long getId();
|
||||
LocalDate getDate();
|
||||
User getUser();
|
||||
BigDecimal getAmount();
|
||||
IMoneyTransactionCategory getCategory();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.faf223.expensetrackerfaf.model;
|
||||
|
||||
public interface IMoneyTransactionCategory {
|
||||
Long getId();
|
||||
String getName();
|
||||
}
|
||||
@@ -2,10 +2,8 @@ package com.faf223.expensetrackerfaf.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@@ -13,10 +11,11 @@ import java.time.LocalDate;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Entity(name = "incomes")
|
||||
public class Income {
|
||||
public class Income implements IMoneyTransaction {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long incomeId;
|
||||
@Column(name = "income_id")
|
||||
private Long id;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_uuid")
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
package com.faf223.expensetrackerfaf.model;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Entity(name = "income_categories")
|
||||
public class IncomeCategory {
|
||||
public class IncomeCategory implements IMoneyTransactionCategory {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long categoryId;
|
||||
@Column(name = "category_id")
|
||||
private Long id;
|
||||
|
||||
private String categoryName;
|
||||
@Column(name = "category_name")
|
||||
private String name;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.faf223.expensetrackerfaf.model;
|
||||
|
||||
public enum Role {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.faf223.expensetrackerfaf.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
||||
Reference in New Issue
Block a user