using System;
using System.Collections.Generic;
using Baza_Reklam.Classes.Interfaces;
using Baza_Reklam.Classes.Model.Enums;

namespace Baza_Reklam.Classes.Model
{
    public class Product : IProduct
    {
        private int _id;
        private int _titleId;
        private ProductType _productType;
        private string _type;
        private string _shortName;
        private DateTime? _startDate;
        private decimal _price;
        private decimal _totalPrice;
        private decimal _vat;
        private string _currency;
        private bool _isActivated;
        private int? _orderId;
        private bool _hasInvoice;
        private int _detailCount;
        private decimal _discount;
        private List<IProductDetail> _productDetails = new List<IProductDetail>();

        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }

        public int TitleId
        {
            get { return _titleId; }
            set { _titleId = value; }
        }

        public ProductType ProductType
        {
            get { return _productType; }
            set { _productType = value; }
        }

        public string Type
        {
            get { return _type; }
            set { _type = value; }
        }

        public string ShortName
        {
            get { return _shortName; }
            set { _shortName = value; }
        }

        public DateTime? StartDate
        {
            get { return _startDate; }
            set { _startDate = value; }
        }

        public decimal Price
        {
            get { return _price; }
            set { _price = value; }
        }

        public decimal TotalPrice
        {
            get { return _totalPrice; }
            set { _totalPrice = value; }
        }

        public decimal Vat
        {
            get { return _vat; }
            set { _vat = value; }
        }

        public string Currency
        {
            get { return _currency; }
            set { _currency = value; }
        }

        public bool IsActivated
        {
            get { return _isActivated; }
            set { _isActivated = value; }
        }

        public int? OrderId
        {
            get { return _orderId; }
            set { _orderId = value; }
        }

        public bool HasInvoice
        {
            get { return _hasInvoice; }
            set { _hasInvoice = value; }
        }

        public int DetailCount
        {
            get { return _detailCount; }
            set { _detailCount = value; }
        }

        public decimal Discount
        {
            get { return _discount; }
            set { _discount = value; }
        }

        public List<IProductDetail> ProductDetails
        {
            get { return _productDetails; }
        }

        public void AddProductDetail(IProductDetail productDetail)
        {
            productDetail.ProductId = _id;
            _productDetails.Add(productDetail);
        }
    }
}