From ecd4f24137d05bc8f4678cb94e80e612ac04630a Mon Sep 17 00:00:00 2001 From: azizbekxm Date: Tue, 14 Nov 2023 18:28:59 +0500 Subject: [PATCH] [MODAUD-174] - Implemented status change history feature and cleaned code --- descriptors/ModuleDescriptor-template.json | 2 +- .../acquisition/impl/OrderEventsDaoImpl.java | 9 ++- .../impl/OrderLineEventsDaoImpl.java | 8 ++- .../acquisition/impl/PieceEventsDaoImpl.java | 21 ++++--- .../rest/impl/AuditDataAcquisitionImpl.java | 6 +- .../impl/OrderAuditEventsServiceImpl.java | 4 +- .../impl/OrderLineAuditEventsServiceImpl.java | 4 +- .../impl/PieceAuditEventsServiceImpl.java | 4 +- .../org/folio/util/AuditEventDBConstants.java | 1 + .../templates/db_scripts/schema.json | 2 +- .../impl/AuditDataAcquisitionAPITest.java | 56 +++++++++++++++++++ .../java/org/folio/utils/EntityUtils.java | 15 +++++ ramls/acquisition-events.raml | 2 +- 13 files changed, 109 insertions(+), 25 deletions(-) diff --git a/descriptors/ModuleDescriptor-template.json b/descriptors/ModuleDescriptor-template.json index 190404c..8eaa93a 100644 --- a/descriptors/ModuleDescriptor-template.json +++ b/descriptors/ModuleDescriptor-template.json @@ -138,7 +138,7 @@ "methods": [ "GET" ], - "pathPattern": "/audit-data/acquisition/piece/{id}/unique-status", + "pathPattern": "/audit-data/acquisition/piece/{id}/status-change-history", "permissionsRequired": [ "acquisition.piece.events.get" ] diff --git a/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderEventsDaoImpl.java b/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderEventsDaoImpl.java index f866e24..202f8b9 100644 --- a/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderEventsDaoImpl.java +++ b/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderEventsDaoImpl.java @@ -32,7 +32,7 @@ public class OrderEventsDaoImpl implements OrderEventsDao { public static final String TABLE_NAME = "acquisition_order_log"; public static final String GET_BY_ORDER_ID_SQL = "SELECT id, action, order_id, user_id, event_date, action_date, modified_content_snapshot," + - " (SELECT count(*) AS total_records FROM %s WHERE order_id = $1) FROM %s WHERE order_id = $1 %s LIMIT $2 OFFSET $3"; + " FROM %s WHERE order_id = $1 %s LIMIT $2 OFFSET $3"; public static final String INSERT_SQL = "INSERT INTO %s (id, action, order_id, user_id, event_date, action_date, modified_content_snapshot)" + " VALUES ($1, $2, $3, $4, $5, $6, $7)"; @@ -65,7 +65,7 @@ public Future getAuditEventsByOrderId(String orderId, try { LOGGER.info("getAuditEventsByOrderId:: Trying to Retrieve AuditEvent with order id : {}", orderId); String logTable = formatDBTableName(tenantId, TABLE_NAME); - String query = format(GET_BY_ORDER_ID_SQL, logTable, logTable, format(ORDER_BY_PATTERN, sortBy, sortOrder)); + String query = format(GET_BY_ORDER_ID_SQL, logTable, format(ORDER_BY_PATTERN, sortBy, sortOrder)); Tuple queryParams = Tuple.of(UUID.fromString(orderId), limit, offset); pgClientFactory.createInstance(tenantId).selectRead(query, queryParams, promise); } catch (Exception e) { @@ -98,10 +98,13 @@ private void makeSaveCall(Promise> promise, String query, OrderAudit private OrderAuditEventCollection mapRowToListOfOrderEvent(RowSet rowSet) { LOGGER.debug("mapRowToListOfOrderEvent:: Mapping row to List of Order Events"); OrderAuditEventCollection orderAuditEventCollection = new OrderAuditEventCollection(); + // set audit piece change record(s) by mapping rowSet one by one rowSet.iterator().forEachRemaining(row -> { orderAuditEventCollection.getOrderAuditEvents().add(mapRowToOrderEvent(row)); - orderAuditEventCollection.setTotalItems(row.getInteger(TOTAL_RECORDS_FIELD)); }); + // set total records + int totalRecords = orderAuditEventCollection.getOrderAuditEvents().size(); + orderAuditEventCollection.setTotalItems(totalRecords); LOGGER.info("mapRowToListOfOrderEvent:: Mapped row to List of Order Events"); return orderAuditEventCollection; } diff --git a/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderLineEventsDaoImpl.java b/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderLineEventsDaoImpl.java index edae488..12da894 100644 --- a/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderLineEventsDaoImpl.java +++ b/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderLineEventsDaoImpl.java @@ -32,7 +32,6 @@ public class OrderLineEventsDaoImpl implements OrderLineEventsDao { public static final String TABLE_NAME = "acquisition_order_line_log"; public static final String GET_BY_ORDER_LINE_ID_SQL = "SELECT id, action, order_id, order_line_id, user_id, event_date, action_date, modified_content_snapshot," + - " (SELECT count(*) AS total_records FROM %s WHERE order_line_id = $1) " + " FROM %s WHERE order_line_id = $1 %s LIMIT $2 OFFSET $3"; private static final String INSERT_SQL = "INSERT INTO %s (id, action, order_id, order_line_id, user_id, event_date, action_date, modified_content_snapshot) " + @@ -67,7 +66,7 @@ public Future getAuditEventsByOrderLineId(String try { LOGGER.info("getAuditEventsByOrderLineId:: Trying to Retrieve AuditEvent with order line id : {}", orderLineId); String logTable = formatDBTableName(tenantId, TABLE_NAME); - String query = format(GET_BY_ORDER_LINE_ID_SQL, logTable, logTable, format(ORDER_BY_PATTERN, sortBy, sortOrder)); + String query = format(GET_BY_ORDER_LINE_ID_SQL, logTable, format(ORDER_BY_PATTERN, sortBy, sortOrder)); Tuple queryParams = Tuple.of(UUID.fromString(orderLineId), limit, offset); pgClientFactory.createInstance(tenantId).selectRead(query, queryParams, promise); } catch (Exception e) { @@ -101,10 +100,13 @@ private void makeSaveCall(Promise> promise, String query, OrderLineA private OrderLineAuditEventCollection mapRowToListOfOrderLineEvent(RowSet rowSet) { LOGGER.debug("mapRowToListOfOrderLineEvent:: Mapping row to List of Order Line Events"); OrderLineAuditEventCollection orderLineAuditEventCollection = new OrderLineAuditEventCollection(); + // set audit piece change record(s) by mapping rowSet one by one rowSet.iterator().forEachRemaining(row -> { orderLineAuditEventCollection.getOrderLineAuditEvents().add(mapRowToOrderLineEvent(row)); - orderLineAuditEventCollection.setTotalItems(row.getInteger(TOTAL_RECORDS_FIELD)); }); + // set total records + int totalRecords = orderLineAuditEventCollection.getOrderLineAuditEvents().size(); + orderLineAuditEventCollection.setTotalItems(totalRecords); LOGGER.info("mapRowToListOfOrderLineEvent:: Mapped row to List of Order Line Events"); return orderLineAuditEventCollection; } diff --git a/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/PieceEventsDaoImpl.java b/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/PieceEventsDaoImpl.java index 4848335..8f5107c 100644 --- a/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/PieceEventsDaoImpl.java +++ b/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/PieceEventsDaoImpl.java @@ -37,11 +37,16 @@ public class PieceEventsDaoImpl implements PieceEventsDao { private static final String TABLE_NAME = "acquisition_piece_log"; private static final String GET_BY_PIECE_ID_SQL = "SELECT id, action, piece_id, user_id, event_date, action_date, modified_content_snapshot" + " FROM %s WHERE piece_id = $1 %s LIMIT $2 OFFSET $3"; - private static final String GET_UNIQUE_STATUS_BY_PIECE_ID_SQL = "SELECT id, action, piece_id, user_id, event_date, action_date, modified_content_snapshot" + - " FROM %s WHERE piece_id = $1 AND" + - " action IN" + - " (SELECT action FROM %s WHERE piece_id = $1 GROUP BY action HAVING COUNT(action) = 1)" + - " %s LIMIT $2 OFFSET $3"; + private static final String GET_STATUS_CHANGE_HISTORY_BY_PIECE_ID_SQL = + """ + WITH StatusChanges AS (SELECT id, action, piece_id, user_id, event_date, action_date, modified_content_snapshot, + LAG(modified_content_snapshot ->> 'status') OVER (PARTITION BY piece_id ORDER BY action_date) AS previous_status FROM %s + ) + SELECT id, action, piece_id, user_id, event_date, action_date, modified_content_snapshot FROM StatusChanges + WHERE piece_id = $1 and modified_content_snapshot ->> 'status' <> COALESCE(previous_status, '') + %s LIMIT $2 OFFSET $3 + """; + private static final String INSERT_SQL = "INSERT INTO %s (id, action, piece_id, user_id, event_date, action_date, modified_content_snapshot)" + " VALUES ($1, $2, $3, $4, $5, $6, $7)"; @@ -89,9 +94,9 @@ public Future getAuditEventsWithUniqueStatusByPieceId LOGGER.debug("getAuditEventsByOrderId:: Retrieving AuditEvent with piece id : {}", pieceId); Promise> promise = Promise.promise(); try { - LOGGER.info("getAuditEventsByOrderId:: Trying to Retrieve AuditEvent with order id : {}", pieceId); + LOGGER.info("getAuditEventsByOrderId:: Trying to Retrieve AuditEvent with piece id : {}", pieceId); String logTable = formatDBTableName(tenantId, TABLE_NAME); - String query = format(GET_UNIQUE_STATUS_BY_PIECE_ID_SQL, logTable, logTable, format(ORDER_BY_PATTERN, sortBy, sortOrder)); + String query = format(GET_STATUS_CHANGE_HISTORY_BY_PIECE_ID_SQL, logTable, format(ORDER_BY_PATTERN, sortBy, sortOrder)); Tuple queryParams = Tuple.of(UUID.fromString(pieceId), limit, offset); pgClientFactory.createInstance(tenantId).selectRead(query, queryParams, promise); } catch (Exception e) { @@ -106,7 +111,6 @@ public Future getAuditEventsWithUniqueStatusByPieceId private PieceAuditEventCollection mapRowToListOfPieceEvent(RowSet rowSet) { LOGGER.debug("mapRowToListOfOrderEvent:: Mapping row to List of Piece Events"); PieceAuditEventCollection pieceAuditEventCollection = new PieceAuditEventCollection(); - // set audit piece change record(s) by mapping rowSet one by one rowSet.iterator().forEachRemaining(row -> { pieceAuditEventCollection.getPieceAuditEvents().add(mapRowToPieceEvent(row)); @@ -114,7 +118,6 @@ private PieceAuditEventCollection mapRowToListOfPieceEvent(RowSet rowSet) { // set total records int totalRecords = pieceAuditEventCollection.getPieceAuditEvents().size(); pieceAuditEventCollection.setTotalItems(totalRecords); - LOGGER.info("mapRowToListOfOrderEvent:: Mapped row to List of Piece Events"); return pieceAuditEventCollection; } diff --git a/mod-audit-server/src/main/java/org/folio/rest/impl/AuditDataAcquisitionImpl.java b/mod-audit-server/src/main/java/org/folio/rest/impl/AuditDataAcquisitionImpl.java index 5c210c8..5c3edaf 100644 --- a/mod-audit-server/src/main/java/org/folio/rest/impl/AuditDataAcquisitionImpl.java +++ b/mod-audit-server/src/main/java/org/folio/rest/impl/AuditDataAcquisitionImpl.java @@ -10,7 +10,7 @@ import org.folio.rest.jaxrs.model.AuditDataAcquisitionOrderIdGetSortOrder; import org.folio.rest.jaxrs.model.AuditDataAcquisitionOrderLineIdGetSortOrder; import org.folio.rest.jaxrs.model.AuditDataAcquisitionPieceIdGetSortOrder; -import org.folio.rest.jaxrs.model.AuditDataAcquisitionPieceIdUniqueStatusGetSortOrder; +import org.folio.rest.jaxrs.model.AuditDataAcquisitionPieceIdStatusChangeHistoryGetSortOrder; import org.folio.rest.jaxrs.resource.AuditDataAcquisition; import org.folio.rest.tools.utils.TenantTool; import org.folio.services.acquisition.OrderAuditEventsService; @@ -105,7 +105,9 @@ public void getAuditDataAcquisitionPieceById(String pieceId, String sortBy, Audi } @Override - public void getAuditDataAcquisitionPieceUniqueStatusById(String pieceId, String sortBy, AuditDataAcquisitionPieceIdUniqueStatusGetSortOrder sortOrder, int limit, int offset, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { + public void getAuditDataAcquisitionPieceStatusChangeHistoryById(String pieceId, String sortBy, + AuditDataAcquisitionPieceIdStatusChangeHistoryGetSortOrder sortOrder, + int limit, int offset, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { LOGGER.debug("getAuditDataAcquisitionOrderById:: Retrieving Audit Data Acquisition Piece with unique status By Id : {}", pieceId); String tenantId = TenantTool.tenantId(okapiHeaders); diff --git a/mod-audit-server/src/main/java/org/folio/services/acquisition/impl/OrderAuditEventsServiceImpl.java b/mod-audit-server/src/main/java/org/folio/services/acquisition/impl/OrderAuditEventsServiceImpl.java index 213b2b7..3741c36 100644 --- a/mod-audit-server/src/main/java/org/folio/services/acquisition/impl/OrderAuditEventsServiceImpl.java +++ b/mod-audit-server/src/main/java/org/folio/services/acquisition/impl/OrderAuditEventsServiceImpl.java @@ -1,5 +1,7 @@ package org.folio.services.acquisition.impl; +import static org.folio.util.AuditEventDBConstants.UNIQUE_CONSTRAINT_VIOLATION_CODE; + import io.vertx.core.Future; import io.vertx.pgclient.PgException; import io.vertx.sqlclient.Row; @@ -19,8 +21,6 @@ public class OrderAuditEventsServiceImpl implements OrderAuditEventsService { private static final Logger LOGGER = LogManager.getLogger(); - public static final String UNIQUE_CONSTRAINT_VIOLATION_CODE = "23505"; - private OrderEventsDao orderEventsDao; @Autowired diff --git a/mod-audit-server/src/main/java/org/folio/services/acquisition/impl/OrderLineAuditEventsServiceImpl.java b/mod-audit-server/src/main/java/org/folio/services/acquisition/impl/OrderLineAuditEventsServiceImpl.java index ecc275c..e08c409 100644 --- a/mod-audit-server/src/main/java/org/folio/services/acquisition/impl/OrderLineAuditEventsServiceImpl.java +++ b/mod-audit-server/src/main/java/org/folio/services/acquisition/impl/OrderLineAuditEventsServiceImpl.java @@ -1,5 +1,7 @@ package org.folio.services.acquisition.impl; +import static org.folio.util.AuditEventDBConstants.UNIQUE_CONSTRAINT_VIOLATION_CODE; + import io.vertx.core.Future; import io.vertx.pgclient.PgException; import io.vertx.sqlclient.Row; @@ -19,8 +21,6 @@ public class OrderLineAuditEventsServiceImpl implements OrderLineAuditEventsServ private static final Logger LOGGER = LogManager.getLogger(); - public static final String UNIQUE_CONSTRAINT_VIOLATION_CODE = "23505"; - private OrderLineEventsDao orderLineEventsDao; @Autowired diff --git a/mod-audit-server/src/main/java/org/folio/services/acquisition/impl/PieceAuditEventsServiceImpl.java b/mod-audit-server/src/main/java/org/folio/services/acquisition/impl/PieceAuditEventsServiceImpl.java index 7839f2a..9f73a41 100644 --- a/mod-audit-server/src/main/java/org/folio/services/acquisition/impl/PieceAuditEventsServiceImpl.java +++ b/mod-audit-server/src/main/java/org/folio/services/acquisition/impl/PieceAuditEventsServiceImpl.java @@ -1,5 +1,7 @@ package org.folio.services.acquisition.impl; +import static org.folio.util.AuditEventDBConstants.UNIQUE_CONSTRAINT_VIOLATION_CODE; + import io.vertx.core.Future; import io.vertx.pgclient.PgException; import io.vertx.sqlclient.Row; @@ -17,7 +19,7 @@ @Service public class PieceAuditEventsServiceImpl implements PieceAuditEventsService { private static final Logger LOGGER = LogManager.getLogger(); - private static final String UNIQUE_CONSTRAINT_VIOLATION_CODE = "23505"; + private final PieceEventsDao pieceEventsDao; @Autowired diff --git a/mod-audit-server/src/main/java/org/folio/util/AuditEventDBConstants.java b/mod-audit-server/src/main/java/org/folio/util/AuditEventDBConstants.java index f81a84e..62d40cf 100644 --- a/mod-audit-server/src/main/java/org/folio/util/AuditEventDBConstants.java +++ b/mod-audit-server/src/main/java/org/folio/util/AuditEventDBConstants.java @@ -26,4 +26,5 @@ private AuditEventDBConstants() {} public static final String ORDER_BY_PATTERN = "ORDER BY %s %s"; + public static final String UNIQUE_CONSTRAINT_VIOLATION_CODE = "23505"; } diff --git a/mod-audit-server/src/main/resources/templates/db_scripts/schema.json b/mod-audit-server/src/main/resources/templates/db_scripts/schema.json index 960d463..be4d080 100644 --- a/mod-audit-server/src/main/resources/templates/db_scripts/schema.json +++ b/mod-audit-server/src/main/resources/templates/db_scripts/schema.json @@ -78,7 +78,7 @@ { "run": "after", "snippetPath": "acquisition/create_acquisition_piece_log_table.sql", - "fromModuleVersion": "mod-audit-2.8.1" + "fromModuleVersion": "mod-audit-2.9.0" } ] } diff --git a/mod-audit-server/src/test/java/org/folio/rest/impl/AuditDataAcquisitionAPITest.java b/mod-audit-server/src/test/java/org/folio/rest/impl/AuditDataAcquisitionAPITest.java index 6e68270..534d689 100644 --- a/mod-audit-server/src/test/java/org/folio/rest/impl/AuditDataAcquisitionAPITest.java +++ b/mod-audit-server/src/test/java/org/folio/rest/impl/AuditDataAcquisitionAPITest.java @@ -4,6 +4,7 @@ import static org.folio.utils.EntityUtils.ORDER_ID; import static org.folio.utils.EntityUtils.ORDER_LINE_ID; import static org.folio.utils.EntityUtils.PIECE_ID; +import static org.folio.utils.EntityUtils.createPieceAuditEvent; import static org.hamcrest.Matchers.containsString; import java.util.Date; @@ -34,6 +35,7 @@ public class AuditDataAcquisitionAPITest extends ApiTestBase { private static final String ACQ_AUDIT_ORDER_PATH = "/audit-data/acquisition/order/"; private static final String ACQ_AUDIT_ORDER_LINE_PATH = "/audit-data/acquisition/order-line/"; private static final String ACQ_AUDIT_PIECE_PATH = "/audit-data/acquisition/piece/"; + private static final String ACQ_AUDIT_PIECE_STATUS_CHANGE_HISTORY_PATH = "/status-change-history"; private static final String TENANT_ID = "modaudittest"; @Spy @@ -146,4 +148,58 @@ void shouldReturnPieceEventsOnGetByPieceId() { given().header(CONTENT_TYPE).header(TENANT).header(PERMS).get(ACQ_AUDIT_PIECE_PATH + PIECE_ID + 123).then().log().all().statusCode(500) .body(containsString("UUID string too large")); } + + @Test + void shouldReturnPieceEventsStatusChangeHistoryGetByPieceId() { + String id1 = UUID.randomUUID().toString(); + String id2 = UUID.randomUUID().toString(); + String id3 = UUID.randomUUID().toString(); + String id4 = UUID.randomUUID().toString(); + String id5 = UUID.randomUUID().toString(); + var pieceAuditEvent1 = createPieceAuditEvent(id1, "STATUS 1"); + var pieceAuditEvent2 = createPieceAuditEvent(id2, "STATUS 1"); + var pieceAuditEvent3 = createPieceAuditEvent(id3, "STATUS 2"); + var pieceAuditEvent4 = createPieceAuditEvent(id4, "STATUS 2"); + var pieceAuditEvent5 = createPieceAuditEvent(id5, "STATUS 1"); + + pieceEventsDao.save(pieceAuditEvent1, TENANT_ID); + pieceEventsDao.save(pieceAuditEvent2, TENANT_ID); + pieceEventsDao.save(pieceAuditEvent3, TENANT_ID); + pieceEventsDao.save(pieceAuditEvent4, TENANT_ID); + pieceEventsDao.save(pieceAuditEvent5, TENANT_ID); + + // based on our business logic, it returns pieceAuditEvent1, pieceAuditEvent3, pieceAuditEvent5 + given().header(CONTENT_TYPE).header(TENANT).header(PERMS) + .get(ACQ_AUDIT_PIECE_PATH + INVALID_ID + ACQ_AUDIT_PIECE_STATUS_CHANGE_HISTORY_PATH) + .then().log().all().statusCode(200) + .body(containsString("pieceAuditEvents")).body(containsString("totalItems")); + + + given().header(CONTENT_TYPE).header(TENANT).header(PERMS) + .get(ACQ_AUDIT_PIECE_PATH + PIECE_ID + ACQ_AUDIT_PIECE_STATUS_CHANGE_HISTORY_PATH) + .then().log().all().statusCode(200) + .body(containsString(PIECE_ID)) + .body(containsString(id1)) + .body(containsString(id3)) + .body(containsString(id5)); + + given().header(CONTENT_TYPE).header(TENANT).header(PERMS) + .get(ACQ_AUDIT_PIECE_PATH + PIECE_ID + ACQ_AUDIT_PIECE_STATUS_CHANGE_HISTORY_PATH +"?limit=1") + .then().log().all().statusCode(200) + .body(containsString(PIECE_ID)) + .body(containsString(id1)); + + given().header(CONTENT_TYPE).header(TENANT).header(PERMS) + .get(ACQ_AUDIT_PIECE_PATH + PIECE_ID + ACQ_AUDIT_PIECE_STATUS_CHANGE_HISTORY_PATH +"?sortBy=action_date") + .then().log().all().statusCode(200) + .body(containsString(PIECE_ID)) + .body(containsString(id1)) + .body(containsString(id3)) + .body(containsString(id5)); + + given().header(CONTENT_TYPE).header(TENANT).header(PERMS) + .get(ACQ_AUDIT_PIECE_PATH + PIECE_ID + ACQ_AUDIT_PIECE_STATUS_CHANGE_HISTORY_PATH + 123) + .then().log().all().statusCode(500) + .body(containsString("UUID string too large")); + } } diff --git a/mod-audit-server/src/test/java/org/folio/utils/EntityUtils.java b/mod-audit-server/src/test/java/org/folio/utils/EntityUtils.java index d16a90b..b40bf2b 100644 --- a/mod-audit-server/src/test/java/org/folio/utils/EntityUtils.java +++ b/mod-audit-server/src/test/java/org/folio/utils/EntityUtils.java @@ -69,6 +69,21 @@ public static PieceAuditEvent createPieceAuditEvent(String id) { .withPieceSnapshot(jsonObject); } + public static PieceAuditEvent createPieceAuditEvent(String id, String status) { + JsonObject jsonObject = new JsonObject(); + jsonObject.put("name", "Test Product"); + jsonObject.put("status", status); + + return new PieceAuditEvent() + .withId(id) + .withAction(PieceAuditEvent.Action.CREATE) + .withPieceId(PIECE_ID) + .withUserId(UUID.randomUUID().toString()) + .withEventDate(new Date()) + .withActionDate(new Date()) + .withPieceSnapshot(jsonObject); + } + public static PieceAuditEvent createPieceAuditEventWithoutSnapshot() { return new PieceAuditEvent() .withId(UUID.randomUUID().toString()) diff --git a/ramls/acquisition-events.raml b/ramls/acquisition-events.raml index e83a998..8bdd085 100644 --- a/ramls/acquisition-events.raml +++ b/ramls/acquisition-events.raml @@ -125,7 +125,7 @@ traits: example: strict: false value: !include raml-util/examples/errors.sample - /piece/{id}/unique-status: + /piece/{id}/status-change-history: get: description: Get list of piece events which have unique status changes by piece_id is: [