Class: ForestAdminDatasourceMambuPayments::Collections::File

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

Constant Summary collapse

ManyToOneSchema =
ForestAdminDatasourceToolkit::Schema::Relations::ManyToOneSchema
ENUM_DIRECTION =
%w[incoming outgoing].freeze
ENUM_STATUS =
%w[created approved canceled sent rejected processed received].freeze

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) ⇒ File

Returns a new instance of File.



11
12
13
14
15
16
# File 'lib/forest_admin_datasource_mambu_payments/collections/file.rb', line 11

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

Instance Method Details

#serialize(record) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/forest_admin_datasource_mambu_payments/collections/file.rb', line 18

def serialize(record)
  a = attrs_of(record)
  {
    'id' => a['id'],
    'object' => a['object'],
    'connected_account_id' => a['connected_account_id'],
    'connected_account_ids' => a['connected_account_ids'],
    'direction' => a['direction'],
    'category' => a['category'],
    'format' => a['format'],
    'filename' => a['filename'],
    'size' => a['size'],
    'summary' => a['summary'],
    'status' => a['status'],
    'status_details' => a['status_details'],
    'bank_data' => a['bank_data'],
    'created_at' => a['created_at']
  }
end