entities

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Customer

type Customer struct {
	ID        uint   `json:"id"`
	Name      string `json:"name"`
	CPF       string `json:"cpf"`
	Email     string `json:"email"`
	CreatedAt string `json:"createdAt"`
}

type Order

type Order struct {
	ID            string               `json:"id"`
	CustomerID    int64                `json:"customer"`
	Products      []ProductInsideOrder `json:"products"`
	Status        string               `json:"status"`
	PaymentStatus string               `json:"paymentStatus"`
	CreatedAt     string               `json:"createdAt"`
	UpdatedAt     string               `json:"updatedAt"`
}

func (*Order) GetProductIds

func (o *Order) GetProductIds() []uint

type Product

type Product struct {
	ID          uint    `json:"id"`
	Name        string  `json:"name"`
	Price       float64 `json:"price"`
	Description string  `json:"description"`
	CategoryId  uint    `json:"categoryId"`
	CreatedAt   string  `json:"createdAt"`
}

func GetByID

func GetByID(products []Product, id uint) (*Product, error)

func (Product) IsExistingProduct

func (p Product) IsExistingProduct() bool

func (*Product) PatchFields

func (p *Product) PatchFields(name string, price float64, description string, categoryId uint)

type ProductCategory

type ProductCategory struct {
	ID          uint   `json:"id"`
	Description string `json:"description"`
}

func (ProductCategory) IsExistingProductCategory

func (pc ProductCategory) IsExistingProductCategory() bool

type ProductInsideOrder

type ProductInsideOrder struct {
	Product     Product `json:"product"`
	Quantity    int     `json:"quantity"`
	Observation string  `json:"observation"`
}

Jump to

Keyboard shortcuts

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