Class: FriendlyShipping::Services::TForceFreight::GenerateCreateBOLRequestHash
- Inherits:
-
Object
- Object
- FriendlyShipping::Services::TForceFreight::GenerateCreateBOLRequestHash
- Defined in:
- lib/friendly_shipping/services/tforce_freight/generate_create_bol_request_hash.rb
Overview
Generates a Bill of Lading (BOL) request hash for JSON serialization.
Class Method Summary collapse
-
.call(shipment:, options:) ⇒ Hash
BOL request hash.
Class Method Details
.call(shipment:, options:) ⇒ Hash
Returns BOL request hash.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/friendly_shipping/services/tforce_freight/generate_create_bol_request_hash.rb', line 12 def call(shipment:, options:) origin = shipment.origin destination = shipment.destination { requestOptions: (), shipFrom: location(origin).merge(isResidential: origin.residential?), shipTo: location(destination).merge(isResidential: destination.residential?), payment: payment(origin, ), commodities: .commodity_information_generator.call(shipment: shipment, options: ), instructions: instructions(), serviceOptions: (), pickupRequest: pickup_request(origin, ), documents: { image: documents(.) } }.compact. merge(GenerateHandlingUnitsHash.call(shipment: shipment, options: )). merge(GenerateReferenceHash.call(reference_numbers: .reference_numbers)) end |