Skip to content

Fix Quote currency in Asset and datetime parsing in csv import#578

Merged
afadil merged 6 commits intomainfrom
fix/v3-dependecies-upgrade
Feb 12, 2026
Merged

Fix Quote currency in Asset and datetime parsing in csv import#578
afadil merged 6 commits intomainfrom
fix/v3-dependecies-upgrade

Conversation

@afadil
Copy link
Owner

@afadil afadil commented Feb 12, 2026

  • Fixed quote currency for assets
  • Fix date time parsing in csv import

Checklist

By submitting this PR, I agree to the
CLA.

…nitial activity setup

- Added useAssetProfile hook to fetch asset details when assetId is provided.
- Updated initial activity construction to include asset data from the fetched profile, improving clarity and functionality.
…et quote_ccy

- Preserve case-sensitive minor-unit codes in canonicalization (GBp, GBX, ZAc)
- Enforce MIC-derived quote currency for market equities/options/metals
- Apply MIC currency enforcement across create/update/ensure flows
- Repair existing/reused assets when stored quote_ccy or MIC is stale
- Update enrichment to persist resolved quote_ccy instead of leaving it unchanged
- Adjust activity asset-spec building to prefer MIC currency for market securities
- Remove uppercase UI masking so GBp displays correctly in asset forms
- Add tests for GBp preservation and MIC currency enforcement
@afadil
Copy link
Owner Author

afadil commented Feb 12, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17d8826895

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 270 to 273
let normalized_mic = raw_mic.trim().to_uppercase();
if !normalized_mic.is_empty() {
payload.instrument_exchange_mic = Some(normalized_mic.clone());
if effective_quote_mode == QuoteMode::Market {
payload.quote_ccy = mic_to_currency(&normalized_mic).map(|ccy| ccy.to_string());
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Recompute quote currency after exchange MIC updates

When update_asset_profile receives a new instrument_exchange_mic for a market-priced asset, this branch now only normalizes/stores the MIC and never refreshes quote_ccy. Because later canonicalization is seeded with the existing currency, changing an asset from one exchange to another can leave a stale quote currency (for example USD after switching to XLON), which then drives incorrect pricing and FX conversion behavior.

Useful? React with 👍 / 👎.

Comment on lines +183 to +184
const parsed = parse(trimmed, pattern, new Date());
if (isValid(parsed)) return parsed.toISOString();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid UTC day shifts when parsing configured date formats

date-fns parse() returns a local-time Date, and immediately calling toISOString() converts that local midnight/time to UTC. For date-only and naive datetime CSV values, users outside UTC can get an off-by-one calendar day in the stored import timestamp (and downstream idempotency/date matching), even when the source CSV date itself is correct.

Useful? React with 👍 / 👎.

…in activity mutation hooks and service logic
@afadil afadil merged commit a764a9d into main Feb 12, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant