This commit is contained in:
2021-06-11 16:58:56 +00:00
parent bcd0530026
commit e35a69043f
19 changed files with 138 additions and 53 deletions

View File

@@ -4294,12 +4294,19 @@ namespace AyaNova.Biz
bool isNew = currentObj == null; bool isNew = currentObj == null;
WorkOrderItemPartRequest oProposed = (WorkOrderItemPartRequest)proposedObj;
var woId = await GetWorkOrderIdFromRelativeAsync(AyaType.WorkOrderItem, oProposed.WorkOrderItemId, ct);
var WorkorderInfo = await ct.WorkOrder.AsNoTracking().Where(x => x.Id == woId).Select(x => new { Serial = x.Serial, Tags = x.Tags }).FirstOrDefaultAsync();
//sub wo tags here.
proposedObj.Tags = WorkorderInfo.Tags;
//STANDARD EVENTS FOR ALL OBJECTS //STANDARD EVENTS FOR ALL OBJECTS
await NotifyEventHelper.ProcessStandardObjectEvents(ayaEvent, proposedObj, ct); await NotifyEventHelper.ProcessStandardObjectEvents(ayaEvent, proposedObj, ct);
//SPECIFIC EVENTS FOR THIS OBJECT //SPECIFIC EVENTS FOR THIS OBJECT
WorkOrderItemPartRequest o = (WorkOrderItemPartRequest)proposedObj;

View File

