quicktravel_client 3.8.1 → 3.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b571276490332c20a8f3590a5fd8db3b1829c4ee997abd52637f16fd60faf08f
4
- data.tar.gz: a113d127a0b9e43284651a6c655d09f6580be932dc95f155abddaaf589a609e6
3
+ metadata.gz: 2d3388b310dd9bf0f503277b7fea3f329e692600cf9db6cf53ae8c8882246f0f
4
+ data.tar.gz: cb262cc43f77f388ec5250840338a1e2136ed142b5adbe4ffd798b07e62953e4
5
5
  SHA512:
6
- metadata.gz: 56e1275a4222457a5de43a9894680c5c9e949cb83fd9b160c4c4db3f5d40c008741dc6ed5ee75f4a613cbea5dd03dc169c83bf69e272cd9162c9cf62f32fbd72
7
- data.tar.gz: 2889b499da18348ca09d8474434cefbb8d4cfd3ad5f1ae110aa1417bd1dc9b7c929564545b18f6fdbac14dd48c19ff990d19c18188edb3289b0d51626352b0a4
6
+ metadata.gz: 64080794df1529bc263e7e641223d8e8c741289c426d97748c6afb62026eb71141d502462e844c33c4028526825823b895862c6ef0b80a99343304f31c2ad8a0
7
+ data.tar.gz: a9ba238eed20b7276eb7a9d4253843d0374a197c07a149c2b3b98c9da1477993ef0eab3f8d7678a10bb44f8d87ef0b88f40688523fa58441756317b11aeafb43
data/CHANGELOG.md CHANGED
@@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
  This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).
5
5
 
6
+ ## [3.9.0]
7
+ ### Added
8
+ - [DC-3115] Add customer comments method in booking
9
+ - [DC-2942] Add package class to support quantity based package
10
+
6
11
  ## [3.8.1]
7
12
  ### Changed
8
13
  - [DC-3033] Reverse changes in checkout class to fix polipay redirection in EcomEngine
@@ -296,6 +296,11 @@ module QuickTravel
296
296
  Encrypt.access_key(@id.to_s)
297
297
  end
298
298
 
299
+ def customer_comments
300
+ comment = comments.detect{ |comment| comment['comment_type'] == 'customer' }
301
+ comment.presence.try(:[], 'text') || ''
302
+ end
303
+
299
304
  protected
300
305
 
301
306
  def reserve(url, options)
@@ -0,0 +1,13 @@
1
+ require 'quick_travel/adapter'
2
+
3
+ module QuickTravel
4
+ class Package < Adapter
5
+ attr_reader :error_message
6
+
7
+ self.api_base = '/api/packages'
8
+
9
+ def product_type
10
+ QuickTravel::ProductType.find(product_type_id)
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module QuickTravel
2
- VERSION = '3.8.1'
2
+ VERSION = '3.9.0'
3
3
  end
data/lib/quick_travel.rb CHANGED
@@ -33,6 +33,7 @@ module QuickTravel
33
33
  require 'quick_travel/drop_off_location'
34
34
  require 'quick_travel/drop_off_option'
35
35
  require 'quick_travel/location'
36
+ require 'quick_travel/package'
36
37
  require 'quick_travel/party'
37
38
  require 'quick_travel/passenger'
38
39
  require 'quick_travel/passenger_type'
data/spec/booking_spec.rb CHANGED
@@ -207,3 +207,13 @@ describe QuickTravel::Booking, "when booking doesn't exist" do
207
207
  end
208
208
  end
209
209
  end
