Refacto FileStore to JSONStore
Generate check / check-changes (pull_request) Successful in 3s
Quality / check-changes (pull_request) Successful in 2s
Generate check / verify-generate (pull_request) Successful in 32s
Quality / static-checks (pull_request) Successful in 55s
Quality / run-tests (pull_request) Successful in 52s

This commit is contained in:
2026-09-06 18:16:26 +01:00
parent e5961c0dff
commit 6c06dbdd59
6 changed files with 132 additions and 76 deletions
+2 -2
View File
@@ -40,7 +40,7 @@ func NewRecordSerializer(figi *ofigi.Client) *RecordSerializer {
// MarshalRecord encodes the given internal.Record as JSON. It returns an
// error if the record is not a trading212.Record (or a *trading212.Record).
func (s *RecordSerializer) MarshalRecord(_ context.Context, r internal.Record) ([]byte, error) {
func (s *RecordSerializer) MarshalRecord(_ context.Context, r internal.Record) (json.RawMessage, error) {
var rec Record
switch v := r.(type) {
case Record:
@@ -69,7 +69,7 @@ func (s *RecordSerializer) MarshalRecord(_ context.Context, r internal.Record) (
// UnmarshalRecord decodes a JSON-encoded trading212.Record and re-wires its
// natureGetter to the serializer's OpenFIGI client.
func (s *RecordSerializer) UnmarshalRecord(ctx context.Context, data []byte) (internal.Record, error) {
func (s *RecordSerializer) UnmarshalRecord(ctx context.Context, data json.RawMessage) (internal.Record, error) {
var state recordState
if err := json.Unmarshal(data, &state); err != nil {
return nil, fmt.Errorf("unmarshal trading212 record: %w", err)