Show UI warning to user when they need provider data but have not setup Synth yet #1926

Merged
zachgoll merged 4 commits from 1899-show-ui-warning-when-exchange-rates-are-missing-on-self-hosted-instances into main 2025-03-01 00:35:10 +08:00
zachgoll commented 2025-03-01 00:28:33 +08:00 (Migrated from github.com)

Simplify provider concerns

Previously, we had an abstract Providable implementation that given our sole usage of Synth, made working with provider data a bit confusing.

Now, all models that fetch external provider data will have a [Model]::Provided concern, which typically will expose a Model.provider class method. Now, working with the provider is a bit easier:

ExchangeRate.provider.present?
Security.provider.present?
Security::Price.provider.present?

If we add more providers in the future, the Model::Provided concern for each model will be responsible for configuring and choosing the desired provider for that type of data.

Add UI warning for Synth

If a family does not have Synth configured and meets any of the following criteria, we show a UI warning indicating that historical data is inaccurate.

  • Has accounts not denominated in their Family currency
  • Has investment trades
  • Has entries not denominated in their Family currency

CleanShot 2025-02-28 at 11 25 10

**Simplify provider concerns** Previously, we had an abstract `Providable` implementation that given our sole usage of Synth, made working with provider data a bit confusing. Now, all models that fetch _external provider data_ will have a `[Model]::Provided` concern, which typically will expose a `Model.provider` class method. Now, working with the provider is a bit easier: ```rb ExchangeRate.provider.present? Security.provider.present? Security::Price.provider.present? ``` If we add more providers in the future, the `Model::Provided` concern for each model will be responsible for configuring and choosing the desired provider for that type of data. **Add UI warning for Synth** If a family does _not_ have Synth configured and meets _any_ of the following criteria, we show a UI warning indicating that historical data is inaccurate. - Has accounts not denominated in their Family currency - Has investment trades - Has entries not denominated in their Family currency ![CleanShot 2025-02-28 at 11 25 10](https://github.com/user-attachments/assets/5556da1b-a577-4363-b6fe-9cd84fa4654f)
Sign in to join this conversation.