Class: ShellDataReportingApIs::Filters

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

Overview

Filters 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, invoice_status = nil, payer_number = nil, account_id = SKIP, account_number = SKIP, driver_name = SKIP, card_group_id = SKIP, card_pan = SKIP, product_code = SKIP, product_name = SKIP, site_code = SKIP, incoming_site_number = SKIP, invoice_date = SKIP, invoice_number = SKIP, purchased_in_country_code = SKIP, purchased_in_country = SKIP, site_group_id = SKIP, vehicle_registration_number = SKIP, fee_type_id = SKIP, line_item_description = SKIP, cards = SKIP, sort_order = SKIP, from_date = SKIP, to_date = SKIP, period = SKIP, posting_date_from = SKIP, posting_date_to = SKIP, transaction_item_id = SKIP, fuel_only = false, include_fees = SKIP, is_multipayer = SKIP, valid_invoice_date_only = false, invoice_from_date = SKIP, invoice_to_date = SKIP, hosting_collecting_company_number = SKIP, search = SKIP, transaction_id = SKIP) ⇒ Filters

Returns a new instance of Filters.



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
348
349
350
351
352
353
354
355
356
357
358
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 295

def initialize(col_co_code = nil, invoice_status = nil, payer_number = nil,
                = SKIP,  = SKIP, driver_name = SKIP,
               card_group_id = SKIP, card_pan = SKIP, product_code = SKIP,
               product_name = SKIP, site_code = SKIP,
               incoming_site_number = SKIP, invoice_date = SKIP,
               invoice_number = SKIP, purchased_in_country_code = SKIP,
               purchased_in_country = SKIP, site_group_id = SKIP,
               vehicle_registration_number = SKIP, fee_type_id = SKIP,
               line_item_description = SKIP, cards = SKIP,
               sort_order = SKIP, from_date = SKIP, to_date = SKIP,
               period = SKIP, posting_date_from = SKIP,
               posting_date_to = SKIP, transaction_item_id = SKIP,
               fuel_only = false, include_fees = SKIP, is_multipayer = SKIP,
               valid_invoice_date_only = false, invoice_from_date = SKIP,
               invoice_to_date = SKIP,
               hosting_collecting_company_number = SKIP, search = SKIP,
               transaction_id = SKIP)
  @col_co_code = col_co_code
  @invoice_status = invoice_status
  @payer_number = payer_number
  @account_id =  unless  == SKIP
  @account_number =  unless  == SKIP
  @driver_name = driver_name unless driver_name == SKIP
  @card_group_id = card_group_id unless card_group_id == SKIP
  @card_pan = card_pan unless card_pan == SKIP
  @product_code = product_code unless product_code == SKIP
  @product_name = product_name unless product_name == SKIP
  @site_code = site_code unless site_code == SKIP
  @incoming_site_number = incoming_site_number unless incoming_site_number == SKIP
  @invoice_date = invoice_date unless invoice_date == SKIP
  @invoice_number = invoice_number unless invoice_number == SKIP
  unless purchased_in_country_code == SKIP
    @purchased_in_country_code =
      purchased_in_country_code
  end
  @purchased_in_country = purchased_in_country unless purchased_in_country == SKIP
  @site_group_id = site_group_id unless site_group_id == SKIP
  unless vehicle_registration_number == SKIP
    @vehicle_registration_number =
      vehicle_registration_number
  end
  @fee_type_id = fee_type_id unless fee_type_id == SKIP
  @line_item_description = line_item_description unless line_item_description == SKIP
  @cards = cards unless cards == SKIP
  @sort_order = sort_order unless sort_order == 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
  @transaction_item_id = transaction_item_id unless transaction_item_id == SKIP
  @fuel_only = fuel_only unless fuel_only == SKIP
  @include_fees = include_fees unless include_fees == SKIP
  @is_multipayer = is_multipayer unless is_multipayer == 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
  unless hosting_collecting_company_number == SKIP
    @hosting_collecting_company_number =
      hosting_collecting_company_number
  end
  @search = search unless search == SKIP
  @transaction_id = transaction_id unless transaction_id == SKIP
end

Instance Attribute Details

#account_idInteger

Account Id (GFN customer id)

Returns:

  • (Integer)


26
27
28
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 26

def 
  @account_id
end

#account_numberString

Account Number of the selected account.

Returns:

  • (String)


30
31
32
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 30

def 
  @account_number
end

#card_group_idInteger

Card Group Id in GFN

Returns:

  • (Integer)


38
39
40
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 38

