-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathFormSubmissionModel.cs
More file actions
27 lines (24 loc) · 912 Bytes
/
FormSubmissionModel.cs
File metadata and controls
27 lines (24 loc) · 912 Bytes
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
using Module.Answers.Mappers;
using Module.Answers.Models;
using Vote.Monitor.Domain.Entities.FormSubmissionAggregate;
namespace Feature.Form.Submission.SMS;
public record FormSubmissionModel
{
public required Guid Id { get; init; }
public required Guid FormId { get; init; }
public required Guid PollingStationId { get; init; }
public SubmissionFollowUpStatus FollowUpStatus { get; init; }
public IReadOnlyList<BaseAnswerModel> Answers { get; init; }
public bool IsCompleted { get; init; }
public static FormSubmissionModel FromEntity(FormSubmission entity) => new()
{
Id = entity.Id,
PollingStationId = entity.PollingStationId,
FormId = entity.FormId,
Answers = entity.Answers
.Select(AnswerMapper.ToModel)
.ToList(),
FollowUpStatus = entity.FollowUpStatus,
IsCompleted = entity.IsCompleted
};
}