210
+
211
+ describe QuickTravel::Booking, "#customer_comments" do
212
+ let(:booking) { QuickTravel::Booking.find(333536) }
213
+
214
+ it 'should return customer comments' do
215
+ VCR.use_cassette('booking_with_comments') do
216
+ expect(booking.customer_comments).to eq 'I hate this'
217
+ end
218
+ end
219
+ end
@@ -0,0 +1,24 @@
1
+ require 'spec_helper'
2
+ require 'quick_travel/package'
3
+
4
+ describe QuickTravel::Package do
5
+ subject(:package) {
6
+ VCR.use_cassette('package_show') do
7
+ QuickTravel::Package.find(464)
8
+ end
9
+ }
10
+
11
+ its(:name) { should eq 'Swan Valley Gourmet Wine Cruise (SVGWC-0945)' }
12
+ its(:type) { should eq 'Package' }
13
+
14
+
15
+ context '#product_type' do
16
+ subject(:property_type) {
17
+ VCR.use_cassette 'package_show_product_type' do
18
+ package.product_type
19
+ end
20
+ }
21
+
22
+ its(:name) { should eq 'Rottnest Packages' }
23
+ end
24
+ end
@@ -0,0 +1,119 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://test.qt.sealink.com.au:8080/api/bookings/333536.json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Content-Length:
11
+ - '0'
12
+ X-Api-Key:
13
+ - <QT_KEY>
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Date:
20
+ - Thu, 20 Feb 2020 04:49:21 GMT
21
+ Content-Type:
22
+ - application/json; charset=utf-8
23
+ Transfer-Encoding:
24
+ - chunked
25
+ Connection:
26
+ - keep-alive
27
+ Set-Cookie:
28
+ - __cfduid=d479fa6197c2ba76728106cae869037381582174160; expires=Sat, 21-Mar-20
29
+ 04:49:20 GMT; path=/; domain=.quicktravel.com.au; HttpOnly; SameSite=Lax
30
+ - _session_id=nDi7wN9vz%2BWnYivttZncWLTlh0sID39ME4%2BzY1x85FwnrsEma2kQLQy56t8wG4Trg%2B%2B6pOaO5RsFQ%2FxoU3Q7K46VhP%2BMMADI5HK9csHIagOb5bHEjQM%3D--9uFF2MnY7YnenN12--OcTj7hAxSUXCSEo7gFV7qw%3D%3D;
31
+ path=/; HttpOnly
32
+ Cache-Control:
33
+ - max-age=0, private, must-revalidate
34
+ Etag:
35
+ - W/"ec8f8b692ff0cdd0ad92d33a51c41088"
36
+ P3p:
37
+ - CP="IDC DSP CAO COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
38
+ Strict-Transport-Security:
39
+ - max-age=631138519
40
+ Vary:
41
+ - Origin
42
+ X-Content-Type-Options:
43
+ - nosniff
44
+ X-Download-Options:
45
+ - noopen
46
+ X-Frame-Options:
47
+ - sameorigin
48
+ X-Rack-Cache:
49
+ - miss
50
+ X-Request-Id:
51
+ - 8a7660a8-8ca5-4b29-bf42-ffc70b2ab78b
52
+ X-Runtime:
53
+ - '0.974720'
54
+ X-Xss-Protection:
55
+ - 1; mode=block
56
+ Cf-Cache-Status:
57
+ - DYNAMIC
58
+ Expect-Ct:
59
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
60
+ Server:
61
+ - cloudflare
62
+ Cf-Ray:
63
+ - 567dda783ac2f2ed-ADL
64
+ body:
65
+ encoding: UTF-8
66
+ string: '{"id":333536,"state":"active","reference":"23263F","public_comments":null,"internal_comments":null,"comments":[{"id":12,"booking_id":333536,"comment_type":"customer","text":"I
67
+ hate this","sentiment":"neutral","language_code":"en","translated_text":null}],"customer_contact_name":"John
68
+ Smith","customer_contact_phone":"1234","customer_contact_mobile":null,"customer_contact_email":"john.smith@test.com","currency_iso_code":"AUD","country_id":14,"drop_off_option_id":null,"drop_off_location_id":null,"post_code":"5000","referral_code_id":31,"external_identifier":null,"created_at":"2020-02-20T12:11:12.000+08:00","updated_at":"2020-02-20T12:29:45.000+08:00","promo_code":null,"promo_code_id":null,"insurance_offered":true,"total_adjustments_in_cents":136,"pre_adjusted_gross_in_cents":10900,"nett_in_cents":11036,"gross_in_cents":11036,"commission_in_cents":0,"balance_in_cents":0,"paid_in_cents":11036,"surcharge_in_cents":136,"deposit_in_cents":11036,"web_site":{"id":2,"name":"SeaLink
69
+ Rottnest","created_at":"2017-08-08T09:32:56.000+08:00","updated_at":"2017-08-08T09:32:56.000+08:00","access_key":"46eff490c163bad418569bf990214f798df8533fea29f0efb75ff0da10865109","manager_id":4,"letterhead_id":1},"web_site_name":"SeaLink
70
+ Rottnest","deposit_relevant":false,"deposit_due_on":{"_type":"Date","_value":"2020-02-20T12:11:12.000+08:00"},"balance_due_on":{"_type":"Date","_value":"2020-02-20T12:11:12.000+08:00"},"due":true,"first_travel_date":{"_type":"Date","_value":"2020-02-21"},"last_travel_date":{"_type":"Date","_value":"2020-02-21"},"complete":true,"reason_not_complete":"","first_reason_not_complete":"","unprintable_luggage_tags":false,"ttlseconds":null,"expires_from":"2020-02-20T12:39:21.289+08:00","discardable_in":-600,"inactivatable_in":-600,"notices":{},"client":null,"passenger_ids":[1101379],"vehicle_ids":[],"reservation_ids":[898357,898358],"adjustment_ids":[],"todo_items":[],"confirmation_requests":[],"passengers_attributes":[{"id":1101379,"title":"Mr","first_name":"John","last_name":"Smith","passenger_type_id":1,"age":null,"gender":"Male","position":1,"driver_uid":null,"booking_id":333536}],"vehicles_attributes":[],"reservations_attributes":[{"id":898357,"booking_id":333536,"description":"The
71
+ ''Quokka 1'', is a 400 passenger Enviro-Cat vessel that runs less fuel per
72
+ passenger than a small four cylinder car","comment":null,"active":true,"service_ids":[106911],"resource_id":2,"quantity":null,"adjustments_attributes":[{"id":3062684,"gross_in_cents":1900,"creator":{"id":4,"name":"Web
73
+ Site Manager","age":null,"first_name":"Web Site","last_name":"Manager","title":"Mr","created_at":"2017-05-01T13:27:47.000+08:00","updated_at":"2017-10-04T09:23:21.000+08:00","notes":"","updator_id":18,"creator_id":null,"active":true,"internal_subdivision":false,"business_number":null,"business_number_type":null,"access_type":2,"gender_id":"Male","auth_id":null,"birthdate":null},"created_at":"2020-02-20T12:11:49.000+08:00","description":"Rottnest
74
+ Island Admission Fee - Adult - One Way / Return on Same Day 2019/20","adjustable_item_type":"Reservation","adjustable_item_id":898357,"adjustment_definition_id":468,"adjustment_category_id":3,"automatic":true}],"complete":true,"reason_not_complete":"","first_reason_not_complete":"","enough_time_before_travel_to_edit":true,"start_time":"2000-01-01T08:30:00.000Z","end_time":"2000-01-01T10:00:00.000Z","route":"Perth
75
+ and Fremantle to Rottnest Island","route_path":"Perth to Rottnest Island","route_id":8,"trip_id":97,"inverse_reservation_id":898358,"from_route_stop_attributes":{"id":73,"inventory_controlled":true,"route_id":8,"position":1,"created_at":"2019-10-14T08:43:51.000+08:00","updated_at":"2019-10-14T08:43:51.000+08:00","stop_id":3,"name":"Perth","code":"PERTH","address":"Pier
76
+ 3, Barrack Street Jetty, Perth, WA 6000"},"to_route_stop_attributes":{"id":75,"inventory_controlled":true,"route_id":8,"position":3,"created_at":"2019-10-14T08:43:51.000+08:00","updated_at":"2019-10-14T08:43:51.000+08:00","stop_id":2,"name":"Rottnest
77
+ Island","code":"ROTTO","address":"Main Jetty, Thomson Bay, Rottnest Island,
78
+ WA 6161"},"product_type_id":6,"itinerary_footer":false,"fare_basis_set_id":266,"manually_priced":false,"manually_assigned_fare_basis_set":false,"has_vendor":false,"has_fare_basis":true,"fare_basis_season_name":"","fare_basis_pointer_id":80,"pick_up_info":"0830:
79
+ Perth (Pier 3, Barrack Street Jetty, Perth, WA 6000)","drop_off_info":"1000:
80
+ Rottnest Island (Main Jetty, Thomson Bay, Rottnest Island, WA 6161)","selection_name":"0830
81
+ - Quokka 2 - From Perth","product_name_underscore":"ferry","resource_class_name_underscore":"ship","resource_class_name":"Ship","has_ticket_template":false,"resource_ignore_last_travel_date_offset":false,"first_travel_date":{"_type":"Date","_value":"2020-02-21"},"last_travel_date":{"_type":"Date","_value":"2020-02-21"},"durational":false,"duration":1,"span":1,"duration_units":"Days","date_start_label":"Start
82
+ Date:","date_end_label":"End Date:","expires":false,"expiry":"*NA*","has_skipped_reservation_groups":false,"editable_reservation_groups":[],"tariff_level_name":"Auto
83
+ Priced as: Rottnest Island - from 5 September 2019 - Same Day \u0026 Different
84
+ Day Return","gross_including_packaged_item_in_cents":6400,"pre_adjusted_gross_including_packaged_item_in_cents":4500,"gross_in_cents":6400,"pre_adjusted_gross_in_cents":4500,"pre_adjusted_commission_in_cents":0,"cost_in_cents":0,"sub_items_gross_in_cents":0,"rules":[{"unique_name":"Rottnest
85
+ Island Admission Fee - Same Day Return from 1 July 2019 (Not commissionable)","description":"Rottnest
86
+ Island Admission Fee (only charged when arriving on Rottnest Island, not when
87
+ departing)","display_name":"Rottnest Island Admission Fee - Same Day Return
88
+ from 1 July 2019 (Not commissionable)"},{"unique_name":"Rottnest Island Ferry
89
+ - Same Day Return - travel from 5/9/19","description":"Rottnest Island Ferry
90
+ - Same Day Return - travel from 5/9/19","display_name":"Rottnest Island Ferry
91
+ - Same Day Return - travel from 5/9/19"}],"package":false,"sub_reservation_depth":0,"extra_pick":null,"child_resource":null,"pending_confirmation":false,"confirmation_request_fields":[],"report_reservation_changes":false,"vendor_pnr":null,"pick_up_information":null,"drop_off_information":null,"vendor_staff":null,"notes_for_vendor":null,"passenger_ids":[1101379],"passenger_splits":[{"id":7646275,"consumer_id":1101379,"consumer_splittable_id":898357,"gross_in_cents":4500,"commission_in_cents":0,"consumer_splittable_type":"Reservation","created_at":"2020-02-20T12:11:14.000+08:00","updated_at":"2020-02-20T12:11:15.000+08:00","commission_percentage":"0.0","length_multiplier":"1.0"}],"vehicle_ids":[],"vehicle_splits":[],"consumer_grosses":{"1101379":6400}},{"id":898358,"booking_id":333536,"description":"The
92
+ ''Quokka 1'', is a 400 passenger Enviro-Cat vessel that runs less fuel per
93
+ passenger than a small four cylinder car","comment":null,"active":true,"service_ids":[106912],"resource_id":2,"quantity":null,"adjustments_attributes":[],"complete":true,"reason_not_complete":"","first_reason_not_complete":"","enough_time_before_travel_to_edit":true,"start_time":"2000-01-01T16:15:00.000Z","end_time":"2000-01-01T17:45:00.000Z","route":"Rottnest
94
+ Island to Fremantle and Perth","route_path":"Rottnest Island to Perth","route_id":9,"trip_id":98,"inverse_reservation_id":898357,"from_route_stop_attributes":{"id":76,"inventory_controlled":true,"route_id":9,"position":1,"created_at":"2019-10-14T08:44:31.000+08:00","updated_at":"2019-10-14T08:44:31.000+08:00","stop_id":2,"name":"Rottnest
95
+ Island","code":"ROTTO","address":"Main Jetty, Thomson Bay, Rottnest Island,
96
+ WA 6161"},"to_route_stop_attributes":{"id":78,"inventory_controlled":true,"route_id":9,"position":3,"created_at":"2019-10-14T08:44:31.000+08:00","updated_at":"2019-10-14T08:44:31.000+08:00","stop_id":3,"name":"Perth","code":"PERTH","address":"Pier
97
+ 3, Barrack Street Jetty, Perth, WA 6000"},"product_type_id":6,"itinerary_footer":false,"fare_basis_set_id":257,"manually_priced":false,"manually_assigned_fare_basis_set":false,"has_vendor":false,"has_fare_basis":true,"fare_basis_season_name":"","fare_basis_pointer_id":81,"pick_up_info":"1615:
98
+ Rottnest Island (Main Jetty, Thomson Bay, Rottnest Island, WA 6161)","drop_off_info":"1745:
99
+ Perth (Pier 3, Barrack Street Jetty, Perth, WA 6000)","selection_name":"1615
100
+ - Quokka 2 - To Perth","product_name_underscore":"ferry","resource_class_name_underscore":"ship","resource_class_name":"Ship","has_ticket_template":false,"resource_ignore_last_travel_date_offset":false,"first_travel_date":{"_type":"Date","_value":"2020-02-21"},"last_travel_date":{"_type":"Date","_value":"2020-02-21"},"durational":false,"duration":1,"span":1,"duration_units":"Days","date_start_label":"Start
101
+ Date:","date_end_label":"End Date:","expires":false,"expiry":"*NA*","has_skipped_reservation_groups":false,"editable_reservation_groups":[],"tariff_level_name":"Auto
102
+ Priced as: Rottnest Island - from 5 September 2019 - Same Day \u0026 Different
103
+ Day Return","gross_including_packaged_item_in_cents":4500,"pre_adjusted_gross_including_packaged_item_in_cents":4500,"gross_in_cents":4500,"pre_adjusted_gross_in_cents":4500,"pre_adjusted_commission_in_cents":0,"cost_in_cents":0,"sub_items_gross_in_cents":0,"rules":[{"unique_name":"Rottnest
104
+ Island Ferry - Same Day Return - travel from 5/9/19","description":"Rottnest
105
+ Island Ferry - Same Day Return - travel from 5/9/19","display_name":"Rottnest
106
+ Island Ferry - Same Day Return - travel from 5/9/19"}],"package":false,"sub_reservation_depth":0,"extra_pick":null,"child_resource":null,"pending_confirmation":false,"confirmation_request_fields":[],"report_reservation_changes":false,"vendor_pnr":null,"pick_up_information":null,"drop_off_information":null,"vendor_staff":null,"notes_for_vendor":null,"passenger_ids":[1101379],"passenger_splits":[{"id":7646276,"consumer_id":1101379,"consumer_splittable_id":898358,"gross_in_cents":4500,"commission_in_cents":0,"consumer_splittable_type":"Reservation","created_at":"2020-02-20T12:11:14.000+08:00","updated_at":"2020-02-20T12:11:15.000+08:00","commission_percentage":"0.0","length_multiplier":"1.0"}],"vehicle_ids":[],"vehicle_splits":[],"consumer_grosses":{"1101379":4500}}],"adjustments_attributes":[],"payments_attributes":[{"id":155921,"booking_id":333536,"amount_in_cents":11036,"client_id":null,"creator_id":4,"created_at":"2020-02-20T12:29:42.000+08:00","updated_at":"2020-02-20T12:29:44.000+08:00","till_id":3,"comment":"","payment_type_id":2,"success":true,"payment_method":"credit_card","surcharge_in_cents":136,"creator_name":"Web
107
+ Site Manager"},{"id":155920,"booking_id":333536,"amount_in_cents":10900,"client_id":null,"creator_id":4,"created_at":"2020-02-20T12:22:33.000+08:00","updated_at":"2020-02-20T12:22:45.000+08:00","till_id":3,"comment":"","payment_type_id":21,"success":false,"payment_method":"poli_pay","surcharge_in_cents":0,"creator_name":"Web
108
+ Site Manager"}],"payment_types_attributes":[{"id":5,"name":"American Express","description":"Payments
109
+ made by American Express through the payment gateway.","transaction_fee":"1.25","active":true,"position":3,"comment_required":false,"created_at":"2017-08-03T10:05:26.000+08:00","updated_at":"2017-12-15T07:37:59.000+08:00","credit_card_brand":"American
110
+ Express","payment_method":"credit_card","gateway":"braintree","restrict_refunds":false,"on_account":false,"ticket_holding":false,"requires_staff":false,"internal":false,"redirect":false,"background":true,"creditlink":false,"surchargeable":true},{"id":14,"name":"MasterCard","description":"Payments
111
+ made by MasterCard through the payment gateway.","transaction_fee":"1.25","active":true,"position":4,"comment_required":false,"created_at":"2017-08-03T10:23:50.000+08:00","updated_at":"2017-12-01T02:54:42.000+08:00","credit_card_brand":"MasterCard","payment_method":"credit_card","gateway":"braintree","restrict_refunds":false,"on_account":false,"ticket_holding":false,"requires_staff":false,"internal":false,"redirect":false,"background":true,"creditlink":false,"surchargeable":true},{"id":2,"name":"Visa","description":"Payments
112
+ paid by Visa through the payment gateway","transaction_fee":"1.25","active":true,"position":5,"comment_required":false,"created_at":"2017-05-01T13:27:46.000+08:00","updated_at":"2017-12-01T02:54:45.000+08:00","credit_card_brand":"Visa","payment_method":"credit_card","gateway":"braintree","restrict_refunds":false,"on_account":false,"ticket_holding":false,"requires_staff":false,"internal":false,"redirect":false,"background":true,"creditlink":false,"surchargeable":true},{"id":21,"name":"POLiPay","description":"POLiPay
113
+ only online","transaction_fee":"0.0","active":true,"position":22,"comment_required":false,"created_at":"2017-09-27T14:39:23.000+08:00","updated_at":"2017-10-11T06:49:44.000+08:00","credit_card_brand":null,"payment_method":"poli_pay","gateway":null,"restrict_refunds":false,"on_account":false,"ticket_holding":false,"requires_staff":false,"internal":false,"redirect":true,"background":false,"creditlink":false,"surchargeable":false}],"issued_tickets_attributes":[],"creator":{"name":"Web
114
+ Site Manager","gravatar":"https://secure.gravatar.com/avatar/?secure=true\u0026gravatar=%7B%3Asize%3D%3E50%7D\u0026alt=Web%20Site%20Manager","url":"/parties/4"},"updator":{"name":"Web
115
+ Site Manager","gravatar":"https://secure.gravatar.com/avatar/?secure=true\u0026gravatar=%7B%3Asize%3D%3E50%7D\u0026alt=Web%20Site%20Manager","url":"/parties/4"},"company_creator":{"name":"Captain
116
+ Cook Cruises WA - Reservations","gravatar":"https://secure.gravatar.com/avatar/?secure=true\u0026gravatar=%7B%3Asize%3D%3E50%7D\u0026alt=Captain%20Cook%20Cruises%20WA%20-%20Reservations","url":"/parties/3"}}'
117
+ http_version:
118
+ recorded_at: Thu, 20 Feb 2020 04:49:22 GMT
119
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,83 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://test.qt.sealink.com.au:8080/api/packages/464.json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Content-Length:
11
+ - '0'
12
+ X-Api-Key:
13
+ - <QT_KEY>
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Date:
20
+ - Thu, 20 Feb 2020 01:00:56 GMT
21
+ Content-Type:
22
+ - application/json; charset=utf-8
23
+ Transfer-Encoding:
24
+ - chunked
25
+ Connection:
26
+ - keep-alive
27
+ Set-Cookie:
28
+ - __cfduid=d4476d9cd867237ab1e7ddfe8cab9bb7f1582160456; expires=Sat, 21-Mar-20
29
+ 01:00:56 GMT; path=/; domain=.quicktravel.com.au; HttpOnly; SameSite=Lax
30
+ - _session_id=HNhfu80YF9UuLdm9%2Fvd4OrAKDAwGgM7yyyxm5Hre5J6SCh1rK7pOCUrasl0eqcCxjItMZCX6GWErtUMjSUS%2BfLOfX8kg%2BEoaKm1O41EPp0aohkzYQ78%3D--ylH6XcOdnh0BcLnE--SKcJAqb%2B%2BAdJmnzJZ0i1%2Bg%3D%3D;
31
+ path=/; HttpOnly
32
+ Cache-Control:
33
+ - max-age=0, private, must-revalidate
34
+ Etag:
35
+ - W/"da1758ef2426563776eaed931d5175b9"
36
+ P3p:
37
+ - CP="IDC DSP CAO COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
38
+ Strict-Transport-Security:
39
+ - max-age=631138519
40
+ Vary:
41
+ - Origin
42
+ X-Content-Type-Options:
43
+ - nosniff
44
+ X-Download-Options:
45
+ - noopen
46
+ X-Frame-Options:
47
+ - sameorigin
48
+ X-Rack-Cache:
49
+ - miss
50
+ X-Request-Id:
51
+ - 03c5ebc4-eb1d-4647-9d59-4f33e7417a76
52
+ X-Runtime:
53
+ - '0.141355'
54
+ X-Xss-Protection:
55
+ - 1; mode=block
56
+ Cf-Cache-Status:
57
+ - DYNAMIC
58
+ Expect-Ct:
59
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
60
+ Server:
61
+ - cloudflare
62
+ Cf-Ray:
63
+ - 567c8be46bd9f2e9-ADL
64
+ body:
65
+ encoding: UTF-8
66
+ string: '{"name":"Swan Valley Gourmet Wine Cruise (SVGWC-0945)","id":464,"type":"Package","product_type_id":11,"resource_groups":[{"title":"Perth
67
+ to Sandalford ","id":664,"pick":1,"minimum_required":false,"maximum_restriction":false,"minimum":null,"maximum":null,"product_type_id":21,"package_options":[],"type":"ResourceGroup","package_items":[{"id":2058,"default_selection":false,"type":"PackageItem","resource":{"id":486,"name":"Perth
68
+ to Mandoon/Sandalford","type":"Ship","package_item_id":2058,"product_type_id":21,"from_route_stop_id":351,"to_route_stop_id":353}}]},{"title":"Tour
69
+ Description \u0026 Vendor Items","id":665,"pick":1,"minimum_required":false,"maximum_restriction":false,"minimum":null,"maximum":null,"product_type_id":11,"package_options":[],"type":"ResourceGroup","package_items":[{"id":1828,"default_selection":false,"type":"PackageItem","resource":{"name":"Swan
70
+ Valley Gourmet Wine Cruise - Vendor Items \u0026 Tour Description","id":465,"type":"Package","product_type_id":11,"resource_groups":[{"title":"Tour
71
+ Description \u0026 Vendor Items","id":667,"pick":1,"minimum_required":false,"maximum_restriction":false,"minimum":null,"maximum":null,"product_type_id":20,"package_options":[],"type":"ResourceGroup","package_items":[{"id":1830,"default_selection":false,"type":"PackageItem","resource":{"id":397,"name":"SVGWC-0945
72
+ - Swan Valley Gourmet Wine Cruise","type":"GenericResource","package_item_id":1830,"product_type_id":20,"from_route_stop_id":null,"to_route_stop_id":null}},{"id":1831,"default_selection":false,"type":"PackageItem","resource":{"id":329,"name":"BELLS:
73
+ Morning Tea Package","type":"GenericResource","package_item_id":1831,"product_type_id":20,"from_route_stop_id":null,"to_route_stop_id":null}},{"id":1832,"default_selection":false,"type":"PackageItem","resource":{"id":330,"name":"BELLS:
74
+ Afternoon Tea Package","type":"GenericResource","package_item_id":1832,"product_type_id":20,"from_route_stop_id":null,"to_route_stop_id":null}},{"id":1833,"default_selection":false,"type":"PackageItem","resource":{"id":335,"name":"SANDALFORD
75
+ ESTATE: 2 Course Lunch \u0026 Wine Tasting","type":"GenericResource","package_item_id":1833,"product_type_id":20,"from_route_stop_id":null,"to_route_stop_id":null}}]}],"default_options":[]}}]},{"title":"Sandalford
76
+ to Perth","id":666,"pick":1,"minimum_required":false,"maximum_restriction":false,"minimum":null,"maximum":null,"product_type_id":21,"package_options":[],"type":"ResourceGroup","package_items":[{"id":2059,"default_selection":false,"type":"PackageItem","resource":{"id":487,"name":"Sandalford/Mandoon
77
+ to Perth","type":"Ship","package_item_id":2059,"product_type_id":21,"from_route_stop_id":354,"to_route_stop_id":356}}]},{"title":"Optional
78
+ Extra","id":713,"pick":0,"minimum_required":false,"maximum_restriction":false,"minimum":null,"maximum":null,"product_type_id":22,"package_options":[],"type":"ResourceGroup","package_items":[{"id":2087,"default_selection":false,"type":"PackageItem","resource":{"id":502,"name":"Premium
79
+ Beverage Upgrade (18+)","type":"Item","package_item_id":2087,"product_type_id":22,"from_route_stop_id":null,"to_route_stop_id":null}},{"id":2088,"default_selection":false,"type":"PackageItem","resource":{"id":503,"name":"Last
80
+ Minute Premium Beverage Upgrade (18+) ","type":"Item","package_item_id":2088,"product_type_id":22,"from_route_stop_id":null,"to_route_stop_id":null}}]}],"default_options":[]}'
81
+ http_version:
82
+ recorded_at: Thu, 20 Feb 2020 01:00:56 GMT
83
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,80 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://test.qt.sealink.com.au:8080/api/product_types.json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Content-Length:
11
+ - '0'
12
+ X-Api-Key:
13
+ - <QT_KEY>
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Date:
20
+ - Thu, 20 Feb 2020 01:01:30 GMT
21
+ Content-Type:
22
+ - application/json; charset=utf-8
23
+ Transfer-Encoding:
24
+ - chunked
25
+ Connection:
26
+ - keep-alive
27
+ Set-Cookie:
28
+ - __cfduid=df7c89a7945a63958553e70497ede639a1582160490; expires=Sat, 21-Mar-20
29
+ 01:01:30 GMT; path=/; domain=.quicktravel.com.au; HttpOnly; SameSite=Lax
30
+ - _session_id=ohFEAurOFA0k3Dkfurpzg7yWDoevpE1we3n1pGout1j%2BCbEjjT9xDpMiVvY8FKGzDX8YDbEV2KYzlGqKmub84stiPt9YtKFD3o69iDPkSfqNbw9Xsng%3D--DBpWmmvc92dX5tYa--yXGiS4InGDOsWVI5ll1G7Q%3D%3D;
31
+ path=/; HttpOnly
32
+ Cache-Control:
33
+ - max-age=0, private, must-revalidate
34
+ Etag:
35
+ - W/"9e86e28ddbc8b9438ee44e55c192b7eb"
36
+ P3p:
37
+ - CP="IDC DSP CAO COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
38
+ Strict-Transport-Security:
39
+ - max-age=631138519
40
+ Vary:
41
+ - Origin
42
+ X-Content-Type-Options:
43
+ - nosniff
44
+ X-Download-Options:
45
+ - noopen
46
+ X-Frame-Options:
47
+ - sameorigin
48
+ X-Rack-Cache:
49
+ - miss
50
+ X-Request-Id:
51
+ - 95f9f85d-fe5d-4d5f-b52b-6a63c2613249
52
+ X-Runtime:
53
+ - '0.057441'
54
+ X-Xss-Protection:
55
+ - 1; mode=block
56
+ Cf-Cache-Status:
57
+ - DYNAMIC
58
+ Expect-Ct:
59
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
60
+ Server:
61
+ - cloudflare
62
+ Cf-Ray:
63
+ - 567c8cbae911f2e9-ADL
64
+ body:
65
+ encoding: UTF-8
66
+ string: '[{"id":6,"name":"Ferry","resource_class_name":"Ship","disclaimer_id":1,"durational":false,"can_find_by_location":false,"measure_units_by_pax_count":true,"multi_leg":true,"prompt_for_pick_up_drop_off":false,"book_before_level":90,"book_before_units":"minutes","maximum_passengers_online":null,"confirmation_request_fields":[],"only_bookable_with_accommodation":false,"footer_itinerary_item":false,"created_at":"2017-07-31T13:58:21.000+08:00","updated_at":"2019-10-14T08:37:06.000+08:00","code":"","needs_services":true,"can_have_quantity":false,"can_have_dates":true,"needs_passengers":true},{"id":9,"name":"Miscellaneous
67
+ Item","resource_class_name":"Item","disclaimer_id":null,"durational":false,"can_find_by_location":false,"measure_units_by_pax_count":false,"multi_leg":false,"prompt_for_pick_up_drop_off":false,"book_before_level":null,"book_before_units":"seconds","maximum_passengers_online":null,"confirmation_request_fields":[],"only_bookable_with_accommodation":false,"footer_itinerary_item":false,"created_at":"2017-08-28T13:38:17.000+08:00","updated_at":"2017-08-28T13:38:17.000+08:00","code":"","needs_services":false,"can_have_quantity":true,"can_have_dates":false,"needs_passengers":false},{"id":10,"name":"Gift
68
+ Vouchers/Donations","resource_class_name":"GenericResource","disclaimer_id":2,"durational":false,"can_find_by_location":false,"measure_units_by_pax_count":false,"multi_leg":false,"prompt_for_pick_up_drop_off":false,"book_before_level":null,"book_before_units":"seconds","maximum_passengers_online":null,"confirmation_request_fields":[],"only_bookable_with_accommodation":false,"footer_itinerary_item":false,"created_at":"2017-09-27T08:47:40.000+08:00","updated_at":"2017-12-07T12:12:53.000+08:00","code":"GIFT","needs_services":false,"can_have_quantity":false,"can_have_dates":false,"needs_passengers":false},{"id":11,"name":"Rottnest
69
+ Packages","resource_class_name":"Package","disclaimer_id":2,"durational":false,"can_find_by_location":false,"measure_units_by_pax_count":true,"multi_leg":false,"prompt_for_pick_up_drop_off":true,"book_before_level":null,"book_before_units":"seconds","maximum_passengers_online":null,"confirmation_request_fields":["pick_up_information","drop_off_information","vendor_pnr","notes_for_vendor","vendor_staff","note_for_inventory_type_change"],"only_bookable_with_accommodation":false,"footer_itinerary_item":false,"created_at":"2017-12-11T09:02:10.000+08:00","updated_at":"2018-08-17T08:38:42.000+08:00","code":"","needs_services":true,"can_have_quantity":false,"can_have_dates":true,"needs_passengers":true},{"id":12,"name":"OLD
70
+ Rottnest Island Bike Hire","resource_class_name":"GenericResource","disclaimer_id":2,"durational":false,"can_find_by_location":false,"measure_units_by_pax_count":true,"multi_leg":false,"prompt_for_pick_up_drop_off":true,"book_before_level":null,"book_before_units":"seconds","maximum_passengers_online":null,"confirmation_request_fields":["pick_up_information","drop_off_information","vendor_pnr","notes_for_vendor","vendor_staff"],"only_bookable_with_accommodation":false,"footer_itinerary_item":false,"created_at":"2017-12-21T11:02:46.000+08:00","updated_at":"2018-10-29T11:33:29.000+08:00","code":"","needs_services":true,"can_have_quantity":false,"can_have_dates":true,"needs_passengers":true},{"id":13,"name":"Rottnest
71
+ Island Tours","resource_class_name":"GenericResource","disclaimer_id":2,"durational":false,"can_find_by_location":false,"measure_units_by_pax_count":true,"multi_leg":false,"prompt_for_pick_up_drop_off":true,"book_before_level":null,"book_before_units":"seconds","maximum_passengers_online":null,"confirmation_request_fields":["pick_up_information","drop_off_information","vendor_pnr","notes_for_vendor","vendor_staff"],"only_bookable_with_accommodation":false,"footer_itinerary_item":false,"created_at":"2018-07-10T06:53:42.000+08:00","updated_at":"2018-07-10T06:53:42.000+08:00","code":"","needs_services":true,"can_have_quantity":false,"can_have_dates":true,"needs_passengers":true},{"id":15,"name":"Rottnest
72
+ Island Bike Hire","resource_class_name":"Item","disclaimer_id":2,"durational":true,"can_find_by_location":false,"measure_units_by_pax_count":false,"multi_leg":false,"prompt_for_pick_up_drop_off":false,"book_before_level":null,"book_before_units":"seconds","maximum_passengers_online":null,"confirmation_request_fields":["vendor_pnr","notes_for_vendor","vendor_staff"],"only_bookable_with_accommodation":false,"footer_itinerary_item":false,"created_at":"2018-10-29T11:35:34.000+08:00","updated_at":"2020-02-06T06:29:50.000+08:00","code":"","needs_services":true,"can_have_quantity":true,"can_have_dates":true,"needs_passengers":false},{"id":16,"name":"Accommodation","resource_class_name":"Accommodation","disclaimer_id":2,"durational":true,"can_find_by_location":true,"measure_units_by_pax_count":false,"multi_leg":false,"prompt_for_pick_up_drop_off":false,"book_before_level":null,"book_before_units":"seconds","maximum_passengers_online":null,"confirmation_request_fields":["vendor_pnr","notes_for_vendor","vendor_staff","note_for_inventory_type_change"],"only_bookable_with_accommodation":false,"footer_itinerary_item":false,"created_at":"2018-12-28T05:53:59.000+08:00","updated_at":"2019-03-14T05:08:22.000+08:00","code":"","needs_services":true,"can_have_quantity":false,"can_have_dates":true,"needs_passengers":true},{"id":17,"name":"Coach
73
+ Transfers","resource_class_name":"ScheduledTripResource","disclaimer_id":2,"durational":false,"can_find_by_location":false,"measure_units_by_pax_count":true,"multi_leg":true,"prompt_for_pick_up_drop_off":false,"book_before_level":null,"book_before_units":"seconds","maximum_passengers_online":null,"confirmation_request_fields":["pick_up_information","drop_off_information","vendor_pnr","notes_for_vendor","vendor_staff","note_for_inventory_type_change"],"only_bookable_with_accommodation":false,"footer_itinerary_item":false,"created_at":"2019-03-19T10:45:01.000+08:00","updated_at":"2019-03-19T10:45:01.000+08:00","code":"","needs_services":true,"can_have_quantity":false,"can_have_dates":true,"needs_passengers":true},{"id":18,"name":"Flights","resource_class_name":"ScheduledTripResource","disclaimer_id":2,"durational":false,"can_find_by_location":false,"measure_units_by_pax_count":true,"multi_leg":false,"prompt_for_pick_up_drop_off":false,"book_before_level":null,"book_before_units":"seconds","maximum_passengers_online":null,"confirmation_request_fields":["trip_name","departure_time","pick_up_information","drop_off_information","vendor_pnr","notes_for_vendor","vendor_staff","note_for_inventory_type_change"],"only_bookable_with_accommodation":false,"footer_itinerary_item":false,"created_at":"2019-09-23T14:17:51.000+08:00","updated_at":"2019-09-24T07:37:17.000+08:00","code":"","needs_services":true,"can_have_quantity":false,"can_have_dates":true,"needs_passengers":true},{"id":19,"name":"Extra
74
+ Picks","resource_class_name":"ExtraPick","disclaimer_id":null,"durational":true,"can_find_by_location":false,"measure_units_by_pax_count":false,"multi_leg":false,"prompt_for_pick_up_drop_off":false,"book_before_level":null,"book_before_units":"seconds","maximum_passengers_online":null,"confirmation_request_fields":["vendor_pnr","notes_for_vendor","vendor_staff","note_for_inventory_type_change"],"only_bookable_with_accommodation":true,"footer_itinerary_item":false,"created_at":"2019-09-30T08:07:18.000+08:00","updated_at":"2019-09-30T08:07:18.000+08:00","code":"","needs_services":true,"can_have_quantity":true,"can_have_dates":true,"needs_passengers":false},{"id":20,"name":"Captain
75
+ Cook Cruises - Tour \u0026 Vendor Resources","resource_class_name":"GenericResource","disclaimer_id":1,"durational":false,"can_find_by_location":false,"measure_units_by_pax_count":true,"multi_leg":false,"prompt_for_pick_up_drop_off":false,"book_before_level":null,"book_before_units":"seconds","maximum_passengers_online":null,"confirmation_request_fields":["reservation_group_id","vendor_pnr","notes_for_vendor"],"only_bookable_with_accommodation":false,"footer_itinerary_item":false,"created_at":"2019-11-28T09:10:55.000+08:00","updated_at":"2020-02-06T06:07:31.000+08:00","code":"","needs_services":true,"can_have_quantity":false,"can_have_dates":true,"needs_passengers":true},{"id":21,"name":"Captain
76
+ Cook Cruises - Ferry","resource_class_name":"Ship","disclaimer_id":1,"durational":false,"can_find_by_location":false,"measure_units_by_pax_count":true,"multi_leg":true,"prompt_for_pick_up_drop_off":false,"book_before_level":null,"book_before_units":"seconds","maximum_passengers_online":null,"confirmation_request_fields":[],"only_bookable_with_accommodation":false,"footer_itinerary_item":false,"created_at":"2020-02-03T05:24:36.000+08:00","updated_at":"2020-02-03T05:24:36.000+08:00","code":"","needs_services":true,"can_have_quantity":false,"can_have_dates":true,"needs_passengers":true},{"id":22,"name":"Captain
77
+ Cook Cruises - Optional Upgrades","resource_class_name":"Item","disclaimer_id":1,"durational":false,"can_find_by_location":false,"measure_units_by_pax_count":false,"multi_leg":false,"prompt_for_pick_up_drop_off":false,"book_before_level":null,"book_before_units":"seconds","maximum_passengers_online":null,"confirmation_request_fields":[],"only_bookable_with_accommodation":false,"footer_itinerary_item":false,"created_at":"2020-02-06T06:08:10.000+08:00","updated_at":"2020-02-06T06:08:10.000+08:00","code":"","needs_services":true,"can_have_quantity":true,"can_have_dates":true,"needs_passengers":false}]'
78
+ http_version:
79
+ recorded_at: Thu, 20 Feb 2020 01:01:30 GMT
80
+ recorded_with: VCR 2.9.3
@@ -1,4 +1,4 @@
1
1
  require 'simplecov-rcov'