def card_group_id
  @card_group_id
end

#card_panString

Full Card PAN

Returns:

  • (String)


42
43
44
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 42

def card_pan
  @card_pan
end

#cardsArray[Integer]

This entity accepts the list of CardId to filter in the response. Note: The number of cardId allowed to be passed in the request is configurable to a maximum of 500 cards.

Returns:

  • (Array[Integer])


96
97
98
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 96

def cards
  @cards
end

#col_co_codeString

Collecting Company Code (Shell Code) of the selected payer.

Returns:

  • (String)


14
15
16
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 14

def col_co_code
  @col_co_code
end

#driver_nameString

Driver Name (of Card record)

Returns:

  • (String)


34
35
36
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 34

def driver_name
  @driver_name
end

#fee_type_idInteger

Card Id (i.e. Unique Card Id in GFN)

Returns:

  • (Integer)


86
87
88
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 86

def fee_type_id
  @fee_type_id
end

#from_dateString

From transaction delivery date

Returns:

  • (String)


106
107
108
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 106

def from_date
  @from_date
end

#fuel_onlyTrueClass | FalseClass

Is FuelOnly indicator

Returns:

  • (TrueClass | FalseClass)


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

def fuel_only
  @fuel_only
end

#hosting_collecting_company_numberString

Hosting Collecting Company Number of the selected payer.

Returns:

  • (String)


164
165
166
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 164

def hosting_collecting_company_number
  @hosting_collecting_company_number
end

#include_feesTrueClass | FalseClass

When passed as ‘true’ then all sales items along with fees will be included in the response and the follwoing filteres will be ignored

  • InvoiceNumber

  • InvoiceDate

  • PostingDateFrom

  • PostingDateTo

Returns:

  • (TrueClass | FalseClass)


139
140
141
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 139

def include_fees
  @include_fees
end

#incoming_site_numberString

Site Code as configured in GFN

Returns:

  • (String)


58
59
60
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 58

def incoming_site_number
  @incoming_site_number
end

#invoice_dateString

Returns the billed transaction for the given invoice date

Returns:

  • (String)


62
63
64
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 62

def invoice_date
  @invoice_date
end

#invoice_from_dateString

Invoice From Date, this is a search criterion to filter invoiced transactions with invoice date from this date.

Returns:

  • (String)


155
156
157
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 155

def invoice_from_date
  @invoice_from_date
end

#invoice_numberString

Returns the billed transaction for the given invoice number

Returns:

  • (String)


66
67
68
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 66

def invoice_number
  @invoice_number
end

#invoice_statusObject

Collecting Company Code (Shell Code) of the selected payer.

Returns:

  • (Object)


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

def invoice_status
  @invoice_status
end

#invoice_to_dateString

Invoice To Date, this is a search criterion to filter invoiced transactions with invoice date until this date.

Returns:

  • (String)


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

def invoice_to_date
  @invoice_to_date
end

#is_multipayerTrueClass | FalseClass

If true then returns all the data linked tothe payer group of the provided PayerNumberin the request

Returns:

  • (TrueClass | FalseClass)


144
145
146
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 144

def is_multipayer
  @is_multipayer
end

#line_item_descriptionString

Item identifier in the transaction.

Returns:

  • (String)


90
91
92
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 90

def line_item_description
  @line_item_description
end

#payer_numberString

Payer Number of the selected payer.

Returns:

  • (String)


22
23
24
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 22

def payer_number
  @payer_number
end

#periodPricedTransactionReqV2PeriodEnum

To transaction delivery date



114
115
116
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 114

def period
  @period
end

#posting_date_fromString

Transaction posting start date and time

Returns:

  • (String)


118
119
120
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 118

def posting_date_from
  @posting_date_from
end

#posting_date_toString

Transaction posting end date and time

Returns:

  • (String)


122
123
124
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 122

def posting_date_to
  @posting_date_to
end

#product_codeString

Product Code – Global as per GFN configuration

Returns:

  • (String)


46
47
48
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 46

def product_code
  @product_code
end

#product_nameString

Product Name – Global as per GFN configuration

Returns:

  • (String)


50
51
52
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 50

def product_name
  @product_name
end

#purchased_in_countryString

Network Delco PurchasedCountryName

Returns:

  • (String)


74
75
76
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 74

def purchased_in_country
  @purchased_in_country
end

#purchased_in_country_codeString

Purchased InCountryCode

Returns:

  • (String)


70
71
72
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 70

def purchased_in_country_code
  @purchased_in_country_code
