/*
 * Magic Cloud, copyright (c) 2023 Thomas Hansen. See the attached LICENSE file for details. For license inquiries you can send an email to thomas@ainiro.io
 */

using magic.signals.contracts;
using magic.data.common.helpers;
using magic.data.common.contracts;

namespace magic.data.common.slots
{
    /// <summary>
    /// [data.transaction.rollback] slot, for rolling back a database transaction,
    /// according to your configuration settings.
    /// </summary>
    [Slot(
        Name = "data.transaction.rollback",
        Description = "Rolls back the current database transaction using the configured provider",
        ReturnsMode = SlotReturnsMode.None,
        RequiresScope = "data.transaction",
        ScopeDescription = "Requires an active database transaction created by [data.transaction.create]",
        SignatureType = typeof(global::magic.data.common.signatures.DataTransactionSignature))]
    public class RollbackTransaction : DataSlotBase
    {
        /// <summary>
        /// Creates a new instance of your type.
        /// </summary>
        /// <param name="settings">Configuration object.</param>
        public RollbackTransaction(IDataSettings settings)
            : base(".transaction.rollback", settings)
        { }
    }
}
