Class: ShellDataReportingApIs::CardExceptions

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

Overview

CardExceptions Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(account_id = SKIP, account_number = SKIP, account_short_name = SKIP, card_id = SKIP, currency_code = SKIP, currency_symbol = SKIP, day = SKIP, driver_name = SKIP, month = SKIP, pan = SKIP, payer_id = SKIP, payer_number = SKIP, payer_short_name = SKIP, total_amount = SKIP, total_quantity = SKIP, total_sales_items = SKIP, total_transactions = SKIP, vrn = SKIP, week = SKIP, year = SKIP) ⇒ CardExceptions

Returns a new instance of CardExceptions.



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
201
# File 'lib/shell_data_reporting_ap_is/models/card_exceptions.rb', line 172

def initialize( = SKIP,  = SKIP,
                = SKIP, card_id = SKIP,
               currency_code = SKIP, currency_symbol = SKIP, day = SKIP,
               driver_name = SKIP, month = SKIP, pan = SKIP,
               payer_id = SKIP, payer_number = SKIP,
               payer_short_name = SKIP, total_amount = SKIP,
               total_quantity = SKIP, total_sales_items = SKIP,
               total_transactions = SKIP, vrn = SKIP, week = SKIP,
               year = SKIP)
  @account_id =  unless  == SKIP
  @account_number =  unless  == SKIP
  @account_short_name =  unless  == SKIP
  @card_id = card_id unless card_id == SKIP
  @currency_code = currency_code unless currency_code == SKIP
  @currency_symbol = currency_symbol unless currency_symbol == SKIP
  @day = day unless day == SKIP
  @driver_name = driver_name unless driver_name == SKIP
  @month = month unless month == SKIP
  @pan = pan unless pan == SKIP
  @payer_id = payer_id unless payer_id == SKIP
  @payer_number = payer_number unless payer_number == SKIP
  @payer_short_name = payer_short_name unless payer_short_name == SKIP
  @total_amount = total_amount unless total_amount == SKIP
  @total_quantity = total_quantity unless total_quantity == SKIP
  @total_sales_items = total_sales_items unless total_sales_items == SKIP
  @total_transactions = total_transactions unless total_transactions == SKIP
  @vrn = vrn unless vrn == SKIP
  @week = week unless week == SKIP
  @year = year unless year == SKIP
end

Instance Attribute Details

#account_idInteger

Account Id

Returns:

  • (Integer)


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

def 
  @account_id
end

#account_numberString

Account Number

Returns:

  • (String)


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

def 
  @account_number
end

#account_short_nameString

Account Short Name

Returns:

  • (String)


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

def 
  @account_short_name
end

#card_idInteger

Unique Card Id

Returns:

  • (Integer)


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

def card_id
  @card_id
end

#currency_codeString

ISO currency code

Returns:

  • (String)


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

def currency_code
  @currency_code
end

#currency_symbolString

Currency symbol of the Invoice Currency Code

Returns:

  • (String)


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

def currency_symbol
  @currency_symbol
end

#dayInteger

Summary Day: Populated when the Period is passed as ‘Day’.

Returns:

  • (Integer)


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

def day
  @day
end

#driver_nameString

Driver name

Returns:

  • (String)


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

def driver_name
  @driver_name
end

#monthInteger

Summary Month: Populated when the Value of Period is Passed as ‘Month’.

Returns:

  • (Integer)


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

def month
  @month
end

#panString

Card PAN

Returns:

  • (String)


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

def pan
  @pan
end

#payer_idInteger

Payment customer id of the customer

Returns:

  • (Integer)


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

def payer_id
  @payer_id
end

#payer_numberString

Payment customer number

Returns:

  • (String)


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

def payer_number
  @payer_number
end

#payer_short_nameString

Payer Short Name

Returns:

  • (String)


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

def payer_short_name
  @payer_short_name
end

#total_amountFloat

Total Amount (In Customer Currency) of Transactions met with the given exceptions criteria.

Returns:

  • (Float)


67
68
69
# File 'lib/shell_data_reporting_ap_is/models/card_exceptions.rb', line 67

def total_amount
  @total_amount
end

#total_quantityInteger

Total Quantity of Transactions met with the given exceptions criteria.

Returns:

  • (Integer)


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

def total_quantity
  @total_quantity
end

#total_sales_itemsInteger

Total number of Sales Items met with the given exception criteria.

Returns:

  • (Integer)


75
76
77
# File 'lib/shell_data_reporting_ap_is/models/card_exceptions.rb', line 75

def total_sales_items
  @total_sales_items
end

#total_transactionsInteger

Total number of Transactions met with the given exception criteria.

Returns:

  • (Integer)


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

