Repository navigation
Expand file tree
/
Copy pathEntities.cs
More file actions
218 lines (202 loc) · 9.01 KB
/
Copy pathEntities.cs
File metadata and controls
218 lines (202 loc) · 9.01 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace BlazorWebForms.Infrastructure.SqlServer;
public class FormEntity
{
public Guid Id { get; init; }
[MaxLength(100)]
public string Key { get; set; } = string.Empty;
[MaxLength(100)]
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public Guid OwnerUserId { get; set; }
public DateTimeOffset CreatedUtc { get; set; } = DateTimeOffset.UtcNow;
public DateTimeOffset UpdatedUtc { get; set; } = DateTimeOffset.UtcNow;
public DateTimeOffset? ArchivedUtc { get; set; }
public Guid? ArchivedByUserId { get; set; }
public string? DraftDefinitionJson { get; set; }
[MaxLength(50)]
public string PublicationSlug { get; set; } = string.Empty;
[MaxLength(40)]
public string PublicationDomain { get; set; } = string.Empty;
public int PublicationAccessMode { get; set; }
public bool PublicationSendSubmissionCopyToSubmitter { get; set; }
public int PublicationEditMode { get; set; }
public DateTimeOffset? PublicationOpenUtc { get; set; }
public DateTimeOffset? PublicationCloseUtc { get; set; }
public string PublicationNotYetOpenMessage { get; set; } = string.Empty;
public string PublicationClosedMessage { get; set; } = string.Empty;
public int? PublicationMaxSubmissions { get; set; }
public string PublicationCapReachedMessage { get; set; } = string.Empty;
public string PublicationConfirmationMessage { get; set; } = string.Empty;
public string PublicationConfirmationRedirectUrl { get; set; } = string.Empty;
public string PublicationAccessPasswordHash { get; set; } = string.Empty;
public bool PublicationRequireCaptcha { get; set; }
public int? PublicationAutoSaveIntervalSeconds { get; set; }
public byte[] RowVersion { get; init; } = Array.Empty<byte>();
public ICollection<FormVersionEntity> Versions { get; set; } = new List<FormVersionEntity>();
public ICollection<FormPermissionEntity> Permissions { get; set; } = new List<FormPermissionEntity>();
public ICollection<FormNotificationEntity> Notifications { get; set; } = new List<FormNotificationEntity>();
public ICollection<FormWebhookEntity> Webhooks { get; set; } = new List<FormWebhookEntity>();
}
public class FormVersionEntity
{
public Guid Id { get; set; }
public Guid FormId { get; set; }
public FormEntity? Form { get; set; }
public int VersionNumber { get; set; }
public DateTimeOffset CreatedUtc { get; set; } = DateTimeOffset.UtcNow;
public string DefinitionJson { get; set; } = string.Empty;
}
public class FormPermissionEntity
{
public Guid Id { get; set; }
public Guid FormId { get; set; }
public FormEntity? Form { get; set; }
public Guid UserId { get; set; }
public string DisplayName { get; set; } = string.Empty;
public int Role { get; set; }
public string ScopeType { get; set; } = "Form";
public string? ScopeValue { get; set; }
public Guid UpdatedByUserId { get; set; }
public DateTimeOffset UpdatedUtc { get; set; } = DateTimeOffset.UtcNow;
}
public class FormNotificationEntity
{
public Guid Id { get; set; }
public Guid FormId { get; set; }
public FormEntity? Form { get; set; }
public string Email { get; set; } = string.Empty;
public bool OnSubmission { get; set; } = true;
public bool OnApproval { get; set; } = true;
}
public class EntryEntity
{
public Guid Id { get; set; }
public Guid FormId { get; set; }
public FormEntity? Form { get; set; }
public Guid FormVersionId { get; set; }
public string SubmittedBy { get; set; } = string.Empty;
public string SubmittedByEmail { get; set; } = string.Empty;
public DateTimeOffset SubmittedUtc { get; set; } = DateTimeOffset.UtcNow;
public DateTimeOffset? StartedUtc { get; set; }
public int Status { get; set; }
public Dictionary<string, string?> Answers { get; set; } = new(StringComparer.OrdinalIgnoreCase);
public Dictionary<string, string> SearchIndex { get; set; } = new(StringComparer.OrdinalIgnoreCase);
public decimal? Score { get; set; }
public bool? QuizPassed { get; set; }
public byte[] RowVersion { get; set; } = Array.Empty<byte>();
public ICollection<EntryRevisionEntity> Revisions { get; set; } = new List<EntryRevisionEntity>();
public ICollection<ApprovalStepEntity> ApprovalSteps { get; set; } = new List<ApprovalStepEntity>();
public ICollection<ApprovalAuditEventEntity> ApprovalAuditTrail { get; set; } = new List<ApprovalAuditEventEntity>();
public ICollection<EntrySearchIndexEntity> SearchIndexEntries { get; set; } = new List<EntrySearchIndexEntity>();
public ICollection<EntryFileMetadataEntity> Files { get; set; } = new List<EntryFileMetadataEntity>();
}
public class EntryRevisionEntity
{
public Guid Id { get; set; }
public Guid EntryId { get; set; }
public EntryEntity? Entry { get; set; }
public int RevisionNumber { get; set; }
public string EditedBy { get; set; } = string.Empty;
public DateTimeOffset EditedUtc { get; set; } = DateTimeOffset.UtcNow;
public Dictionary<string, string?> Answers { get; set; } = new(StringComparer.OrdinalIgnoreCase);
}
public class ApprovalStepEntity
{
public Guid Id { get; set; }
public Guid EntryId { get; set; }
public EntryEntity? Entry { get; set; }
public int Order { get; set; }
public string ApproverId { get; set; } = string.Empty;
public string ApproverName { get; set; } = string.Empty;
public string ApproverEmail { get; set; } = string.Empty;
public int AcceptorMode { get; set; }
public string AcceptorsJson { get; set; } = "[]";
public string Instructions { get; set; } = string.Empty;
public int Status { get; set; }
public string? Signature { get; set; }
public string? RejectionReason { get; set; }
public DateTimeOffset? CompletedUtc { get; set; }
public string? DelegatedToEmail { get; set; }
public string? DelegatedToName { get; set; }
public DateTimeOffset? DelegatedUtc { get; set; }
}
public class ApprovalAuditEventEntity
{
public Guid Id { get; set; }
public Guid EntryId { get; set; }
public EntryEntity? Entry { get; set; }
public int Action { get; set; }
public Guid? ApprovalStepId { get; set; }
public Guid ActorUserId { get; set; }
public string ActorDisplayName { get; set; } = string.Empty;
public string? Signature { get; set; }
public string? Reason { get; set; }
public string? CorrelationId { get; set; }
public DateTimeOffset OccurredUtc { get; set; } = DateTimeOffset.UtcNow;
}
public class EntrySearchIndexEntity
{
public Guid Id { get; set; }
public Guid EntryId { get; set; }
public EntryEntity? Entry { get; set; }
public string Key { get; set; } = string.Empty;
public string Value { get; set; } = string.Empty;
}
public class EntryFileMetadataEntity
{
public Guid Id { get; set; }
public Guid EntryId { get; set; }
public EntryEntity? Entry { get; set; }
public string FieldId { get; set; } = string.Empty;
public string FileName { get; set; } = string.Empty;
public string ContentType { get; set; } = "application/octet-stream";
public long Length { get; set; }
public string RelativePath { get; set; } = string.Empty;
public string Sha256 { get; set; } = string.Empty;
public Guid UploadedByUserId { get; set; }
public string UploadedByEmail { get; set; } = string.Empty;
public int RevisionNumber { get; set; }
public DateTimeOffset UploadedUtc { get; set; } = DateTimeOffset.UtcNow;
}
public class FormInvitationEntity
{
public Guid Id { get; set; }
public Guid FormId { get; set; }
public FormEntity? Form { get; set; }
public string Email { get; set; } = string.Empty;
public int Role { get; set; }
public string ScopeType { get; set; } = "Form";
public string? ScopeValue { get; set; }
public string Token { get; set; } = string.Empty;
public DateTimeOffset ExpiresUtc { get; set; }
public int Status { get; set; }
public Guid CreatedByUserId { get; set; }
public DateTimeOffset CreatedUtc { get; set; } = DateTimeOffset.UtcNow;
public Guid? UpdatedByUserId { get; set; }
public DateTimeOffset? UpdatedUtc { get; set; }
}
public class FormWebhookEntity
{
public Guid Id { get; set; }
public Guid FormId { get; set; }
public FormEntity? Form { get; set; }
public string Url { get; set; } = string.Empty;
public string Secret { get; set; } = string.Empty;
public string TriggerEventsJson { get; set; } = "[]";
public string HeadersJson { get; set; } = "{}";
public bool IsEnabled { get; set; } = true;
}
public class FormAnalyticsEntity
{
public Guid FormId { get; set; }
public FormEntity? Form { get; set; }
public long ViewCount { get; set; }
public long StartCount { get; set; }
public long SubmissionCount { get; set; }
public long AbandonCount { get; set; }
public double AverageCompletionSeconds { get; set; }
public DateTimeOffset? LastUpdatedUtc { get; set; }
}