Commit 2f211902 authored by Maxym Borodenko's avatar Maxym Borodenko

Merge branch 'ui-120-inventory-details' into 'master'

Inventory: Details should include inventory maintenance policy

See merge request !114
parents 22f5031d fc6c7601
......@@ -133,6 +133,7 @@ public class Inventory extends CooperatorOwnedModel implements Copyable<Inventor
@NotNull
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "inventory_maint_policy_id", nullable = false)
@JsonIgnoreProperties({ "ownedBy" })
private InventoryMaintenancePolicy inventoryMaintenancePolicy;
@Basic
......
......@@ -333,6 +333,7 @@ public class InventoryServiceImpl extends FilteredCRUDServiceImpl<Inventory, Inv
Hibernate.initialize(inventory.getActions());
Hibernate.initialize(inventory.getViability());
Hibernate.initialize(inventory.getQuality());
Hibernate.initialize(inventory.getInventoryMaintPolicy());
InventoryDetails inventoryDetails = new InventoryDetails();
inventoryDetails.inventory = inventory;
......
......@@ -166,6 +166,8 @@ public class InventoryControllerTest extends AbstractApiV1Test {
.andExpect(jsonPath("$.formTypeCode", is(savedInventory.getFormTypeCode())))
// has accession
.andExpect(jsonPath("$.accession").isMap())
// has maintenance policy
.andExpect(jsonPath("$.inventoryMaintPolicy").isMap())
// check actions
.andExpect(jsonPath("$.actions").isArray())
.andExpect(jsonPath("$.actions", hasSize(1)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment