Код бумаги в запросе НРД — код НРД из DEPO по ISIN (у акций ≠ ISIN: SBER/03), иначе M2M43
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014FsEKyJrYF69Cj9ZXzFLRi
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package lkgateway
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Код бумаги НРД вместо ISIN (M2M43 29.09.2026): из DEPO; явный код НРД не трогаем.
|
||||
func TestWithNSDSecCodes(t *testing.T) {
|
||||
nsdSecCodes.Lock()
|
||||
nsdSecCodes.m["RU0009029540"] = nsdSecCodeEntry{code: "SBER/03", at: time.Now()}
|
||||
nsdSecCodes.m["RU000A0JUR61"] = nsdSecCodeEntry{code: "", at: time.Now()}
|
||||
nsdSecCodes.Unlock()
|
||||
old := globalRC
|
||||
if globalRC == nil {
|
||||
globalRC = &RuntimeConfig{}
|
||||
}
|
||||
defer func() { globalRC = old }()
|
||||
in := CreateClaimRequest{Securities: []ClaimSec{
|
||||
{SecurityCode: "RU0009029540", SecurityDetails: SecurityDetails{ISIN: "RU0009029540"}},
|
||||
{SecurityCode: "", SecurityDetails: SecurityDetails{ISIN: "RU0009029540"}},
|
||||
{SecurityCode: "RU000A0JUR61", SecurityDetails: SecurityDetails{ISIN: "RU000A0JUR61"}},
|
||||
{SecurityCode: "SU26238RMFS4", SecurityDetails: SecurityDetails{ISIN: "RU000A1038V6"}},
|
||||
}}
|
||||
out := withNSDSecCodes(in)
|
||||
want := []string{"SBER/03", "SBER/03", "RU000A0JUR61", "SU26238RMFS4"}
|
||||
for i, w := range want {
|
||||
if out.Securities[i].SecurityCode != w {
|
||||
t.Fatalf("бумага %d: %q, ожидалось %q", i, out.Securities[i].SecurityCode, w)
|
||||
}
|
||||
}
|
||||
if in.Securities[0].SecurityCode != "RU0009029540" {
|
||||
t.Fatal("исходная заявка не меняется")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user