Class: ShellDataReportingApIs::MultiPricedTransactionRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb

Overview

MultiPricedTransactionRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(col_co_code = nil, accounts = nil, col_co_id = SKIP, invoice_status = SKIP, purchased_in_country = SKIP, from_date = SKIP, to_date = SKIP, period = SKIP, posting_date_from = SKIP, posting_date_to = SKIP, invoice_date = SKIP, invoice_number = SKIP, valid_invoice_date_only = SKIP, invoice_from_date = SKIP, invoice_to_date = SKIP, fuel_only = SKIP, include_fees = SKIP, sort_order = SKIP, current_page = SKIP, page_size = SKIP) ⇒ MultiPricedTransactionRequest

Returns a new instance of MultiPricedTransactionRequest.



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 254

def initialize(col_co_code = nil, accounts = nil, col_co_id = SKIP,
               invoice_status = SKIP, purchased_in_country = SKIP,
               from_date = SKIP, to_date = SKIP, period = SKIP,
               posting_date_from = SKIP, posting_date_to = SKIP,
               invoice_date = SKIP, invoice_number = SKIP,
               valid_invoice_date_only = SKIP, invoice_from_date = SKIP,
               invoice_to_date = SKIP, fuel_only = SKIP,
               include_fees = SKIP, sort_order = SKIP, current_page = SKIP,
               page_size = SKIP)
  @col_co_id = col_co_id unless col_co_id == SKIP
  @col_co_code = col_co_code
  @accounts = accounts
  @invoice_status = invoice_status unless invoice_status == SKIP
  @purchased_in_country = purchased_in_country unless purchased_in_country == SKIP
  @from_date = from_date unless from_date == SKIP
  @to_date = to_date unless to_date == SKIP
  @period = period unless period == SKIP
  @posting_date_from = posting_date_from unless posting_date_from == SKIP
  @posting_date_to = posting_date_to unless posting_date_to == SKIP
  @invoice_date = invoice_date unless invoice_date == SKIP
  @invoice_number = invoice_number unless invoice_number == SKIP
  @valid_invoice_date_only = valid_invoice_date_only unless valid_invoice_date_only == SKIP
  @invoice_from_date = invoice_from_date unless invoice_from_date == SKIP
  @invoice_to_date = invoice_to_date unless invoice_to_date == SKIP
  @fuel_only = fuel_only unless fuel_only == SKIP
  @include_fees = include_fees unless include_fees == SKIP
  @sort_order = sort_order unless sort_order == SKIP
  @current_page = current_page unless current_page == SKIP
  @page_size = page_size unless page_size == SKIP
end

Instance Attribute Details

#accountsArray[MultiPricedTransactionRequestAccountsItems]

List of Payers/Accounts entity. Mandatory. • Max number of payers allowed in the input is 10, if it exceeds in the input it will throw an error. • This value is configurable. Initial configuration will be 100 and will change to 10 once SFH changes are integrated. Note:

  1. At least one payer should be present.

Accounts information are optional.



39
40
41
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 39

def accounts
  @accounts
end

#col_co_codeInteger

Collecting Company Code of the selected payer. Mandatory for serviced OUs such as Romania, Latvia, Lithuania, Estonia, Ukraine etc. It is optional for other countries if ColCoID is provided. Example: 86 for Philippines 5 for UK

Returns:

  • (Integer)


27
28
29
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 27

def col_co_code
  @col_co_code
end

#col_co_idInteger

Collecting Company Id of the selected payer. Optional if ColCoCode is passed else Mandatory. Example: 1 for Philippines 5 for UK

Returns:

  • (Integer)


18
19
20
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 18

def col_co_id
  @col_co_id
end

#current_pageInteger

Page Number (as shown to the users) Optional Default value 1 Note: If IncludeFees is ‘True’ then pagination is not allowed. This parameter will be ignored.

Returns:

  • (Integer)


189
190
191
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 189

def current_page
  @current_page
end

#from_dateString

Transactions from Date/Time. Optional – When provided, it should be with in last 24 months. Format: yyyyMMdd

Returns:

  • (String)


61
62
63
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 61

def from_date
  @from_date
end

#fuel_onlyTrueClass | FalseClass

True/False Optional Default value: False. When passed as ‘True’ Only returned records with Fuel transactions. When passed as ‘False’ the above condition will not be checked. Note: If IncludeFees is ‘True’ then this filter will be ignored

Returns:

  • (TrueClass | FalseClass)


160
161
162
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 160

def fuel_only
  @fuel_only
end

#include_feesTrueClass | FalseClass

True/False Optional Default value: False When passed as ‘True’ then ignore complex filters, all sales items along with fees included on the same response

