endpoint

package
v0.0.0-...-ca96c0c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoryEndpoints

type CategoryEndpoints struct {
	GetCategoryEndpoint    endpoint.Endpoint
	InsertCategoryEndpoint endpoint.Endpoint
	ListCategoriesEndpoint endpoint.Endpoint
	DeleteCategoryEndpoint endpoint.Endpoint
}

func MakeCategoryEndpoints

func MakeCategoryEndpoints(svc service.CategoriesService) CategoryEndpoints

type CheckoutOrderRequest

type CheckoutOrderRequest struct {
	ID string `json:"id"`
}

type CoreCategory

type CoreCategory struct {
	ID        string `json:"id"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at,omitempty"`
	Name      string `json:"name"`
}

CATEGORIES

type CreateOrderRequest

type CreateOrderRequest struct {
	UserID      string   `json:"user_id" description:"ID do dono do pedido"`
	ProductsIDs []string `json:"products_ids" description:"ID dos produtos"`
}

type DelectProductResponse

type DelectProductResponse struct {
	Deleted bool `json:"Deleted"`
}

type DeleteCategoryRequest

type DeleteCategoryRequest struct {
	ID string `json:"id"`
}

type DeleteCategoryResponse

type DeleteCategoryResponse struct {
	ID string `json:"id"`
}

type DeleteOrderRequest

type DeleteOrderRequest struct {
	ID string `json:"id"`
}

type DeleteOrderResponse

type DeleteOrderResponse struct {
	Deleted string `json:"deleted"`
}

type DeleteProductRequest

type DeleteProductRequest struct {
	ID string `json:"id"`
}

type GetCategoryRequest

type GetCategoryRequest struct {
	ID string `json:"id"`
}

type GetCategoryResponse

type GetCategoryResponse struct {
	CoreCategory
}

type GetOrderByPaymentIDRequest

type GetOrderByPaymentIDRequest struct {
	PaymentID string `json:"payment_id"`
}

type GetOrderRequest

type GetOrderRequest struct {
	ID string `json:"id"`
}

type GetPaymentRequest

type GetPaymentRequest struct {
	ID string `json:"id"`
}

type GetPaymentResponse

type GetPaymentResponse struct {
	ID        string `json:"id"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
	Price     string `json:"price"`
	OrderID   string `json:"order_id"`
	Status    string `json:"status"`
}

type GetProductRequest

type GetProductRequest struct {
	ID string `json:"id"`
}

type InsertCategoryRequest

type InsertCategoryRequest struct {
	Name string `json:"name" description:"Nome da categoria de produto"`
}

type InsertCategoryResponse

type InsertCategoryResponse struct {
	CoreCategory
}

type InsertProductRequest

type InsertProductRequest struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	CategoryID  string `json:"category_id"`
	Price       string `json:"price"`
}

type ListCategoriesRequest

type ListCategoriesRequest struct {
	Limit  int64 `json:"limit" default:"10" description:"Quantidade de registros"`
	Offset int64 `json:"offset"`
}

type ListCategoriesResponse

type ListCategoriesResponse struct {
	Categories []CoreCategory `json:"categories"`
	Limit      int            `json:"limit" default:"10"`
	Offset     int            `json:"offset"`
	Total      int64          `json:"total"`
}

type ListOrderRequest

type ListOrderRequest struct {
	Limit  int `json:"limt"`
	Offset int `json:"offset"`
}

type ListProductsByCategoryRequest

type ListProductsByCategoryRequest struct {
	ID     string `json:"id"`
	Limit  int    `json:"limit"`
	Offset int    `json:"offset"`
}

type OrderList

type OrderList struct {
	Orders []OrderResponse `json:"orders"`
	Limit  int             `json:"limit" default:"10"`
	Offset int             `json:"offset"`
	Total  int             `json:"total"`
}

type OrderResponse

type OrderResponse struct {
	ID        string            `json:"id" description:"ID do Pedido"`
	PaymentID string            `json:"payment_id,omitempty" description:"ID do pagamento"`
	CreatedAt string            `json:"created_at" description:"Data de criação"`
	UpdatedAt string            `json:"updated_at,omitempty" description:"Data de atualização"`
	DeletedAt string            `json:"deleted_at,omitempty" description:"Data de deleção"`
	Price     string            `json:"price" description:"Preço do pedido"`
	Status    string            `json:"status" description:"Status do pedido"`
	Products  []ProductResponse `json:"products" description:"Lista de Pedidos"`
}

ORDERS

func OrderResponseFromModel

func OrderResponseFromModel(in *models.Order) OrderResponse

type OrdersEndpoint

type OrdersEndpoint struct {
	GetOrderEndpoint         endpoint.Endpoint
	CreateOrderEndpoint      endpoint.Endpoint
	UpdateOrderItemsEndpoint endpoint.Endpoint
	ListOrdersEndpoint       endpoint.Endpoint
	DeleteOrderEndpoint      endpoint.Endpoint
	OrderCheckoutEndpoint    endpoint.Endpoint
	GetOrderByPaymentID      endpoint.Endpoint
}

func MakeOrdersEndpoint

func MakeOrdersEndpoint(svc service.OrdersService) OrdersEndpoint

type PaymentsEndpoints

type PaymentsEndpoints struct {
	GetPaymentEndpoint endpoint.Endpoint
}

func MakePaymentsEndpoint

func MakePaymentsEndpoint(svc service.PaymentsService) PaymentsEndpoints

type ProductList

type ProductList struct {
	Products []ProductResponse `json:"products"`
	Limit    int               `json:"limit" default:"10"`
	Offset   int               `json:"offset"`
	Total    int               `json:"total"`
}

type ProductResponse

type ProductResponse struct {
	ID          string `json:"id,omitempty"`
	Name        string `json:"name"`
	Description string `json:"description"`
	CategoryID  string `json:"category_id"`
	Price       string `json:"price"`
	CreatedAt   string `json:"created_at,omitempty" readOnly:"true"`
	UpdatedAt   string `json:"updated_at,omitempty" readOnly:"true"`
	DeletedAt   string `json:"deleted_at,omitempty" readOnly:"true"`
}

func ProductResponseFromModel

func ProductResponseFromModel(in *models.Product) ProductResponse

type ProductsEndpoints

type ProductsEndpoints struct {
	GetProductEndpoint     endpoint.Endpoint
	InsertProductEndpoint  endpoint.Endpoint
	UpdateProductEndpoint  endpoint.Endpoint
	DeleteProductEndpoint  endpoint.Endpoint
	ListProductsByCategory endpoint.Endpoint
}

func MakeProductsEndpoint

func MakeProductsEndpoint(svc service.ProductsService) ProductsEndpoints

type UpdateOrderRequest

type UpdateOrderRequest struct {
	ID          string   `json:"id"`
	ProductsIDs []string `json:"products_ids" description:"ID dos produtos"`
}

type UpdateProductRequest

type UpdateProductRequest struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	CategoryID  string `json:"category_id"`
	Price       string `json:"price"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL