Module: RockRMS::Client::TransactionDetail

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

Instance Method Summary collapse

Instance Method Details

#create_transaction_detail(transaction_id:, fund_id:, amount:, fee_amount: nil, fee_coverage_amount: nil, entity_type_id: nil, entity_id: nil) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/rock_rms/resources/transaction_detail.rb', line 34

def create_transaction_detail(
  transaction_id:,
  fund_id:,
  amount:,
  fee_amount: nil,
  fee_coverage_amount: nil,
  entity_type_id: nil,
  entity_id: nil
)
  options = {}
  options['TransactionId']     = transaction_id
  options['AccountId']         = fund_id
  options['Amount']            = amount
  options['FeeAmount']         = fee_amount     if fee_amount
  options['EntityTypeId']      = entity_type_id if entity_type_id
  options['EntityId']          = entity_id      if entity_id
  options['FeeCoverageAmount'] = fee_coverage_amount if fee_coverage_amount

  post(transaction_detail_path, options)
end

#delete_transaction_detail(id) ⇒ Object



55
56
57
# File 'lib/rock_rms/resources/transaction_detail.rb', line 55

def delete_transaction_detail(id)
  delete(transaction_detail_path(id))
end

#find_transaction_detail(id) ⇒ Object



9
10
11
12
# File 'lib/rock_rms/resources/transaction_detail.rb', line 9

def find_transaction_detail(id)
  res = get(transaction_detail_path(id))
  Response::TransactionDetail.format(res)
end

#list_transaction_details(options = {}) ⇒ Object



4
5
6
7
# File 'lib/rock_rms/resources/transaction_detail.rb', line 4

def list_transaction_details(options = {})
  res = get(transaction_detail_path, options)
  Response::TransactionDetail.format(res)
end

#update_transaction_detail(id, fund_id: nil, amount: nil, fee_amount: nil, fee_coverage_amount: nil, entity_type_id: nil, entity_id: nil) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/rock_rms/resources/transaction_detail.rb', line 14

def update_transaction_detail(
  id,
  fund_id: nil,
  amount: nil,
  fee_amount: nil,
  fee_coverage_amount: nil,
  entity_type_id: nil,
  entity_id: nil
)
  options = {}
  options['AccountId']         = fund_id        if fund_id
  options['Amount']            = amount         if amount
  options['FeeAmount']         = fee_amount     if fee_amount
  options['EntityTypeId']      = entity_type_id if entity_type_id
  options['EntityId']          = entity_id      if entity_id
  options['FeeCoverageAmount'] = fee_coverage_amount if fee_coverage_amount

  patch(transaction_detail_path(id), options)
end