package confirmationdb

import (
	"context"

	"github.com/tech/sendico/pkg/db/repository"
	"github.com/tech/sendico/pkg/model"
	"go.mongodb.org/mongo-driver/v2/bson"
)

func (db *ConfirmationDB) DeleteTuple(ctx context.Context, accountRef bson.ObjectID, destination string, target model.ConfirmationTarget) error {
	query := repository.Query().
		Filter(repository.Field(fieldAccountRef), accountRef).
		Filter(repository.Field(fieldDestination), destination).
		Filter(repository.Field(fieldTarget), target)
	return db.DeleteMany(ctx, query)
}
