| | 1 | | namespace Syki.Back.Features.Academic.CreateNotification; |
| | 2 | |
|
| | 3 | | public class Notification |
| | 4 | | { |
| 436 | 5 | | public Guid Id { get; set; } |
| 250 | 6 | | public Guid InstitutionId { get; set; } |
| 310 | 7 | | public string Title { get; set; } |
| 310 | 8 | | public string Description { get; set; } |
| 280 | 9 | | public bool Timeless { get; set; } |
| 280 | 10 | | public UsersGroup Target { get; set; } |
| 304 | 11 | | public DateTime CreatedAt { get; set; } |
| 8 | 12 | | public List<UserNotification> Users { get; set; } |
| | 13 | |
|
| 38 | 14 | | public string Views { get; set; } |
| | 15 | |
|
| 248 | 16 | | public Notification( |
| 248 | 17 | | Guid institutionId, |
| 248 | 18 | | string title, |
| 248 | 19 | | string description, |
| 248 | 20 | | UsersGroup target, |
| 248 | 21 | | bool timeless |
| 248 | 22 | | ) { |
| 248 | 23 | | Id = Guid.CreateVersion7(); |
| 248 | 24 | | InstitutionId = institutionId; |
| 248 | 25 | | Title = title; |
| 248 | 26 | | Description = description; |
| 248 | 27 | | Target = target; |
| 248 | 28 | | Timeless = timeless; |
| 248 | 29 | | CreatedAt = DateTime.UtcNow; |
| 248 | 30 | | } |
| | 31 | |
|
| | 32 | | public NotificationOut ToOut() |
| | 33 | | { |
| 30 | 34 | | return new() |
| 30 | 35 | | { |
| 30 | 36 | | Id = Id, |
| 30 | 37 | | Title = Title, |
| 30 | 38 | | Description = Description, |
| 30 | 39 | | Target = Target, |
| 30 | 40 | | Timeless = Timeless, |
| 30 | 41 | | CreatedAt = CreatedAt, |
| 30 | 42 | | Views = Views, |
| 30 | 43 | | }; |
| | 44 | | } |
| | 45 | | } |