41 lines
1.1 KiB
Java
41 lines
1.1 KiB
Java
package com.agendaestudantil.entidade;
|
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.Builder;
|
|
import lombok.Data;
|
|
import lombok.EqualsAndHashCode;
|
|
import lombok.NoArgsConstructor;
|
|
import org.springframework.data.annotation.Id;
|
|
import org.springframework.data.mongodb.core.index.CompoundIndex;
|
|
import org.springframework.data.mongodb.core.mapping.Document;
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
@Data
|
|
@Builder
|
|
@NoArgsConstructor
|
|
@AllArgsConstructor
|
|
@EqualsAndHashCode(callSuper = false)
|
|
@Document(collection = "notificacoes")
|
|
@CompoundIndex(name = "estudante_lida_idx", def = "{estudanteId: 1, lida: 1}")
|
|
public class Notificacao extends EntidadeAuditoria {
|
|
|
|
@Id
|
|
private String id;
|
|
private String estudanteId;
|
|
private String titulo;
|
|
private String mensagem;
|
|
private TipoNotificacao tipo;
|
|
private String referenciaId;
|
|
private TipoReferencia tipoReferencia;
|
|
private boolean lida;
|
|
private LocalDateTime dataGeracao;
|
|
|
|
public enum TipoNotificacao {
|
|
PRAZO_PROXIMO, TAREFA_ATRASADA, EVENTO_PROXIMO
|
|
}
|
|
|
|
public enum TipoReferencia {
|
|
TAREFA, EVENTO
|
|
}
|
|
} |