1234567891011121314151617181920 |
- package helper
- import (
- "github.com/gshopify/service-wrapper/scalar"
- "gshopper.com/gshopify/products/graphql/generated"
- )
- func NewPriceRange(min, max float64, currency generated.CurrencyCode) *generated.ProductPriceRange {
- return &generated.ProductPriceRange{
- MaxVariantPrice: NewMoney(max, currency),
- MinVariantPrice: NewMoney(min, currency),
- }
- }
- func NewMoney(f float64, currency generated.CurrencyCode) *generated.MoneyV2 {
- return &generated.MoneyV2{
- Amount: scalar.NewDecimal(f),
- CurrencyCode: currency,
- }
- }
|