diff --git a/client_test.go b/client_test.go index 7805814..349be69 100644 --- a/client_test.go +++ b/client_test.go @@ -724,7 +724,7 @@ func newOrder() Order { }, }, }, - ServiceSelectStrategy: ServiceSelectStrategy{ + Service: OrderService{ SelectionType: ServiceTypeDirectId, ServiceIds: []int64{1}, }, @@ -756,7 +756,7 @@ func newOrderWithAddressId() Order { }, }, }, - ServiceSelectStrategy: ServiceSelectStrategy{ + Service: OrderService{ SelectionType: ServiceTypeDirectId, ServiceIds: []int64{1}, }, @@ -770,7 +770,7 @@ func newOrderWithAddressId() Order { func newOrderResponse() OrderResponse { return OrderResponse{ - Service: OrderService{ + Service: OrderResponseService{ Price: ServicePrice{ Total: 10.0, NoVat: 8.0, @@ -789,7 +789,7 @@ func newOrderResponse() OrderResponse { func newOrderPriceResponse() OrderPriceResponse { return OrderPriceResponse{ - Selected: OrderService{ + Selected: OrderResponseService{ Price: ServicePrice{ Total: 10.0, NoVat: 8.0, @@ -800,7 +800,7 @@ func newOrderPriceResponse() OrderPriceResponse { Name: "Service Name", }, }, - List: []OrderService{ + List: []OrderResponseService{ { Price: ServicePrice{ Total: 10.0, diff --git a/order.go b/order.go index 84662b8..2f97221 100644 --- a/order.go +++ b/order.go @@ -46,7 +46,7 @@ const ( ServiceGradeRepayment ServiceGrade = "repayment" ) -type ServiceSelectStrategy struct { +type OrderService struct { SelectionType ServiceType `json:"selectionType"` ServiceIds []int64 `json:"serviceIds,omitempty"` Grades []ServiceGrade `json:"grades,omitempty"` @@ -59,11 +59,11 @@ type Packages struct { } type Order struct { - Sender Sender `json:"sender"` - Recipient Recipient `json:"recipient"` - Packages Packages `json:"packages"` - ServiceSelectStrategy ServiceSelectStrategy `json:"serviceSelectStrategy"` - ExtraOptions []interface{} `json:"extraOptions,omitempty"` + Sender Sender `json:"sender"` + Recipient Recipient `json:"recipient"` + Packages Packages `json:"packages"` + Service OrderService `json:"service"` + ExtraOptions []interface{} `json:"extraOptions,omitempty"` } type ServicePrice struct { @@ -77,7 +77,7 @@ type ServiceDetails struct { Name string `json:"name"` } -type OrderService struct { +type OrderResponseService struct { Price ServicePrice `json:"price"` Service ServiceDetails `json:"service"` } @@ -98,15 +98,15 @@ const ( ) type OrderResponse struct { - Service OrderService `json:"service"` - AWB string `json:"awb"` - UniqueId string `json:"uniqueId"` - EstimatedPickupDate string `json:"estimatedPickupDate"` + Service OrderResponseService `json:"service"` + AWB string `json:"awb"` + UniqueId string `json:"uniqueId"` + EstimatedPickupDate string `json:"estimatedPickupDate"` } type OrderPriceResponse struct { - Selected OrderService `json:"selected"` - List []OrderService `json:"list"` + Selected OrderResponseService `json:"selected"` + List []OrderResponseService `json:"list"` } type StatusSummary struct {