Mark properties as required

This commit is contained in:
2023-05-07 14:59:02 +02:00
parent efc9f9c77c
commit c44005359a
4 changed files with 25 additions and 7 deletions

View File

@@ -1,8 +1,6 @@
package net.kapcake.bankingservice.domain;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.*;
import lombok.Data;
@Entity
@@ -13,5 +11,6 @@ public class Balance {
private Long id;
private Long amount;
private String currency;
@Enumerated(EnumType.STRING)
private BalanceType type;
}

View File

@@ -12,13 +12,16 @@ public class BankAccount {
@GeneratedValue
private Long id;
@Column(nullable = false)
private String accountNumber;
@ManyToMany
private List<User> users;
@Column(nullable = false)
private String accountName;
@OneToMany
private List<Balance> balances;
@Enumerated(EnumType.STRING)
private AccountStatus status;
}

View File

@@ -12,15 +12,22 @@ public class Payment {
@Id
@GeneratedValue
private Long id;
@Column(nullable = false)
private Long amount;
@Column(nullable = false)
private String currency;
@ManyToOne
@JoinColumn(nullable = false)
private BankAccount giver;
@Column(nullable = false)
private String beneficiaryAccountNumber;
@Column(nullable = false)
private String beneficiaryName;
private String communication;
@CreationTimestamp
@Temporal(TemporalType.TIMESTAMP)
@Column(nullable = false)
private Date creationDate;
@Enumerated(EnumType.STRING)
private PaymentStatus status;
}

View File

@@ -1,18 +1,27 @@
package net.kapcake.bankingservice.domain;
import jakarta.persistence.*;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
@Entity
@Data
@Table(name = "BANKING_USER")
@Accessors(chain = true)
@Getter
@Setter
public class User {
@Id
@GeneratedValue
private Long id;
@Column(nullable = false)
private String username;
@Column(nullable = false)
private String password;
@ManyToOne
private Address address;
private String street;
private Integer number;
private String numberExtension;
private Integer postalCode;
private String country;
}