Discover Packages
github.com/EaleksS/ecom
types
package
Version:
v0.0.0-...-9e6aa24
Opens a new window with list of versions in this module.
Published: Jun 17, 2024
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
type CartCheckoutPayload struct {
Items []CartItem `json:"items" validate:"required"`
}
type CartItem struct {
ProductID int `json:"productID"`
Quantity int `json:"quantity"`
}
type CreateProductPayload struct {
Name string `json:"name" validate:"required"`
Description string `json:"description" validate:"required"`
Image string `json:"image" validate:"required"`
Price float64 `json:"price" validate:"required"`
Quantity int `json:"quantity" validate:"required"`
}
type LoginUserPayload struct {
Email string `json:"email" validate:"required,email"`
Password string `json:"password" validate:"required"`
}
type Order struct {
ID int `json:"id"`
UserID int `json:"userID"`
Total float64 `json:"total"`
Status string `json:"status"`
Address string `json:"address"`
CreatedAt time .Time `json:"createdAt"`
}
type OrderItem struct {
ID int `json:"id"`
OrderID int `json:"orderID"`
ProductID int `json:"productID"`
Quantity int `json:"quantity"`
Price float64 `json:"price"`
CreatedAt time .Time `json:"createdAt"`
}
type Product struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Image string `json:"image"`
Price float64 `json:"price"`
Quantity int `json:"quantity"`
CreatedAt time .Time `json:"createdAt"`
}
type RegisterUserPayload struct {
FirstName string `json:"firstName" validate:"required"`
LastName string `json:"lastName" validate:"required"`
Email string `json:"email" validate:"required,email"`
Password string `json:"password" validate:"required,min=3,max=130"`
}
type User struct {
ID int `json:"id"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Email string `json:"email"`
Password string `json:"password"`
CreatedAt time .Time `json:"createdAt"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.