This commit is contained in:
2022-06-22 20:35:30 +00:00
parent e140a9cf5b
commit ca607957fa
4 changed files with 160 additions and 2 deletions

View File

@@ -77,6 +77,8 @@
</Compile> </Compile>
<Compile Include="AuthorizationRoles.cs" /> <Compile Include="AuthorizationRoles.cs" />
<Compile Include="AyaNovaLicense.cs" /> <Compile Include="AyaNovaLicense.cs" />
<Compile Include="AyaType.cs" />
<Compile Include="Integration.cs" />
<Compile Include="MainForm.cs"> <Compile Include="MainForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>

109
AyaNovaQBI/AyaType.cs Normal file
View File

@@ -0,0 +1,109 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AyaNovaQBI
{
/// <summary>
/// All AyaNova types and their attributes indicating what features that type will support (tagging, attachments etc)
/// </summary>
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
}
}

48
AyaNovaQBI/Integration.cs Normal file
View File

@@ -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<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; }//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
}

View File

@@ -474,8 +474,7 @@ namespace AyaNovaQBI
if (d.ShowDialog() == System.Windows.Forms.DialogResult.Cancel) if (d.ShowDialog() == System.Windows.Forms.DialogResult.Cancel)
return false; return false;
//CHECK ROLE //ACCOUNTING ROLE?
//must have Accounting full role to use QBI
if (!AyaNovaUserRoles.HasFlag(AuthorizationRoles.Accounting)) if (!AyaNovaUserRoles.HasFlag(AuthorizationRoles.Accounting))
{ {
initErrors.AppendLine($"User must have the \"Accounting\" Role to use QBI\r\n"); initErrors.AppendLine($"User must have the \"Accounting\" Role to use QBI\r\n");