separate trading212 logic

This commit is contained in:
2025-11-10 13:38:49 +00:00
parent 06dc25ae88
commit 4686e36501
5 changed files with 359 additions and 0 deletions

28
internal/direction.go Normal file
View File

@@ -0,0 +1,28 @@
package internal
type Direction uint
const (
DirectionUnknown Direction = 0
DirectionBuy Direction = 1
DirectionSell Direction = 2
)
func (d Direction) String() string {
switch d {
case 1:
return "buy"
case 2:
return "sell"
default:
return "unknown"
}
}
func (d Direction) IsBuy() bool {
return d == DirectionBuy
}
func (d Direction) IsSell() bool {
return d == DirectionSell
}