Class: Nfe::StateTaxLegalEntity::StateTax

Inherits:
Data
  • Object
show all
Defined in:
lib/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rb,
sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs

Overview

A single state-tax registration (Inscrição Estadual) within stateTaxes. Carries its own status, dates, code, address and the per-document contributor indicators.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStateTax

Returns a new instance of StateTax.

Parameters:



53
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 53

def initialize: (status: untyped, tax_number: String?, status_on: String?, opened_on: String?, closed_on: String?, additional_information: String?, code: String?, address: Nfe::StateTaxLegalEntity::Address?, economic_activities: untyped, nfe: Nfe::StateTaxLegalEntity::FiscalDocumentInfo?, nfse: Nfe::StateTaxLegalEntity::FiscalDocumentInfo?, cte: Nfe::StateTaxLegalEntity::FiscalDocumentInfo?, nfce: Nfe::StateTaxLegalEntity::FiscalDocumentInfo?) -> void

Instance Attribute Details

#additional_informationString? (readonly)

Returns the value of attribute additional_information.

Returns:

  • (String, nil)


42
43
44
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 42

def additional_information
  @additional_information
end

#addressNfe::StateTaxLegalEntity::Address? (readonly)

Returns the value of attribute address.



44
45
46
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 44

def address
  @address
end

#closed_onString? (readonly)

Returns the value of attribute closed_on.

Returns:

  • (String, nil)


41
42
43
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 41

def closed_on
  @closed_on
end

#codeString? (readonly)

Returns the value of attribute code.

Returns:

  • (String, nil)


43
44
45
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 43

def code
  @code
end

#cteNfe::StateTaxLegalEntity::FiscalDocumentInfo? (readonly)

Returns the value of attribute cte.



48
49
50
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 48

def cte
  @cte
end

#economic_activitiesObject (readonly)

Returns the value of attribute economic_activities.

Returns:

  • (Object)


45
46
47
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 45

def economic_activities
  @economic_activities
end

#nfceNfe::StateTaxLegalEntity::FiscalDocumentInfo? (readonly)

Returns the value of attribute nfce.



49
50
51
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 49

def nfce
  @nfce
end

#nfeNfe::StateTaxLegalEntity::FiscalDocumentInfo? (readonly)

Returns the value of attribute nfe.



46
47
48
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 46

def nfe
  @nfe
end

#nfseNfe::StateTaxLegalEntity::FiscalDocumentInfo? (readonly)

Returns the value of attribute nfse.



47
48
49
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 47

def nfse
  @nfse
end

#opened_onString? (readonly)

Returns the value of attribute opened_on.

Returns:

  • (String, nil)


40
41
42
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 40

def opened_on
  @opened_on
end

#statusObject (readonly)

Returns the value of attribute status.

Returns:

  • (Object)


37
38
39
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 37

def status
  @status
end

#status_onString? (readonly)

Returns the value of attribute status_on.

Returns:

  • (String, nil)


39
40
41
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 39

def status_on
  @status_on
end

#tax_numberString? (readonly)

Returns the value of attribute tax_number.

Returns:

  • (String, nil)


38
39
40
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 38

def tax_number
  @tax_number
end

Class Method Details

.from_api(payload) ⇒ Nfe::StateTaxLegalEntity::StateTax?

Parameters:

  • payload (Hash[untyped, untyped], nil)

Returns:



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rb', line 87

def self.from_api(payload)
  return nil if payload.nil?

  new(
    status: payload["status"],
    tax_number: payload["taxNumber"]&.to_s,
    status_on: payload["statusOn"],
    opened_on: payload["openedOn"],
    closed_on: payload["closedOn"],
    additional_information: payload["additionalInformation"],
    code: payload["code"]&.to_s,
    address: Address.from_api(payload["address"]),
    economic_activities: (payload["economicActivities"] || []).map { |a| EconomicActivity.from_api(a) },
    nfe: FiscalDocumentInfo.from_api(payload["nfe"]),
    nfse: FiscalDocumentInfo.from_api(payload["nfse"]),
    cte: FiscalDocumentInfo.from_api(payload["cte"]),
    nfce: FiscalDocumentInfo.from_api(payload["nfce"])
  )
end

.newinstance

Parameters:

Returns:

  • (instance)


52
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 52

def self.new: (status: untyped, tax_number: String?, status_on: String?, opened_on: String?, closed_on: String?, additional_information: String?, code: String?, address: Nfe::StateTaxLegalEntity::Address?, economic_activities: untyped, nfe: Nfe::StateTaxLegalEntity::FiscalDocumentInfo?, nfse: Nfe::StateTaxLegalEntity::FiscalDocumentInfo?, cte: Nfe::StateTaxLegalEntity::FiscalDocumentInfo?, nfce: Nfe::StateTaxLegalEntity::FiscalDocumentInfo?) -> instance