Repository navigation
Conversation
Saved rates already apply from their month on to every later past month, but the current month was always priced at live instrument rates. A covered foreign-currency envelope drifted with each quote refresh and moved again at rollover, when the month switched to the inherited table. Live rates now date the calendar only until a first table is saved. The current month gets a button to pin today's rates instead of the inherited ones.
|
@oviron is attempting to deploy a commit to the Alexey Ardov's projects Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #206
A saved rates table already applies from its month on to every later past month, but the current month is always priced at live instrument rates. So a foreign-currency envelope that was covered today shows an overspend again after the next quote refresh, and moves once more at rollover, when the month switches from live rates to the inherited table.
This PR applies saved tables to the current month too. Live rates date the calendar only until a table takes effect, so users who never saved rates see no change.
'current'lookups stay live, and a partial table still falls back to live rates per code, as before.To move to today's rates, the current month's rates panel gets a "Pin current exchange rates" button. It reuses the existing
loadFxRatesbranch for a month that has not ended, so it saves the instrument rates. The panel now also shows when only an envelope is in another currency, so that case gets the button too. The envelope currency tooltip now says the balance is recalculated at the rate of each month.Tests:
read.test.tscovers tables before, in and after the current month; a graph test shows a covered USD envelope staying at zero when the live quote changes and following it again after reset;FxRates.test.tsxpins rates for a USD envelope over an inherited table.pnpm verifypasses. I could not runpnpm test:storybooklocally (no Playwright browser), so CI decides there.