Module: RockRMS::Client::RefundReason

Included in:
RockRMS::Client
Defined in:
lib/rock_rms/resources/refund_reason.rb

Instance Method Summary collapse

Instance Method Details

#create_refund_reason(value:, description:, order: nil, active: nil) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/rock_rms/resources/refund_reason.rb', line 12

def create_refund_reason(value:, description:, order: nil, active: nil)
  order ||= Random.rand(100..1000)

  options = {
    'Value'         => value,
    'Description'   => description,
    'Order'         => order,
    'IsSystem'      => false,
    'DefinedTypeId' => 37
  }
  options['IsActive'] = active if active
  post(defined_values_path, options)
end

#list_refund_reasons(options = {}) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/rock_rms/resources/refund_reason.rb', line 4

def list_refund_reasons(options = {})
  options['$filter'] = 'DefinedTypeId eq 37' unless options.keys.include?('$filter')

  Response::DefinedValue.format(
    get(defined_values_path, options)
  )
end