Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 40 additions & 17 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ type Order struct {
DialogID int `json:"dialogId,omitempty"`
Links []OrderLink `json:"links,omitempty"`
Currency string `json:"currency,omitempty"`

BonusesCreditTotal float32 `json:"bonusesCreditTotal,omitempty"`
BonusesChargeTotal float32 `json:"bonusesChargeTotal,omitempty"`
}

// LinkedOrder type.
Expand Down Expand Up @@ -594,23 +597,43 @@ type OrderPayment struct {

// OrderItem type.
type OrderItem struct {
ID int `json:"id,omitempty"`
InitialPrice float32 `json:"initialPrice,omitempty"`
PurchasePrice float32 `json:"purchasePrice,omitempty"`
DiscountTotal float32 `json:"discountTotal,omitempty"`
DiscountManualAmount float32 `json:"discountManualAmount,omitempty"`
DiscountManualPercent float32 `json:"discountManualPercent,omitempty"`
ProductName string `json:"productName,omitempty"`
VatRate string `json:"vatRate,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
Quantity float32 `json:"quantity,omitempty"`
Status string `json:"status,omitempty"`
Comment string `json:"comment,omitempty"`
IsCanceled bool `json:"isCanceled,omitempty"`
Offer Offer `json:"offer,omitempty"`
Properties Properties `json:"properties,omitempty"`
PriceType *PriceType `json:"priceType,omitempty"`
}
ID int `json:"id,omitempty"`
InitialPrice float32 `json:"initialPrice,omitempty"`
PurchasePrice float32 `json:"purchasePrice,omitempty"`
DiscountTotal float32 `json:"discountTotal,omitempty"`
DiscountManualAmount float32 `json:"discountManualAmount,omitempty"`
DiscountManualPercent float32 `json:"discountManualPercent,omitempty"`
ProductName string `json:"productName,omitempty"`
VatRate string `json:"vatRate,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
Quantity float32 `json:"quantity,omitempty"`
Status string `json:"status,omitempty"`
Comment string `json:"comment,omitempty"`
IsCanceled bool `json:"isCanceled,omitempty"`
Offer Offer `json:"offer,omitempty"`
Properties Properties `json:"properties,omitempty"`
PriceType *PriceType `json:"priceType,omitempty"`
BonusesChargeTotal float32 `json:"bonusesChargeTotal,omitempty"`
BonusesCreditTotal float32 `json:"bonusesCreditTotal,omitempty"`
Discounts []ItemDiscount `json:"discounts,omitempty"`
}

type ItemDiscount struct {
Type DiscountType `json:"type"`
Amount float32 `json:"amount"`
}

type DiscountType string

const (
ManualOrderDiscountType DiscountType = "manual_order"
ManualProductDiscountType DiscountType = "manual_product"
LoyaltyLevelDiscountType DiscountType = "loyalty_level"
LoyaltyEventDiscountType DiscountType = "loyalty_event"
PersonalDiscountType DiscountType = "loyalty_personal"
BonusChargeDiscountType DiscountType = "bonus_charge"
RoundDiscountType DiscountType = "round"
)

// OrdersHistoryRecord type.
type OrdersHistoryRecord struct {
Expand Down
Loading