using MediatR;
using Microsoft.Extensions.DependencyInjection;
using MTWorkHR.Application.Identity;
using MTWorkHR.Application.Services;
using MTWorkHR.Application.Services.Interfaces;
using MTWorkHR.Application.Services.Payment;
using MTWorkHR.Core.Entities;
using MTWorkHR.Core.Global;
using MTWorkHR.Identity.Services;
using System.Reflection;

namespace MTWorkHR.Application
{
    public static class ApplicationServiceRegistration
    {
        public static IServiceCollection AddApplicationServices(this IServiceCollection services, AppSettingsConfiguration config)
        {
            services.AddSingleton(config);

            services.AddAutoMapper(Assembly.GetExecutingAssembly());

            services.AddMediatR(Assembly.GetExecutingAssembly());

            services.AddScoped<IAuthService, AuthService>();
            services.AddScoped<IUserService, UserService>();
          //  services.AddTransient<IFileService, FileService>();
            services.AddScoped<IFileService, BlobFileService>();
            services.AddScoped<IProjectService, ProjectService>();
            services.AddScoped<IUserTaskService, UserTaskService>();
            services.AddScoped<IUserTaskAttachmentService, UserTaskAttachmentService>();
            services.AddScoped<IUserTaskHistoryService, UserTaskHistoryService>();
            services.AddScoped<ITeamService, TeamService>();
            services.AddScoped<IMeetingService, MeetingService>();
            services.AddScoped<IAttendanceService, AttendanceService>();
            services.AddScoped<IOrderAllocationService, OrderAllocationService>();
            services.AddScoped<IOrderRequestService, OrderRequestService>();
            services.AddScoped<ILookupService, LookupService>();
            services.AddScoped<ICompanyService, CompanyService>();
            services.AddScoped<IContractService, ContractService>();
            services.AddScoped<IContractTaskAttachmentService, ContractTaskAttachmentService>();
            services.AddScoped<IProjectStageAttachmentService, ProjectStageAttachmentService>();
            services.AddScoped<IOTPService, OTPService>();
            services.AddScoped<ILogService<UserLog>, LogService<UserLog>>();
            services.AddScoped<ISubscriptionService, SubscriptionService>();
            services.AddScoped<IMatchMoveService, MatchMoveService>();
            services.AddScoped<IAmazonPayService, AmazonPayService>();
           // services.AddScoped<IContractPdfService, ContractPdfService>();

            services.AddHttpClient<AmazonPayService>();


            return services;
        }
    }
}
