using System;
using System.Collections.Generic;

namespace AyaNovaQBI
{
    public class Integration
    {
        public long Id { get; set; }
        public uint Concurrency { get; set; }

        public Guid IntegrationAppId { get; set; } = Guid.Empty;//Guid of integrating application.  All data for it is stored under this guid key.  This guid should be fixed and unchanged for all users of the integration app, i.e. it shouldn't be unique to each install but unique to itself once, a publish app id

        public string Name { get; set; }
        public bool Active { get; set; }//integration apps should always check if this is true before working or not and give appropriate error if turned off
        public string IntegrationData { get; set; } = String.Empty;//foreign object data store for entire integration, can be used for custom data, unused by any AyaNova add-on's, expect json or xml or some other text value here


        public List<IntegrationItem> Items { get; set; } = new List<IntegrationItem>();



    }//eoc

    public class IntegrationItem
    {
        public long Id { get; set; }
        public uint Concurrency { get; set; }


        public long IntegrationId { get; set; }


        public long ObjectId { get; set; }

        public AyaType AType { get; set; }

        public string IntegrationItemId { get; set; } = String.Empty;//foreign id (e.g. QB Id)
        public string IntegrationItemName { get; set; } = String.Empty;//foreign object's name for UI, not required if not displayed anywhere
        public DateTime? LastSync { get; set; }//optional, used by qbi
        public string IntegrationItemData { get; set; }//foreign object data store for this item, unused by any AyaNova add-on's in the past but might be useful for others, expect json or xml or some other text value here



    }//eoc
}
