use of org.rembx.jeeshop.catalog.model.SKU in project jeeshop by remibantos.
the class SKUsCT method modify_ShouldModify_for_store_admin.
@Test
public void modify_ShouldModify_for_store_admin() {
tester.setStoreAdminUser();
SKU sku = new SKU(tester.getFixtures().aVisibleSKU().getId(), "New name");
tester.test_modify(sku);
Assertions.assertThat(sku.getName()).isEqualTo("New name");
}
use of org.rembx.jeeshop.catalog.model.SKU in project jeeshop by remibantos.
the class DefaultPaymentTransactionEngine method updateSkusQuantities.
protected void updateSkusQuantities(Order order) {
order.getItems().forEach(orderItem -> {
SKU sku = catalogEntityManager.find(SKU.class, (orderItem).getSkuId());
sku.setQuantity(sku.getQuantity() - (orderItem).getQuantity());
});
}
Aggregations