Class: Merge::Accounting::BankFeedTransaction

Inherits:
Object
  • Object
show all
Defined in:
lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb

Overview

# The BankFeedTransaction Object

### Description
The `BankFeedTransaction` object is used to represent transactions linked to a
bank feed . This includes details about the transaction such as the date,
amount, description, and type.
### Usage Example
Fetch from the `GET BankFeedTransaction` endpoint to view details of a
transaction associated with a bank feed .

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, bank_feed_account: OMIT, transaction_date: OMIT, posted_date: OMIT, amount: OMIT, description: OMIT, transaction_type: OMIT, payee: OMIT, credit_or_debit: OMIT, source_transaction_id: OMIT, remote_was_deleted: OMIT, is_processed: OMIT, additional_properties: nil) ⇒ Merge::Accounting::BankFeedTransaction

Parameters:

  • id (String) (defaults to: OMIT)
  • remote_id (String) (defaults to: OMIT)

    The third-party API ID of the matching object.

  • created_at (DateTime) (defaults to: OMIT)

    The datetime that this object was created by Merge.

  • modified_at (DateTime) (defaults to: OMIT)

    The datetime that this object was modified by Merge.

  • bank_feed_account (Merge::Accounting::BankFeedTransactionBankFeedAccount) (defaults to: OMIT)

    The bank feed account associated with the transaction.

  • transaction_date (DateTime) (defaults to: OMIT)

    The date that the transaction occurred.

  • posted_date (DateTime) (defaults to: OMIT)

    The date the transaction was posted to the bank account.

  • amount (Float) (defaults to: OMIT)

    The amount of the transaction.

  • description (String) (defaults to: OMIT)

    The description of the transaction.

  • transaction_type (String) (defaults to: OMIT)

    The underlying type of the transaction.

  • payee (String) (defaults to: OMIT)

    The person or merchant who initiated the transaction, or alternatively, to whom the transaction was paid.

  • credit_or_debit (Merge::Accounting::CreditOrDebitEnum) (defaults to: OMIT)

    If the transaction is of type debit or credit.

    • ‘CREDIT` - CREDIT

    • ‘DEBIT` - DEBIT

  • source_transaction_id (String) (defaults to: OMIT)

    The customer’s identifier for the transaction.

  • remote_was_deleted (Boolean) (defaults to: OMIT)

    Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](docs.merge.dev/integrations/hris/supported-features/).

  • is_processed (Boolean) (defaults to: OMIT)

    Whether or not this transaction has been processed by the external system. For example, NetSuite writes this field as True when the SuiteApp has processed the transaction.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 91

def initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, bank_feed_account: OMIT,
               transaction_date: OMIT, posted_date: OMIT, amount: OMIT, description: OMIT, transaction_type: OMIT, payee: OMIT, credit_or_debit: OMIT, source_transaction_id: OMIT, remote_was_deleted: OMIT, is_processed: OMIT, additional_properties: nil)
  @id = id if id != OMIT
  @remote_id = remote_id if remote_id != OMIT
  @created_at = created_at if created_at != OMIT
  @modified_at = modified_at if modified_at != OMIT
   =  if  != OMIT
  @transaction_date = transaction_date if transaction_date != OMIT
  @posted_date = posted_date if posted_date != OMIT
  @amount = amount if amount != OMIT
  @description = description if description != OMIT
  @transaction_type = transaction_type if transaction_type != OMIT
  @payee = payee if payee != OMIT
  @credit_or_debit = credit_or_debit if credit_or_debit != OMIT
  @source_transaction_id = source_transaction_id if source_transaction_id != OMIT
  @remote_was_deleted = remote_was_deleted if remote_was_deleted != OMIT
  @is_processed = is_processed if is_processed != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "id": id,
    "remote_id": remote_id,
    "created_at": created_at,
    "modified_at": modified_at,
    "bank_feed_account": ,
    "transaction_date": transaction_date,
    "posted_date": posted_date,
    "amount": amount,
    "description": description,
    "transaction_type": transaction_type,
    "payee": payee,
    "credit_or_debit": credit_or_debit,
    "source_transaction_id": source_transaction_id,
    "remote_was_deleted": remote_was_deleted,
    "is_processed": is_processed
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



59
60
61
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 59

def additional_properties
  @additional_properties
end

#amountFloat (readonly)

Returns The amount of the transaction.

Returns:

  • (Float)

    The amount of the transaction.



35
36
37
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 35

def amount
  @amount
end

#bank_feed_accountMerge::Accounting::BankFeedTransactionBankFeedAccount (readonly)

Returns The bank feed account associated with the transaction.

Returns:



29
30
31
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 29

def 
  
end

#created_atDateTime (readonly)

Returns The datetime that this object was created by Merge.

Returns:

  • (DateTime)

    The datetime that this object was created by Merge.



25
26
27
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 25

def created_at
  @created_at
end

#credit_or_debitMerge::Accounting::CreditOrDebitEnum (readonly)

Returns If the transaction is of type debit or credit.

  • ‘CREDIT` - CREDIT

  • ‘DEBIT` - DEBIT.

Returns:



46
47
48
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 46

def credit_or_debit
  @credit_or_debit
end

#descriptionString (readonly)

Returns The description of the transaction.

Returns:

  • (String)

    The description of the transaction.



37
38
39
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 37

def description
  @description
end

#idString (readonly)

Returns:

  • (String)


21
22
23
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 21

def id
  @id
end

#is_processedBoolean (readonly)

Returns Whether or not this transaction has been processed by the external system. For example, NetSuite writes this field as True when the SuiteApp has processed the transaction.

Returns:

  • (Boolean)

    Whether or not this transaction has been processed by the external system. For example, NetSuite writes this field as True when the SuiteApp has processed the transaction.



