Record Class StockAnalysisDTO

java.lang.Object
java.lang.Record
com.raphaelsalles.backend.api.dto.StockAnalysisDTO
Record Components:
companyName - Nome da empresa.
ticker - Código do ativo.
sector - Setor de atuação.
referenceYear - Ano de referência do último balanço processado.
netMargin - Margem Líquida calculada (%).
roe - Retorno sobre Patrimônio Líquido (ROE) calculado (%).
healthStatus - Classificação de saúde financeira (ex: "EXCELENTE 💎").
aiSummary - Resumo textual gerado por IA ou regra de negócio.
isDataAudited - Flag indicando se os dados são auditados/confiáveis (CVM).
marketData - Dados de mercado em tempo real (Preço, P/L, P/VP).

public record StockAnalysisDTO(String companyName, String ticker, String sector, int referenceYear, BigDecimal netMargin, BigDecimal roe, String healthStatus, String aiSummary, boolean isDataAudited, MarketDataDTO marketData) extends Record
DTO principal para Análise Fundamentalista de Ações.

Propósito: Agrega dados estáticos (balanço, indicadores calculados) e dinâmicos (preço de mercado) em uma única resposta para o frontend.

  • Field Details

    • companyName

      private final String companyName
      The field for the companyName record component.
    • ticker

      private final String ticker
      The field for the ticker record component.
    • sector

      private final String sector
      The field for the sector record component.
    • referenceYear

      private final int referenceYear
      The field for the referenceYear record component.
    • netMargin

      private final BigDecimal netMargin
      The field for the netMargin record component.
    • roe

      private final BigDecimal roe
      The field for the roe record component.
    • healthStatus

      private final String healthStatus
      The field for the healthStatus record component.
    • aiSummary

      private final String aiSummary
      The field for the aiSummary record component.
    • isDataAudited

      private final boolean isDataAudited
      The field for the isDataAudited record component.
    • marketData

      private final MarketDataDTO marketData
      The field for the marketData record component.
  • Constructor Details

    • StockAnalysisDTO

      public StockAnalysisDTO(StockAnalysis entity, MarketDataDTO marketData)
      Construtor inteligente que mapeia a Entidade de Domínio e o DTO de Mercado. Trata valores nulos para evitar quebras no frontend.
      Parameters:
      entity - A entidade StockAnalysis persistida.
      marketData - O DTO MarketDataDTO com cotação atual.
    • StockAnalysisDTO

      public StockAnalysisDTO(String companyName, String ticker, String sector, int referenceYear, BigDecimal netMargin, BigDecimal roe, String healthStatus, String aiSummary, boolean isDataAudited, MarketDataDTO marketData)
      Creates an instance of a StockAnalysisDTO record class.
      Parameters:
      companyName - the value for the companyName record component
      ticker - the value for the ticker record component
      sector - the value for the sector record component
      referenceYear - the value for the referenceYear record component
      netMargin - the value for the netMargin record component
      roe - the value for the roe record component
      healthStatus - the value for the healthStatus record component
      aiSummary - the value for the aiSummary record component
      isDataAudited - the value for the isDataAudited record component
      marketData - the value for the marketData record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • companyName

      public String companyName()
      Returns the value of the companyName record component.
      Returns:
      the value of the companyName record component
    • ticker

      public String ticker()
      Returns the value of the ticker record component.
      Returns:
      the value of the ticker record component
    • sector

      public String sector()
      Returns the value of the sector record component.
      Returns:
      the value of the sector record component
    • referenceYear

      public int referenceYear()
      Returns the value of the referenceYear record component.
      Returns:
      the value of the referenceYear record component
    • netMargin

      public BigDecimal netMargin()
      Returns the value of the netMargin record component.
      Returns:
      the value of the netMargin record component
    • roe

      public BigDecimal roe()
      Returns the value of the roe record component.
      Returns:
      the value of the roe record component
    • healthStatus

      public String healthStatus()
      Returns the value of the healthStatus record component.
      Returns:
      the value of the healthStatus record component
    • aiSummary

      public String aiSummary()
      Returns the value of the aiSummary record component.
      Returns:
      the value of the aiSummary record component
    • isDataAudited

      public boolean isDataAudited()
      Returns the value of the isDataAudited record component.
      Returns:
      the value of the isDataAudited record component
    • marketData

      public MarketDataDTO marketData()
      Returns the value of the marketData record component.
      Returns:
      the value of the marketData record component