<?php

declare(strict_types=1);

use ApiModel\Action\AuthAction;
use ApiModel\Action\HealthAction;
use ApiModel\Action\MetricsAction;
use ApiModel\Action\NotificationAction;
use ApiModel\Action\PlatformAction;
use ApiModel\Action\UserAction;
use ApiModel\Action\SecurityAction;
use ApiModel\Action\OrganizationAction;
use ApiModel\Action\AccountingAction;
use ApiModel\Action\ContactAction;
use ApiModel\Action\TaxRateAction;
use ApiModel\Action\CurrencyAction;
use ApiModel\Action\ExchangeRateAction;
use ApiModel\Action\SalesAction;
use ApiModel\Action\PurchasesAction;
use ApiModel\Action\ReportAction;
use ApiModel\Service\ExchangeRateService;
use ApiModel\Service\FinancialReportService;
use ApiModel\Service\InvoiceService;
use ApiModel\Service\PaymentService;
use ApiModel\Service\BillService;
use ApiModel\Service\PurchasePaymentService;
use ApiModel\Service\ExpenseService;
use ApiModel\Service\InventoryService;
use ApiModel\Service\InventoryAdjustmentService;
use ApiModel\Service\InventoryTransferService;
use ApiModel\Domain\Repository\BillRepositoryInterface;
use ApiModel\Domain\Repository\PurchasePaymentRepositoryInterface;
use ApiModel\Domain\Repository\ExpenseRepositoryInterface;
use ApiModel\Domain\Repository\InventoryRepositoryInterface;
use ApiModel\Domain\Repository\InventoryAdjustmentRepositoryInterface;
use ApiModel\Domain\Repository\InventoryTransferRepositoryInterface;
use ApiModel\Infrastructure\Persistence\Repositories\PdoBillRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoPurchasePaymentRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoExpenseRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoInventoryRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoInventoryAdjustmentRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoInventoryTransferRepository;
use ApiModel\Action\InventoryAction;
use ApiModel\Domain\Repository\PasswordResetRepositoryInterface;
use ApiModel\Domain\Repository\PlatformAuditRepositoryInterface;
use ApiModel\Domain\Repository\RefreshTokenRepositoryInterface;
use ApiModel\Domain\Repository\UserRepositoryInterface;
use ApiModel\Domain\Repository\PagoFerreteriaRepositoryInterface;
use ApiModel\Domain\Repository\RoleRepositoryInterface;
use ApiModel\Domain\Repository\ModuleRepositoryInterface;
use ApiModel\Domain\Repository\PageRepositoryInterface;
use ApiModel\Domain\Repository\ProfileRepositoryInterface;
use ApiModel\Domain\Repository\MessageRepositoryInterface;
use ApiModel\Domain\Repository\SecurityMenuRepositoryInterface;
use ApiModel\Domain\Repository\CompanyRepositoryInterface;
use ApiModel\Domain\Repository\BranchRepositoryInterface;
use ApiModel\Domain\Repository\UserAccessRepositoryInterface;
use ApiModel\Domain\Repository\ChartAccountRepositoryInterface;
use ApiModel\Domain\Repository\JournalRepositoryInterface;
use ApiModel\Domain\Repository\ExchangeRateRepositoryInterface;
use ApiModel\Domain\Repository\ContactRepositoryInterface;
use ApiModel\Domain\Repository\InvoiceRepositoryInterface;
use ApiModel\Domain\Repository\PaymentRepositoryInterface;
use ApiModel\Domain\Repository\TaxRateRepositoryInterface;
use ApiModel\Domain\Repository\CurrencyRepositoryInterface;
use ApiModel\Infrastructure\Persistence\Database;
use ApiModel\Infrastructure\Mail\PhpMailerFactory;
use ApiModel\Infrastructure\Storage\LocalDatedUploadStorage;
use ApiModel\Infrastructure\Storage\R2S3Presigner;
use ApiModel\Infrastructure\Persistence\Repositories\PdoNotificationRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoPasswordResetRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoPlatformAuditRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoRefreshTokenRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoUserRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoPagoFerreteriaRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoRoleRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoModuleRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoPageRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoProfileRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoMessageRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoSecurityMenuRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoCompanyRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoBranchRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoUserAccessRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoChartAccountRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoJournalRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoExchangeRateRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoContactRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoInvoiceRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoPaymentRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoTaxRateRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoCurrencyRepository;
use ApiModel\Infrastructure\Queue\AsyncJobQueue;
use ApiModel\Infrastructure\Queue\JobDispatcher;
use ApiModel\Service\AuthService;
use ApiModel\Service\NotificationService;
use ApiModel\Service\PlatformService;
use ApiModel\Service\UserService;
use ApiModel\Service\RoleService;
use ApiModel\Service\MenuService;
use ApiModel\Service\AuditLogService;
use ApiModel\Service\OrganizationService;
use ApiModel\Service\ChartAccountService;
use ApiModel\Service\JournalService;
use ApiModel\Service\ContactService;
use ApiModel\Service\TaxRateService;
use ApiModel\Service\CurrencyService;
use ApiModel\Middleware\AccessLogMiddleware;
use ApiModel\Middleware\CompanyContextMiddleware;
use Psr\Container\ContainerInterface;
use function DI\get;

