refactor: Change balance type to bigdecimal for better precision
This commit is contained in:
parent
9c5e05f29d
commit
aef0f09d09
5 changed files with 23 additions and 7 deletions
|
@ -8,6 +8,7 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
|
@ -20,9 +21,11 @@ public class UserEntity {
|
|||
@Column(unique = true)
|
||||
private String keycloakId;
|
||||
private String username;
|
||||
private float balance;
|
||||
|
||||
public UserEntity(String keycloakId, String username, float balance) {
|
||||
@Column(precision = 19, scale = 2)
|
||||
private BigDecimal balance;
|
||||
|
||||
public UserEntity(String keycloakId, String username, BigDecimal balance) {
|
||||
this.keycloakId = keycloakId;
|
||||
this.username = username;
|
||||
this.balance = balance;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue