﻿using System;
using System.Collections.Generic;
using EnhancedChannelManager.Entities.Addresses;
using EnhancedChannelManager.Entities.Contacts;
using EnhancedChannelManager.Entities.Services;
using EnhancedChannelManager.Library;

namespace EnhancedChannelManager.Entities.Enterprises
{
    public enum EnterpriseState
    {
        Test,
        Managed,
        Connected
    }

    public abstract class Enterprise :
        MappedEntity,
        IOwnedEntity<Chain>,
        IOwningEntity<Service>
    {
        public Chain Owner { get; set; }

        public EnterpriseState State { get; set; }
        public bool IsTest
        {
            get { return State == EnterpriseState.Test; }
        }
        public bool IsManaged
        {
            get { return State == EnterpriseState.Managed; }
        }
        public bool IsConnected
        {
            get { return State == EnterpriseState.Connected; }
        }

        public List<Address> Addresses { get; set; }

        public List<Contact> Contacts { get; set; }

        public List<Currency> AcceptedCurrencies { get; set; }
        public Currency DefaultCurrency { get; set; }

        public TimeZoneInfo TimeZoneInfo { get; set; }

        public List<Service> Services { get; set; }

        IEnumerable<Service> IOwningEntity<Service>.GetOwnedEntities()
        {
            return Services;
        }
    }
}