// HR Module Imports
use ApiModel\Action\HrAction;

// Sales Adjustment Module Imports
use ApiModel\Action\SalesAdjustmentAction;
use ApiModel\Service\SalesAdjustmentService;
use ApiModel\Domain\Repository\SalesAdjustmentRepositoryInterface;
use ApiModel\Infrastructure\Persistence\Repositories\PdoSalesAdjustmentRepository;
use ApiModel\Service\EmployeeService;
use ApiModel\Service\PayrollService;
use ApiModel\Service\LeaveService;
use ApiModel\Domain\Repository\EmployeeRepositoryInterface;
use ApiModel\Domain\Repository\DepartmentRepositoryInterface;
use ApiModel\Domain\Repository\PayrollRepositoryInterface;
use ApiModel\Domain\Repository\LeaveRepositoryInterface;
use ApiModel\Infrastructure\Persistence\Repositories\PdoEmployeeRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoDepartmentRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoPayrollRepository;
use ApiModel\Infrastructure\Persistence\Repositories\PdoLeaveRepository;

/**
 * Definiciones PHP-DI. Recibe la raíz del proyecto para rutas (p. ej. uploads locales).
 *
 * @return array<string, mixed>
 */
return static function (string $projectRoot): array {
    return [
        PDO::class => static fn (): PDO => Database::connect(),

        PdoUserRepository::class => static fn (ContainerInterface $c): PdoUserRepository => new PdoUserRepository($c->get(PDO::class)),
        PdoRefreshTokenRepository::class => static fn (ContainerInterface $c): PdoRefreshTokenRepository => new PdoRefreshTokenRepository($c->get(PDO::class)),
        PdoPasswordResetRepository::class => static fn (ContainerInterface $c): PdoPasswordResetRepository => new PdoPasswordResetRepository($c->get(PDO::class)),
        PdoPlatformAuditRepository::class => static fn (ContainerInterface $c): PdoPlatformAuditRepository => new PdoPlatformAuditRepository($c->get(PDO::class)),
        PdoPagoFerreteriaRepository::class => static fn (ContainerInterface $c): PdoPagoFerreteriaRepository => new PdoPagoFerreteriaRepository($c->get(PDO::class)),
        PdoRoleRepository::class => static fn (ContainerInterface $c): PdoRoleRepository => new PdoRoleRepository($c->get(PDO::class)),
        PdoModuleRepository::class => static fn (ContainerInterface $c): PdoModuleRepository => new PdoModuleRepository($c->get(PDO::class)),
        PdoPageRepository::class => static fn (ContainerInterface $c): PdoPageRepository => new PdoPageRepository($c->get(PDO::class)),
        PdoProfileRepository::class => static fn (ContainerInterface $c): PdoProfileRepository => new PdoProfileRepository($c->get(PDO::class)),
        PdoMessageRepository::class => static fn (ContainerInterface $c): PdoMessageRepository => new PdoMessageRepository($c->get(PDO::class)),
        PdoSecurityMenuRepository::class => static fn (ContainerInterface $c): PdoSecurityMenuRepository => new PdoSecurityMenuRepository($c->get(PDO::class)),
        PdoCompanyRepository::class => static fn (ContainerInterface $c): PdoCompanyRepository => new PdoCompanyRepository($c->get(PDO::class)),
        PdoBranchRepository::class => static fn (ContainerInterface $c): PdoBranchRepository => new PdoBranchRepository($c->get(PDO::class)),
        PdoUserAccessRepository::class => static fn (ContainerInterface $c): PdoUserAccessRepository => new PdoUserAccessRepository($c->get(PDO::class)),
        PdoChartAccountRepository::class => static fn (ContainerInterface $c): PdoChartAccountRepository => new PdoChartAccountRepository($c->get(PDO::class)),
        PdoJournalRepository::class => static fn (ContainerInterface $c): PdoJournalRepository => new PdoJournalRepository($c->get(PDO::class)),
        PdoExchangeRateRepository::class => static fn (ContainerInterface $c): PdoExchangeRateRepository => new PdoExchangeRateRepository($c->get(PDO::class)),
        PdoContactRepository::class => static fn (ContainerInterface $c): PdoContactRepository => new PdoContactRepository($c->get(PDO::class)),
        PdoInvoiceRepository::class => static fn (ContainerInterface $c): PdoInvoiceRepository => new PdoInvoiceRepository($c->get(PDO::class)),
        PdoPaymentRepository::class => static fn (ContainerInterface $c): PdoPaymentRepository => new PdoPaymentRepository($c->get(PDO::class)),
        PdoTaxRateRepository::class => static fn (ContainerInterface $c): PdoTaxRateRepository => new PdoTaxRateRepository($c->get(PDO::class)),
        PdoCurrencyRepository::class => static fn (ContainerInterface $c): PdoCurrencyRepository => new PdoCurrencyRepository($c->get(PDO::class)),
        PdoBillRepository::class => static fn (ContainerInterface $c): PdoBillRepository => new PdoBillRepository($c->get(PDO::class)),
        PdoPurchasePaymentRepository::class => static fn (ContainerInterface $c): PdoPurchasePaymentRepository => new PdoPurchasePaymentRepository($c->get(PDO::class)),
        PdoExpenseRepository::class => static fn (ContainerInterface $c): PdoExpenseRepository => new PdoExpenseRepository($c->get(PDO::class)),
        PdoInventoryRepository::class => static fn (ContainerInterface $c): PdoInventoryRepository => new PdoInventoryRepository($c->get(PDO::class)),
        PdoInventoryAdjustmentRepository::class => static fn (ContainerInterface $c): PdoInventoryAdjustmentRepository => new PdoInventoryAdjustmentRepository($c->get(PDO::class)),
        PdoInventoryTransferRepository::class => static fn (ContainerInterface $c): PdoInventoryTransferRepository => new PdoInventoryTransferRepository($c->get(PDO::class)),
        PdoEmployeeRepository::class => static fn (ContainerInterface $c): PdoEmployeeRepository => new PdoEmployeeRepository($c->get(PDO::class)),
        PdoDepartmentRepository::class => static fn (ContainerInterface $c): PdoDepartmentRepository => new PdoDepartmentRepository($c->get(PDO::class)),
        PdoPayrollRepository::class => static fn (ContainerInterface $c): PdoPayrollRepository => new PdoPayrollRepository($c->get(PDO::class)),
        PdoLeaveRepository::class => static fn (ContainerInterface $c): PdoLeaveRepository => new PdoLeaveRepository($c->get(PDO::class)),
        PdoSalesAdjustmentRepository::class => static fn (ContainerInterface $c): PdoSalesAdjustmentRepository => new PdoSalesAdjustmentRepository($c->get(PDO::class)),

        UserRepositoryInterface::class => get(PdoUserRepository::class),
        RefreshTokenRepositoryInterface::class => get(PdoRefreshTokenRepository::class),
        PasswordResetRepositoryInterface::class => get(PdoPasswordResetRepository::class),
        PlatformAuditRepositoryInterface::class => get(PdoPlatformAuditRepository::class),
        PagoFerreteriaRepositoryInterface::class => get(PdoPagoFerreteriaRepository::class),
        RoleRepositoryInterface::class => get(PdoRoleRepository::class),
        ModuleRepositoryInterface::class => get(PdoModuleRepository::class),
        PageRepositoryInterface::class => get(PdoPageRepository::class),
        ProfileRepositoryInterface::class => get(PdoProfileRepository::class),
        MessageRepositoryInterface::class => get(PdoMessageRepository::class),
        SecurityMenuRepositoryInterface::class => get(PdoSecurityMenuRepository::class),
        CompanyRepositoryInterface::class => get(PdoCompanyRepository::class),
        BranchRepositoryInterface::class => get(PdoBranchRepository::class),
        UserAccessRepositoryInterface::class => get(PdoUserAccessRepository::class),
        ChartAccountRepositoryInterface::class => get(PdoChartAccountRepository::class),
        JournalRepositoryInterface::class => get(PdoJournalRepository::class),
        ExchangeRateRepositoryInterface::class => get(PdoExchangeRateRepository::class),
        ContactRepositoryInterface::class => get(PdoContactRepository::class),
        InvoiceRepositoryInterface::class => get(PdoInvoiceRepository::class),
        PaymentRepositoryInterface::class => get(PdoPaymentRepository::class),
        TaxRateRepositoryInterface::class => get(PdoTaxRateRepository::class),
        CurrencyRepositoryInterface::class => get(PdoCurrencyRepository::class),
        BillRepositoryInterface::class => get(PdoBillRepository::class),
        PurchasePaymentRepositoryInterface::class => get(PdoPurchasePaymentRepository::class),
        ExpenseRepositoryInterface::class => get(PdoExpenseRepository::class),
        InventoryRepositoryInterface::class => get(PdoInventoryRepository::class),
        InventoryAdjustmentRepositoryInterface::class => get(PdoInventoryAdjustmentRepository::class),
        InventoryTransferRepositoryInterface::class => get(PdoInventoryTransferRepository::class),
        EmployeeRepositoryInterface::class => get(PdoEmployeeRepository::class),
        DepartmentRepositoryInterface::class => get(PdoDepartmentRepository::class),
        PayrollRepositoryInterface::class => get(PdoPayrollRepository::class),
        LeaveRepositoryInterface::class => get(PdoLeaveRepository::class),
        SalesAdjustmentRepositoryInterface::class => get(PdoSalesAdjustmentRepository::class),

        AsyncJobQueue::class => static fn (ContainerInterface $c): AsyncJobQueue => new AsyncJobQueue($c->get(PDO::class)),
        JobDispatcher::class => static fn (ContainerInterface $c): JobDispatcher => new JobDispatcher(
            $c->get(PhpMailerFactory::class),
            $c->get(PDO::class),
        ),

        RoleService::class => static fn (ContainerInterface $c): RoleService => new RoleService(
            $c->get(RoleRepositoryInterface::class),
            $c->get(ProfileRepositoryInterface::class),
        ),
        MenuService::class => static fn (ContainerInterface $c): MenuService => new MenuService(
            $c->get(ModuleRepositoryInterface::class),
            $c->get(PageRepositoryInterface::class),
            $c->get(ProfileRepositoryInterface::class),
        ),
        AuditLogService::class => static fn (ContainerInterface $c): AuditLogService => new AuditLogService(
            $c->get(PlatformAuditRepositoryInterface::class),
        ),
        OrganizationService::class => static fn (ContainerInterface $c): OrganizationService => new OrganizationService(
            $c->get(CompanyRepositoryInterface::class),
            $c->get(BranchRepositoryInterface::class),
            $c->get(UserAccessRepositoryInterface::class),
            $c->get(ProfileRepositoryInterface::class),
        ),
        ChartAccountService::class => static fn (ContainerInterface $c): ChartAccountService => new ChartAccountService(
            $c->get(ChartAccountRepositoryInterface::class),
        ),
        JournalService::class => static fn (ContainerInterface $c): JournalService => new JournalService(
            $c->get(JournalRepositoryInterface::class),
            $c->get(ChartAccountRepositoryInterface::class),
            $c->get(CompanyRepositoryInterface::class),
            $c->get(BranchRepositoryInterface::class),
            $c->get(ExchangeRateRepositoryInterface::class),
        ),
        ContactService::class => static fn (ContainerInterface $c): ContactService => new ContactService(
            $c->get(ContactRepositoryInterface::class),
        ),
        TaxRateService::class => static fn (ContainerInterface $c): TaxRateService => new TaxRateService(
            $c->get(TaxRateRepositoryInterface::class),
        ),
        CurrencyService::class => static fn (ContainerInterface $c): CurrencyService => new CurrencyService(
            $c->get(CurrencyRepositoryInterface::class),
        ),
        ExchangeRateService::class => static fn (ContainerInterface $c): ExchangeRateService => new ExchangeRateService(
            $c->get(ExchangeRateRepositoryInterface::class),
            $c->get(CurrencyRepositoryInterface::class),
        ),
        InvoiceService::class => static fn (ContainerInterface $c): InvoiceService => new InvoiceService(
            $c->get(InvoiceRepositoryInterface::class),
            $c->get(JournalRepositoryInterface::class),
            $c->get(TaxRateRepositoryInterface::class),
            $c->get(JournalService::class),
            $c->get(PDO::class)
        ),
        PaymentService::class => static fn (ContainerInterface $c): PaymentService => new PaymentService(
            $c->get(PaymentRepositoryInterface::class),
            $c->get(InvoiceRepositoryInterface::class),
            $c->get(JournalRepositoryInterface::class),
            $c->get(JournalService::class),
            $c->get(PDO::class)
        ),
        BillService::class => static fn (ContainerInterface $c): BillService => new BillService(
            $c->get(BillRepositoryInterface::class),
            $c->get(JournalRepositoryInterface::class),
            $c->get(TaxRateRepositoryInterface::class),
            $c->get(JournalService::class),
            $c->get(PDO::class)
        ),
        PurchasePaymentService::class => static fn (ContainerInterface $c): PurchasePaymentService => new PurchasePaymentService(
            $c->get(PurchasePaymentRepositoryInterface::class),
            $c->get(BillRepositoryInterface::class),
            $c->get(JournalRepositoryInterface::class),
            $c->get(JournalService::class),
            $c->get(PDO::class)
        ),
        ExpenseService::class => static fn (ContainerInterface $c): ExpenseService => new ExpenseService(
            $c->get(ExpenseRepositoryInterface::class),
            $c->get(JournalRepositoryInterface::class),
            $c->get(TaxRateRepositoryInterface::class),
            $c->get(JournalService::class),
            $c->get(PDO::class)
        ),
        InventoryService::class => static fn (ContainerInterface $c): InventoryService => new InventoryService(
            $c->get(InventoryRepositoryInterface::class)
        ),
        InventoryAdjustmentService::class => static fn (ContainerInterface $c): InventoryAdjustmentService => new InventoryAdjustmentService(
            $c->get(InventoryAdjustmentRepositoryInterface::class),
            $c->get(InventoryRepositoryInterface::class),
            $c->get(JournalRepositoryInterface::class),
            $c->get(JournalService::class),
            $c->get(PDO::class)
        ),
        InventoryTransferService::class => static fn (ContainerInterface $c): InventoryTransferService => new InventoryTransferService(
            $c->get(InventoryTransferRepositoryInterface::class),
            $c->get(InventoryRepositoryInterface::class),
            $c->get(PDO::class)
        ),

        AccessLogMiddleware::class => static fn (ContainerInterface $c): AccessLogMiddleware => new AccessLogMiddleware(
            $c->get(PlatformAuditRepositoryInterface::class),
        ),
        CompanyContextMiddleware::class => static fn (ContainerInterface $c): CompanyContextMiddleware => new CompanyContextMiddleware(
            $c->get(OrganizationService::class),
        ),

        AuthService::class => static fn (ContainerInterface $c): AuthService => new AuthService(
            $c->get(UserRepositoryInterface::class),
            $c->get(RefreshTokenRepositoryInterface::class),
            $c->get(PasswordResetRepositoryInterface::class),
            $c->get(PlatformAuditRepositoryInterface::class),
            $c->get(AsyncJobQueue::class),
            $c->get(JobDispatcher::class),
        ),
        PlatformService::class => static fn (ContainerInterface $c): PlatformService => new PlatformService(
            $c->get(UserRepositoryInterface::class),
            $c->get(PlatformAuditRepositoryInterface::class),
        ),
        UserService::class => static fn (ContainerInterface $c): UserService => new UserService($c->get(UserRepositoryInterface::class)),
        NotificationService::class => static fn (ContainerInterface $c): NotificationService => new NotificationService(new PdoNotificationRepository($c->get(PDO::class))),

        R2S3Presigner::class => static fn (): ?R2S3Presigner => R2S3Presigner::tryCreate(),
        PhpMailerFactory::class => static fn (): ?PhpMailerFactory => PhpMailerFactory::tryFromEnv(),
        LocalDatedUploadStorage::class => static fn (): ?LocalDatedUploadStorage => LocalDatedUploadStorage::tryFromEnv($projectRoot),

        AuthAction::class => static fn (ContainerInterface $c): AuthAction => new AuthAction(
            $c->get(AuthService::class),
            $c->get(MenuService::class),
        ),
        HealthAction::class => static fn (): HealthAction => new HealthAction(),
        UserAction::class => static fn (ContainerInterface $c): UserAction => new UserAction($c->get(UserService::class)),
        PlatformAction::class => static fn (ContainerInterface $c): PlatformAction => new PlatformAction($c->get(PlatformService::class)),
        NotificationAction::class => static fn (ContainerInterface $c): NotificationAction => new NotificationAction($c->get(NotificationService::class)),
        MetricsAction::class => static fn (): MetricsAction => new MetricsAction(),
        SecurityAction::class => static fn (ContainerInterface $c): SecurityAction => new SecurityAction(
            $c->get(RoleService::class),
            $c->get(MenuService::class),
            $c->get(UserService::class),
            $c->get(AuditLogService::class),
            $c->get(AuthService::class),
        ),
        OrganizationAction::class => static fn (ContainerInterface $c): OrganizationAction => new OrganizationAction(
            $c->get(OrganizationService::class),
        ),
        AccountingAction::class => static fn (ContainerInterface $c): AccountingAction => new AccountingAction(
            $c->get(ChartAccountService::class),
            $c->get(JournalService::class),
        ),
        ContactAction::class => static fn (ContainerInterface $c): ContactAction => new ContactAction(
            $c->get(ContactService::class),
        ),
        TaxRateAction::class => static fn (ContainerInterface $c): TaxRateAction => new TaxRateAction(
            $c->get(TaxRateService::class),
        ),
        CurrencyAction::class => static fn (ContainerInterface $c): CurrencyAction => new CurrencyAction(
            $c->get(CurrencyService::class),
        ),
        ExchangeRateAction::class => static fn (ContainerInterface $c): ExchangeRateAction => new ExchangeRateAction(
            $c->get(ExchangeRateService::class),
        ),
        SalesAction::class => static fn (ContainerInterface $c): SalesAction => new SalesAction(
            $c->get(InvoiceService::class),
            $c->get(PaymentService::class)
        ),
        PurchasesAction::class => static fn (ContainerInterface $c): PurchasesAction => new PurchasesAction(
            $c->get(BillService::class),
            $c->get(PurchasePaymentService::class),
            $c->get(ExpenseService::class)
        ),
        InventoryAction::class => static fn (ContainerInterface $c): InventoryAction => new InventoryAction(
            $c->get(InventoryService::class),
            $c->get(InventoryAdjustmentService::class),
            $c->get(InventoryTransferService::class)
        ),
        FinancialReportService::class => static fn (ContainerInterface $c): FinancialReportService => new FinancialReportService($c->get(PDO::class)),
        ReportAction::class => static fn (ContainerInterface $c): ReportAction => new ReportAction($c->get(FinancialReportService::class)),

        // HR Services
        EmployeeService::class => static fn (ContainerInterface $c): EmployeeService => new EmployeeService(
            $c->get(EmployeeRepositoryInterface::class),
            $c->get(DepartmentRepositoryInterface::class)
        ),
        PayrollService::class => static fn (ContainerInterface $c): PayrollService => new PayrollService(
            $c->get(PayrollRepositoryInterface::class),
            $c->get(EmployeeRepositoryInterface::class),
            $c->get(JournalService::class),
            $c->get(PDO::class)
        ),
        LeaveService::class => static fn (ContainerInterface $c): LeaveService => new LeaveService(
            $c->get(LeaveRepositoryInterface::class),
            $c->get(EmployeeRepositoryInterface::class)
        ),

        // HR Action
        HrAction::class => static fn (ContainerInterface $c): HrAction => new HrAction(
            $c->get(EmployeeService::class),
            $c->get(PayrollService::class),
            $c->get(LeaveService::class)
        ),

        // Sales Adjustment Module Services
        SalesAdjustmentService::class => static fn (ContainerInterface $c): SalesAdjustmentService => new SalesAdjustmentService(
            $c->get(SalesAdjustmentRepositoryInterface::class),
            $c->get(InvoiceRepositoryInterface::class),
            $c->get(JournalRepositoryInterface::class),
            $c->get(TaxRateRepositoryInterface::class),
            $c->get(JournalService::class),
            $c->get(PDO::class)
        ),

        // Sales Adjustment Action
        SalesAdjustmentAction::class => static fn (ContainerInterface $c): SalesAdjustmentAction => new SalesAdjustmentAction(
            $c->get(SalesAdjustmentService::class)
        ),

        // Canjea Services
        \ApiModel\Service\FerreteriaService::class => static fn (ContainerInterface $c): \ApiModel\Service\FerreteriaService => new \ApiModel\Service\FerreteriaService($c->get(PDO::class)),
        \ApiModel\Service\CertificadoService::class => static fn (ContainerInterface $c): \ApiModel\Service\CertificadoService => new \ApiModel\Service\CertificadoService($c->get(PDO::class)),
        \ApiModel\Service\CertificadoTipoService::class => static fn (ContainerInterface $c): \ApiModel\Service\CertificadoTipoService => new \ApiModel\Service\CertificadoTipoService($c->get(PDO::class)),
        \ApiModel\Service\CanjeService::class => static fn (ContainerInterface $c): \ApiModel\Service\CanjeService => new \ApiModel\Service\CanjeService($c->get(PDO::class)),
        \ApiModel\Service\ReporteCanjeService::class => static fn (ContainerInterface $c): \ApiModel\Service\ReporteCanjeService => new \ApiModel\Service\ReporteCanjeService($c->get(PDO::class)),

        // Canjea Actions
        \ApiModel\Action\FerreteriaAction::class => static fn (ContainerInterface $c): \ApiModel\Action\FerreteriaAction => new \ApiModel\Action\FerreteriaAction($c->get(\ApiModel\Service\FerreteriaService::class)),
        \ApiModel\Action\CertificadoAction::class => static fn (ContainerInterface $c): \ApiModel\Action\CertificadoAction => new \ApiModel\Action\CertificadoAction($c->get(\ApiModel\Service\CertificadoService::class)),
        \ApiModel\Action\CertificadoTipoAction::class => static fn (ContainerInterface $c): \ApiModel\Action\CertificadoTipoAction => new \ApiModel\Action\CertificadoTipoAction($c->get(\ApiModel\Service\CertificadoTipoService::class)),
        \ApiModel\Action\CanjeAction::class => static fn (ContainerInterface $c): \ApiModel\Action\CanjeAction => new \ApiModel\Action\CanjeAction($c->get(\ApiModel\Service\CanjeService::class)),
        \ApiModel\Action\ReporteCanjeAction::class => static fn (ContainerInterface $c): \ApiModel\Action\ReporteCanjeAction => new \ApiModel\Action\ReporteCanjeAction($c->get(\ApiModel\Service\ReporteCanjeService::class)),
    ];
};

