using TakeoutSaaS.Domain.Dictionary.Entities;
using TakeoutSaaS.Domain.Dictionary.Repositories;
using TakeoutSaaS.Infrastructure.Dictionary.Persistence;

namespace TakeoutSaaS.Infrastructure.Dictionary.Repositories;

/// <summary>
/// 字典导入日志仓储实现。
/// </summary>
public sealed class DictionaryImportLogRepository(DictionaryDbContext context) : IDictionaryImportLogRepository
{
    /// <summary>
    /// 新增导入日志。
    /// </summary>
    public Task AddAsync(DictionaryImportLog log, CancellationToken cancellationToken = default)
    {
        context.DictionaryImportLogs.Add(log);
        return Task.CompletedTask;
    }

    /// <summary>
    /// 持久化更改。
    /// </summary>
    public Task SaveChangesAsync(CancellationToken cancellationToken = default)
        => context.SaveChangesAsync(cancellationToken);
}
