model

package
v0.0.0-...-dd53e7b Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	ID        uint64    `db:"id"`
	Name      string    `db:"name"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

func (Category) ToDomain

func (c Category) ToDomain() *domaincategory.Category

type Order

type Order struct {
	ID           uint64         `db:"id"`
	UserID       uint64         `db:"user_id"`
	PaymentID    uint64         `db:"payment_id"`
	CustomerName string         `db:"customer_name"`
	TotalPrice   float64        `db:"total_price"`
	TotalPaid    float64        `db:"total_paid"`
	TotalReturn  float64        `db:"total_return"`
	ReceiptCode  uuid.UUID      `db:"receipt_code"`
	CreatedAt    time.Time      `db:"created_at"`
	UpdatedAt    time.Time      `db:"updated_at"`
	User         *User          `db:"user"`
	Payment      *Payment       `db:"payment"`
	Products     []OrderProduct `db:"products"`
}

type OrderProduct

type OrderProduct struct {
	ID         uint64
	OrderID    uint64
	ProductID  uint64
	Quantity   int64
	TotalPrice float64
	CreatedAt  time.Time
	UpdatedAt  time.Time
	Order      *Order
	Product    *Product
}

type Payment

type Payment struct {
	ID        uint64    `db:"id"`
	Name      string    `db:"name"`
	Type      string    `db:"type"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

type Product

type Product struct {
	ID         uint64    `db:"id"`
	CategoryID uint64    `db:"category_id"`
	SKU        uuid.UUID `db:"sku"`
	Name       string    `db:"name"`
	Stock      int64     `db:"stock"`
	Price      float64   `db:"price"`
	Image      string    `db:"image"`
	CreatedAt  time.Time `db:"created_at"`
	UpdatedAt  time.Time `db:"updated_at"`
	Category   *Category `db:"category"`
}

type User

type User struct {
	ID        uint64    `db:"id"`
	Name      string    `db:"name"`
	Email     string    `db:"email"`
	Password  string    `db:"password"`
	Role      string    `db:"role"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

Jump to

Keyboard shortcuts

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