Skip to content

Commit

Permalink
[TDC-140] Coupon domain 에 CouponGroup 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yerimkoko committed Jan 10, 2025
1 parent 57b9d78 commit 46a570b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public class Coupon extends BaseEntity {
@Enumerated(EnumType.STRING)
private CouponType couponType;

@Column(nullable = false)
@Enumerated(EnumType.STRING)
private CouponGroup couponGroup;

@Column(nullable = false)
@Enumerated(EnumType.STRING)
private CouponStatus status;
Expand All @@ -51,20 +55,21 @@ public class Coupon extends BaseEntity {

@Builder(access = AccessLevel.PRIVATE)
public Coupon(String workspaceId, String targetId, String name, CouponType couponType,
CouponTag couponTag, CouponStatus status, CouponTime couponTime, long count, String accountId) {
CouponTag couponTag, CouponStatus status, CouponGroup couponGroup, CouponTime couponTime, long count, String accountId) {
this.workspaceId = workspaceId;
this.targetId = targetId;
this.name = name;
this.couponTag = couponTag;
this.couponType = couponType;
this.status = status;
this.couponGroup = couponGroup;
this.count = count;
this.couponTime = couponTime;
this.accountId = accountId;
}

public static Coupon newInstance(String workspaceId, String targetId, String name,
CouponType couponType, CouponTag couponTag, long count, CouponTime couponTime, String accountId) {
CouponType couponType, CouponTag couponTag, CouponGroup couponGroup, long count, CouponTime couponTime, String accountId) {
return Coupon.builder()
.couponType(couponType)
.workspaceId(workspaceId)
Expand All @@ -74,6 +79,7 @@ public static Coupon newInstance(String workspaceId, String targetId, String nam
.couponTime(couponTime)
.accountId(accountId)
.count(count)
.couponGroup(couponGroup)
.status(CouponStatus.ACTIVE)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.threedollar.domain.coupon;

import lombok.Getter;

@Getter
public enum CouponGroup {
BOSS_STORE("사장님 가게")
;
private final String description;
CouponGroup(String description) {
this.description = description;
}
}

0 comments on commit 46a570b

Please sign in to comment.