content: package org.goormthon.seasonthon.nocheongmaru.domain.notification.entity;
  
  import jakarta.persistence.*;
  import lombok.AccessLevel;
  import lombok.Builder;
  import lombok.Getter;
  import lombok.NoArgsConstructor;
  import org.goormthon.seasonthon.nocheongmaru.domain.member.entity.Member;
  import org.goormthon.seasonthon.nocheongmaru.global.common.BaseTimeEntity;
  
  @NoArgsConstructor(access = AccessLevel.PROTECTED)
  @Getter
  @Table(name = "notifications")
  @Entity
  public class Notification extends BaseTimeEntity {
      
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "notification_id")
      private Long id;
      
      @Column(name = "message", nullable = false)
      private String message;
      
      @Enumerated(EnumType.STRING)
      @Column(name = "notification_type", nullable = false)
      private NotificationType type;
      
      @ManyToOne(fetch = FetchType.LAZY)
      @JoinColumn(name = "member_id", nullable = false)
      private Member member;
      
      @Column(name = "is_read", nullable = false)
      private boolean isRead;
      
      @Builder
      private Notification(String message, NotificationType type, Member member) {
          this.message = message;
          this.type = type;
          this.member = member;
          this.isRead = false;
      }
      
      public void markAsRead() {
          this.isRead = true;
      }
      
  }
  