57
58
59
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 57

def is_processed
  @is_processed
end

#modified_atDateTime (readonly)

Returns The datetime that this object was modified by Merge.

Returns:

  • (DateTime)

    The datetime that this object was modified by Merge.



27
28
29
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 27

def modified_at
  @modified_at
end

#payeeString (readonly)

Returns The person or merchant who initiated the transaction, or alternatively, to whom the transaction was paid.

Returns:

  • (String)

    The person or merchant who initiated the transaction, or alternatively, to whom the transaction was paid.



42
43
44
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 42

def payee
  @payee
end

#posted_dateDateTime (readonly)

Returns The date the transaction was posted to the bank account.

Returns:

  • (DateTime)

    The date the transaction was posted to the bank account.



33
34
35
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 33

def posted_date
  @posted_date
end

#remote_idString (readonly)

Returns The third-party API ID of the matching object.

Returns:

  • (String)

    The third-party API ID of the matching object.



23
24
25
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 23

def remote_id
  @remote_id
end

#remote_was_deletedBoolean (readonly)

Returns Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](docs.merge.dev/integrations/hris/supported-features/).

Returns:

  • (Boolean)

    Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](docs.merge.dev/integrations/hris/supported-features/).



53
54
55
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 53

def remote_was_deleted
  @remote_was_deleted
end

#source_transaction_idString (readonly)

Returns The customer’s identifier for the transaction.

Returns:

  • (String)

    The customer’s identifier for the transaction.



48
49
50
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 48

def source_transaction_id
  @source_transaction_id
end

#transaction_dateDateTime (readonly)

Returns The date that the transaction occurred.

Returns:

  • (DateTime)

    The date that the transaction occurred.



31
32
33
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 31

def transaction_date
  @transaction_date
end

#transaction_typeString (readonly)

Returns The underlying type of the transaction.

Returns:

  • (String)

    The underlying type of the transaction.



39
40
41
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 39

def transaction_type
  @transaction_type
end

Class Method Details

.from_json(json_object:) ⇒ Merge::Accounting::BankFeedTransaction

Deserialize a JSON object to an instance of BankFeedTransaction

Parameters:

  • json_object (String)

Returns:



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 134

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  remote_id = parsed_json["remote_id"]
  created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?)
  modified_at = (DateTime.parse(parsed_json["modified_at"]) unless parsed_json["modified_at"].nil?)
  if parsed_json["bank_feed_account"].nil?
     = nil
  else
     = parsed_json["bank_feed_account"].to_json
     = Merge::Accounting::BankFeedTransactionBankFeedAccount.from_json(json_object: )
  end
  transaction_date = (DateTime.parse(parsed_json["transaction_date"]) unless parsed_json["transaction_date"].nil?)
  posted_date = (DateTime.parse(parsed_json["posted_date"]) unless parsed_json["posted_date"].nil?)
  amount = parsed_json["amount"]
  description = parsed_json["description"]
  transaction_type = parsed_json["transaction_type"]
  payee = parsed_json["payee"]
  credit_or_debit = parsed_json["credit_or_debit"]
  source_transaction_id = parsed_json["source_transaction_id"]
  remote_was_deleted = parsed_json["remote_was_deleted"]
  is_processed = parsed_json["is_processed"]
  new(
    id: id,
    remote_id: remote_id,
    created_at: created_at,
    modified_at: modified_at,
    bank_feed_account: ,
    transaction_date: transaction_date,
    posted_date: posted_date,
    amount: amount,
    description: description,
    transaction_type: transaction_type,
    payee: payee,
    credit_or_debit: credit_or_debit,
    source_transaction_id: source_transaction_id,
    remote_was_deleted: remote_was_deleted,
    is_processed: is_processed,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Leveraged for Union-type generation, validate_raw attempts to parse the given

hash and check each fields type against the current object's property
definitions.

Parameters:

  • obj (Object)

Returns:

  • (Void)


190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 190

def self.validate_raw(obj:)
  obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.remote_id&.is_a?(String) != false || raise("Passed value for field obj.remote_id is not the expected type, validation failed.")
  obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
  obj.modified_at&.is_a?(DateTime) != false || raise("Passed value for field obj.modified_at is not the expected type, validation failed.")
  obj..nil? || Merge::Accounting::BankFeedTransactionBankFeedAccount.validate_raw(obj: obj.)
  obj.transaction_date&.is_a?(DateTime) != false || raise("Passed value for field obj.transaction_date is not the expected type, validation failed.")
  obj.posted_date&.is_a?(DateTime) != false || raise("Passed value for field obj.posted_date is not the expected type, validation failed.")
  obj.amount&.is_a?(Float) != false || raise("Passed value for field obj.amount is not the expected type, validation failed.")
  obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
  obj.transaction_type&.is_a?(String) != false || raise("Passed value for field obj.transaction_type is not the expected type, validation failed.")
  obj.payee&.is_a?(String) != false || raise("Passed value for field obj.payee is not the expected type, validation failed.")
  obj.credit_or_debit&.is_a?(Merge::Accounting::CreditOrDebitEnum) != false || raise("Passed value for field obj.credit_or_debit is not the expected type, validation failed.")
  obj.source_transaction_id&.is_a?(String) != false || raise("Passed value for field obj.source_transaction_id is not the expected type, validation failed.")
  obj.remote_was_deleted&.is_a?(Boolean) != false || raise("Passed value for field obj.remote_was_deleted is not the expected type, validation failed.")
  obj.is_processed&.is_a?(Boolean) != false || raise("Passed value for field obj.is_processed is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of BankFeedTransaction to a JSON object

Returns:

  • (String)


180
181
182
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 180

def to_json(*_args)
  @_field_set&.to_json
end