entities

package
v0.0.0-...-daa638b Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
	Timestamps
}

type AttributePaginated

type AttributePaginated struct {
	Pagination
	Attributes []*Attribute `json:"attributes"`
}

type Category

type Category struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Timestamps
}

type CategoryPaginated

type CategoryPaginated struct {
	Pagination
	Categories []*Category `json:"categories"`
}

type CategoryProductsPaginated

type CategoryProductsPaginated struct {
	Pagination
	Category
	Products []*Product `json:"products"`
}

type Image

type Image struct {
	ID           int    `json:"id"`
	Name         string `json:"name"`
	ImageUrl     string `json:"image_url"`
	ThumbnailUrl string `json:"thumbnail_url"`
	Timestamps
}

type Pagination

type Pagination struct {
	TotalPage    int `json:"total_page"`
	CurrentPage  int `json:"current_page"`
	NextPage     int `json:"next_page"`
	PreviousPage int `json:"previous_page"`
	Count        int `json:"count"`
	Size         int `json:"size"`
}

type Product

type Product struct {
	ID              int               `json:"id"`
	Name            string            `json:"name"`
	Description     string            `json:"description"`
	CategoryID      int               `json:"category_id"`
	Category        *Category         `json:"category"`
	Images          []*Image          `json:"images"`
	ProductVariants []*ProductVariant `json:"product_variants"`
	Timestamps
}

type ProductPaginated

type ProductPaginated struct {
	Pagination
	Products []*Product `json:"products"`
}

type ProductVariant

type ProductVariant struct {
	ID         int          `json:"id"`
	Name       string       `json:"name"`
	ProductId  int          `json:"product_id"`
	Product    *Product     `json:"product"`
	Price      float64      `json:"price"`
	Stock      int          `json:"stock"`
	Attributes []*Attribute `json:"attributes"`
	Timestamps
}

type ProductVariantPaginated

type ProductVariantPaginated struct {
	Pagination
	Product
	ProductVariants []*ProductVariant `json:"product_variants"`
}

type Timestamps

type Timestamps struct {
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt *time.Time `json:"updated_at"`
	DeletedAt *time.Time `json:"deleted_at"`
}

type User

type User struct {
	ID          int    `json:"id"`
	Username    string `json:"username"`
	Password    string `json:"password"`
	IsActive    bool   `json:"is_active"`
	IsStaff     bool   `json:"is_staff"`
	IsSuperuser bool   `json:"is_superuser"`
	Timestamps
}

Jump to

Keyboard shortcuts

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