end

#searchString

Search based on DriverName or VRN

Returns:

  • (String)


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

def search
  @search
end

#site_codeString

Site Code in GFN

Returns:

  • (String)


54
55
56
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 54

def site_code
  @site_code
end

#site_group_idInteger

Site Group Id in GFN

Returns:

  • (Integer)


78
79
80
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 78

def site_group_id
  @site_group_id
end

#sort_orderPricedTransactionReqV2SortOrderEnum

This entity accepts the list of CardId to filter in the response. Note: The number of cardId allowed to be passed in the request is configurable to a maximum of 500 cards.



102
103
104
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 102

def sort_order
  @sort_order
end

#to_dateString

To transaction delivery date

Returns:

  • (String)


110
111
112
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 110

def to_date
  @to_date
end

#transaction_idString

Unique id of the transaction that may include one or more salesitems

Returns:

  • (String)


172
173
174
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 172

def transaction_id
  @transaction_id
end

#transaction_item_idString

Unique id of the transaction that may include one or more salesitems

Returns:

  • (String)


126
127
128
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 126

def transaction_item_id
  @transaction_item_id
end

#valid_invoice_date_onlyTrueClass | FalseClass

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.

Returns:

  • (TrueClass | FalseClass)


150
151
152
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 150

def valid_invoice_date_only
  @valid_invoice_date_only
end

#vehicle_registration_numberString

Vehicle Registration (of Card record)

Returns:

  • (String)


82
83
84
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 82

def vehicle_registration_number
  @vehicle_registration_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 361

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : nil
  invoice_status = hash.key?('InvoiceStatus') ? hash['InvoiceStatus'] : nil
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : nil
   = hash.key?('AccountId') ? hash['AccountId'] : SKIP
   = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
  driver_name = hash.key?('DriverName') ? hash['DriverName'] : SKIP
  card_group_id = hash.key?('CardGroupId') ? hash['CardGroupId'] : SKIP
  card_pan = hash.key?('CardPAN') ? hash['CardPAN'] : SKIP
  product_code = hash.key?('ProductCode') ? hash['ProductCode'] : SKIP
  product_name = hash.key?('ProductName') ? hash['ProductName'] : SKIP
  site_code = hash.key?('SiteCode') ? hash['SiteCode'] : SKIP
  incoming_site_number =
    hash.key?('IncomingSiteNumber') ? hash['IncomingSiteNumber'] : SKIP
  invoice_date = hash.key?('InvoiceDate') ? hash['InvoiceDate'] : SKIP
  invoice_number = hash.key?('InvoiceNumber') ? hash['InvoiceNumber'] : SKIP
  purchased_in_country_code =
    hash.key?('PurchasedInCountryCode') ? hash['PurchasedInCountryCode'] : SKIP
  purchased_in_country =
    hash.key?('PurchasedInCountry') ? hash['PurchasedInCountry'] : SKIP
  site_group_id = hash.key?('SiteGroupId') ? hash['SiteGroupId'] : SKIP
  vehicle_registration_number =
    hash.key?('VehicleRegistrationNumber') ? hash['VehicleRegistrationNumber'] : SKIP
  fee_type_id = hash.key?('FeeTypeId') ? hash['FeeTypeId'] : SKIP
  line_item_description =
    hash.key?('LineItemDescription') ? hash['LineItemDescription'] : SKIP
  cards = hash.key?('Cards') ? hash['Cards'] : SKIP
  sort_order = hash.key?('SortOrder') ? hash['SortOrder'] : 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
  transaction_item_id =
    hash.key?('TransactionItemId') ? hash['TransactionItemId'] : SKIP
  fuel_only = hash['FuelOnly'] ||= false
  include_fees = hash.key?('IncludeFees') ? hash['IncludeFees'] : SKIP
  is_multipayer = hash.key?('IsMultipayer') ? hash['IsMultipayer'] : SKIP
  valid_invoice_date_only = hash['ValidInvoiceDateOnly'] ||= false
  invoice_from_date =
    hash.key?('InvoiceFromDate') ? hash['InvoiceFromDate'] : SKIP
  invoice_to_date =
    hash.key?('InvoiceToDate') ? hash['InvoiceToDate'] : SKIP
  hosting_collecting_company_number =
    hash.key?('HostingCollectingCompanyNumber') ? hash['HostingCollectingCompanyNumber'] : SKIP
  search = hash.key?('Search') ? hash['Search'] : SKIP
  transaction_id = hash.key?('TransactionId') ? hash['TransactionId'] : SKIP

  # Create object from extracted values.
  Filters.new(col_co_code,
              invoice_status,
              payer_number,
              ,
              ,
              driver_name,
              card_group_id,
              card_pan,
              product_code,
              product_name,
              site_code,
              incoming_site_number,
              invoice_date,
              invoice_number,
              purchased_in_country_code,
              purchased_in_country,
              site_group_id,
              vehicle_registration_number,
              fee_type_id,
              line_item_description,
              cards,
              sort_order,
              from_date,
              to_date,
              period,
              posting_date_from,
              posting_date_to,
              transaction_item_id,
              fuel_only,
              include_fees,
              is_multipayer,
              valid_invoice_date_only,
              invoice_from_date,
              invoice_to_date,
              hosting_collecting_company_number,
              search,
              transaction_id)
