Class: ForestAdminDatasourceMambuPayments::Collections::IncomingPayment

Inherits:
BaseCollection
  • Object
show all
Defined in:
lib/forest_admin_datasource_mambu_payments/collections/incoming_payment.rb

Constant Summary collapse

ManyToOneSchema =
ForestAdminDatasourceToolkit::Schema::Relations::ManyToOneSchema

Constants inherited from BaseCollection

BaseCollection::BOOL_OPS, BaseCollection::ColumnSchema, BaseCollection::DATE_OPS, BaseCollection::ForestException, BaseCollection::ID_OPS, BaseCollection::Leaf, BaseCollection::NUMBER_OPS, BaseCollection::Operators, BaseCollection::STRING_OPS

Instance Method Summary collapse

Methods inherited from BaseCollection

#aggregate, client_resource, #fetch_by_ids, #list

Constructor Details

#initialize(datasource) ⇒ IncomingPayment

Returns a new instance of IncomingPayment.



9
10
11
12
13
14
# File 'lib/forest_admin_datasource_mambu_payments/collections/incoming_payment.rb', line 9

def initialize(datasource)
  super(datasource, 'MambuIncomingPayment')
  define_schema
  define_relations
  reconcile_filter_operators!
end

Instance Method Details

#serialize(record) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/forest_admin_datasource_mambu_payments/collections/incoming_payment.rb', line 16

def serialize(record)
  a = attrs_of(record)
  {
    'id' => a['id'],
    'object' => a['object'],
    'connected_account_id' => a['connected_account_id'],
    'type' => a['type'],
    'status' => a['status'],
    'amount' => a['amount'],
    'currency' => a['currency'],
    'end_to_end_id' => a['end_to_end_id'],
    'uetr' => a['uetr'],
    'reference' => a['reference'],
    'structured_reference' => a['structured_reference'],
    'value_date' => a['value_date'],
    'booking_date' => a['booking_date'],
    'originating_account' => a['originating_account'],
    'receiving_account' => a['receiving_account'],
    'internal_account_id' => a['internal_account_id'],
    'external_account_id' => a['external_account_id'],
    'reconciliation_status' => a['reconciliation_status'],
    'reconciled_amount' => a['reconciled_amount'],
    'return_information' => a['return_information'],
    'custom_fields' => a['custom_fields'],
    'metadata' => a['metadata'],
    'created_at' => a['created_at']
  }
end