Class: ForestAdminDatasourceMambuPayments::Collections::Claim

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

Constant Summary collapse

ManyToOneSchema =
ForestAdminDatasourceToolkit::Schema::Relations::ManyToOneSchema
ENUM_TYPE =
%w[sepa_non_receipt sepa_value_date_correction].freeze
ENUM_STATUS =
%w[created processing sent received accepted rejected].freeze
%w[payment_order incoming_payment].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) ⇒ Claim

Returns a new instance of Claim.



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

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

Instance Method Details

#serialize(record) ⇒ Object



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

def serialize(record)
  a = attrs_of(record)
  {
    'id' => a['id'],
    'object' => a['object'],
    'type' => a['type'],
    'status' => a['status'],
    'status_details' => a['status_details'],
    'reason' => a['reason'],
    'value_date' => a['value_date'],
    'connected_account_id' => a['connected_account_id'],
    'related_payment_type' => a['related_payment_type'],
    'related_payment_id' => a['related_payment_id'],
    'related_payment' => a['related_payment'],
    'metadata' => a['metadata'],
    'bank_data' => a['bank_data'],
    'created_at' => a['created_at']
  }
end