-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmodels_calc_products.go
More file actions
42 lines (35 loc) · 1.7 KB
/
models_calc_products.go
File metadata and controls
42 lines (35 loc) · 1.7 KB
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
package cloudloyalty_client
import "github.com/shopspring/decimal"
type CalculateProductsRequest struct {
Client *ClientQuery `json:"client,omitempty"`
Shop ShopQuery `json:"shop"`
Products []CalculateProductsRequestItem `json:"products"`
DiscountRoundStep *float64 `json:"discountRoundStep,omitempty"`
}
type CalculateProductsRequestItem struct {
ID *string `json:"id,omitempty"`
Product CalculationQueryRowProduct `json:"product"`
Qty *float64 `json:"qty,omitempty"`
ExternalDiscount decimal.Decimal `json:"externalDiscount,omitempty"`
NoCollectBonuses bool `json:"noCollectBonuses,omitempty"`
NoOffer bool `json:"noOffer,omitempty"`
MaxDiscount *decimal.Decimal `json:"maxDiscount,omitempty"`
}
type CalculateProductsReply struct {
Products []CalculateProductsResultItem `json:"products"`
}
type CalculateProductsResultItem struct {
ID *string `json:"id,omitempty"`
TotalDiscount decimal.Decimal `json:"totalDiscount"`
Discounts CalculateProductsResultItemDiscounts `json:"discounts"`
Bonuses CalculateProductsResultItemBonuses `json:"bonuses"`
Offers []CalculationResultRowOffer `json:"offers,omitempty"`
}
type CalculateProductsResultItemDiscounts struct {
External decimal.Decimal `json:"external"`
Offer decimal.Decimal `json:"offer"`
Rounding decimal.Decimal `json:"rounding"`
}
type CalculateProductsResultItemBonuses struct {
Collected int `json:"collected"`
}