From ca607957faebd3b1cf5739f9e22d5c3cef282a16 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 22 Jun 2022 20:35:30 +0000 Subject: [PATCH] --- AyaNovaQBI/AyaNovaQBI.csproj | 2 + AyaNovaQBI/AyaType.cs | 109 +++++++++++++++++++++++++++++++++++ AyaNovaQBI/Integration.cs | 48 +++++++++++++++ AyaNovaQBI/util.cs | 3 +- 4 files changed, 160 insertions(+), 2 deletions(-) create mode 100644 AyaNovaQBI/AyaType.cs create mode 100644 AyaNovaQBI/Integration.cs diff --git a/AyaNovaQBI/AyaNovaQBI.csproj b/AyaNovaQBI/AyaNovaQBI.csproj index 007b368..302c51c 100644 --- a/AyaNovaQBI/AyaNovaQBI.csproj +++ b/AyaNovaQBI/AyaNovaQBI.csproj @@ -77,6 +77,8 @@ + + Form diff --git a/AyaNovaQBI/AyaType.cs b/AyaNovaQBI/AyaType.cs new file mode 100644 index 0000000..f1ba8b0 --- /dev/null +++ b/AyaNovaQBI/AyaType.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +namespace AyaNovaQBI +{ + /// + /// All AyaNova types and their attributes indicating what features that type will support (tagging, attachments etc) + /// + public enum AyaType : int + { + NoType = 0, + Global = 1, + FormUserOptions = 2, + User = 3, + ServerState = 4, + License = 5, + LogFile = 6, + PickListTemplate = 7, + Customer = 8, + ServerJob = 9, + Contract = 10, + TrialSeeder = 11, + ServerMetrics = 12, + Translation = 13, + UserOptions = 14, + HeadOffice = 15, + LoanUnit = 16, + FileAttachment = 17, + DataListSavedFilter = 18, + FormCustom = 19, + Part = 20, + PM = 21, + PMItem = 22, + QuoteItemExpense = 23, + QuoteItemLabor = 24, + Project = 25, + PurchaseOrder = 26, + Quote = 27, + QuoteItem = 28, + QuoteItemLoan = 29, + QuoteItemPart = 30, + Unit = 31, + UnitModel = 32, + Vendor = 33, + //--- WorkOrder + WorkOrder = 34, + WorkOrderItem = 35, + WorkOrderItemExpense = 36, + WorkOrderItemLabor = 37, + WorkOrderItemLoan = 38, + WorkOrderItemPart = 39, + WorkOrderItemPartRequest = 40, + WorkOrderItemScheduledUser = 41, + WorkOrderItemTask = 42, + WorkOrderItemTravel = 43, + WorkOrderItemUnit = 44, + //--- + QuoteItemScheduledUser = 45, + QuoteItemTask = 46, + GlobalOps = 47,//really only used for rights, not an object type of any kind + BizMetrics = 48,//deprecate? Not used for anything as of nov 2020 + Backup = 49, + Notification = 50, + NotifySubscription = 51, + Reminder = 52, + UnitMeterReading = 53, + CustomerServiceRequest = 54, + // ServiceBank = 55, + OpsNotificationSettings = 56, + Report = 57, + DashboardView = 58, + CustomerNote = 59, + Memo = 60, + Review = 61, + ServiceRate = 62, + TravelRate = 63, + TaxCode = 64, + PartAssembly = 65, + PartWarehouse = 66, + PartInventory = 67, + DataListColumnView = 68, + PartInventoryRestock = 69,//for list only, synthetic object + PartInventoryRequest = 70,//for list only, synthetic object + WorkOrderStatus = 71, + TaskGroup = 72, + WorkOrderItemOutsideService = 73, + WorkOrderItemPriority = 74, + WorkOrderItemStatus = 75, + QuoteItemTravel = 76, + QuoteItemUnit = 77, + QuoteStatus = 78, + QuoteItemOutsideService = 79, + PMItemExpense = 80, + PMItemLabor = 81, + PMItemLoan = 82, + PMItemPart = 83, + CustomerNotifySubscription = 84,//proxy subs for customers + PMItemScheduledUser = 85, + PMItemTask = 86, + PMItemTravel = 87, + PMItemUnit = 88, + PMItemOutsideService = 89, + PartInventoryDataList = 90,//for list/reporting only, synthetic object + PartInventoryRequestDataList = 91,//for list/reporting only, synthetic object + Integration = 92 //3rd party or add-on integration data store + } +} diff --git a/AyaNovaQBI/Integration.cs b/AyaNovaQBI/Integration.cs new file mode 100644 index 0000000..0b7d6d3 --- /dev/null +++ b/AyaNovaQBI/Integration.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +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; }//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 Items { get; set; } = new List(); + + + + }//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; }//foreign id (e.g. QB Id) + public string IntegrationItemName { get; set; }//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 +} diff --git a/AyaNovaQBI/util.cs b/AyaNovaQBI/util.cs index 5dc992c..6a217d7 100644 --- a/AyaNovaQBI/util.cs +++ b/AyaNovaQBI/util.cs @@ -474,8 +474,7 @@ namespace AyaNovaQBI if (d.ShowDialog() == System.Windows.Forms.DialogResult.Cancel) return false; - //CHECK ROLE - //must have Accounting full role to use QBI + //ACCOUNTING ROLE? if (!AyaNovaUserRoles.HasFlag(AuthorizationRoles.Accounting)) { initErrors.AppendLine($"User must have the \"Accounting\" Role to use QBI\r\n");