Handle Spin-off events as buys #35
@@ -139,7 +139,7 @@ func (rr RecordReader) ReadRecord(ctx context.Context) (internal.Record, error)
|
|||||||
|
|
||||||
var kind internal.Kind
|
var kind internal.Kind
|
||||||
switch strings.ToLower(raw[0]) {
|
switch strings.ToLower(raw[0]) {
|
||||||
case MarketBuy, LimitBuy:
|
case MarketBuy, LimitBuy, SpinOff:
|
||||||
kind = internal.KindBuy
|
kind = internal.KindBuy
|
||||||
case MarketSell, LimitSell:
|
case MarketSell, LimitSell:
|
||||||
kind = internal.KindSell
|
kind = internal.KindSell
|
||||||
@@ -177,13 +177,6 @@ func (rr RecordReader) ReadRecord(ctx context.Context) (internal.Record, error)
|
|||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
case SpinOff:
|
|
||||||
slog.Warn("Skipping 'spin off' event!",
|
|
||||||
slog.Any("ISIN", symbol),
|
|
||||||
slog.Any("Quantity", qant),
|
|
||||||
)
|
|
||||||
continue
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return Record{}, fmt.Errorf("parse record type: %s", raw[0])
|
return Record{}, fmt.Errorf("parse record type: %s", raw[0])
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user