-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathEnrolmentCertificateAccessToken.cs
More file actions
43 lines (32 loc) · 1.18 KB
/
EnrolmentCertificateAccessToken.cs
File metadata and controls
43 lines (32 loc) · 1.18 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
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
using Flurl;
using System.Collections.Generic;
namespace Prime.Models
{
[Table("EnrolmentCertificateAccessToken")]
public sealed class EnrolmentCertificateAccessToken : BaseAuditable
{
public static int MaxViews { get => 3; }
public static TimeSpan Lifespan { get => TimeSpan.FromDays(10); }
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid Id { get; set; }
public int EnrolleeId { get; set; }
[JsonIgnore]
public Enrollee Enrollee { get; set; }
public DateTimeOffset Expires { get; set; }
public int ViewCount { get; set; }
public bool Active { get; set; }
public int? CareSettingCode { get; set; }
public int? HealthAuthorityCode { get; set; }
public ICollection<AccessTokenRemoteAccessSite> RemoteAccessSites { get; set; }
[NotMapped]
public string FrontendUrl
{
get => Url.Combine(PrimeConfiguration.Current.FrontendUrl, "provisioner-access", Id.ToString());
}
}
}