-
Notifications
You must be signed in to change notification settings - Fork 4
/
decl.go
62 lines (43 loc) · 1.39 KB
/
decl.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Package product is a implementation of interfaces declared in
// "github.com/ottemo/commerce/app/models/product" package
package product
import (
"github.com/ottemo/commerce/app/helpers/attributes"
"github.com/ottemo/commerce/db"
"github.com/ottemo/commerce/env"
)
// Package global constants
const (
ConstCollectionNameProduct = "product"
ConstErrorModule = "product"
ConstErrorLevel = env.ConstErrorLevelActor
ConstProductMediaTypeImage = "image"
ConstSwatchImageDefaultFormat = "jpeg"
ConstSwatchImageDefaultExtention = "jpeg"
)
// DefaultProduct is a default implementer of InterfaceProduct
type DefaultProduct struct {
id string
Enabled bool
Sku string
Name string
ShortDescription string
Description string
DefaultImage string
Price float64
Weight float64
Options map[string]interface{}
RelatedProductIds []string
Visible bool
// appliedOptions tracks options were applied to current instance
appliedOptions map[string]interface{}
// updatedQty holds qty should be updated during save operation ("" item holds qty value)
updatedQty []map[string]interface{}
customAttributes *attributes.ModelCustomAttributes
externalAttributes *attributes.ModelExternalAttributes
}
// DefaultProductCollection is a default implementer of InterfaceProduct
type DefaultProductCollection struct {
listCollection db.InterfaceDBCollection
listExtraAtributes []string
}