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 Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for theaiSummaryrecord component.private final StringThe field for thecompanyNamerecord component.private final StringThe field for thehealthStatusrecord component.private final booleanThe field for theisDataAuditedrecord component.private final MarketDataDTOThe field for themarketDatarecord component.private final BigDecimalThe field for thenetMarginrecord component.private final intThe field for thereferenceYearrecord component.private final BigDecimalThe field for theroerecord component.private final StringThe field for thesectorrecord component.private final StringThe field for thetickerrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionStockAnalysisDTO(StockAnalysis entity, MarketDataDTO marketData) Construtor inteligente que mapeia a Entidade de Domínio e o DTO de Mercado.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 aStockAnalysisDTOrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaiSummaryrecord component.Returns the value of thecompanyNamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thehealthStatusrecord component.booleanReturns the value of theisDataAuditedrecord component.Returns the value of themarketDatarecord component.Returns the value of thenetMarginrecord component.intReturns the value of thereferenceYearrecord component.roe()Returns the value of theroerecord component.sector()Returns the value of thesectorrecord component.ticker()Returns the value of thetickerrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
companyName
The field for thecompanyNamerecord component. -
ticker
-
sector
-
referenceYear
private final int referenceYearThe field for thereferenceYearrecord component. -
netMargin
The field for thenetMarginrecord component. -
roe
The field for theroerecord component. -
healthStatus
The field for thehealthStatusrecord component. -
aiSummary
-
isDataAudited
private final boolean isDataAuditedThe field for theisDataAuditedrecord component. -
marketData
The field for themarketDatarecord component.
-
-
Constructor Details
-
StockAnalysisDTO
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 entidadeStockAnalysispersistida.marketData- O DTOMarketDataDTOcom 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 aStockAnalysisDTOrecord class.- Parameters:
companyName- the value for thecompanyNamerecord componentticker- the value for thetickerrecord componentsector- the value for thesectorrecord componentreferenceYear- the value for thereferenceYearrecord componentnetMargin- the value for thenetMarginrecord componentroe- the value for theroerecord componenthealthStatus- the value for thehealthStatusrecord componentaiSummary- the value for theaiSummaryrecord componentisDataAudited- the value for theisDataAuditedrecord componentmarketData- the value for themarketDatarecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
companyName
Returns the value of thecompanyNamerecord component.- Returns:
- the value of the
companyNamerecord component
-
ticker
-
sector
-
referenceYear
public int referenceYear()Returns the value of thereferenceYearrecord component.- Returns:
- the value of the
referenceYearrecord component
-
netMargin
-
roe
-
healthStatus
Returns the value of thehealthStatusrecord component.- Returns:
- the value of the
healthStatusrecord component
-
aiSummary
-
isDataAudited
public boolean isDataAudited()Returns the value of theisDataAuditedrecord component.- Returns:
- the value of the
isDataAuditedrecord component
-
marketData
Returns the value of themarketDatarecord component.- Returns:
- the value of the
marketDatarecord component
-