Skip to content

Commit

Permalink
MVP of feedback template stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-bstein committed Dec 11, 2024
1 parent f793d89 commit 0f4de80
Show file tree
Hide file tree
Showing 31 changed files with 9,682 additions and 418 deletions.
4 changes: 2 additions & 2 deletions src/Gameboard.Api/Common/Services/JsonService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Gameboard.Api.Common.Services;
public interface IJsonService
{
string Serialize<T>(T obj) where T : class;
T Deserialize<T>(string json) where T : new();
T Deserialize<T>(string json) where T : class;
}

internal class JsonService : IJsonService
Expand Down Expand Up @@ -50,7 +50,7 @@ public JsonService(JsonSerializerOptions options)
Options = options;
}

public T Deserialize<T>(string json) where T : new()
public T Deserialize<T>(string json) where T : class
{
if (json.IsEmpty())
return default;
Expand Down
2 changes: 0 additions & 2 deletions src/Gameboard.Api/Data/Entities/Feedback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Released under a MIT (SEI)-style license. See LICENSE.md in the project root for license information.

using System;
using System.ComponentModel.DataAnnotations;

namespace Gameboard.Api.Data
{
Expand All @@ -22,6 +21,5 @@ public class Feedback : IEntity
public Game Game { get; set; }
public Challenge Challenge { get; set; }
public ChallengeSpec ChallengeSpec { get; set; }

}
}
6 changes: 3 additions & 3 deletions src/Gameboard.Api/Data/Entities/FeedbackSubmission.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ public enum FeedbackSubmissionAttachedEntityType
Game = 1
}

public class FeedbackSubmission : IEntity
public abstract class FeedbackSubmission : IEntity
{
public string Id { get; set; }
public FeedbackSubmissionAttachedEntityType AttachedEntityType { get; set; }
public DateTimeOffset? WhenEdited { get; set; }
public required DateTimeOffset WhenSubmitted { get; set; }
public DateTimeOffset? WhenFinalized { get; set; }
public required DateTimeOffset WhenCreated { get; set; }

// json-mapped data (see GameboardDbContext for JSON column config)
public required ICollection<QuestionSubmission> Responses { get; set; }

// navs
public required string TeamId { get; set; }
public required string FeedbackTemplateId { get; set; }
public FeedbackTemplate FeedbackTemplate { get; set; }
public required string UserId { get; set; }
Expand Down
Loading

0 comments on commit 0f4de80

Please sign in to comment.