This commit is contained in:
2026-03-02 13:18:30 -08:00
parent d248753984
commit 48f9f82c23
2 changed files with 7 additions and 3 deletions

View File

@@ -99,6 +99,8 @@ namespace raven_integration
long woId = a.ObjectResponse["data"]["id"].Value<long>();
// Attempt to delete the customer — should be blocked by referential integrity
//bugbug: this is returning a 500 due to a bug at the server end
//case 4653, holding off fixing until ready for refactor.
a = await Util.DeleteAsync($"customer/{customerId}", token);
Util.ValidateViolatesReferentialIntegrityError(a);

View File

@@ -33,7 +33,7 @@ namespace raven_integration
// customerId=1 is a seeded customer; serial=0 means server assigns it.
// -------------------------------------------------------------------
var payload = $$"""
{"id":0,"concurrency":0,"serial":0,"notes":"Test PM the quick brown fox jumped over the six lazy dogs!","wiki":null,"customFields":"{}","tags":[],"copyWiki":false,"copyAttachments":true,"stopGeneratingDate":null,"excludeDaysOfWeek":96,"active":true,"nextServiceDate":"{{isoNextService}}","repeatUnit":6,"generateBeforeUnit":4,"repeatInterval":1,"generateBeforeInterval":3,"customerId":1,"projectId":null,"internalReferenceNumber":"PM-INT-001","customerReferenceNumber":null,"customerContactName":null,"onsite":true,"contractId":null,"postAddress":null,"postCity":null,"postRegion":null,"postCountry":null,"postCode":null,"address":null,"city":null,"region":null,"country":null,"addressPostal":null,"latitude":null,"longitude":null}
{"id":0,"concurrency":0,"serial":0,"notes":"Test PM the quick brown fox jumped over the six lazy dogs!","wiki":null,"customFields":"{}","tags":[],"copyWiki":false,"copyAttachments":true,"stopGeneratingDate":null,"excludeDaysOfWeek":96,"active":false,"nextServiceDate":"{{isoNextService}}","repeatUnit":6,"generateBeforeUnit":4,"repeatInterval":1,"generateBeforeInterval":3,"customerId":1,"projectId":null,"internalReferenceNumber":"PM-INT-001","customerReferenceNumber":null,"customerContactName":null,"onsite":true,"contractId":null,"postAddress":null,"postCity":null,"postRegion":null,"postCountry":null,"postCode":null,"address":null,"city":null,"region":null,"country":null,"addressPostal":null,"latitude":null,"longitude":null}
""";
ApiResponse a = await Util.PostAsync("pm", token, payload);
@@ -81,6 +81,7 @@ namespace raven_integration
// -------------------------------------------------------------------
// UPDATE PM ITEM
// -------------------------------------------------------------------
payload = $$"""
{"id":{{PMItemId}},"concurrency":{{itemConcurrency}},"notes":"Updated PM item notes","wiki":null,"customFields":"{}","tags":[],"pmId":{{PMId}},"techNotes":"Updated tech notes","workOrderItemStatusId":null,"workOrderItemPriorityId":null,"requestDate":null,"warrantyService":false,"sequence":1}
""";
@@ -96,14 +97,15 @@ namespace raven_integration
// -------------------------------------------------------------------
// UPDATE PM HEADER
// -------------------------------------------------------------------
var isoNewNextService = DateTime.UtcNow.AddDays(14).ToString("o");
payload = $$"""
{"id":{{PMId}},"concurrency":{{headerConcurrency}},"serial":{{PMSerial}},"notes":"Updated PM notes","wiki":null,"customFields":"{}","tags":[],"copyWiki":true,"copyAttachments":true,"stopGeneratingDate":null,"excludeDaysOfWeek":0,"active":true,"nextServiceDate":"{{isoNewNextService}}","repeatUnit":4,"generateBeforeUnit":4,"repeatInterval":2,"generateBeforeInterval":5,"customerId":1,"projectId":null,"internalReferenceNumber":"PM-INT-002","customerReferenceNumber":null,"customerContactName":null,"onsite":false,"contractId":null,"postAddress":null,"postCity":null,"postRegion":null,"postCountry":null,"postCode":null,"address":null,"city":null,"region":null,"country":null,"addressPostal":null,"latitude":null,"longitude":null}
{"id":{{PMId}},"concurrency":{{headerConcurrency}},"serial":{{PMSerial}},"notes":"Updated PM notes","wiki":null,"customFields":"{}","tags":[],"copyWiki":true,"copyAttachments":true,"stopGeneratingDate":null,"excludeDaysOfWeek":0,"active":false,"nextServiceDate":"{{isoNewNextService}}","repeatUnit":7,"generateBeforeUnit":4,"repeatInterval":1,"generateBeforeInterval":5,"customerId":1,"projectId":null,"internalReferenceNumber":"PM-INT-002","customerReferenceNumber":null,"customerContactName":null,"onsite":false,"contractId":null,"postAddress":null,"postCity":null,"postRegion":null,"postCountry":null,"postCode":null,"address":null,"city":null,"region":null,"country":null,"addressPostal":null,"latitude":null,"longitude":null}
""";
a = await Util.PutAsync("pm", token, payload);
Util.ValidateHTTPStatusCode(a, 200);
a.ObjectResponse["data"]["internalReferenceNumber"].Value<string>().Should().Be("PM-INT-002");
a.ObjectResponse["data"]["repeatUnit"].Value<int>().Should().Be(4, "should now be Days");
a.ObjectResponse["data"]["repeatUnit"].Value<int>().Should().Be(7, "should now be Years");
var newHeaderConcurrency = a.ObjectResponse["data"]["concurrency"].Value<uint>();
newHeaderConcurrency.Should().NotBe(headerConcurrency);