Returns:

  • (TrueClass | FalseClass)


168
169
170
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 168

def include_fees
  @include_fees
end

#invoice_dateString

Invoice Date. Optional Note: 1) If value is not blank then the system will ignore the InvoiceStatus parameter and it will return all the billed transactions for the given invoice date. 2) If IncludeFees is true then this filter will be ignored

Format: yyyyMMdd

Returns:

  • (String)


111
112
113
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 111

def invoice_date
  @invoice_date
end

#invoice_from_dateString

Start date for transaction search by invoice date. Optional Note: 1) Value should be with in last 24 months (if provided). 2) Maximum of 90(Configurable) days duration allowed per search. 3) When provided, InvoiceFromDate has to be less than or equal to InvoiceToDate. Format: yyyyMMdd

Returns:

  • (String)


141
142
143
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 141

def invoice_from_date
  @invoice_from_date
end

#invoice_numberString

Invoice Number. Optional Note: 1) If value is not blank then the system will ignore the InvoiceStatus parameter and it will return all the billed transactions for the given invoice date.

Returns:

  • (String)


120
121
122
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 120

def invoice_number
  @invoice_number
end

#invoice_statusString

Invoice status of the transactions Mandatory Possible options: I - Invoiced U – Un-Invoiced A – All Max Length: 1

Returns:

  • (String)


49
50
51
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 49

def invoice_status
  @invoice_status
end

#invoice_to_dateString

End date for transaction search by invoice date. Optional Note: 1) When InvoiceFromDate is provided and InvoiceToDate is null, then InvoiceToDate will be calculated as (InvoiceFromDate + 90 days) or (CurrentDate) whichever is lesser. Format: yyyyMMdd

Returns:

  • (String)


151
152
153
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 151

def invoice_to_date
  @invoice_to_date
end

#page_sizeInteger

Page Size – Number of records to show on a page Optional Default value 50 Note: If IncludeFees is ‘True’ then pagination is not allowed. This parameter will be ignored.

Returns:

  • (Integer)


197
198
199
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 197

def page_size
  @page_size
end

#periodInteger

Transactions Period. Possible values are:

  1. Last 7 Days

  2. Last 30 Days

  3. Last 90 Days

Returns:

  • (Integer)


79
80
81
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 79

def period
  @period
end

#posting_date_fromString

Transaction Posting Date/time in the Cards Platform - From Date/time. Note: 1) When the value of both PostingDateFrom and PostingDateTo are present in the request then the value of PostingDateFrom must be less than PostingDateTo. 2) If IncludeFees is true then this filter will be ignored Format: yyyyMMdd HH:mm:ss

Returns:

  • (String)


89
90
91
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 89

def posting_date_from
  @posting_date_from
end

#posting_date_toString

Transaction Posting Date/time in the Cards Platform – To Date/time. Note: 1) If IncludeFees is true then this filter will be ignored. 2) When the value of both PostingDateFrom and PostingDateTo are present in the request then the value of PostingDateFrom must be less than PostingDateTo. Format: yyyyMMdd HH:mm:ss

Returns:

  • (String)


99
100
101
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 99

def posting_date_to
  @posting_date_to
end

#purchased_in_countryString

ISO Country Code (ex: UK, FR) Optional Note: If IncludeFees is true then this filter will be ignored

Returns:

  • (String)


55
56
57
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 55

def purchased_in_country
  @purchased_in_country
end

#sort_orderString

Allowed Sorting Options:

  1. TransactionDateAscending

  2. TransactionDateDescending

  3. GrossAmountDescending

  4. GrossAmountAscending

  5. NetAmountAscending

  6. NetAmountDescensding

Example value to be passed: 1,3 Note: If IncludeFees is ‘True’ then sorting is not allowed. This parameter will be ignored.

Returns:

  • (String)


181
182
183
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 181

def sort_order
  @sort_order
end

#to_dateString

Transactions to Date/Time. 1) When the value is blank and FromDate is provided on the input, all transactions took place 210(Configurable) days after the given FromDate is returned. 2) Difference between FromDate and ToDate cannot be more than 210 (Configurable) days. Format: yyyyMMdd

Returns:

  • (String)


71
72
73
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 71

def to_date
  @to_date
end

#valid_invoice_date_onlyTrueClass | FalseClass

True/False Optional Default value: True. When passed as ‘True’ the transactions records with report date not equal to 9999-12-30 will be returned. When passed as ‘False’ the above condition will not be checked. Note: If IncludeFees is ‘True’ then this filter will be ignored

Returns:

  • (TrueClass | FalseClass)


