stronger kind tests and validation

This commit is contained in:
2026-08-01 16:32:20 +01:00
parent d2b2f934a0
commit 8f6cefcd68
3 changed files with 93 additions and 50 deletions
+2
View File
@@ -132,6 +132,8 @@ func BuildReport(ctx context.Context, reader RecordReader, writer ReportWriter,
buysCount++
} else if rec.Kind().Is(KindSell) {
sellsCount++
} else if !rec.Kind().Valid() {
return fmt.Errorf("cannot process Kind(%d)", rec.Kind())
}
lastTimestamp = rec.Timestamp()