cart

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PublicCart

type PublicCart struct {
	ID        primitive.ObjectID `json:"id"`
	IsPickup  bool               `json:"isPickup"`
	Items     []PublicCartItem   `json:"items"`
	Summary   PublicCartSummary  `json:"summary"`
	Secret    string             `json:"secret"`
	CreatedAt time.Time          `bson:"createdAt" json:"createdAt"`
	UpdatedAt time.Time          `bson:"updatedAt" json:"updatedAt"`
}

func Calculate

func Calculate(ctx context.Context, c *db.Cart, products []db.Product, taxes []db.Tax) (*PublicCart, error)

type PublicCartItem

type PublicCartItem struct {
	db.CartItem
	SKU        string   `json:"sku"`
	Categories []string `json:"categories"`
	UnitPrice  string   `json:"unitPrice"`
	Total      string   `json:"total"`
	Tax        string   `json:"tax"`
	Net        string   `json:"net"`
	TaxClass   string   `json:"taxClass"`
}

type PublicCartSummary

type PublicCartSummary struct {
	Total    string            `json:"total"`
	TotalTax string            `json:"totalTax"`
	TotalNet string            `json:"net"`
	Taxes    map[string]string `json:"taxes"`
}

Jump to

Keyboard shortcuts

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