Skip to content

Commit cf308cf

Browse files
authored
Merge pull request #108 from a-kokovkin/master
Added fields to order and order items
2 parents 5598498 + 14c8da3 commit cf308cf

1 file changed

Lines changed: 40 additions & 17 deletions

File tree

types.go

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,9 @@ type Order struct {
373373
DialogID int `json:"dialogId,omitempty"`
374374
Links []OrderLink `json:"links,omitempty"`
375375
Currency string `json:"currency,omitempty"`
376+
377+
BonusesCreditTotal float32 `json:"bonusesCreditTotal,omitempty"`
378+
BonusesChargeTotal float32 `json:"bonusesChargeTotal,omitempty"`
376379
}
377380

378381
// LinkedOrder type.
@@ -595,23 +598,43 @@ type OrderPayment struct {
595598

596599
// OrderItem type.
597600
type OrderItem struct {
598-
ID int `json:"id,omitempty"`
599-
InitialPrice float32 `json:"initialPrice,omitempty"`
600-
PurchasePrice float32 `json:"purchasePrice,omitempty"`
601-
DiscountTotal float32 `json:"discountTotal,omitempty"`
602-
DiscountManualAmount float32 `json:"discountManualAmount,omitempty"`
603-
DiscountManualPercent float32 `json:"discountManualPercent,omitempty"`
604-
ProductName string `json:"productName,omitempty"`
605-
VatRate string `json:"vatRate,omitempty"`
606-
CreatedAt string `json:"createdAt,omitempty"`
607-
Quantity float32 `json:"quantity,omitempty"`
608-
Status string `json:"status,omitempty"`
609-
Comment string `json:"comment,omitempty"`
610-
IsCanceled bool `json:"isCanceled,omitempty"`
611-
Offer Offer `json:"offer,omitempty"`
612-
Properties Properties `json:"properties,omitempty"`
613-
PriceType *PriceType `json:"priceType,omitempty"`
614-
}
601+
ID int `json:"id,omitempty"`
602+
InitialPrice float32 `json:"initialPrice,omitempty"`
603+
PurchasePrice float32 `json:"purchasePrice,omitempty"`
604+
DiscountTotal float32 `json:"discountTotal,omitempty"`
605+
DiscountManualAmount float32 `json:"discountManualAmount,omitempty"`
606+
DiscountManualPercent float32 `json:"discountManualPercent,omitempty"`
607+
ProductName string `json:"productName,omitempty"`
608+
VatRate string `json:"vatRate,omitempty"`
609+
CreatedAt string `json:"createdAt,omitempty"`
610+
Quantity float32 `json:"quantity,omitempty"`
611+
Status string `json:"status,omitempty"`
612+
Comment string `json:"comment,omitempty"`
613+
IsCanceled bool `json:"isCanceled,omitempty"`
614+
Offer Offer `json:"offer,omitempty"`
615+
Properties Properties `json:"properties,omitempty"`
616+
PriceType *PriceType `json:"priceType,omitempty"`
617+
BonusesChargeTotal float32 `json:"bonusesChargeTotal,omitempty"`
618+
BonusesCreditTotal float32 `json:"bonusesCreditTotal,omitempty"`
619+
Discounts []ItemDiscount `json:"discounts,omitempty"`
620+
}
621+
622+
type ItemDiscount struct {
623+
Type DiscountType `json:"type"`
624+
Amount float32 `json:"amount"`
625+
}
626+
627+
type DiscountType string
628+
629+
const (
630+
ManualOrderDiscountType DiscountType = "manual_order"
631+
ManualProductDiscountType DiscountType = "manual_product"
632+
LoyaltyLevelDiscountType DiscountType = "loyalty_level"
633+
LoyaltyEventDiscountType DiscountType = "loyalty_event"
634+
PersonalDiscountType DiscountType = "loyalty_personal"
635+
BonusChargeDiscountType DiscountType = "bonus_charge"
636+
RoundDiscountType DiscountType = "round"
637+
)
615638

616639
// OrdersHistoryRecord type.
617640
type OrdersHistoryRecord struct {

0 commit comments

Comments
 (0)