Class: NewStoreApi::ConfigModel

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/new_store_api/models/config_model.rb

Overview

ConfigModel Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(allow_adjustments_manual_quantity_editing = nil, allow_counts_manual_quantity_editing = nil, allow_full_counts_manual_quantity_editing = nil, allow_receiving_manual_quantity_editing = nil, allow_transfers_manual_quantity_editing = nil, enabled_adjustments_stores = nil, enabled_carton_receiving_stores = nil, enabled_counts_stores = nil, enabled_full_counts_stores = nil, enabled_receiving_stores = nil, enabled_receiving_without_asn_stores = nil, enabled_reservations_stores = nil, enabled_store_initiated_transfers_stores = nil, enabled_transfers_stores = nil, require_confirmation_on_scanning = nil) ⇒ ConfigModel

Returns a new instance of ConfigModel.



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/new_store_api/models/config_model.rb', line 112

def initialize(allow_adjustments_manual_quantity_editing = nil,
               allow_counts_manual_quantity_editing = nil,
               allow_full_counts_manual_quantity_editing = nil,
               allow_receiving_manual_quantity_editing = nil,
               allow_transfers_manual_quantity_editing = nil,
               enabled_adjustments_stores = nil,
               enabled_carton_receiving_stores = nil,
               enabled_counts_stores = nil,
               enabled_full_counts_stores = nil,
               enabled_receiving_stores = nil,
               enabled_receiving_without_asn_stores = nil,
               enabled_reservations_stores = nil,
               enabled_store_initiated_transfers_stores = nil,
               enabled_transfers_stores = nil,
               require_confirmation_on_scanning = nil)
  @allow_adjustments_manual_quantity_editing = allow_adjustments_manual_quantity_editing
  @allow_counts_manual_quantity_editing = allow_counts_manual_quantity_editing
  @allow_full_counts_manual_quantity_editing = allow_full_counts_manual_quantity_editing
  @allow_receiving_manual_quantity_editing = allow_receiving_manual_quantity_editing
  @allow_transfers_manual_quantity_editing = allow_transfers_manual_quantity_editing
  @enabled_adjustments_stores = enabled_adjustments_stores
  @enabled_carton_receiving_stores = enabled_carton_receiving_stores
  @enabled_counts_stores = enabled_counts_stores
  @enabled_full_counts_stores = enabled_full_counts_stores
  @enabled_receiving_stores = enabled_receiving_stores
  @enabled_receiving_without_asn_stores = enabled_receiving_without_asn_stores
  @enabled_reservations_stores = enabled_reservations_stores
  @enabled_store_initiated_transfers_stores = enabled_store_initiated_transfers_stores
  @enabled_transfers_stores = enabled_transfers_stores
  @require_confirmation_on_scanning = require_confirmation_on_scanning
end

Instance Attribute Details

#allow_adjustments_manual_quantity_editingTrueClass | FalseClass

Allow setting the product quantity when scanning an item on Adjustments

Returns:

  • (TrueClass | FalseClass)


14
15
16
# File 'lib/new_store_api/models/config_model.rb', line 14

def allow_adjustments_manual_quantity_editing
  @allow_adjustments_manual_quantity_editing
end

#allow_counts_manual_quantity_editingTrueClass | FalseClass

Allow setting the product quantity when scanning an item on Count Tasks

Returns:

  • (TrueClass | FalseClass)


18
19
20
# File 'lib/new_store_api/models/config_model.rb', line 18

def allow_counts_manual_quantity_editing
  @allow_counts_manual_quantity_editing
end

#allow_full_counts_manual_quantity_editingTrueClass | FalseClass

Allow setting the product quantity when scanning items on Full counts

Returns:

  • (TrueClass | FalseClass)


22
23
24
# File 'lib/new_store_api/models/config_model.rb', line 22

def allow_full_counts_manual_quantity_editing
  @allow_full_counts_manual_quantity_editing
end

#allow_receiving_manual_quantity_editingTrueClass | FalseClass

Allow setting the product quantity when scanning an item on Receiving

Returns:

  • (TrueClass | FalseClass)


26
27
28
# File 'lib/new_store_api/models/config_model.rb', line 26

def allow_receiving_manual_quantity_editing
  @allow_receiving_manual_quantity_editing
end

#allow_transfers_manual_quantity_editingTrueClass | FalseClass

Allow setting the product quantity when scanning an item on Transfers

Returns:

  • (TrueClass | FalseClass)


30
31
32
# File 'lib/new_store_api/models/config_model.rb', line 30

def allow_transfers_manual_quantity_editing
  @allow_transfers_manual_quantity_editing
end

#enabled_adjustments_storesArray[String]

Stores that can create adjustments

Returns:

  • (Array[String])


34
35
36
# File 'lib/new_store_api/models/config_model.rb', line 34

def enabled_adjustments_stores
  @enabled_adjustments_stores
end

#enabled_carton_receiving_storesArray[String]

Stores which allow receiving using a carton identifier

Returns:

  • (Array[String])


38
39
40
# File 'lib/new_store_api/models/config_model.rb', line 38

def enabled_carton_receiving_stores
  @enabled_carton_receiving_stores
