using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using AyCode.Interfaces.Entities; using AyCode.Interfaces.TimeStampInfo; namespace TIAM.Entities.Auctions { [Table("AuctionBids")] public class AuctionBid : IEntityGuid, ITimeStampInfo { public AuctionBid() { } public AuctionBid(Guid ownerId, int targetProduct, string email) : this(Guid.NewGuid(), ownerId, targetProduct, email) { } public AuctionBid(Guid id, Guid ownerId, int targetProductId, string email) : this() { Id = id; OwnerId = ownerId; TargetProductId = targetProductId; Email = email; IsValid = false; } public AuctionBid(Guid ownerId, int targetProductId, string email, string phoneNumber) : this(Guid.NewGuid(), ownerId, targetProductId, email,phoneNumber) { } public AuctionBid(Guid id, Guid ownerId, int targetProductId, string email, string? phoneNumber) : this() { Id = id; OwnerId = ownerId; TargetProductId = targetProductId; Email = email; PhoneNumber = phoneNumber; IsValid = false; } public AuctionBid(Guid ownerId, int targetProductId, string email, string phoneNumber, int bidAmount) : this(Guid.NewGuid(), ownerId, targetProductId, email, phoneNumber, bidAmount) { OwnerId = ownerId; TargetProductId = targetProductId; Email = email; PhoneNumber = phoneNumber; BidAmount = bidAmount; IsValid = false; } public AuctionBid(Guid id, Guid ownerId, int targetProductId, string email, string? phoneNumber, int bidAmount) : this() { Id = id; OwnerId = ownerId; TargetProductId = targetProductId; Email = email; PhoneNumber = phoneNumber; BidAmount = bidAmount; IsValid = false; } [Key, DatabaseGenerated(DatabaseGeneratedOption.None)] public Guid Id { get; set; } public Guid OwnerId { get; set; } public int TargetProductId { get; set; } public string Email { get; set; } public string? PhoneNumber { get; set; } public int BidAmount { get; set; } public bool? IsValid { get; set; } public DateTime Created { get; set; } public DateTime Modified { get; set; } } public enum TargetProductType { Product1 = 1, Product2 = 2, } }