Documentation
¶
Index ¶
- Constants
- func MakeBrandCatalogs(catalog Catalog) map[string]BrandCatalog
- func Mask(s string) string
- type Article
- func (article Article) NameHTML() template.HTML
- func (article Article) TranslateAbout(l lang.Lang) template.HTML
- func (article Article) TranslateAlert(l lang.Lang) template.HTML
- func (article Article) TranslateHowto(l lang.Lang) template.HTML
- func (article Article) TranslateLegal(l lang.Lang) template.HTML
- type BrandCatalog
- type Cart
- type Catalog
- type Category
- type DeliveredItem
- type Delivery
- type Description
- type Order
- type OrderRow
- type Purchase
- type PurchaseArticle
- type PurchaseVariant
- type Sale
- type Status
- type Stock
- type UploadBrand
- type UploadCatalog
- type UploadStockUnit
- type Variant
Constants ¶
View Source
const DateFmt = "2006-01-02"
Variables ¶
This section is empty.
Functions ¶
func MakeBrandCatalogs ¶
func MakeBrandCatalogs(catalog Catalog) map[string]BrandCatalog
MakeBrandCatalogs creates a catalog for the backend upload view. It collects stock units by brand.
Types ¶
type Article ¶
type Article struct {
Brand string
Name string // not translated
Hide bool
ImageLink string
ID string // for <details> and #anchor
Desc map[string]Description
Variants []Variant
}
func MakePurchaseCatalog ¶
MakePurchaseCatalog prepares a catalog for the purchase view. It removes categories and moves duplicate variants into separate articles.
func (Article) TranslateAbout ¶
only supports langs which exist as key, TODO: language.Matcher
func (Article) TranslateAlert ¶
only supports langs which exist as key, TODO: language.Matcher
func (Article) TranslateHowto ¶
only supports langs which exist as key, TODO: language.Matcher
type BrandCatalog ¶
type Catalog ¶
type Catalog []Category
func (Catalog) Products ¶
func (catalog Catalog) Products() []productfeed.Product
assumes that catalog contains every article exactly once
type DeliveredItem ¶
type Delivery ¶
type Delivery []DeliveredItem
type Purchase ¶
type Purchase struct {
ID string
AccessKey string
PaymentKey string
Status Status
Message string // from store to customer, in case of problems
NotifyProto string
NotifyAddr string
Ordered Order
Delivered Delivery
CreateDate string // yyyy-mm-dd, for foreign currency rates
DeleteDate string // yyyy-mm-dd
CountryCode string // EU country
}
func (*Purchase) GetUnfulfilled ¶
func (*Purchase) Underdelivered ¶
type PurchaseArticle ¶
type PurchaseArticle struct {
Article
Variants []PurchaseVariant // shadows Article.Variants
}
func MakePurchaseArticles ¶
func MakePurchaseArticles(catalog []Article, purchase *Purchase) []PurchaseArticle
MakePurchaseArticles runs in O(n^2). Only use it for small catalogs.
func (PurchaseArticle) AnythingDelivered ¶
func (pa PurchaseArticle) AnythingDelivered() bool
type PurchaseVariant ¶
type PurchaseVariant struct {
Variant
Quantity int
GrossPrice int // in case Variant.Price has changed
Delivered []DeliveredItem
}
func (PurchaseVariant) GrossSum ¶
func (pv PurchaseVariant) GrossSum() int
type Status ¶
type Status string
const ( StatusNew Status = "new" // unpaid StatusPaymentProcessing Status = "processing" // e.g. btcpay: "InvoiceProcessing Webhook: Triggers when an invoice is fully paid, but doesn't have the required amount of confirmations on the blockchain yet according to your store's settings." StatusUnderdelivered Status = "underdelivered" // payment settled, but we had not had enough items in stock StatusFinalized Status = "finalized" // payment settled, codes delivered )
type UploadBrand ¶
type UploadBrand struct {
Brand string
Units []UploadStockUnit
}
type UploadCatalog ¶
type UploadCatalog []UploadBrand
func MakeUploadCatalog ¶
func MakeUploadCatalog(catalog Catalog) UploadCatalog
MakeUploadCatalog creates a catalog for the backend upload view. It collects stock units by brand.
func (UploadCatalog) UploadStockUnit ¶
func (ucatalog UploadCatalog) UploadStockUnit(id string) (UploadStockUnit, bool)
type UploadStockUnit ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
digitalgoods
command
|
|
|
Package userdb implements a very simple, read-only user database.
|
Package userdb implements a very simple, read-only user database. |
|
cmd/bcrypt
command
|
Click to show internal directories.
Click to hide internal directories.