using e_suite.API.Common;
using e_suite.Database.Audit;
using e_suite.Service.SigmaImporter.GmgProfiles;
using e_suite.Service.SigmaImporter.PrintSpecifications;

namespace e_suite.Service.SigmaImporter;

public class SigmaImporter : ISigmaImporter
{
    private readonly IGmgProfileImporter _gmgProfileImporter;
    private readonly IPrintSpecificationImporter _printSpecificationImporter;

    public SigmaImporter(IGmgProfileImporter gmgProfileImporter, IPrintSpecificationImporter printSpecificationImporter)
    {
        _gmgProfileImporter = gmgProfileImporter;
        _printSpecificationImporter = printSpecificationImporter;
    }

    private readonly AuditUserDetails _auditUserDetails = new()
    {
        Comment = "SigmaImporter Automated import",
        UserDisplayName = "MessageProcessor"
    };

    public async Task ImportGMGProfiles()
    {
        await _gmgProfileImporter.DoGmgProfileImport(_auditUserDetails);
    }

    public async Task ImportPrintSpecifications()
    {
        await _gmgProfileImporter.DoGmgProfileImport(_auditUserDetails);
        await _printSpecificationImporter.DoPrintSpecificationImport(_auditUserDetails);
    }
}