Skip to content

Commit

Permalink
review swagger properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Myller Sakaguchi Lobo committed Aug 10, 2024
1 parent bc50325 commit 07ce50c
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.fiap.tc.adapters.driver.presentation.requests;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
Expand All @@ -12,11 +13,22 @@
public class DeleteProductImagesRequest {

@NotNull
@ApiModelProperty(
value = "Product Id",
required = true,
example = "7ba2a960-2354-466f-8868-6ad713742407",
dataType = "UUID"
)
private UUID idProduct;

@NotNull
@Size(min = 1)
@Valid
@ApiModelProperty(
value = "Product Images ids to be deleted",
required = true,
dataType = "List<UUID>"
)
private List<UUID> images;

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class OrderPaymentRequest {
@NotNull
@ApiModelProperty(
value = "Transaction Number",
required = true,
example = "7ba2a960-2354-466f-8868-6ad713742407",
dataType = "String"
)
Expand All @@ -25,6 +26,7 @@ public class OrderPaymentRequest {
@NotNull
@ApiModelProperty(
value = "Transaction Message Result - Order Id",
required = true,
example = "transaction successfully",
dataType = "String"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.fiap.tc.adapters.driver.presentation.requests;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
Expand All @@ -10,10 +11,21 @@

@Data
public class OrderRequest {

@NotNull
@NotEmpty
@Valid
@ApiModelProperty(
value = "Order items request",
required = true,
dataType = "List<OrderItemRequest>"
)
private List<OrderItemRequest> orderItems;

@ApiModelProperty(
value = "Customer Id",
example = "7ba2a960-2354-466f-8868-6ad713742407",
dataType = "UUID"
)
private UUID idCustomer;
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
package com.fiap.tc.adapters.driver.presentation.requests;

import com.fiap.tc.core.domain.enums.OrderStatus;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.util.UUID;

@Data
public class OrderStatusRequest {

@NotNull
@ApiModelProperty(
value = "Order Id",
example = "7ba2a960-2354-466f-8868-6ad713742407",
dataType = "UUID",
required = true
)
private UUID id;

@NotNull
@ApiModelProperty(
value = "Order status",
example = "READY",
dataType = "String",
allowableValues = "RECEIVED, PENDING, PREPARING, READY, FINISHED, CANCELED",
required = true
)
private OrderStatus status;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public class ProductRequest {
@ApiModelProperty(
value = "Category Id",
example = "7ba2a960-2354-466f-8868-6ad713742407",
dataType = "UUID"
dataType = "UUID",
required = true
)
private UUID idCategory;

Expand Down Expand Up @@ -44,7 +45,8 @@ public class ProductRequest {
@ApiModelProperty(
value = "Product price",
example = "20.55",
dataType = "BigDecimal"
dataType = "BigDecimal",
required = true
)
private BigDecimal price;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.fiap.tc.adapters.driver.presentation.requests;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
Expand All @@ -13,12 +14,23 @@
public class RegisterProductImagesRequest {

@NotNull
@ApiModelProperty(
value = "Product Id",
example = "7ba2a960-2354-466f-8868-6ad713742407",
dataType = "UUID",
required = true
)
private UUID idProduct;

@NotNull
@Size(min = 1, max = 5)
@NotEmpty
@Valid
@ApiModelProperty(
value = "List of Product Images to be uploaded",
required = true,
dataType = "List<ProductImageRequest>"
)
private List<ProductImageRequest> images;

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public class CategoryResponse {
@Size(max = 255, message = "Invalid category name")
@ApiModelProperty(
value = "Category name",
required = true,
example = "lanche",
dataType = "String"
)
Expand All @@ -31,7 +30,6 @@ public class CategoryResponse {
@Size(max = 255, message = "Invalid category description")
@ApiModelProperty(
value = "Category description",
required = true,
example = "categoria de lanche",
dataType = "String"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ public class CustomerResponse {

@ApiModelProperty(
value = "Customer name",
required = true,
example = "Lucas Silva e Silva",
dataType = "String"
)
private String name;

@ApiModelProperty(
value = "Customer E-mail",
required = true,
example = "lucas.silva@gmail.com",
dataType = "String"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ public class OrderListResponse {
private UUID id;

@ApiModelProperty(
value = "Order Number",
example = "EfhxLZ",
value = "Order number to customer follow up",
example = "ed6l",
dataType = "String"
)
private String orderNumber;

@ApiModelProperty(
value = "Order status",
required = true,
example = "READY",
dataType = "enum"

Expand All @@ -34,7 +33,6 @@ public class OrderListResponse {

@ApiModelProperty(
value = "Order wait time in minutes",
required = true,
example = "10",
dataType = "Optional<Integer>"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.fiap.tc.adapters.driver.presentation.dtos.OrderHistoricDto;
import com.fiap.tc.adapters.driver.presentation.dtos.OrderItemDto;
import com.fiap.tc.core.domain.enums.OrderStatus;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -19,12 +20,51 @@
@NoArgsConstructor
public class OrderResponse {

@ApiModelProperty(
value = "Order Id",
example = "7ba2a960-2354-466f-8868-6ad713742407",
dataType = "UUID"
)
private UUID id;

@ApiModelProperty(
value = "Order number to customer follow up",
example = "ed6l",
dataType = "String"
)
private String orderNumber;

@ApiModelProperty(
value = "Order total amount",
example = "75.55",
dataType = "BigDecimal"
)
private BigDecimal total;

@ApiModelProperty(
value = "Order status",
example = "RECEIVED",
dataType = "String",
allowableValues = "RECEIVED, PENDING, PREPARING, READY, FINISHED, CANCELED"
)
private OrderStatus status;

@ApiModelProperty(
value = "Order items",
dataType = "List<OrderItemDto>"
)
private List<OrderItemDto> items;

@ApiModelProperty(
value = "Order Status historic transitions",
dataType = "List<OrderHistoricDto>"
)
private List<OrderHistoricDto> orderHistoric;

@ApiModelProperty(
value = "Order payment link qrcode base64 encoded",
dataType = "String"
)
private String paymentLink;


Expand Down

0 comments on commit 07ce50c

Please sign in to comment.