def total_transactions
  @total_transactions
end

#vrnString

Vehicle Registration Number

Returns:

  • (String)


83
84
85
# File 'lib/shell_data_reporting_ap_is/models/card_exceptions.rb', line 83

def vrn
  @vrn
end

#weekInteger

Summary Week Number with in the given date range. Populated when the Value of Period is Passed as ‘Week’.

Returns:

  • (Integer)


88
89
90
# File 'lib/shell_data_reporting_ap_is/models/card_exceptions.rb', line 88

def week
  @week
end

#yearInteger

Summary Year: Populated when the Value of Period is Passed as ‘Month’.

Returns:

  • (Integer)


92
93
94
# File 'lib/shell_data_reporting_ap_is/models/card_exceptions.rb', line 92

def year
  @year
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('AccountId') ? hash['AccountId'] : SKIP
   = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
   =
    hash.key?('AccountShortName') ? hash['AccountShortName'] : SKIP
  card_id = hash.key?('CardId') ? hash['CardId'] : SKIP
  currency_code = hash.key?('CurrencyCode') ? hash['CurrencyCode'] : SKIP
  currency_symbol =
    hash.key?('CurrencySymbol') ? hash['CurrencySymbol'] : SKIP
  day = hash.key?('Day') ? hash['Day'] : SKIP
  driver_name = hash.key?('DriverName') ? hash['DriverName'] : SKIP
  month = hash.key?('Month') ? hash['Month'] : SKIP
  pan = hash.key?('PAN') ? hash['PAN'] : SKIP
  payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP
  payer_short_name =
    hash.key?('PayerShortName') ? hash['PayerShortName'] : SKIP
  total_amount = hash.key?('TotalAmount') ? hash['TotalAmount'] : SKIP
  total_quantity = hash.key?('TotalQuantity') ? hash['TotalQuantity'] : SKIP
  total_sales_items =
    hash.key?('TotalSalesItems') ? hash['TotalSalesItems'] : SKIP
  total_transactions =
    hash.key?('TotalTransactions') ? hash['TotalTransactions'] : SKIP
  vrn = hash.key?('VRN') ? hash['VRN'] : SKIP
  week = hash.key?('Week') ? hash['Week'] : SKIP
  year = hash.key?('Year') ? hash['Year'] : SKIP

  # Create object from extracted values.
  CardExceptions.new(,
                     ,
                     ,
                     card_id,
                     currency_code,
                     currency_symbol,
                     day,
                     driver_name,
                     month,
                     pan,
                     payer_id,
                     payer_number,
                     payer_short_name,
                     total_amount,
                     total_quantity,
                     total_sales_items,
                     total_transactions,
                     vrn,
                     week,
                     year)
end

.namesObject

A mapping from model property names to API property names.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/shell_data_reporting_ap_is/models/card_exceptions.rb', line 95

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_id'] = 'AccountId'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['account_short_name'] = 'AccountShortName'
  @_hash['card_id'] = 'CardId'
  @_hash['currency_code'] = 'CurrencyCode'
  @_hash['currency_symbol'] = 'CurrencySymbol'
  @_hash['day'] = 'Day'
  @_hash['driver_name'] = 'DriverName'
  @_hash['month'] = 'Month'
  @_hash['pan'] = 'PAN'
  @_hash['payer_id'] = 'PayerId'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['payer_short_name'] = 'PayerShortName'
  @_hash['total_amount'] = 'TotalAmount'
  @_hash['total_quantity'] = 'TotalQuantity'
  @_hash['total_sales_items'] = 'TotalSalesItems'
  @_hash['total_transactions'] = 'TotalTransactions'
  @_hash['vrn'] = 'VRN'
  @_hash['week'] = 'Week'
  @_hash['year'] = 'Year'
  @_hash
end

.nullablesObject

An array for nullable fields



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/shell_data_reporting_ap_is/models/card_exceptions.rb', line 147

def self.nullables
  %w[
    account_id
    account_number
    account_short_name
    card_id
    currency_code
    currency_symbol
    day
    driver_name
    month
    pan
    payer_id
    payer_number
    payer_short_name
    total_amount
    total_quantity
    total_sales_items
    total_transactions
    vrn
    week
    year
  ]
end

.optionalsObject

An array for optional fields



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/shell_data_reporting_ap_is/models/card_exceptions.rb', line 121

def self.optionals
  %w[
    account_id
    account_number
    account_short_name
    card_id
    currency_code
    currency_symbol
    day
    driver_name
    month
    pan
    payer_id
    payer_number
    payer_short_name
    total_amount
    total_quantity
    total_sales_items
    total_transactions
    vrn
    week
    year
  ]
end