entity

package
v0.0.0-...-39a58cf Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CartItem

type CartItem struct {
	Id         string  `json:"id"`
	UserId     string  `json:"userId,omitempty"`
	Product    Product `json:"product"`
	Quantity   int     `json:"quantity"`
	TotalPrice float64 `json:"totalPrice"`
}

type CartItemRequest

type CartItemRequest struct {
	ProductId  string  `json:"productId"`
	Quantity   int     `json:"quantity"`
	TotalPrice float64 `json:"totalPrice"`
}

type Category

type Category struct {
	Id    string `json:"id,omitempty"`
	Title string `json:"title,omitempty"`
}

type HealthCheck

type HealthCheck struct {
	Id          int    `json:"id"`
	Environment string `json:"environment"`
	Status      string `json:"status"`
}

func NewHealthCheck

func NewHealthCheck() HealthCheck

type Product

type Product struct {
	Id               string   `json:"id"`
	Title            string   `json:"title"`
	ShortDescription string   `json:"shortDescription,omitempty"`
	Description      string   `json:"description,omitempty"`
	Category         Category `json:"category,omitempty"`
	Price            float64  `json:"price,omitempty"`
	Quantity         int      `json:"quantity,omitempty"`
	ImageUrl         string   `json:"imageUrl"`
}

type User

type User struct {
	Id        string `json:"id"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Email     string `json:"email"`
	Password  string `json:"-"`
}

func NewUser

func NewUser(id string, firstName string, lastName string, email string) *User

func (*User) ComparePassword

func (u *User) ComparePassword(password string) error

func (*User) HashPassword

func (u *User) HashPassword(password string) (string, error)

type UserRequest

type UserRequest 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,password,min=8,max=16"`
}

Jump to

Keyboard shortcuts

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