Pure move: one 624-line storecontract.go becomes storecontract.go (package doc + composed TaskStore), task.go, capture.go, binding.go, mapping.go, source.go, status.go, resource.go, credentials.go and errors.go. The package remains the single seam; no declaration changed (verified line-identical against HEAD). task check green.
27 lines
1.0 KiB
Go
27 lines
1.0 KiB
Go
package storecontract
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/samcharles93/archie-core/internal/domain/mapping"
|
|
)
|
|
|
|
// MappingStore persists payload field mappings. Deliberately separate from
|
|
// TaskStore and CaptureStore for the same reason those are split: the
|
|
// dashboard's mapping editor should only acquire the mapping surface, not the
|
|
// full task or capture APIs. See
|
|
type MappingStore interface {
|
|
InsertMapping(ctx context.Context, m mapping.Mapping) (string, error)
|
|
GetMapping(ctx context.Context, id string) (*mapping.Mapping, error)
|
|
ListMappings(ctx context.Context) ([]mapping.Mapping, error)
|
|
UpdateMapping(ctx context.Context, m mapping.Mapping) error
|
|
DeleteMapping(ctx context.Context, id string) error
|
|
}
|
|
|
|
// MappingMatchRecorder counts the events each mapping resolved, which the
|
|
// store reports as Mapping.MatchCount and LastMatchedAt. Recording the same
|
|
// (mapping, capture) twice counts once.
|
|
type MappingMatchRecorder interface {
|
|
RecordMappingMatch(ctx context.Context, mappingID, captureID string) error
|
|
}
|