2
2
  require 'coveralls'
3
3
  require 'coverage/kit'
4
- Coverage::Kit.setup(minimum_coverage: 83)
4
+ Coverage::Kit.setup(minimum_coverage: 83.2)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quicktravel_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.1
4
+ version: 3.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Noack
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-01-10 00:00:00.000000000 Z
13
+ date: 2020-02-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
@@ -319,6 +319,7 @@ files:
319
319
  - lib/quick_travel/init_from_hash.rb
320
320
  - lib/quick_travel/location.rb
321
321
  - lib/quick_travel/mock.rb
322
+ - lib/quick_travel/package.rb
322
323
  - lib/quick_travel/party.rb
323
324
  - lib/quick_travel/passenger.rb
324
325
  - lib/quick_travel/passenger_price_break.rb
@@ -366,6 +367,7 @@ files:
366
367
  - spec/country_spec.rb
367
368
  - spec/credit_card_spec.rb
368
369
  - spec/discounts_spec.rb
370
+ - spec/package_spec.rb
369
371
  - spec/passenger_type_spec.rb
370
372
  - spec/payment_type_spec.rb
371
373
  - spec/price_changes/price_change_spec.rb
@@ -396,6 +398,7 @@ files:
396
398
  - spec/support/cassettes/booking_price_changes.yml
