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,22 +4294,29 @@ namespace AyaNova.Biz
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
await NotifyEventHelper.ProcessStandardObjectEvents(ayaEvent, proposedObj, ct);
//SPECIFIC EVENTS FOR THIS OBJECT
WorkOrderItemPartRequest o = (WorkOrderItemPartRequest)proposedObj;
}//end of process notifications

View File

@@ -12,11 +12,13 @@ namespace AyaNova.Models
//didn't want to end up with a zillion interfaces for all manner of stuff
public long Id { 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 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 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; }
}

View File

@@ -23,13 +23,20 @@ namespace AyaNova.Models
public string CustomFields { get; set; }
public List<string> Tags { get; set; }
/*
todo: Consider adding latitude / longitude to wo, quote, pm objects
can copy over from the unit or customer or set themselves
and can always hide
means wo could be scheduled for ad-hoc locations and serviced that way, i.e. a truck parked on the side of the highway etc
*/
//workaround for notification
[NotMapped, JsonIgnore]
public string Name { get; set; }
/*
todo: Consider adding latitude / longitude to wo, quote, pm objects
can copy over from the unit or customer or set themselves
and can always hide
means wo could be scheduled for ad-hoc locations and serviced that way, i.e. a truck parked on the side of the highway etc
*/
//dependents
public List<PMItem> PMItems { get; set; }

View File

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

View File

@@ -22,13 +22,18 @@ namespace AyaNova.Models
public string CustomFields { get; set; }
public List<string> Tags { get; set; }
/*
todo: Consider adding latitude / longitude to wo, quote, pm objects
can copy over from the unit or customer or set themselves
and can always hide
means wo could be scheduled for ad-hoc locations and serviced that way, i.e. a truck parked on the side of the highway etc
*/
//workaround for notification
[NotMapped, JsonIgnore]
public string Name { get; set; }
/*
todo: Consider adding latitude / longitude to wo, quote, pm objects
can copy over from the unit or customer or set themselves
and can always hide
means wo could be scheduled for ad-hoc locations and serviced that way, i.e. a truck parked on the side of the highway etc
*/
//dependents
public List<QuoteItem> QuoteItems { get; set; }

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
@@ -58,6 +59,12 @@ namespace AyaNova.Models
[NotMapped, JsonIgnore]
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
}//eons

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
@@ -50,8 +51,12 @@ namespace AyaNova.Models
[NotMapped]
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]
public long WorkOrderItemId { get; set; }
[JsonIgnore]

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
@@ -47,7 +48,11 @@ namespace AyaNova.Models
[NotMapped]
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]
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.Schema;
using Newtonsoft.Json;
@@ -51,7 +51,12 @@ namespace AyaNova.Models
[NotMapped]
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]
public long WorkOrderItemId { get; set; }
[JsonIgnore]

View File

@@ -50,9 +50,11 @@ namespace AyaNova.Models
[NotMapped, JsonIgnore]
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]
public List<string> Tags { get; set; } = new List<string>();
[NotMapped, JsonIgnore]
public string Name { get; set; }
}//eoc
}//eons

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
@@ -21,6 +22,12 @@ namespace AyaNova.Models
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]
public long WorkOrderItemId { get; set; }
[JsonIgnore]

View File

@@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
using AyaNova.Biz;
using System.Collections.Generic;
namespace AyaNova.Models
{
@@ -26,7 +27,12 @@ namespace AyaNova.Models
public string CompletedByUserViz { 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]
public long WorkOrderItemId { get; set; }
[JsonIgnore]

View File

@@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
using AyaNova.Biz;
using System.Collections.Generic;
namespace AyaNova.Models
{
@@ -29,28 +30,6 @@ namespace AyaNova.Models
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)
//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
@@ -71,6 +50,11 @@ namespace AyaNova.Models
[NotMapped]
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]
public long WorkOrderItemId { get; set; }

View File

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

View File

@@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
using AyaNova.Biz;
using System.Collections.Generic;
namespace AyaNova.Models
{
@@ -15,16 +16,22 @@ namespace AyaNova.Models
public long WorkOrderId { get; set; }
[Required]
public long WorkOrderStatusId { get; set; }
public DateTime Created { get; set; } = DateTime.UtcNow;
[Required]
public long UserId { get; set; }
[NotMapped]
[NotMapped]
public string UserViz { get; set; }
//UTILITY FIELDS
//workaround for notification
[NotMapped, JsonIgnore]
public List<string> Tags { get; set; } = new List<string>();
[NotMapped, JsonIgnore]
public string Name { get; set; }
//UTILITY FIELDS
//related
// [JsonIgnore]//internal only here at server not used by client
// public WorkOrderStatus WorkOrderStatus { get; set; }