Skip to content

Commit

Permalink
feat: 봉사자 모집자 알림 Entity에 NotificationType 필드 추가 (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyeong-hyeok committed May 15, 2024
1 parent 57a8d4d commit e979c57
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public class IntermediaryNotification extends BaseTimeEntity {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String image;
@Enumerated(EnumType.STRING)
@Column(nullable = false)
private NotificationType notificationType;
@Column(nullable = false)
private String title;
@Column(nullable = false)
Expand All @@ -26,11 +29,12 @@ public class IntermediaryNotification extends BaseTimeEntity {
private Boolean isRead;

@Builder
public IntermediaryNotification(String image, String title, String body, Intermediary intermediary, Boolean isRead) {
this.image = image;
this.title = title;
this.body = body;
this.intermediary = intermediary;
this.isRead = isRead;
}
public IntermediaryNotification(String image, NotificationType notificationType, String title, String body, Intermediary intermediary, Boolean isRead) {
this.image = image;
this.notificationType = notificationType;
this.title = title;
this.body = body;
this.intermediary = intermediary;
this.isRead = isRead;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.pawwithu.connectdog.domain.notification.entity;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum NotificationType {

// 봉사자
REJECTED("반려 확인"), CONFIRMED("승인 확인"), COMPLETED("봉사 완료"), BADGE("배지 확득"),

// 모집자
APPLICATION("신청 확인"), CANCELED("봉사 취소"), REVIEW_REGISTERED("후기 확인"), EXPIRED("모집 마감"), COMPLETED_REQUEST("봉사 완료 요청");

private final String key;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public class VolunteerNotification extends BaseTimeEntity {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String image;
@Enumerated(EnumType.STRING)
@Column(nullable = false)
private NotificationType notificationType;
@Column(nullable = false)
private String title;
@Column(nullable = false)
Expand All @@ -26,8 +29,9 @@ public class VolunteerNotification extends BaseTimeEntity {
private Boolean isRead;

@Builder
public VolunteerNotification(String image, String title, String body, Volunteer volunteer, Boolean isRead) {
public VolunteerNotification(String image, NotificationType notificationType, String title, String body, Volunteer volunteer, Boolean isRead) {
this.image = image;
this.notificationType = notificationType;
this.title = title;
this.body = body;
this.volunteer = volunteer;
Expand Down

0 comments on commit e979c57

Please sign in to comment.