﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PCBWayApi.Model
{
    public class Order : IModel
    {
        public Order()
        {
            CreateTime = DateTime.Now;
            Status = OrderStatus.Default;
        }
        /// <summary>
        /// Unique order id
        /// </summary>
        public string OrderId { get; set; }
        /// <summary>
        /// Revision id of the order
        /// </summary>
        public string RevisionId { get; set; }
        /// <summary>
        /// “PCB10X” | "KIT5X" | "ASMB1X"
        /// </summary>
        public string Type { get; set; }
        /// <summary>
        /// “REGISTERED” | "EXPRESS"
        /// </summary>
        public string ShippingType { get; set; }
        /// <summary>
        /// Number of items ordered 
        /// </summary>
        public int Amount { get; set; }
        public int ProductId { get; set; }
        /// <summary>
        /// Esitmated price: shipping fee + amount * type-price
        /// </summary>
        public decimal Price { get; set; }
        public string Email { get; set; }
        public string Name { get; set; }
        public string Address1 { get; set; }
        public string Address2 { get; set; }
        public string Zip { get; set; }
        public string State { get; set; }
        public string City { get; set; }
        public string Country { get; set; }
        public string Phone { get; set; }
        public string RedirectUrl { get; set; }
        public OrderStatus Status { get; set; }
        public DateTime CreateTime { get; set; }

        public int Id
        {
            get;
            set;
        }
    }
    public enum OrderStatus
    {
        Default = 1,
        Payed,
        Shipped,
        Confirmed,
        Aborted,
        Refunded
    }
}
