From 5d3e48a393ade971e1339eafc8eee78cfc9a36b0 Mon Sep 17 00:00:00 2001 From: koreanMike513 Date: Sun, 29 Dec 2024 21:41:59 +0000 Subject: [PATCH] feat: Added Currency entity --- .../com/f_lab/la_planete/domain/Currency.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/main/java/com/f_lab/la_planete/domain/Currency.java diff --git a/src/main/java/com/f_lab/la_planete/domain/Currency.java b/src/main/java/com/f_lab/la_planete/domain/Currency.java new file mode 100644 index 0000000..56cb9fb --- /dev/null +++ b/src/main/java/com/f_lab/la_planete/domain/Currency.java @@ -0,0 +1,43 @@ +package com.f_lab.la_planete.domain; + +import com.f_lab.la_planete.domain.base.BaseTimeEntity; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.math.RoundingMode; + +import static jakarta.persistence.GenerationType.IDENTITY; + +@Entity +@Getter +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Table(name = "currency") +public class Currency extends BaseTimeEntity { + + @Id @GeneratedValue(strategy = IDENTITY) + private Long id; + + @Column(nullable = false) + private String currencyCode; + + @Column(nullable = false) + private String currencySymbol; + + @Column(nullable = false) + private int roundingScale; + + @Enumerated(EnumType.STRING) + @Column(columnDefinition = "VARCHAR(20) NOT NULL DEFAULT 'FLOOR'") + private RoundingMode roundingMode; +}