File size: 1,543 Bytes
1c8e50c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package in.garvit.tasks.taskModel;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import com.fasterxml.jackson.annotation.JsonFormat;

import in.garvit.tasks.enums.TaskStatus;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * Task Entity
 * 
 * Represents a task in the Task Management System.
 * This entity is persisted in MongoDB with collection name "Tasks".
 * 
 * @author garvitpathak27
 */
@Data
@Document(collection = "Tasks")
@AllArgsConstructor
@NoArgsConstructor
public class Task {
	
	/**
	 * Unique identifier for the task (MongoDB ObjectId)
	 */
	@Id
	private String id;
	
	/**
	 * Title of the task
	 */
	private String title;
	
	/**
	 * Detailed description of the task
	 */
	private String description;
	
	/**
	 * URL to an image associated with the task (optional)
	 */
	private String imageUrl;
	
	/**
	 * ID of the user to whom the task is assigned (optional)
	 */
	private String assignedUserId;
	
	/**
	 * Current status of the task (PENDING, ASSIGNED, or DONE)
	 */
	@JsonFormat(shape = JsonFormat.Shape.STRING)
	private TaskStatus status;
	
	/**
	 * Deadline for task completion
	 */
	private LocalDateTime deadline;
	
	/**
	 * Timestamp when the task was created
	 */
	private LocalDateTime createAt;
	
	/**
	 * List of tags associated with the task for categorization
	 */
	private List<String> tags = new ArrayList<>();
}