Skip to content

Commit

Permalink
Add gated community accessorials
Browse files Browse the repository at this point in the history
  • Loading branch information
brodyhoskins committed Jan 29, 2024
1 parent df18842 commit abf164c
Show file tree
Hide file tree
Showing 6 changed files with 159 additions and 0 deletions.
2 changes: 2 additions & 0 deletions accessorial_symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
:fitness_center_pickup
:flatbed_delivery
:flatbed_pickup
:gated_community_delivery
:gated_community_pickup
:golf_course_delivery
:golf_course_pickup
:government_delivery
Expand Down
23 changes: 23 additions & 0 deletions lib/freight_kit/models/response/base.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

module FreightKit
module Response
# Basic Response class for requests against a carrier's API.
#
# @!attribute error
# The error object.
# @return [FreightKit::Error, NilClass]
#
# @!attribute request
# The raw request.
# @return [String]
#
# @!attribute response
# The raw response.
# @return [String]
#
class Base < Model
attr_accessor :error, :request, :response
end
end
end
19 changes: 19 additions & 0 deletions lib/freight_kit/models/response/document.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

module FreightKit
module Response
# Represents the response to calls:
# - {FreightKit::Carrier#bol}
# - {FreightKit::Carrier#pod}
# - {FreightKit::Carrier#scanned_bol}
#
# @attribute content_type
# @return [String] The HTTP `Content-Type`
#
# @attribute data
# @return [String] Raw document data.
class Document < Base
attr_accessor :content_type, :data
end
end
end
21 changes: 21 additions & 0 deletions lib/freight_kit/models/response/pickup.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

module FreightKit
module Response
# The `PickupResponse` object is returned by the {FreightKit::Carrier#create_pickup}
# call. The most important method is {#pickup_number}, which will return the pickup reference
# number.
#
# @!attribute labels
# Shipping labels.
# @return [Array<FreightKit::Label>]
#
# @!attribute pickup_number
# Pickup reference number.
# @return [String]
#
class Pickup < Base
attr_accessor :labels, :pickup_number
end
end
end
17 changes: 17 additions & 0 deletions lib/freight_kit/models/response/rate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

module FreightKit
module Response
# The `RateResponse` object is returned by the {FreightKit::Carrier#find_rates}
# call. The most important method is {#rates}, which will return a list of possible
# shipping options with an estimated price.
#
# @!attribute rates
# The available rate options for the shipment, with an estimated price.
# @return [Array<FreightKit::Rate>]
#
class Rate < Base
attr_accessor :rates
end
end
end
77 changes: 77 additions & 0 deletions lib/freight_kit/models/response/tracking.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# frozen_string_literal: true

module FreightKit
module Response
# Represents the response to a {FreightKit::Carrier#find_tracking_info} call.
#
# @note Some carriers provide more information than others, so not all attributes
# will be set, depending on what carrier you are using.
#
# @!attribute actual_delivery_date
# @return [DateTime]
#
# @!attribute attempted_delivery_date
# @return [DateTime]
#
# @!attribute carrier
# @return [Symbol]
#
# @!attribute carrier_name
# @return [String]
#
# @!attribute delivery_signature
# @return [String]
#
# @!attribute destination
# @return [FreightKit::Location]
#
# @!attribute estimated_delivery_date
# @return [FreightKit::DateTime]
#
# @!attribute origin
# @return [FreightKit::Location]
#
# @!attribute scheduled_delivery_date
# @return [DateTime]
#
# @!attribute ship_time
# @return [Date, Time]
#
# @!attribute shipment_events
# @return [Array<FreightKit::ShipmentEvent>]
#
# @!attribute shipper_address
# @return [FreightKit::Location]
#
# @!attribute status
# @return [Symbol]
#
# @!attribute status_code
# @return [string]
#
# @!attribute status_description
# @return [String]
#
# @!attribute tracking_number
# @return [String]
#
class Tracking < Base
attr_accessor :actual_delivery_date,
:attempted_delivery_date,
:carrier,
:carrier_name,
:delivery_signature,
:destination,
:estimated_delivery_date,
:origin,
:scheduled_delivery_date,
:ship_time,
:shipment_events,
:shipper_address,
:status,
:status_code,
:status_description,
:tracking_number
end
end
end

0 comments on commit abf164c

Please sign in to comment.