Add SCUM trade catalog projections

This commit is contained in:
npc0-hue
2026-08-27 16:14:59 +08:00
parent 316efbe780
commit a0e7ae362b
16 changed files with 267 additions and 23 deletions
@@ -3,11 +3,13 @@ package service
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"strings"
"time"
"browser.local/platform/domain"
"browser.local/platform/repo"
)
func (svc *CoreService) scheduleDuePluginQueryProjectionJobs(claim domain.RunJobClaim, stamp time.Time) error {
@@ -147,6 +149,13 @@ func (svc *CoreService) projectPluginQueryJobResult(job domain.Job, stamp time.T
if keyErr != nil {
return keyErr
}
if projection.MergeExisting {
if existing, existingErr := svc.store.PluginDataRecords().Get(pluginDataID(instance.ID, plugin.ID, projection.Collection, key)); existingErr == nil {
value = mergePluginDataValues(existing.Value, value)
} else if !errors.Is(existingErr, repo.ErrNotFound) {
return existingErr
}
}
collectionMutations[key] = domain.PluginDataMutation{Operation: domain.PluginDataMutationPut, Key: key, Value: value}
}
}