package storage

import (
	"context"

	"github.com/tech/sendico/gateway/aurora/storage/model"
	"github.com/tech/sendico/pkg/merrors"
)

var ErrDuplicate = merrors.DataConflict("payment gateway storage: duplicate record")

type Repository interface {
	Payouts() PayoutsStore
}

type PayoutsStore interface {
	FindByIdempotencyKey(ctx context.Context, key string) (*model.CardPayout, error)
	FindByOperationRef(ctx context.Context, key string) (*model.CardPayout, error)
	FindByPaymentID(ctx context.Context, key string) (*model.CardPayout, error)
	Upsert(ctx context.Context, record *model.CardPayout) error
}
