Class: FdxV660Api::K1StatementC

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/fdx_v660_api/models/k1_statement_c.rb

Overview

Form 1065 and 1120-S Schedule K-1 Statement C, Qualified Business Income (QBI) Pass-Through Entity Reporting, Patrons of Specified Agricultural and Horticultural Coooperatives. Partnership and Partner information for Statement C is found on the Schedule K-1

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(qbi_items: SKIP, section199_ag_deduction: SKIP, self_employed_health_insurance: SKIP, self_employed_retirement: SKIP, additional_properties: nil) ⇒ K1StatementC

Returns a new instance of K1StatementC.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/fdx_v660_api/models/k1_statement_c.rb', line 59

def initialize(qbi_items: SKIP, section199_ag_deduction: SKIP,
               self_employed_health_insurance: SKIP,
               self_employed_retirement: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @qbi_items = qbi_items unless qbi_items == SKIP
  @section199_ag_deduction = section199_ag_deduction unless section199_ag_deduction == SKIP
  unless self_employed_health_insurance == SKIP
    @self_employed_health_insurance =
      self_employed_health_insurance
  end
  @self_employed_retirement = self_employed_retirement unless self_employed_retirement == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#qbi_itemsArray[K1StatementCQualifiedBusinessIncomeQbiPartnerSpecificItems]

Qualified Business Income (QBI) items allocable to qualified payments subject to partner-specific determinations



18
19
20
# File 'lib/fdx_v660_api/models/k1_statement_c.rb', line 18

def qbi_items
  @qbi_items
end

#section199_ag_deductionFloat

Section 199A(g) deduction

Returns:

  • (Float)


22
23
24
# File 'lib/fdx_v660_api/models/k1_statement_c.rb', line 22

def section199_ag_deduction
  @section199_ag_deduction
end

#self_employed_health_insuranceFloat

Self-employed health insurance deduction allocable to Qualified Business Income (QBI)

Returns:

  • (Float)


27
28
29
# File 'lib/fdx_v660_api/models/k1_statement_c.rb', line 27

def self_employed_health_insurance
  @self_employed_health_insurance
end

#self_employed_retirementFloat

Self-employed retirement deduction allocable to Qualified Business Income (QBI)

Returns:

  • (Float)


32
33
34
# File 'lib/fdx_v660_api/models/k1_statement_c.rb', line 32

def self_employed_retirement
  @self_employed_retirement
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/fdx_v660_api/models/k1_statement_c.rb', line 76

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  # Parameter is an array, so we need to iterate through it
  qbi_items = nil
  unless hash['qbiItems'].nil?
    qbi_items = []
    hash['qbiItems'].each do |structure|
      qbi_items << (K1StatementCQualifiedBusinessIncomeQbiPartnerSpecificItems.from_hash(structure) if structure)
    end
  end

  qbi_items = SKIP unless hash.key?('qbiItems')
  section199_ag_deduction =
    hash.key?('section199AgDeduction') ? hash['section199AgDeduction'] : SKIP
  self_employed_health_insurance =
    hash.key?('selfEmployedHealthInsurance') ? hash['selfEmployedHealthInsurance'] : SKIP
  self_employed_retirement =
    hash.key?('selfEmployedRetirement') ? hash['selfEmployedRetirement'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  K1StatementC.new(qbi_items: qbi_items,
                   section199_ag_deduction: section199_ag_deduction,
                   self_employed_health_insurance: self_employed_health_insurance,
                   self_employed_retirement: self_employed_retirement,
                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



35
36
37
38
39
40
41
42
# File 'lib/fdx_v660_api/models/k1_statement_c.rb', line 35

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['qbi_items'] = 'qbiItems'
  @_hash['section199_ag_deduction'] = 'section199AgDeduction'
  @_hash['self_employed_health_insurance'] = 'selfEmployedHealthInsurance'
  @_hash['self_employed_retirement'] = 'selfEmployedRetirement'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/fdx_v660_api/models/k1_statement_c.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



45
46
47
48
49
50
51
52
# File 'lib/fdx_v660_api/models/k1_statement_c.rb', line 45

def self.optionals
  %w[
    qbi_items
    section199_ag_deduction
    self_employed_health_insurance
    self_employed_retirement
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



122
123
124
125
126
127
128
# File 'lib/fdx_v660_api/models/k1_statement_c.rb', line 122

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} qbi_items: #{@qbi_items.inspect}, section199_ag_deduction:"\
  " #{@section199_ag_deduction.inspect}, self_employed_health_insurance:"\
  " #{@self_employed_health_insurance.inspect}, self_employed_retirement:"\
  " #{@self_employed_retirement.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



113
114
115
116
117
118
119
# File 'lib/fdx_v660_api/models/k1_statement_c.rb', line 113

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} qbi_items: #{@qbi_items}, section199_ag_deduction:"\
  " #{@section199_ag_deduction}, self_employed_health_insurance:"\
  " #{@self_employed_health_insurance}, self_employed_retirement:"\
  " #{@self_employed_retirement}, additional_properties: #{@additional_properties}>"
end