Skip to content

Commit

Permalink
Fix ServiceSelectStrategy
Browse files Browse the repository at this point in the history
  • Loading branch information
radulucut committed Nov 16, 2023
1 parent 7fa71a0 commit 15405b3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ func newOrder() Order {
},
},
},
ServiceSelectStrategy: ServiceSelectStrategy{
Service: OrderService{
SelectionType: ServiceTypeDirectId,
ServiceIds: []int64{1},
},
Expand Down Expand Up @@ -756,7 +756,7 @@ func newOrderWithAddressId() Order {
},
},
},
ServiceSelectStrategy: ServiceSelectStrategy{
Service: OrderService{
SelectionType: ServiceTypeDirectId,
ServiceIds: []int64{1},
},
Expand All @@ -770,7 +770,7 @@ func newOrderWithAddressId() Order {

func newOrderResponse() OrderResponse {
return OrderResponse{
Service: OrderService{
Service: OrderResponseService{
Price: ServicePrice{
Total: 10.0,
NoVat: 8.0,
Expand All @@ -789,7 +789,7 @@ func newOrderResponse() OrderResponse {

func newOrderPriceResponse() OrderPriceResponse {
return OrderPriceResponse{
Selected: OrderService{
Selected: OrderResponseService{
Price: ServicePrice{
Total: 10.0,
NoVat: 8.0,
Expand All @@ -800,7 +800,7 @@ func newOrderPriceResponse() OrderPriceResponse {
Name: "Service Name",
},
},
List: []OrderService{
List: []OrderResponseService{
{
Price: ServicePrice{
Total: 10.0,
Expand Down
26 changes: 13 additions & 13 deletions order.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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 {
Expand All @@ -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"`
}
Expand All @@ -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 {
Expand Down

0 comments on commit 15405b3

Please sign in to comment.