Class: TqlOtrFactoringDataExchange::InvoiceSearchRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- TqlOtrFactoringDataExchange::InvoiceSearchRequest
- Defined in:
- lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb
Overview
Search filters and pagination for querying invoices. All filter fields are optional — omit a filter to match all values for that field. **AND across fields, OR within arrays.** When multiple fields are supplied, all must match (AND). When an array-valued field (like ‘status`) contains multiple values, a match on any value satisfies that field (OR).
Instance Attribute Summary collapse
-
#carrier_dot_numbers ⇒ Array[String]
Filter by one or more USDOT numbers (exact match, OR within the array).
-
#carrier_mc_numbers ⇒ Array[String]
Filter by one or more Motor Carrier (MC) numbers (exact match, OR within the array).
-
#carrier_names ⇒ Array[String]
Filter by one or more carrier names (partial match, OR within the array).
-
#invoice_numbers ⇒ Array[String]
Filter by one or more factoring company invoice numbers (exact match, OR within the array).
-
#last_updated_after ⇒ DateTime
Only return invoices whose ‘lastUpdatedAt` is on or after this UTC timestamp.
-
#last_updated_before ⇒ DateTime
Only return invoices whose ‘lastUpdatedAt` is before this UTC timestamp.
-
#load_numbers ⇒ Array[String]
Filter by one or more TQL load numbers (exact match, OR within the array).
-
#page ⇒ Integer
1-based page number.
-
#page_size ⇒ Integer
Number of results per page (max 100).
-
#received_after ⇒ DateTime
Only return invoices received on or after this UTC timestamp.
-
#received_before ⇒ DateTime
Only return invoices received before this UTC timestamp.
-
#statuses ⇒ Array[InvoiceStatus]
Filter by one or more invoice statuses (OR within the array).
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(page:, page_size:, load_numbers: SKIP, invoice_numbers: SKIP, statuses: SKIP, carrier_names: SKIP, carrier_dot_numbers: SKIP, carrier_mc_numbers: SKIP, last_updated_after: SKIP, last_updated_before: SKIP, received_after: SKIP, received_before: SKIP, additional_properties: nil) ⇒ InvoiceSearchRequest
constructor
A new instance of InvoiceSearchRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_last_updated_after ⇒ Object
- #to_custom_last_updated_before ⇒ Object
- #to_custom_received_after ⇒ Object
- #to_custom_received_before ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(page:, page_size:, load_numbers: SKIP, invoice_numbers: SKIP, statuses: SKIP, carrier_names: SKIP, carrier_dot_numbers: SKIP, carrier_mc_numbers: SKIP, last_updated_after: SKIP, last_updated_before: SKIP, received_after: SKIP, received_before: SKIP, additional_properties: nil) ⇒ InvoiceSearchRequest
Returns a new instance of InvoiceSearchRequest.
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 118 def initialize(page:, page_size:, load_numbers: SKIP, invoice_numbers: SKIP, statuses: SKIP, carrier_names: SKIP, carrier_dot_numbers: SKIP, carrier_mc_numbers: SKIP, last_updated_after: SKIP, last_updated_before: SKIP, received_after: SKIP, received_before: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @page = page @page_size = page_size @load_numbers = load_numbers unless load_numbers == SKIP @invoice_numbers = invoice_numbers unless invoice_numbers == SKIP @statuses = statuses unless statuses == SKIP @carrier_names = carrier_names unless carrier_names == SKIP @carrier_dot_numbers = carrier_dot_numbers unless carrier_dot_numbers == SKIP @carrier_mc_numbers = carrier_mc_numbers unless carrier_mc_numbers == SKIP @last_updated_after = last_updated_after unless last_updated_after == SKIP @last_updated_before = last_updated_before unless last_updated_before == SKIP @received_after = received_after unless received_after == SKIP @received_before = received_before unless received_before == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#carrier_dot_numbers ⇒ Array[String]
Filter by one or more USDOT numbers (exact match, OR within the array).
44 45 46 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 44 def carrier_dot_numbers @carrier_dot_numbers end |
#carrier_mc_numbers ⇒ Array[String]
Filter by one or more Motor Carrier (MC) numbers (exact match, OR within the array).
49 50 51 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 49 def carrier_mc_numbers @carrier_mc_numbers end |
#carrier_names ⇒ Array[String]
Filter by one or more carrier names (partial match, OR within the array).
40 41 42 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 40 def carrier_names @carrier_names end |
#invoice_numbers ⇒ Array[String]
Filter by one or more factoring company invoice numbers (exact match, OR within the array).
32 33 34 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 32 def invoice_numbers @invoice_numbers end |
#last_updated_after ⇒ DateTime
Only return invoices whose ‘lastUpdatedAt` is on or after this UTC timestamp.
54 55 56 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 54 def last_updated_after @last_updated_after end |
#last_updated_before ⇒ DateTime
Only return invoices whose ‘lastUpdatedAt` is before this UTC timestamp.
58 59 60 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 58 def last_updated_before @last_updated_before end |
#load_numbers ⇒ Array[String]
Filter by one or more TQL load numbers (exact match, OR within the array).
27 28 29 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 27 def load_numbers @load_numbers end |
#page ⇒ Integer
1-based page number.
19 20 21 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 19 def page @page end |
#page_size ⇒ Integer
Number of results per page (max 100).
23 24 25 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 23 def page_size @page_size end |
#received_after ⇒ DateTime
Only return invoices received on or after this UTC timestamp.
62 63 64 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 62 def received_after @received_after end |
#received_before ⇒ DateTime
Only return invoices received before this UTC timestamp.
66 67 68 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 66 def received_before @received_before end |
#statuses ⇒ Array[InvoiceStatus]
Filter by one or more invoice statuses (OR within the array).
36 37 38 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 36 def statuses @statuses end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 143 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. page = hash.key?('page') ? hash['page'] : nil page_size = hash.key?('pageSize') ? hash['pageSize'] : nil load_numbers = hash.key?('loadNumbers') ? hash['loadNumbers'] : SKIP invoice_numbers = hash.key?('invoiceNumbers') ? hash['invoiceNumbers'] : SKIP statuses = hash.key?('statuses') ? hash['statuses'] : SKIP carrier_names = hash.key?('carrierNames') ? hash['carrierNames'] : SKIP carrier_dot_numbers = hash.key?('carrierDotNumbers') ? hash['carrierDotNumbers'] : SKIP carrier_mc_numbers = hash.key?('carrierMcNumbers') ? hash['carrierMcNumbers'] : SKIP last_updated_after = if hash.key?('lastUpdatedAfter') (DateTimeHelper.from_rfc3339(hash['lastUpdatedAfter']) if hash['lastUpdatedAfter']) else SKIP end last_updated_before = if hash.key?('lastUpdatedBefore') (DateTimeHelper.from_rfc3339(hash['lastUpdatedBefore']) if hash['lastUpdatedBefore']) else SKIP end received_after = if hash.key?('receivedAfter') (DateTimeHelper.from_rfc3339(hash['receivedAfter']) if hash['receivedAfter']) else SKIP end received_before = if hash.key?('receivedBefore') (DateTimeHelper.from_rfc3339(hash['receivedBefore']) if hash['receivedBefore']) else SKIP end # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. InvoiceSearchRequest.new(page: page, page_size: page_size, load_numbers: load_numbers, invoice_numbers: invoice_numbers, statuses: statuses, carrier_names: carrier_names, carrier_dot_numbers: carrier_dot_numbers, carrier_mc_numbers: carrier_mc_numbers, last_updated_after: last_updated_after, last_updated_before: last_updated_before, received_after: received_after, received_before: received_before, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 69 def self.names @_hash = {} if @_hash.nil? @_hash['page'] = 'page' @_hash['page_size'] = 'pageSize' @_hash['load_numbers'] = 'loadNumbers' @_hash['invoice_numbers'] = 'invoiceNumbers' @_hash['statuses'] = 'statuses' @_hash['carrier_names'] = 'carrierNames' @_hash['carrier_dot_numbers'] = 'carrierDotNumbers' @_hash['carrier_mc_numbers'] = 'carrierMcNumbers' @_hash['last_updated_after'] = 'lastUpdatedAfter' @_hash['last_updated_before'] = 'lastUpdatedBefore' @_hash['received_after'] = 'receivedAfter' @_hash['received_before'] = 'receivedBefore' @_hash end |
.nullables ⇒ Object
An array for nullable fields
103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 103 def self.nullables %w[ load_numbers invoice_numbers statuses carrier_names carrier_dot_numbers carrier_mc_numbers last_updated_after last_updated_before received_after received_before ] end |
.optionals ⇒ Object
An array for optional fields
87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 87 def self.optionals %w[ load_numbers invoice_numbers statuses carrier_names carrier_dot_numbers carrier_mc_numbers last_updated_after last_updated_before received_after received_before ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 230 def inspect class_name = self.class.name.split('::').last "<#{class_name} page: #{@page.inspect}, page_size: #{@page_size.inspect}, load_numbers:"\ " #{@load_numbers.inspect}, invoice_numbers: #{@invoice_numbers.inspect}, statuses:"\ " #{@statuses.inspect}, carrier_names: #{@carrier_names.inspect}, carrier_dot_numbers:"\ " #{@carrier_dot_numbers.inspect}, carrier_mc_numbers: #{@carrier_mc_numbers.inspect},"\ " last_updated_after: #{@last_updated_after.inspect}, last_updated_before:"\ " #{@last_updated_before.inspect}, received_after: #{@received_after.inspect},"\ " received_before: #{@received_before.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_custom_last_updated_after ⇒ Object
202 203 204 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 202 def to_custom_last_updated_after DateTimeHelper.to_rfc3339(last_updated_after) end |
#to_custom_last_updated_before ⇒ Object
206 207 208 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 206 def to_custom_last_updated_before DateTimeHelper.to_rfc3339(last_updated_before) end |
#to_custom_received_after ⇒ Object
210 211 212 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 210 def to_custom_received_after DateTimeHelper.to_rfc3339(received_after) end |
#to_custom_received_before ⇒ Object
214 215 216 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 214 def to_custom_received_before DateTimeHelper.to_rfc3339(received_before) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
219 220 221 222 223 224 225 226 227 |
# File 'lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb', line 219 def to_s class_name = self.class.name.split('::').last "<#{class_name} page: #{@page}, page_size: #{@page_size}, load_numbers: #{@load_numbers},"\ " invoice_numbers: #{@invoice_numbers}, statuses: #{@statuses}, carrier_names:"\ " #{@carrier_names}, carrier_dot_numbers: #{@carrier_dot_numbers}, carrier_mc_numbers:"\ " #{@carrier_mc_numbers}, last_updated_after: #{@last_updated_after}, last_updated_before:"\ " #{@last_updated_before}, received_after: #{@received_after}, received_before:"\ " #{@received_before}, additional_properties: #{@additional_properties}>" end |