end

#enabled_counts_storesArray[String]

Stores that can do counts

Returns:

  • (Array[String])


42
43
44
# File 'lib/new_store_api/models/config_model.rb', line 42

def enabled_counts_stores
  @enabled_counts_stores
end

#enabled_full_counts_storesArray[String]

Stores that can do full counts

Returns:

  • (Array[String])


46
47
48
# File 'lib/new_store_api/models/config_model.rb', line 46

def enabled_full_counts_stores
  @enabled_full_counts_stores
end

#enabled_receiving_storesArray[String]

Stores that can receive

Returns:

  • (Array[String])


50
51
52
# File 'lib/new_store_api/models/config_model.rb', line 50

def enabled_receiving_stores
  @enabled_receiving_stores
end

#enabled_receiving_without_asn_storesArray[String]

Stores which can receive without an ASN (blind receiving)

Returns:

  • (Array[String])


54
55
56
# File 'lib/new_store_api/models/config_model.rb', line 54

def enabled_receiving_without_asn_stores
  @enabled_receiving_without_asn_stores
end

#enabled_reservations_storesArray[String]

Stores that can do customer reservations

Returns:

  • (Array[String])


58
59
60
# File 'lib/new_store_api/models/config_model.rb', line 58

def enabled_reservations_stores
  @enabled_reservations_stores
end

#enabled_store_initiated_transfers_storesArray[String]

Stores where a transfer can be initiated

Returns:

  • (Array[String])


62
63
64
# File 'lib/new_store_api/models/config_model.rb', line 62

def enabled_store_initiated_transfers_stores
  @enabled_store_initiated_transfers_stores
end

#enabled_transfers_storesArray[String]

Stores that allow transfers

Returns:

  • (Array[String])


66
67
68
# File 'lib/new_store_api/models/config_model.rb', line 66

def enabled_transfers_stores
  @enabled_transfers_stores
end

#require_confirmation_on_scanningTrueClass | FalseClass

Require confirmation when scanning an item

Returns:

  • (TrueClass | FalseClass)


70
71
72
# File 'lib/new_store_api/models/config_model.rb', line 70

def require_confirmation_on_scanning
  @require_confirmation_on_scanning
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/new_store_api/models/config_model.rb', line 145

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  allow_adjustments_manual_quantity_editing =
    hash.key?('allow_adjustments_manual_quantity_editing') ? hash['allow_adjustments_manual_quantity_editing'] : nil
  allow_counts_manual_quantity_editing =
    hash.key?('allow_counts_manual_quantity_editing') ? hash['allow_counts_manual_quantity_editing'] : nil
  allow_full_counts_manual_quantity_editing =
    hash.key?('allow_full_counts_manual_quantity_editing') ? hash['allow_full_counts_manual_quantity_editing'] : nil
  allow_receiving_manual_quantity_editing =
    hash.key?('allow_receiving_manual_quantity_editing') ? hash['allow_receiving_manual_quantity_editing'] : nil
  allow_transfers_manual_quantity_editing =
    hash.key?('allow_transfers_manual_quantity_editing') ? hash['allow_transfers_manual_quantity_editing'] : nil
  enabled_adjustments_stores =
    hash.key?('enabled_adjustments_stores') ? hash['enabled_adjustments_stores'] : nil
  enabled_carton_receiving_stores =
    hash.key?('enabled_carton_receiving_stores') ? hash['enabled_carton_receiving_stores'] : nil
  enabled_counts_stores =
    hash.key?('enabled_counts_stores') ? hash['enabled_counts_stores'] : nil
  enabled_full_counts_stores =
    hash.key?('enabled_full_counts_stores') ? hash['enabled_full_counts_stores'] : nil
  enabled_receiving_stores =
    hash.key?('enabled_receiving_stores') ? hash['enabled_receiving_stores'] : nil
  enabled_receiving_without_asn_stores =
    hash.key?('enabled_receiving_without_asn_stores') ? hash['enabled_receiving_without_asn_stores'] : nil
  enabled_reservations_stores =
    hash.key?('enabled_reservations_stores') ? hash['enabled_reservations_stores'] : nil
  enabled_store_initiated_transfers_stores =
    hash.key?('enabled_store_initiated_transfers_stores') ? hash['enabled_store_initiated_transfers_stores'] : nil
  enabled_transfers_stores =
    hash.key?('enabled_transfers_stores') ? hash['enabled_transfers_stores'] : nil
  require_confirmation_on_scanning =
    hash.key?('require_confirmation_on_scanning') ? hash['require_confirmation_on_scanning'] : nil

  # Create object from extracted values.
  ConfigModel.new(allow_adjustments_manual_quantity_editing,
                  allow_counts_manual_quantity_editing,
                  allow_full_counts_manual_quantity_editing,
                  allow_receiving_manual_quantity_editing,
                  allow_transfers_manual_quantity_editing,
                  enabled_adjustments_stores,
                  enabled_carton_receiving_stores,
                  enabled_counts_stores,
                  enabled_full_counts_stores,
                  enabled_receiving_stores,
                  enabled_receiving_without_asn_stores,
                  enabled_reservations_stores,
                  enabled_store_initiated_transfers_stores,
                  enabled_transfers_stores,
                  require_confirmation_on_scanning)
