Skip to content

Commit

Permalink
feat: Added Currency entity
Browse files Browse the repository at this point in the history
  • Loading branch information
koreanMike513 committed Dec 29, 2024
1 parent 58be4df commit 5d3e48a
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/main/java/com/f_lab/la_planete/domain/Currency.java
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 5d3e48a

Please sign in to comment.