summaryrefslogtreecommitdiff
path: root/Models/Ticket.cs
blob: fe7bdbd004bc33275e8e07f1cdb42c8e951e1b6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace BackendPIA.Models {
    public class Ticket {
        public long Id { get; set; }
        [Required]
        [Range(1, 54, ErrorMessage = "Value for {0} must be between {1} and {2}.")]
        public int Number { get; set; }
        public bool IsWinner { get; set; }
        [Required]
        [ForeignKey("UserAccountId")]
        public string? UserAccountId { get; set; }
        [Required]
        [ForeignKey("RaffleId")]
        public long RaffleId { get; set; }
        public UserAccount? Owner { get; set; }
        public Raffle? Raffle { get; set; }
    }
}