TripParticipant.cs
1,205 bytes
| 1 | using System.ComponentModel.DataAnnotations; |
|---|---|
| 2 | using App.Domain.Identity; |
| 3 | using Base.Domain; |
| 4 | |
| 5 | namespace App.Domain; |
| 6 | |
| 7 | public class TripParticipant : BaseEntity |
| 8 | { |
| 9 | public Guid TripId { get; set; } |
| 10 | public Trip? Trip { get; set; } |
| 11 | |
| 12 | public Guid UserId { get; set; } |
| 13 | public AppUser? User { get; set; } |
| 14 | |
| 15 | [Display(Name = nameof(Role), ResourceType = typeof(App.Resources.Domain.TripParticipant))] |
| 16 | public EParticipantRole Role { get; set; } = EParticipantRole.Participant; |
| 17 | |
| 18 | [MaxLength(100, ErrorMessageResourceType = typeof(App.Resources.Common), ErrorMessageResourceName = "ErrorMaxLength")] |
| 19 | [Display(Name = nameof(Nickname), ResourceType = typeof(App.Resources.Domain.TripParticipant))] |
| 20 | public string? Nickname { get; set; } |
| 21 | |
| 22 | [Display(Name = nameof(JoinedAt), ResourceType = typeof(App.Resources.Domain.TripParticipant))] |
| 23 | public DateTime JoinedAt { get; set; } = DateTime.UtcNow; |
| 24 | |
| 25 | [Display(Name = nameof(LeftAt), ResourceType = typeof(App.Resources.Domain.TripParticipant))] |
| 26 | public DateTime? LeftAt { get; set; } |
| 27 | |
| 28 | [Display(Name = nameof(IsActive), ResourceType = typeof(App.Resources.Domain.TripParticipant))] |
| 29 | public bool IsActive { get; set; } = true; |
| 30 | } |
| 31 | |