397
399
  - spec/support/cassettes/booking_show.yml
398
400
  - spec/support/cassettes/booking_update.yml
401
+ - spec/support/cassettes/booking_with_comments.yml
399
402
  - spec/support/cassettes/booking_with_documents.yml
400
403
  - spec/support/cassettes/booking_with_nested_attributes.yml
401
404
  - spec/support/cassettes/booking_with_price_changes.yml
@@ -414,6 +417,8 @@ files:
414
417
  - spec/support/cassettes/opal_modern_pay_successful_update_response.yml
415
418
  - spec/support/cassettes/opal_pay.yml
416
419
  - spec/support/cassettes/opal_pay_booking.yml
420
+ - spec/support/cassettes/package_show.yml
421
+ - spec/support/cassettes/package_show_product_type.yml
417
422
  - spec/support/cassettes/passenger_all.yml
418
423
  - spec/support/cassettes/payment_info.yml
419
424
  - spec/support/cassettes/price_quote.yml
@@ -471,6 +476,7 @@ test_files:
471
476
  - spec/country_spec.rb
472
477
  - spec/credit_card_spec.rb
473
478
  - spec/discounts_spec.rb
479
+ - spec/package_spec.rb
474
480
  - spec/passenger_type_spec.rb
475
481
  - spec/payment_type_spec.rb
476
482
  - spec/price_changes/price_change_spec.rb
@@ -501,6 +507,7 @@ test_files:
501
507
  - spec/support/cassettes/booking_price_changes.yml
502
508
  - spec/support/cassettes/booking_show.yml
503
509
  - spec/support/cassettes/booking_update.yml
510
+ - spec/support/cassettes/booking_with_comments.yml
504
511
  - spec/support/cassettes/booking_with_documents.yml
505
512
  - spec/support/cassettes/booking_with_nested_attributes.yml
506
513
  - spec/support/cassettes/booking_with_price_changes.yml
@@ -519,6 +526,8 @@ test_files:
519
526
  - spec/support/cassettes/opal_modern_pay_successful_update_response.yml
520
527
  - spec/support/cassettes/opal_pay.yml
521
528
  - spec/support/cassettes/opal_pay_booking.yml
529
+ - spec/support/cassettes/package_show.yml
530
+ - spec/support/cassettes/package_show_product_type.yml
522
531
  - spec/support/cassettes/passenger_all.yml
523
532
  - spec/support/cassettes/payment_info.yml
524
533
  - spec/support/cassettes/price_quote.yml