domain

package
v0.0.0-...-41be704 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Order

type Order struct {
	ID              string       `json:"id"`
	CustomerID      string       `json:"customer_id"`
	Status          OrderStatus  `json:"status"`
	OrderItems      []*OrderItem `json:"order_items"`
	CreatedAtMillis int64        `json:"created_at_millis"`
	UpdatedAtMillis int64        `json:"updated_at_millis"`
}

func NewOrder

func NewOrder(customerID string, orderItems []*OrderItem) (*Order, error)

type OrderItem

type OrderItem struct {
	ProductCode string `json:"product_code"`
	Quantity    int32  `json:"quantity"`
}

type OrderStatus

type OrderStatus string
const (
	OrderPending   OrderStatus = "Pending"
	OrderCompleted OrderStatus = "Completed"
	OrderFailed    OrderStatus = "Failed"
	OrderCancelled OrderStatus = "Cancelled"
)

type ProductPrice

type ProductPrice struct {
	ProductCode    string `json:"product_code"`
	UnitPriceCents int32  `json:"unit_price_cents"`
}

type ProductStock

type ProductStock struct {
	ProductCode       string `json:"product_code"`
	AvailableQuantity int32  `json:"available_quantity"`
	IsAvailable       bool   `json:"is_available"`
}

Jump to

Keyboard shortcuts

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