130
131
132
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 130

def valid_invoice_date_only
  @valid_invoice_date_only
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 286

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : nil
  # Parameter is an array, so we need to iterate through it
  accounts = nil
  unless hash['Accounts'].nil?
    accounts = []
    hash['Accounts'].each do |structure|
      accounts << (MultiPricedTransactionRequestAccountsItems.from_hash(structure) if structure)
    end
  end

  accounts = nil unless hash.key?('Accounts')
  col_co_id = hash.key?('ColCoId') ? hash['ColCoId'] : SKIP
  invoice_status = hash.key?('InvoiceStatus') ? hash['InvoiceStatus'] : SKIP
  purchased_in_country =
    hash.key?('PurchasedInCountry') ? hash['PurchasedInCountry'] : SKIP
  from_date = hash.key?('FromDate') ? hash['FromDate'] : SKIP
  to_date = hash.key?('ToDate') ? hash['ToDate'] : SKIP
  period = hash.key?('Period') ? hash['Period'] : SKIP
  posting_date_from =
    hash.key?('PostingDateFrom') ? hash['PostingDateFrom'] : SKIP
  posting_date_to =
    hash.key?('PostingDateTo') ? hash['PostingDateTo'] : SKIP
  invoice_date = hash.key?('InvoiceDate') ? hash['InvoiceDate'] : SKIP
  invoice_number = hash.key?('InvoiceNumber') ? hash['InvoiceNumber'] : SKIP
  valid_invoice_date_only =
    hash.key?('ValidInvoiceDateOnly') ? hash['ValidInvoiceDateOnly'] : SKIP
  invoice_from_date =
    hash.key?('InvoiceFromDate') ? hash['InvoiceFromDate'] : SKIP
  invoice_to_date =
    hash.key?('InvoiceToDate') ? hash['InvoiceToDate'] : SKIP
  fuel_only = hash.key?('FuelOnly') ? hash['FuelOnly'] : SKIP
  include_fees = hash.key?('IncludeFees') ? hash['IncludeFees'] : SKIP
  sort_order = hash.key?('SortOrder') ? hash['SortOrder'] : SKIP
  current_page = hash.key?('CurrentPage') ? hash['CurrentPage'] : SKIP
  page_size = hash.key?('PageSize') ? hash['PageSize'] : SKIP

  # Create object from extracted values.
  MultiPricedTransactionRequest.new(col_co_code,
                                    accounts,
                                    col_co_id,
                                    invoice_status,
                                    purchased_in_country,
                                    from_date,
                                    to_date,
                                    period,
                                    posting_date_from,
                                    posting_date_to,
                                    invoice_date,
                                    invoice_number,
                                    valid_invoice_date_only,
                                    invoice_from_date,
                                    invoice_to_date,
                                    fuel_only,
                                    include_fees,
                                    sort_order,
                                    current_page,
                                    page_size)
end

.namesObject

A mapping from model property names to API property names.



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 200

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['col_co_id'] = 'ColCoId'
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['accounts'] = 'Accounts'
  @_hash['invoice_status'] = 'InvoiceStatus'
  @_hash['purchased_in_country'] = 'PurchasedInCountry'
  @_hash['from_date'] = 'FromDate'
  @_hash['to_date'] = 'ToDate'
  @_hash['period'] = 'Period'
  @_hash['posting_date_from'] = 'PostingDateFrom'
  @_hash['posting_date_to'] = 'PostingDateTo'
  @_hash['invoice_date'] = 'InvoiceDate'
  @_hash['invoice_number'] = 'InvoiceNumber'
  @_hash['valid_invoice_date_only'] = 'ValidInvoiceDateOnly'
  @_hash['invoice_from_date'] = 'InvoiceFromDate'
  @_hash['invoice_to_date'] = 'InvoiceToDate'
  @_hash['fuel_only'] = 'FuelOnly'
  @_hash['include_fees'] = 'IncludeFees'
  @_hash['sort_order'] = 'SortOrder'
  @_hash['current_page'] = 'CurrentPage'
  @_hash['page_size'] = 'PageSize'
  @_hash
end

.nullablesObject

An array for nullable fields



250
251
252
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 250

def self.nullables
  []
end

.optionalsObject

An array for optional fields



226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb', line 226

def self.optionals
  %w[
    col_co_id
    invoice_status
    purchased_in_country
    from_date
    to_date
    period
    posting_date_from
    posting_date_to
    invoice_date
    invoice_number
    valid_invoice_date_only
    invoice_from_date
    invoice_to_date
    fuel_only
    include_fees
    sort_order
    current_page
    page_size
  ]
end