Skip to content

Commit

Permalink
Merge pull request #6 from airheartdev/feature/seats
Browse files Browse the repository at this point in the history
Adds seats to passengers object
  • Loading branch information
ivanvanderbyl authored May 27, 2022
2 parents 6ef59f7 + c71b84a commit c59de0e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions duffel.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ type (
CabinClassMarketingName string `json:"cabin_class_marketing_name"`
CabinClass CabinClass `json:"cabin_class"`
Baggages []Baggage `json:"baggages"`
Seat Seat `json:"seat"`
}

Seat struct {
Name string `json:"name,omitempty"`
Disclosures []string `json:"disclosures,omitempty"`
Designator string `json:"designator,omitempty"`
}

Aircraft struct {
Expand Down
1 change: 1 addition & 0 deletions fixtures/200-get-order.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"passenger_id": "passenger_0",
"cabin_class_marketing_name": "Economy Basic",
"cabin_class": "economy",
"fare_basis_code": "OXZ0RO",
"baggages": [
{
"type": "checked",
Expand Down
5 changes: 5 additions & 0 deletions orders_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ func TestCreateOrder(t *testing.T) {
a.Len(order.Slices[0].Segments, 1)
a.Len(order.Slices[0].Segments[0].Passengers, 1)
a.Equal("passenger_0", order.Slices[0].Segments[0].Passengers[0].ID)
a.Equal(CabinClassEconomy, order.Slices[0].Segments[0].Passengers[0].CabinClass)
a.Equal("Economy Basic", order.Slices[0].Segments[0].Passengers[0].CabinClassMarketingName)
a.Equal("14B", order.Slices[0].Segments[0].Passengers[0].Seat.Designator)
a.Equal("Exit row seat", order.Slices[0].Segments[0].Passengers[0].Seat.Name)
a.Equal([]string{"Do not seat children in exit row seats", "Do not seat passengers with special needs in exit row seats"}, order.Slices[0].Segments[0].Passengers[0].Seat.Disclosures)
}

func TestListOrders(t *testing.T) {
Expand Down

0 comments on commit c59de0e

Please sign in to comment.