Commit b909eba1 authored by Alex Pinto's avatar Alex Pinto

updated update and create endpoint

parent 2a2425f6
......@@ -7,6 +7,8 @@ import org.springframework.stereotype.Service;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.util.Date;
@Service
public class WarehouseOrderService {
......@@ -23,7 +25,7 @@ public class WarehouseOrderService {
public Mono<WarehouseOrder> createOrder(WarehouseOrder order) {
order.setStatus("RECEIVED");
order.setCreatedAt(new Date(System.currentTimeMillis()));
return orderRepository.save(order);
}
......@@ -32,6 +34,7 @@ public class WarehouseOrderService {
.flatMap(existingOrder -> {
existingOrder.setOrderId(order.getOrderId());
existingOrder.setStatus(order.getStatus());
existingOrder.setModifiedAt(new Date(System.currentTimeMillis()));
return orderRepository.save(existingOrder);
});
......
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