end

.namesObject

A mapping from model property names to API property names.



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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 175

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['invoice_status'] = 'InvoiceStatus'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['account_id'] = 'AccountId'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['driver_name'] = 'DriverName'
  @_hash['card_group_id'] = 'CardGroupId'
  @_hash['card_pan'] = 'CardPAN'
  @_hash['product_code'] = 'ProductCode'
  @_hash['product_name'] = 'ProductName'
  @_hash['site_code'] = 'SiteCode'
  @_hash['incoming_site_number'] = 'IncomingSiteNumber'
  @_hash['invoice_date'] = 'InvoiceDate'
  @_hash['invoice_number'] = 'InvoiceNumber'
  @_hash['purchased_in_country_code'] = 'PurchasedInCountryCode'
  @_hash['purchased_in_country'] = 'PurchasedInCountry'
  @_hash['site_group_id'] = 'SiteGroupId'
  @_hash['vehicle_registration_number'] = 'VehicleRegistrationNumber'
  @_hash['fee_type_id'] = 'FeeTypeId'
  @_hash['line_item_description'] = 'LineItemDescription'
  @_hash['cards'] = 'Cards'
  @_hash['sort_order'] = 'SortOrder'
  @_hash['from_date'] = 'FromDate'
  @_hash['to_date'] = 'ToDate'
  @_hash['period'] = 'Period'
  @_hash['posting_date_from'] = 'PostingDateFrom'
  @_hash['posting_date_to'] = 'PostingDateTo'
  @_hash['transaction_item_id'] = 'TransactionItemId'
  @_hash['fuel_only'] = 'FuelOnly'
  @_hash['include_fees'] = 'IncludeFees'
  @_hash['is_multipayer'] = 'IsMultipayer'
  @_hash['valid_invoice_date_only'] = 'ValidInvoiceDateOnly'
  @_hash['invoice_from_date'] = 'InvoiceFromDate'
  @_hash['invoice_to_date'] = 'InvoiceToDate'
  @_hash['hosting_collecting_company_number'] =
    'HostingCollectingCompanyNumber'
  @_hash['search'] = 'Search'
  @_hash['transaction_id'] = 'TransactionId'
  @_hash
end

.nullablesObject

An array for nullable fields



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
284
285
286
287
288
289
290
291
292
293
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 259

def self.nullables
  %w[
    col_co_code
    payer_number
    account_id
    account_number
    driver_name
    card_group_id
    card_pan
    product_code
    product_name
    site_code
    incoming_site_number
    invoice_date
    invoice_number
    purchased_in_country_code
    purchased_in_country
    site_group_id
    vehicle_registration_number
    fee_type_id
    line_item_description
    from_date
    to_date
    posting_date_from
    posting_date_to
    transaction_item_id
    fuel_only
    include_fees
    invoice_from_date
    invoice_to_date
    hosting_collecting_company_number
    search
    transaction_id
  ]
end

.optionalsObject

An array for optional fields



219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/shell_data_reporting_ap_is/models/filters.rb', line 219

def self.optionals
  %w[
    account_id
    account_number
    driver_name
    card_group_id
    card_pan
    product_code
    product_name
    site_code
    incoming_site_number
    invoice_date
    invoice_number
    purchased_in_country_code
    purchased_in_country
    site_group_id
    vehicle_registration_number
    fee_type_id
    line_item_description
    cards
    sort_order
    from_date
    to_date
    period
    posting_date_from
    posting_date_to
    transaction_item_id
    fuel_only
    include_fees
    is_multipayer
    valid_invoice_date_only
    invoice_from_date
    invoice_to_date
    hosting_collecting_company_number
    search
    transaction_id
  ]
end