end

.namesObject

A mapping from model property names to API property names.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/new_store_api/models/config_model.rb', line 73

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['allow_adjustments_manual_quantity_editing'] =
    'allow_adjustments_manual_quantity_editing'
  @_hash['allow_counts_manual_quantity_editing'] =
    'allow_counts_manual_quantity_editing'
  @_hash['allow_full_counts_manual_quantity_editing'] =
    'allow_full_counts_manual_quantity_editing'
  @_hash['allow_receiving_manual_quantity_editing'] =
    'allow_receiving_manual_quantity_editing'
  @_hash['allow_transfers_manual_quantity_editing'] =
    'allow_transfers_manual_quantity_editing'
  @_hash['enabled_adjustments_stores'] = 'enabled_adjustments_stores'
  @_hash['enabled_carton_receiving_stores'] =
    'enabled_carton_receiving_stores'
  @_hash['enabled_counts_stores'] = 'enabled_counts_stores'
  @_hash['enabled_full_counts_stores'] = 'enabled_full_counts_stores'
  @_hash['enabled_receiving_stores'] = 'enabled_receiving_stores'
  @_hash['enabled_receiving_without_asn_stores'] =
    'enabled_receiving_without_asn_stores'
  @_hash['enabled_reservations_stores'] = 'enabled_reservations_stores'
  @_hash['enabled_store_initiated_transfers_stores'] =
    'enabled_store_initiated_transfers_stores'
  @_hash['enabled_transfers_stores'] = 'enabled_transfers_stores'
  @_hash['require_confirmation_on_scanning'] =
    'require_confirmation_on_scanning'
  @_hash
end

.nullablesObject

An array for nullable fields



108
109
110
# File 'lib/new_store_api/models/config_model.rb', line 108

def self.nullables
  []
end

.optionalsObject

An array for optional fields



103
104
105
# File 'lib/new_store_api/models/config_model.rb', line 103

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/new_store_api/models/config_model.rb', line 219

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} allow_adjustments_manual_quantity_editing:"\
  " #{@allow_adjustments_manual_quantity_editing.inspect},"\
  " allow_counts_manual_quantity_editing: #{@allow_counts_manual_quantity_editing.inspect},"\
  ' allow_full_counts_manual_quantity_editing:'\
  " #{@allow_full_counts_manual_quantity_editing.inspect},"\
  ' allow_receiving_manual_quantity_editing:'\
  " #{@allow_receiving_manual_quantity_editing.inspect},"\
  ' allow_transfers_manual_quantity_editing:'\
  " #{@allow_transfers_manual_quantity_editing.inspect}, enabled_adjustments_stores:"\
  " #{@enabled_adjustments_stores.inspect}, enabled_carton_receiving_stores:"\
  " #{@enabled_carton_receiving_stores.inspect}, enabled_counts_stores:"\
  " #{@enabled_counts_stores.inspect}, enabled_full_counts_stores:"\
  " #{@enabled_full_counts_stores.inspect}, enabled_receiving_stores:"\
  " #{@enabled_receiving_stores.inspect}, enabled_receiving_without_asn_stores:"\
  " #{@enabled_receiving_without_asn_stores.inspect}, enabled_reservations_stores:"\
  " #{@enabled_reservations_stores.inspect}, enabled_store_initiated_transfers_stores:"\
  " #{@enabled_store_initiated_transfers_stores.inspect}, enabled_transfers_stores:"\
  " #{@enabled_transfers_stores.inspect}, require_confirmation_on_scanning:"\
  " #{@require_confirmation_on_scanning.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/new_store_api/models/config_model.rb', line 199

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} allow_adjustments_manual_quantity_editing:"\
  " #{@allow_adjustments_manual_quantity_editing}, allow_counts_manual_quantity_editing:"\
  " #{@allow_counts_manual_quantity_editing}, allow_full_counts_manual_quantity_editing:"\
  " #{@allow_full_counts_manual_quantity_editing}, allow_receiving_manual_quantity_editing:"\
  " #{@allow_receiving_manual_quantity_editing}, allow_transfers_manual_quantity_editing:"\
  " #{@allow_transfers_manual_quantity_editing}, enabled_adjustments_stores:"\
  " #{@enabled_adjustments_stores}, enabled_carton_receiving_stores:"\
  " #{@enabled_carton_receiving_stores}, enabled_counts_stores: #{@enabled_counts_stores},"\
  " enabled_full_counts_stores: #{@enabled_full_counts_stores}, enabled_receiving_stores:"\
  " #{@enabled_receiving_stores}, enabled_receiving_without_asn_stores:"\
  " #{@enabled_receiving_without_asn_stores}, enabled_reservations_stores:"\
  " #{@enabled_reservations_stores}, enabled_store_initiated_transfers_stores:"\
  " #{@enabled_store_initiated_transfers_stores}, enabled_transfers_stores:"\
  " #{@enabled_transfers_stores}, require_confirmation_on_scanning:"\
  " #{@require_confirmation_on_scanning}>"
end