From 48f9f82c2334b38fc94534dccccd0776e98458bd Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 2 Mar 2026 13:18:30 -0800 Subject: [PATCH] 4648 --- Customer/CustomerCrud.cs | 2 ++ PM/PMCrud.cs | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Customer/CustomerCrud.cs b/Customer/CustomerCrud.cs index abc893a..39e6980 100644 --- a/Customer/CustomerCrud.cs +++ b/Customer/CustomerCrud.cs @@ -99,6 +99,8 @@ namespace raven_integration long woId = a.ObjectResponse["data"]["id"].Value(); // 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); diff --git a/PM/PMCrud.cs b/PM/PMCrud.cs index ad0785b..948ffb0 100644 --- a/PM/PMCrud.cs +++ b/PM/PMCrud.cs @@ -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().Should().Be("PM-INT-002"); - a.ObjectResponse["data"]["repeatUnit"].Value().Should().Be(4, "should now be Days"); + a.ObjectResponse["data"]["repeatUnit"].Value().Should().Be(7, "should now be Years"); var newHeaderConcurrency = a.ObjectResponse["data"]["concurrency"].Value(); newHeaderConcurrency.Should().NotBe(headerConcurrency);