Class: ShellDataReportingApIs::SearchSOAReq

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

Overview

SearchSOAReq 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 = SKIP, payer_number = SKIP, invoice_number = SKIP, from_date = SKIP, to_date = SKIP, period = SKIP, invoice_date = SKIP, invoice_status = SKIP, sort_by = SKIP, col_co_id = SKIP, payer_id = SKIP) ⇒ SearchSOAReq

Returns a new instance of SearchSOAReq.



142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/shell_data_reporting_ap_is/models/search_soa_req.rb', line 142

def initialize(col_co_code = SKIP, payer_number = SKIP,
               invoice_number = SKIP, from_date = SKIP, to_date = SKIP,
               period = SKIP, invoice_date = SKIP, invoice_status = SKIP,
               sort_by = SKIP, col_co_id = SKIP, payer_id = SKIP)
  @col_co_code = col_co_code unless col_co_code == SKIP
  @payer_number = payer_number unless payer_number == SKIP
  @invoice_number = invoice_number unless invoice_number == SKIP
  @from_date = from_date unless from_date == SKIP
  @to_date = to_date unless to_date == SKIP
  @period = period unless period == SKIP
  @invoice_date = invoice_date unless invoice_date == SKIP
  @invoice_status = invoice_status unless invoice_status == SKIP
  @sort_by = sort_by unless sort_by == SKIP
  @col_co_id = col_co_id unless col_co_id == SKIP
  @payer_id = payer_id unless payer_id == SKIP
end

Instance Attribute Details

#col_co_codeInteger

Collecting Company Code of the selected payer.

Returns:

  • (Integer)


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

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-Philippines 5-UK

Returns:

  • (Integer)


87
88
89
# File 'lib/shell_data_reporting_ap_is/models/search_soa_req.rb', line 87

def col_co_id
  @col_co_id
end

#from_dateString

SOA searched from this date. Optional. This input is a search criterion, if given. Date format: yyyy/MM/dd

Returns:

  • (String)


32
33
34
# File 'lib/shell_data_reporting_ap_is/models/search_soa_req.rb', line 32

def from_date
  @from_date
end

#invoice_dateString

Date of invoicing. Optional. This input is a search criterion, if given.

Returns:

  • (String)


53
54
55
# File 'lib/shell_data_reporting_ap_is/models/search_soa_req.rb', line 53

def invoice_date
  @invoice_date
end

#invoice_numberString

Invoice number. Optional. This input is a search criterion, if given.

Returns:

  • (String)


25
26
27
# File 'lib/shell_data_reporting_ap_is/models/search_soa_req.rb', line 25

def invoice_number
  @invoice_number
end

#invoice_statusArray[String]

Possible options are:

  1. StatementDate ASC

  2. StatementDate DESC

Optional Note: This option uses a column name with a combination of “ASC or DESC” for sorting. If only the column name is provided, it is sorted by ascending. Sorting is allowed only ASC or DESC, If both provided in the input ASC will be taken as precedence.

Returns:

  • (Array[String])


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

def invoice_status
  @invoice_status
end

#payer_idInteger

Payer Id of the selected payer.

Returns:

  • (Integer)


91
92
93
# File 'lib/shell_data_reporting_ap_is/models/search_soa_req.rb', line 91

def payer_id
  @payer_id
end

#payer_numberString

Payer Number of the selected payer. Optional if PayerId is passed else Mandatory.

Returns:

  • (String)


19
20
21
# File 'lib/shell_data_reporting_ap_is/models/search_soa_req.rb', line 19

def payer_number
  @payer_number
end

#periodInteger

Invoice date search period. Valid values - Last 7 days – Issued in last 7 days. Last 30 days – Issued in last 30 days. Last 90 days – Issued in last 90 days. Optional. This input is a search criterion, if given.

Returns:

  • (Integer)


47
48
49
# File 'lib/shell_data_reporting_ap_is/models/search_soa_req.rb', line 47

def period
  @period
end

#sort_byArray[Integer]

Possible options are:

  1. StatementDate ASC

  2. StatementDate DESC

Optional Note: This option uses a column name with a combination of “ASC or DESC” for sorting. If only the column name is provided, it is sorted by ascending. Sorting is allowed only ASC or DESC, If both provided in the input ASC will be taken as precedence.

Returns:

  • (Array[Integer])


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

def sort_by
  @sort_by
end

#to_dateString

Invoice date searched until this date. Optional. This input is a search criterion, if given.

Returns:

  • (String)


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

def to_date
  @to_date
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/shell_data_reporting_ap_is/models/search_soa_req.rb', line 160

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : SKIP
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP
  invoice_number = hash.key?('InvoiceNumber') ? hash['InvoiceNumber'] : SKIP
  from_date = hash.key?('FromDate') ? hash['FromDate'] : SKIP
  to_date = hash.key?('ToDate') ? hash['ToDate'] : SKIP
  period = hash.key?('Period') ? hash['Period'] : SKIP
  invoice_date = hash.key?('InvoiceDate') ? hash['InvoiceDate'] : SKIP
  invoice_status = hash.key?('InvoiceStatus') ? hash['InvoiceStatus'] : SKIP
  sort_by = hash.key?('SortBy') ? hash['SortBy'] : SKIP
  col_co_id = hash.key?('ColCoId') ? hash['ColCoId'] : SKIP
  payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP

  # Create object from extracted values.
  SearchSOAReq.new(col_co_code,
                   payer_number,
                   invoice_number,
                   from_date,
                   to_date,
                   period,
                   invoice_date,
                   invoice_status,
                   sort_by,
                   col_co_id,
                   payer_id)
end

.namesObject

A mapping from model property names to API property names.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/shell_data_reporting_ap_is/models/search_soa_req.rb', line 94

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['invoice_number'] = 'InvoiceNumber'
  @_hash['from_date'] = 'FromDate'
  @_hash['to_date'] = 'ToDate'
  @_hash['period'] = 'Period'
  @_hash['invoice_date'] = 'InvoiceDate'
  @_hash['invoice_status'] = 'InvoiceStatus'
  @_hash['sort_by'] = 'SortBy'
  @_hash['col_co_id'] = 'ColCoId'
  @_hash['payer_id'] = 'PayerId'
  @_hash
end

.nullablesObject

An array for nullable fields



128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/shell_data_reporting_ap_is/models/search_soa_req.rb', line 128

def self.nullables
  %w[
    col_co_code
    payer_number
    invoice_number
    from_date
    to_date
    period
    invoice_date
    col_co_id
    payer_id
  ]
end

.optionalsObject

An array for optional fields



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/shell_data_reporting_ap_is/models/search_soa_req.rb', line 111

def self.optionals
  %w[
    col_co_code
    payer_number
    invoice_number
    from_date
    to_date
    period
    invoice_date
    invoice_status
    sort_by
    col_co_id
    payer_id
  ]
end