mirror of
https://github.com/finmars-platform/finmars-core.git
synced 2026-04-26 06:35:59 +03:00
[GH-ISSUE #173] None is rejected for Instrument Type fields, causing incorrect defaults (e.g., 0) and wrong pricing #86
Labels
No labels
BackEnd
FrontEnd
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/finmars-core#86
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sergeiosipov on GitHub (Feb 9, 2026).
Original GitHub issue: https://github.com/finmars-platform/finmars-core/issues/173
Originally assigned to: @HenkKalkwater on GitHub.
Problem
Some Instrument Type fields do not accept
Noneas a valid value. During Instrument creation, this causesNoneto be replaced with a default numeric value (commonly0).Why this is an issue
0is treated as a meaningful value, not as “unset”. As a result, downstream pricing and recalculation logic may not trigger, leading to incorrect persisted values.Example
None(meaning “derive from schedule”) is set to00or any number)0instead of the correct calculated valueExpected behavior
NoneNoneunless explicitly providedNone→ value must be calculatedActual behavior
None(“None is not a valid value for Instrument Types”)Noneis coerced into0(or another numeric default)Impact
Suggested fix
Nonefor affected Instrument Type fields at validation/schema levelNoneis preserved through serialization/deserialization (no coercion to0)