forked from axel/FocusAgenda
47 lines
1.3 KiB
Java
47 lines
1.3 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.index.CompoundIndexes;
|
|
import org.springframework.data.mongodb.core.index.Indexed;
|
|
import org.springframework.data.mongodb.core.mapping.Document;
|
|
|
|
import java.time.LocalDate;
|
|
|
|
@Data
|
|
@Builder
|
|
@NoArgsConstructor
|
|
@AllArgsConstructor
|
|
@EqualsAndHashCode(callSuper = false)
|
|
@Document(collection = "tarefas")
|
|
@CompoundIndexes({
|
|
@CompoundIndex(name = "estudante_data_entrega_idx", def = "{estudanteId: 1, dataEntrega: 1}"),
|
|
@CompoundIndex(name = "estudante_status_idx", def = "{estudanteId: 1, status: 1}")
|
|
})
|
|
public class Tarefa extends EntidadeAuditoria {
|
|
|
|
@Id
|
|
private String id;
|
|
private String titulo;
|
|
private String descricao;
|
|
private Prioridade prioridade;
|
|
private StatusTarefa status;
|
|
private LocalDate dataEntrega;
|
|
private String disciplinaId;
|
|
@Indexed
|
|
private String estudanteId;
|
|
|
|
public enum Prioridade {
|
|
BAIXA, MEDIA, ALTA, URGENTE
|
|
}
|
|
|
|
public enum StatusTarefa {
|
|
PENDENTE, EM_ANDAMENTO, CONCLUIDA, ATRASADA
|
|
}
|
|
}
|