Fixed bug updating status breaks concurrency token for header so can't update it

This commit is contained in:
2022-03-09 18:04:21 +00:00
parent a33f36e5b3
commit 8b5a8e323a
5 changed files with 13 additions and 8 deletions

2
.vscode/launch.json vendored
View File

@@ -48,7 +48,7 @@
"AYANOVA_DATA_PATH": "c:\\temp\\ravendata",
"AYANOVA_USE_URLS": "http://*:7575;",
//"AYANOVA_PERMANENTLY_ERASE_DATABASE":"true",
"AYANOVA_SERVER_TEST_MODE": "true",
"AYANOVA_SERVER_TEST_MODE": "false",
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-8",
//"AYANOVA_REPORT_RENDERING_TIMEOUT":"1",
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",

View File

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

View File

@@ -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()

View File

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

View File

@@ -38,6 +38,9 @@ namespace AyaNova.Models
[NotMapped, JsonIgnore]
public string Name { get; set; }
[NotMapped]
public uint NewWOConcurrency { get; set; }
//UTILITY FIELDS
//related