SubmittedTask
Parent namespace: Commissiestrijd.Models
Namespace: Commissiestrijd.Models
Assembly: backend.dll
Represents a submitted task in the application. This class is used to define the properties of a task that has been submitted by a user including its unique identifier, the ID of the possible task it relates to, the date it was submitted, the committee it was submitted to, the path to the image associated with the submission, its status, points awarded, and any rejection reason if applicable. The Id property serves as the primary key for the submitted task, the PossibleTaskId property is a foreign key linking to the PossibleTask entity, the SubmittedAt property indicates when the task was submitted, the Committee property indicates which committee the task was submitted to, the ImagePath property stores the path to the image associated with the submission, the Status property indicates the current status of the task (Pending, Approved, or Rejected), the Points property indicates the points awarded for the task, and the RejectionReason property provides a reason for rejection if the task was not approved. The MaxPerPeriod property indicates the maximum number of times this task can be completed in a given period.
public class SubmittedTask
Inheritance
Show Inherited Members (7)
Properties
Committee
The committee to which the task was submitted. This property is required and serves as a foreign key linking to the Committee entity. It indicates which committee the task was submitted to for review.
[Column("Committee")]
[ForeignKey("Committee")]
[Required(ErrorMessage = "Committee is required.")]
public required string Committee { get; set; }
Property Value
string
Id
The unique identifier for the submitted task. This property is required and serves as the primary key for the task.
[Column("Id")]
[Key]
public required Guid Id { get; set; }
Property Value
Guid
ImagePath
The path to the image associated with the submission. This property is required and has a maximum length of 255 characters. It stores the file path or URL of the image that was uploaded with the task submission.
[Column("ImagePath")]
[StringLength(255, ErrorMessage = "Image path cannot exceed 255 characters.")]
[Required(ErrorMessage = "Image path is required.")]
public required string ImagePath { get; set; }
Property Value
string
MaxPerPeriod
The maximum number of times this task can be completed in a given period. This property is optional and can be null, indicating that there is no limit on the number of times the task can be completed. If specified, it must be a non-negative integer.
[Column("MaxPerPeriod")]
public int? MaxPerPeriod { get; set; }
Property Value
int
?
Points
The points awarded for the submitted task. This property is required and indicates the number of points that the task has been awarded. It is used to track the points earned by the user for completing the task.
[Column("Points")]
[Range(1, 100, ErrorMessage = "Points must be greater than zero and max 100.")]
[Required(ErrorMessage = "Points are required.")]
public required int Points { get; set; }
Property Value
int
PossibleTaskId
The unique identifier for the possible task that this submission relates to. This property is required and serves as a foreign key linking to the PossibleTask entity. It indicates which possible task this submission is based on.
[Column("PossibleTaskId")]
[ForeignKey("PossibleTask")]
[Required(ErrorMessage = "Possible Task ID is required.")]
public required Guid PossibleTaskId { get; set; }
Property Value
Guid
RejectionReason
The reason for rejection if the task was not approved. This property is optional and can be null. It provides a reason for why the task was rejected, allowing users to understand the feedback on their submission. If the task is approved or pending, this property can be left null.
[Column("RejectionReason")]
[StringLength(500, ErrorMessage = "Rejection reason cannot exceed 500 characters.")]
public string? RejectionReason { get; set; }
Property Value
Status
The current status of the submitted task. This property is required and indicates the state of the task in the submission process. It can be one of the values defined in the TaskStatus enum (Pending, Approved or Rejected). ///
[Column("Status")]
[Required(ErrorMessage = "Task status is required.")]
[EnumDataType(typeof(SubmittedTask.TaskStatus), ErrorMessage = "Invalid task status.")]
public required SubmittedTask.TaskStatus Status { get; set; }
Property Value
SubmittedAt
The date and time when the task was submitted. This property is required and indicates when the submission occurred. It is used to track the submission time for the task.
[Column("SubmittedAt")]
[Required(ErrorMessage = "Submission date is required.")]
public required DateTime SubmittedAt { get; set; }
Property Value
DateTime