@@ -12,11 +12,13 @@ namespace AyaNova.Models
//didn't want to end up with a zillion interfaces for all manner of stuff //didn't want to end up with a zillion interfaces for all manner of stuff
public long Id { get; set; } public long Id { get; set; }
public uint Concurrency { get; set; } public uint Concurrency { get; set; }
public string Name { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } // public string Name { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
public string Name { get; set; }//any notification on these will require this so making it mandatory but will implement a workaround to return alt fields instead
public bool? Active { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } public bool? Active { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
public string Wiki { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } public string Wiki { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
public string CustomFields { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } public string CustomFields { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
public List<string> Tags { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } // public List<string> Tags { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
public List<string> Tags { get; set; }//Notification on objects require this so will implement workaround in object instead
public AyaNova.Biz.AyaType AyaType { get; } public AyaNova.Biz.AyaType AyaType { get; }
} }

View File

@@ -23,6 +23,13 @@ namespace AyaNova.Models
public string CustomFields { get; set; } public string CustomFields { get; set; }
public List<string> Tags { get; set; } public List<string> Tags { get; set; }
//workaround for notification
[NotMapped, JsonIgnore]
public string Name { get; set; }
/* /*
todo: Consider adding latitude / longitude to wo, quote, pm objects todo: Consider adding latitude / longitude to wo, quote, pm objects

View File

@@ -40,11 +40,19 @@ namespace AyaNova.Models
public string Text2 { get; set; } public string Text2 { get; set; }
public List<PurchaseOrderItem> Items { get; set; } = new List<PurchaseOrderItem>(); public List<PurchaseOrderItem> Items { get; set; } = new List<PurchaseOrderItem>();
//workaround for notification
[NotMapped, JsonIgnore]
public string Name { get; set; }
public PurchaseOrder() public PurchaseOrder()
{ {
Tags = new List<string>(); Tags = new List<string>();
} }
[NotMapped, JsonIgnore] [NotMapped, JsonIgnore]
public AyaType AyaType { get => AyaType.PurchaseOrder; } public AyaType AyaType { get => AyaType.PurchaseOrder; }

View File

@@ -22,6 +22,11 @@ namespace AyaNova.Models
public string CustomFields { get; set; } public string CustomFields { get; set; }
public List<string> Tags { get; set; } public List<string> Tags { get; set; }
//workaround for notification
[NotMapped, JsonIgnore]
public string Name { get; set; }
/* /*
todo: Consider adding latitude / longitude to wo, quote, pm objects todo: Consider adding latitude / longitude to wo, quote, pm objects

View File

@@ -67,6 +67,13 @@ namespace AyaNova.Models
public decimal? Latitude { get; set; } public decimal? Latitude { get; set; }
public decimal? Longitude { get; set; } public decimal? Longitude { get; set; }
//workaround for notification
[NotMapped, JsonIgnore]
public string Name { get; set; }
public Unit() public Unit()
{ {
Tags = new List<string>(); Tags = new List<string>();
@@ -75,6 +82,8 @@ namespace AyaNova.Models
[NotMapped, JsonIgnore] [NotMapped, JsonIgnore]
public AyaType AyaType { get => AyaType.Unit; } public AyaType AyaType { get => AyaType.Unit; }
// //convenience links // //convenience links
// [JsonIgnore] // [JsonIgnore]
// public Customer Customer { get; set; } // public Customer Customer { get; set; }

View File

@@ -85,6 +85,10 @@ namespace AyaNova.Models
[NotMapped, JsonIgnore] [NotMapped, JsonIgnore]
public AyaType AyaType { get => AyaType.WorkOrder; } public AyaType AyaType { get => AyaType.WorkOrder; }
//workaround for notification
[NotMapped, JsonIgnore]
public string Name { get; set; }
}//eoc }//eoc
}//eons }//eons

View File

@@ -31,6 +31,10 @@ namespace AyaNova.Models
public bool WarrantyService { get; set; } = false; public bool WarrantyService { get; set; } = false;
public int Sequence { get; set; } public int Sequence { get; set; }
//workaround for notification
[NotMapped, JsonIgnore]
public string Name { get; set; }
//Principle //Principle
[JsonIgnore] [JsonIgnore]
public WorkOrder WorkOrder { get; set; } public WorkOrder WorkOrder { get; set; }

View File

@@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json; using Newtonsoft.Json;
@@ -43,6 +44,11 @@ namespace AyaNova.Models
[JsonIgnore] [JsonIgnore]
public WorkOrderItem WorkOrderItem { get; set; } public WorkOrderItem WorkOrderItem { get; set; }
//workaround for notification
[NotMapped, JsonIgnore]
public List<string> Tags { get; set; } = new List<string>();
[NotMapped, JsonIgnore] [NotMapped, JsonIgnore]
public AyaType AyaType { get => AyaType.WorkOrderItemExpense; } public AyaType AyaType { get => AyaType.WorkOrderItemExpense; }

View File

@@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json; using Newtonsoft.Json;
@@ -58,6 +59,12 @@ namespace AyaNova.Models
[NotMapped, JsonIgnore] [NotMapped, JsonIgnore]
public AyaType AyaType { get => AyaType.WorkOrderItemLabor; } public AyaType AyaType { get => AyaType.WorkOrderItemLabor; }
//workaround for notification
[NotMapped, JsonIgnore]
public List<string> Tags { get; set; } = new List<string>();
[NotMapped, JsonIgnore]
public string Name { get; set; }
}//eoc }//eoc
}//eons }//eons

View File

@@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json; using Newtonsoft.Json;
@@ -50,7 +51,11 @@ namespace AyaNova.Models
[NotMapped] [NotMapped]
public decimal LineTotalViz { get; set; }//line total netViz + taxes public decimal LineTotalViz { get; set; }//line total netViz + taxes
//workaround for notification
[NotMapped, JsonIgnore]
public List<string> Tags { get; set; } = new List<string>();
[NotMapped, JsonIgnore]
public string Name { get; set; }
[Required] [Required]
public long WorkOrderItemId { get; set; } public long WorkOrderItemId { get; set; }

View File

@@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json; using Newtonsoft.Json;
@@ -47,7 +48,11 @@ namespace AyaNova.Models
[NotMapped] [NotMapped]
public decimal LineTotalViz { get; set; }//line total netViz + taxes public decimal LineTotalViz { get; set; }//line total netViz + taxes
//workaround for notification
[NotMapped, JsonIgnore]
public List<string> Tags { get; set; } = new List<string>();
[NotMapped, JsonIgnore]
public string Name { get; set; }
[Required] [Required]
public long WorkOrderItemId { get; set; } public long WorkOrderItemId { get; set; }

View File

@@ -1,4 +1,4 @@
using System; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json; using Newtonsoft.Json;
@@ -51,6 +51,11 @@ namespace AyaNova.Models
[NotMapped] [NotMapped]
public decimal LineTotalViz { get; set; }//line total netViz + taxes public decimal LineTotalViz { get; set; }//line total netViz + taxes
//workaround for notification
[NotMapped, JsonIgnore]
public List<string> Tags { get; set; } = new List<string>();
[NotMapped, JsonIgnore]
public string Name { get; set; }
[Required] [Required]
public long WorkOrderItemId { get; set; } public long WorkOrderItemId { get; set; }

View File

@@ -50,9 +50,11 @@ namespace AyaNova.Models
[NotMapped, JsonIgnore] [NotMapped, JsonIgnore]
public AyaType AyaType { get => AyaType.WorkOrderItemPartRequest; } public AyaType AyaType { get => AyaType.WorkOrderItemPartRequest; }
//tag workaround for notification, workorderbiz will substitute workorder tags instead when processing standard notification //workaround for notification
[NotMapped, JsonIgnore] [NotMapped, JsonIgnore]
public List<string> Tags { get; set; } = new List<string>(); public List<string> Tags { get; set; } = new List<string>();
[NotMapped, JsonIgnore]
public string Name { get; set; }
}//eoc }//eoc
}//eons }//eons

View File

@@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json; using Newtonsoft.Json;
@@ -21,6 +22,12 @@ namespace AyaNova.Models
public string ServiceRateViz { get; set; } public string ServiceRateViz { get; set; }
//workaround for notification
[NotMapped, JsonIgnore]
public List<string> Tags { get; set; } = new List<string>();
[NotMapped, JsonIgnore]
public string Name { get; set; }
[Required] [Required]
public long WorkOrderItemId { get; set; } public long WorkOrderItemId { get; set; }
[JsonIgnore] [JsonIgnore]

View File

@@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json; using Newtonsoft.Json;
using AyaNova.Biz; using AyaNova.Biz;
using System.Collections.Generic;
namespace AyaNova.Models namespace AyaNova.Models
{ {
@@ -26,6 +27,11 @@ namespace AyaNova.Models
public string CompletedByUserViz { get; set; } public string CompletedByUserViz { get; set; }
public DateTime? CompletedDate { get; set; } public DateTime? CompletedDate { get; set; }
//workaround for notification
[NotMapped, JsonIgnore]
public List<string> Tags { get; set; } = new List<string>();
[NotMapped, JsonIgnore]
public string Name { get; set; }
[Required] [Required]
public long WorkOrderItemId { get; set; } public long WorkOrderItemId { get; set; }

View File

@@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json; using Newtonsoft.Json;
using AyaNova.Biz; using AyaNova.Biz;
using System.Collections.Generic;
namespace AyaNova.Models namespace AyaNova.Models
{ {
@@ -29,28 +30,6 @@ namespace AyaNova.Models
public decimal Distance { get; set; } public decimal Distance { get; set; }
// //PRICE FIELDS
// [Required]
// public decimal Cost { get; set; }
// [Required]
// public decimal ListPrice { get; set; }
// [Required]
// public decimal Price { get; set; }
// [Required]
// public string TaxName { get; set; }
// [Required]
// public decimal TaxAPct { get; set; }
// [Required]
// public decimal TaxBPct { get; set; }
// [Required]
// public bool TaxOnTax { get; set; }
// [NotMapped]
// public decimal TaxAViz { get; set; }
// [NotMapped]
// public decimal TaxBViz { get; set; }
// [NotMapped]
// public decimal LineTotalViz { get; set; }
//Standard pricing fields (mostly to support printed reports though some show in UI) //Standard pricing fields (mostly to support printed reports though some show in UI)
//some not to be sent with record depending on role (i.e. cost and charge in some cases) //some not to be sent with record depending on role (i.e. cost and charge in some cases)
public decimal? PriceOverride { get; set; }//user entered manually overridden price, if null then ignored in calcs otherwise this *is* the price even if zero public decimal? PriceOverride { get; set; }//user entered manually overridden price, if null then ignored in calcs otherwise this *is* the price even if zero
@@ -71,6 +50,11 @@ namespace AyaNova.Models
[NotMapped] [NotMapped]
public decimal LineTotalViz { get; set; }//line total netViz + taxes public decimal LineTotalViz { get; set; }//line total netViz + taxes
//workaround for notification
[NotMapped, JsonIgnore]
public List<string> Tags { get; set; } = new List<string>();
[NotMapped, JsonIgnore]
public string Name { get; set; }
[Required] [Required]
public long WorkOrderItemId { get; set; } public long WorkOrderItemId { get; set; }

View File

@@ -25,6 +25,11 @@ namespace AyaNova.Models
[JsonIgnore] [JsonIgnore]
public WorkOrderItem WorkOrderItem { get; set; } public WorkOrderItem WorkOrderItem { get; set; }
//workaround for notification
[NotMapped, JsonIgnore]
public string Name { get; set; }
[NotMapped, JsonIgnore] [NotMapped, JsonIgnore]
public AyaType AyaType { get => AyaType.WorkOrderItemUnit; } public AyaType AyaType { get => AyaType.WorkOrderItemUnit; }

View File

@@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json; using Newtonsoft.Json;
using AyaNova.Biz; using AyaNova.Biz;
using System.Collections.Generic;
namespace AyaNova.Models namespace AyaNova.Models
{ {
@@ -23,6 +24,12 @@ namespace AyaNova.Models
[NotMapped] [NotMapped]
public string UserViz { get; set; } public string UserViz { get; set; }
//workaround for notification
[NotMapped, JsonIgnore]
public List<string> Tags { get; set; } = new List<string>();
[NotMapped, JsonIgnore]
public string Name { get; set; }
//UTILITY FIELDS //UTILITY FIELDS
//related //related