Fixed bug updating status breaks concurrency token for header so can't update it
This commit is contained in:
@@ -1107,10 +1107,12 @@ namespace AyaNova.Biz
|
||||
else
|
||||
{
|
||||
await ct.QuoteState.AddAsync(newObject);
|
||||
var qoute = await ct.Quote.FirstOrDefaultAsync(x => x.Id == newObject.QuoteId);
|
||||
var quote = await ct.Quote.FirstOrDefaultAsync(x => x.Id == newObject.QuoteId);
|
||||
var newStatusInfo = await ct.QuoteStatus.AsNoTracking().FirstOrDefaultAsync(x => x.Id == newObject.QuoteStatusId);
|
||||
qoute.LastStatusId = newObject.QuoteStatusId;
|
||||
quote.LastStatusId = newObject.QuoteStatusId;
|
||||
await ct.SaveChangesAsync();
|
||||
newObject.NewQuoteConcurrency=quote.Concurrency;
|
||||
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, AyaType.QuoteStatus, AyaEvent.Created), ct);
|
||||
await StateHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
return newObject;
|
||||
|
||||
@@ -1646,6 +1646,8 @@ namespace AyaNova.Biz
|
||||
wo.DurationToCompleted = TimeSpan.Zero;
|
||||
wo.LastStatusId = newObject.WorkOrderStatusId;
|
||||
await ct.SaveChangesAsync();
|
||||
newObject.NewWOConcurrency = wo.Concurrency;
|
||||
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, AyaType.WorkOrderStatus, AyaEvent.Created), ct);
|
||||
await StateHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
return newObject;
|
||||
@@ -2056,7 +2058,7 @@ namespace AyaNova.Biz
|
||||
{
|
||||
EventType = NotifyEventType.WorkorderCompleted,
|
||||
CustomerId = WorkorderInfo.CustomerId,
|
||||
AyaType = AyaType.WorkOrder,
|
||||
AyaType = AyaType.WorkOrder,
|
||||
ObjectId = oProposed.WorkOrderId,
|
||||
CustomerNotifySubscriptionId = sub.Id,
|
||||
Name = WorkorderInfo.Serial.ToString()
|
||||
|
||||
@@ -38,11 +38,9 @@ namespace AyaNova.Models
|
||||
[NotMapped, JsonIgnore]
|
||||
public string Name { get; set; }
|
||||
|
||||
//UTILITY FIELDS
|
||||
[NotMapped]
|
||||
public uint NewQuoteConcurrency { get; set; }
|
||||
|
||||
//related
|
||||
// [JsonIgnore]//internal only here at server not used by client
|
||||
// public QuoteStatus QuoteStatus { get; set; }
|
||||
|
||||
[NotMapped, JsonIgnore]
|
||||
public AyaType AyaType { get => AyaType.QuoteStatus; }
|
||||
|
||||
@@ -38,6 +38,9 @@ namespace AyaNova.Models
|
||||
[NotMapped, JsonIgnore]
|
||||
public string Name { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public uint NewWOConcurrency { get; set; }
|
||||
|
||||
//UTILITY FIELDS
|
||||
|
||||
//related
|
||||
|
||||
Reference in New Issue
Block a user