forked from i-love-flamingo/flamingo-commerce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
module.go
52 lines (47 loc) · 1.39 KB
/
module.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
package price
import (
"flamingo.me/dingo"
pricegraphql "flamingo.me/flamingo-commerce/v3/price/interfaces/graphql"
"flamingo.me/flamingo-commerce/v3/price/interfaces/templatefunctions"
"flamingo.me/flamingo/v3/core/locale"
"flamingo.me/flamingo/v3/framework/flamingo"
"flamingo.me/graphql"
)
type (
// Module registers our profiler
Module struct{}
)
// Configure the product URL
func (m Module) Configure(injector *dingo.Injector) {
flamingo.BindTemplateFunc(injector, "commercePriceFormat", new(templatefunctions.CommercePriceFormatFunc))
injector.BindMulti(new(graphql.Service)).To(pricegraphql.Service{})
}
// Depends adds our dependencies
func (*Module) Depends() []dingo.Module {
return []dingo.Module{
new(locale.Module),
}
}
// FlamingoLegacyConfigAlias mapping
func (*Module) FlamingoLegacyConfigAlias() map[string]string {
alias := make(map[string]string)
for _, v := range []string{
"locale.locale",
"locale.accounting.default.precision",
"locale.accounting.default.decimal",
"locale.accounting.default.thousand",
"locale.accounting.default.formatZero",
"locale.accounting.default.format",
"locale.accounting.default.formatLong",
"locale.numbers.decimal",
"locale.numbers.thousand",
"locale.numbers.precision",
"locale.date.dateFormat",
"locale.date.timeFormat",
"locale.date.dateTimeFormat",
"locale.date.location",
} {
alias[v] = "core." + v
}
return alias
}