diff --git a/payment/src/main/java/payment/api/clients/OrderClient.java b/payment/src/main/java/payment/api/clients/OrderClient.java new file mode 100644 index 00000000..d3905665 --- /dev/null +++ b/payment/src/main/java/payment/api/clients/OrderClient.java @@ -0,0 +1,21 @@ +package payment.api.clients; + +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import payment.api.dto.OrderUpdateRequestDTO; + +@RegisterRestClient(baseUri = "http://localhost:8084/") +@Path("/orders") +@Consumes(MediaType.APPLICATION_JSON) +@Produces(MediaType.APPLICATION_JSON) +public interface OrderClient { + @POST + @Path("/update-status") + Response updateOrderStatus(OrderUpdateRequestDTO orderUpdateRequestDTO); +} diff --git a/payment/src/main/java/payment/api/dto/OrderUpdateRequestDTO.java b/payment/src/main/java/payment/api/dto/OrderUpdateRequestDTO.java new file mode 100644 index 00000000..c45d6c1c --- /dev/null +++ b/payment/src/main/java/payment/api/dto/OrderUpdateRequestDTO.java @@ -0,0 +1,34 @@ +package payment.api.dto; + +import java.util.UUID; + +public class OrderUpdateRequestDTO { + + private UUID orderId; + private String newStatus; + + public OrderUpdateRequestDTO() {} + + public OrderUpdateRequestDTO(UUID orderId, String newStatus) { + this.orderId = orderId; + this.newStatus = newStatus; + } + + + public UUID getOrderId() { + return orderId; + } + + public void setOrderId(UUID orderId) { + this.orderId = orderId; + } + + public String getNewStatus() { + return newStatus; + } + + public void setNewStatus(String newStatus) { + this.newStatus = newStatus; + } +} +