2024-12-06 16:14:44 +01:00
|
|
|
package dto
|
2022-12-18 20:51:26 +01:00
|
|
|
|
2022-12-23 08:37:21 +01:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2024-12-06 16:44:42 +01:00
|
|
|
type GetProductRequestDTO struct {
|
2022-12-23 08:37:21 +01:00
|
|
|
ProductID int `json:"product_id"`
|
|
|
|
}
|
|
|
|
|
2024-12-06 16:44:42 +01:00
|
|
|
type GetProductResponseDTO struct {
|
2022-12-23 09:33:13 +01:00
|
|
|
ID int `json:"id"`
|
|
|
|
PID string `json:"pid"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Price float64 `json:"price"`
|
|
|
|
CreatedAt time.Duration `json:"created_at"`
|
|
|
|
UpdatedAt time.Duration `json:"updated_at,omitempty"`
|
2022-12-23 08:37:21 +01:00
|
|
|
}
|
|
|
|
|
2024-12-06 16:44:42 +01:00
|
|
|
type GetProductListRequestDTO struct {
|
2022-12-23 08:37:21 +01:00
|
|
|
CategoryID int `json:"category_id"`
|
|
|
|
}
|
|
|
|
|
2024-12-06 16:44:42 +01:00
|
|
|
type GetProductListResponseDTO struct {
|
|
|
|
Products []GetProductResponseDTO `json:"products"`
|
2022-12-23 08:37:21 +01:00
|
|
|
}
|
|
|
|
|
2024-12-06 16:44:42 +01:00
|
|
|
type AddProductToBasketRequestDTO struct {
|
2022-12-18 20:51:26 +01:00
|
|
|
ProductID int `json:"product_id"`
|
2022-12-20 16:07:56 +01:00
|
|
|
Quantity int `json:"quantity"`
|
2022-12-18 20:51:26 +01:00
|
|
|
}
|
|
|
|
|
2024-12-06 16:44:42 +01:00
|
|
|
type AddProductToBasketResponseDTO struct {
|
2022-12-20 11:22:24 +01:00
|
|
|
ProductID int `json:"product_id"`
|
|
|
|
BasketID string `json:"basket_id"`
|
2022-12-18 20:51:26 +01:00
|
|
|
}
|
|
|
|
|
2024-12-06 16:44:42 +01:00
|
|
|
type RemoveProductFromBasketRequestDTO struct {
|
2022-12-18 20:51:26 +01:00
|
|
|
ProductID int `json:"product_id"`
|
2022-12-20 16:07:56 +01:00
|
|
|
Quantity int `json:"quantity"`
|
2022-12-18 20:51:26 +01:00
|
|
|
}
|
|
|
|
|
2024-12-06 16:44:42 +01:00
|
|
|
type RemoveProductFromBasketResponseDTO struct {
|
2022-12-20 16:07:56 +01:00
|
|
|
ProductID int `json:"product_id"`
|
|
|
|
BasketID string `json:"basket_id"`
|
2022-12-18 20:51:26 +01:00
|
|
|
}
|