aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Models
diff options
context:
space:
mode:
Diffstat (limited to 'BackEnd/Timeline/Models')
-rw-r--r--BackEnd/Timeline/Models/Http/HttpTimelinePost.cs7
-rw-r--r--BackEnd/Timeline/Models/Http/HttpTimelinePostCreateRequest.cs7
-rw-r--r--BackEnd/Timeline/Models/Mapper/TimelineMapper.cs1
3 files changed, 14 insertions, 1 deletions
diff --git a/BackEnd/Timeline/Models/Http/HttpTimelinePost.cs b/BackEnd/Timeline/Models/Http/HttpTimelinePost.cs
index a563bea0..5981d7a4 100644
--- a/BackEnd/Timeline/Models/Http/HttpTimelinePost.cs
+++ b/BackEnd/Timeline/Models/Http/HttpTimelinePost.cs
@@ -9,13 +9,14 @@ namespace Timeline.Models.Http
{
public HttpTimelinePost() { }
- public HttpTimelinePost(long id, HttpTimelinePostContent? content, bool deleted, DateTime time, HttpUser? author, DateTime lastUpdated)
+ public HttpTimelinePost(long id, HttpTimelinePostContent? content, bool deleted, DateTime time, HttpUser? author, string? color, DateTime lastUpdated)
{
Id = id;
Content = content;
Deleted = deleted;
Time = time;
Author = author;
+ Color = color;
LastUpdated = lastUpdated;
}
@@ -40,6 +41,10 @@ namespace Timeline.Models.Http
/// </summary>
public HttpUser? Author { get; set; } = default!;
/// <summary>
+ /// The color.
+ /// </summary>
+ public string? Color { get; set; }
+ /// <summary>
/// Last updated time.
/// </summary>
public DateTime LastUpdated { get; set; } = default!;
diff --git a/BackEnd/Timeline/Models/Http/HttpTimelinePostCreateRequest.cs b/BackEnd/Timeline/Models/Http/HttpTimelinePostCreateRequest.cs
index cfbec029..b25adf36 100644
--- a/BackEnd/Timeline/Models/Http/HttpTimelinePostCreateRequest.cs
+++ b/BackEnd/Timeline/Models/Http/HttpTimelinePostCreateRequest.cs
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
+using Timeline.Models.Validation;
namespace Timeline.Models.Http
{
@@ -15,5 +16,11 @@ namespace Timeline.Models.Http
/// Time of the post. If not set, current time will be used.
/// </summary>
public DateTime? Time { get; set; }
+
+ /// <summary>
+ /// Color of the post.
+ /// </summary>
+ [Color]
+ public string? Color { get; set; }
}
}
diff --git a/BackEnd/Timeline/Models/Mapper/TimelineMapper.cs b/BackEnd/Timeline/Models/Mapper/TimelineMapper.cs
index 25abf0ba..94e55237 100644
--- a/BackEnd/Timeline/Models/Mapper/TimelineMapper.cs
+++ b/BackEnd/Timeline/Models/Mapper/TimelineMapper.cs
@@ -106,6 +106,7 @@ namespace Timeline.Models.Mapper
deleted: content is null,
time: entity.Time,
author: author,
+ color: entity.Color,
lastUpdated: entity.LastUpdated
);
}