fixes
This commit is contained in:
@ -201,13 +201,25 @@ func (m *Manager) handleQuoteRequest(msg quoterequest.QuoteRequest, sessionID qu
|
||||
quoteReqID := parsed.QuoteReqID
|
||||
|
||||
if quoteReqID == "" {
|
||||
err := tracerr.Errorf("handleQuoteRequest: missing QuoteReqID")
|
||||
m.notify.SendMsg(
|
||||
domain.MessageChannelError,
|
||||
"quoteReqID missing in quote request",
|
||||
domain.MessageStatusWarning,
|
||||
nil,
|
||||
)
|
||||
err := tracerr.Errorf("handleQuoteRequest, missing QuoteReqID, quoteRequest: %+v", parsed)
|
||||
slog.Error(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Validate LST_ prefix for List Trading flow.
|
||||
if !strings.HasPrefix(quoteReqID, "LST_") {
|
||||
m.notify.SendMsg(
|
||||
domain.MessageChannelError,
|
||||
"quoteReqID ("+quoteReqID+") missing LST_ prefix",
|
||||
domain.MessageStatusWarning,
|
||||
nil,
|
||||
)
|
||||
slog.Warn("handleQuoteRequest: QuoteReqID missing LST_ prefix, ignoring", "quoteReqID", quoteReqID)
|
||||
return
|
||||
}
|
||||
@ -225,20 +237,8 @@ func (m *Manager) handleQuoteRequest(msg quoterequest.QuoteRequest, sessionID qu
|
||||
}
|
||||
slog.Info("handleQuoteRequest: NoRelatedSym keys", "quoteReqID", quoteReqID, "keys", relSymKeys)
|
||||
|
||||
listID := getString(relSym, "ListID")
|
||||
negotiationType := getString(relSym, "NegotiationType")
|
||||
ownerTraderID := getString(relSym, "OwnerTraderID")
|
||||
|
||||
if listID == "" {
|
||||
slog.Warn("handleQuoteRequest: missing ListID", "quoteReqID", quoteReqID)
|
||||
return
|
||||
}
|
||||
|
||||
if negotiationType != "RFQ" {
|
||||
slog.Warn("handleQuoteRequest: unexpected NegotiationType", "quoteReqID", quoteReqID, "negotiationType", negotiationType)
|
||||
return
|
||||
}
|
||||
|
||||
// Send QuoteStatusReport (35=AI) to acknowledge the inquiry.
|
||||
if ackErr := m.sendQuoteStatusReport(quoteReqID, ownerTraderID, sessionID); ackErr != nil {
|
||||
ackErr = tracerr.Errorf("handleQuoteRequest: failed to send QuoteStatusReport (quoteReqID=%s): %w", quoteReqID, ackErr)
|
||||
@ -418,9 +418,7 @@ func (m *Manager) GetPendingQuoteRequests() []domain.ListTrade {
|
||||
|
||||
pending := make([]domain.ListTrade, 0)
|
||||
for _, t := range m.trades {
|
||||
if !t.Quoted {
|
||||
pending = append(pending, toDomainListTrade(t))
|
||||
}
|
||||
pending = append(pending, toDomainListTrade(t))
|
||||
}
|
||||
|
||||
return pending
|
||||
@ -429,7 +427,6 @@ func (m *Manager) GetPendingQuoteRequests() []domain.ListTrade {
|
||||
func toDomainListTrade(t *listTrade) domain.ListTrade {
|
||||
out := domain.ListTrade{
|
||||
QuoteRequest: t.QuoteRequest,
|
||||
Quoted: t.Quoted,
|
||||
}
|
||||
if !t.Price.IsZero() {
|
||||
out.Price = t.Price.String()
|
||||
@ -447,12 +444,12 @@ func (m *Manager) SendQuote(quoteReqID string, price decimal.Decimal) error {
|
||||
slog.Error(err.Error())
|
||||
return err
|
||||
}
|
||||
if t.Quoted {
|
||||
m.tradesMu.Unlock()
|
||||
err := tracerr.Errorf("SendQuote: quote already sent for quoteReqID %s", quoteReqID)
|
||||
slog.Error(err.Error())
|
||||
return err
|
||||
}
|
||||
// if t.Quoted {
|
||||
// m.tradesMu.Unlock()
|
||||
// err := tracerr.Errorf("SendQuote: quote already sent for quoteReqID %s", quoteReqID)
|
||||
// slog.Error(err.Error())
|
||||
// return err
|
||||
// }
|
||||
|
||||
sessionID := t.SessionID
|
||||
if sessionID == (quickfix.SessionID{}) {
|
||||
@ -465,14 +462,13 @@ func (m *Manager) SendQuote(quoteReqID string, price decimal.Decimal) error {
|
||||
}
|
||||
}
|
||||
|
||||
relSym := firstGroup(t.QuoteRequest.Body, "NoRelatedSym")
|
||||
symbol := getString(relSym, "SecurityID")
|
||||
sIDSource := enum.SecurityIDSource(getString(relSym, "SecurityIDSource"))
|
||||
currency := getString(relSym, "Currency")
|
||||
side := enum.Side(getString(relSym, "Side"))
|
||||
orderQty := getDecimal(relSym, "OrderQty")
|
||||
settlDate := getString(relSym, "SettlDate")
|
||||
ownerTraderID := getString(relSym, "OwnerTraderID")
|
||||
symbol := getString(t.QuoteRequest.Body, "SecurityID")
|
||||
sIDSource := enum.SecurityIDSource(getString(t.QuoteRequest.Body, "SecurityIDSource"))
|
||||
currency := getString(t.QuoteRequest.Body, "Currency")
|
||||
side := enum.Side(getString(t.QuoteRequest.Body, "Side"))
|
||||
orderQty := getDecimal(t.QuoteRequest.Body, "OrderQty")
|
||||
settlDate := getString(t.QuoteRequest.Body, "SettlDate")
|
||||
ownerTraderID := getString(t.QuoteRequest.Body, "OwnerTraderID")
|
||||
m.tradesMu.Unlock()
|
||||
|
||||
if sIDSource != enum.SecurityIDSource_CUSIP {
|
||||
|
||||
Reference in New Issue
Block a user