Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
937 B
1
Indexable
Never
using System;
using System.ComponentModel.DataAnnotations;

namespace AsgardMarketplace.Domain.Models
{
    public class Item
    {
        [Key]
        public int Id { get; set; }
        public string Name { get; set; }
        public DateTime? CreatedDate { get; set; }
        public int Quantity { get; set; }
        public string Seller { get; set; }
        public float Price { get; set; }
        /* available values: 
            CREATED
            NOT_FOUND
        */
        public string State { get; set; }

        public Item()
        {
        }

        public Item(int id, string name, DateTime? date, int quantity, string userId, float price)
        {
            Id = id;
            Name = name;
            CreatedDate = CreatedDate is null ? DateTime.Now : date.Value;
            Quantity = quantity;
            Seller = userId;
            Price = price;
            State = "CREATED";
        }
    }
}