Leandro Hernan Rojas 1c4c241266
Some checks failed
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Failing after 15m47s
Add StockItemModal v1
2025-08-18 00:47:37 -03:00

75 lines
3.0 KiB
C#

using phronCare.UIBlazor;
using phronCare.UIBlazor.Services.UI;
using phronCare.UIBlazor.Services.Sales;
using phronCare.UIBlazor.Services.Lookups;
using phronCare.UIBlazor.Services.Tickets;
using phronCare.UIBlazor.Services.Authorization;
using phronCare.UIBlazor.Services.Sales.Quotes;
using phronCare.UIBlazor.Services.Integrations;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Blazored.Modal;
using Blazored.Toast;
using phronCare.UIBlazor.Services.Stock;
using phronCare.UIBlazor.Services.Stock.Expeditions;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
#region Proveedor de Autorizacion
builder.Services.AddScoped<CustomAuthorizationProvider>();
builder.Services.AddScoped<AuthenticationStateProvider, CustomAuthorizationProvider>(p => p.GetRequiredService<CustomAuthorizationProvider>());
builder.Services.AddScoped<ILoginService, CustomAuthorizationProvider>(p => p.GetRequiredService<CustomAuthorizationProvider>());
builder.Services.AddAuthorizationCore();
#endregion
#region Load Configuration
var config = builder.Configuration.GetSection("BaseAd").Value;
if (config != null)
{
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(config) });
}
#endregion
#region Injection Dependencis
InjectDependencies(builder);
#endregion
#region UI
builder.Services.AddBlazoredModal();
builder.Services.AddBlazoredToast();
builder.Services.AddSingleton<NavMenuService>();
#endregion
await builder.Build().RunAsync();
static void InjectDependencies(WebAssemblyHostBuilder builder)
{
builder.Services.AddScoped<ISalesLookupService, SalesLookupService>();
builder.Services.AddScoped<IStockLookUpService, StockLookUpService>();
builder.Services.AddScoped<IExchangeRateService, ExchangeRateService>();
builder.Services.AddScoped<IStockScanService, StockScanService>();
builder.Services.AddScoped<ExchangeRateService>();
builder.Services.AddScoped<QuoteService>();
builder.Services.AddScoped<TicketsService>();
builder.Services.AddScoped<CustomerService>();
builder.Services.AddScoped<TaxConditionService>();
builder.Services.AddScoped<AccountTypeService>();
builder.Services.AddScoped<DocumentTypeService>();
builder.Services.AddScoped<InstitutionService>();
builder.Services.AddScoped<ProductService>();
builder.Services.AddScoped<BusinessUnitService>();
builder.Services.AddScoped<ProfessionalService>();
builder.Services.AddScoped<PeopleService>();
builder.Services.AddScoped<ProfessionalSpecialtyService>();
builder.Services.AddScoped<ProductCategoryService>();
builder.Services.AddScoped<PatientService>();
builder.Services.AddScoped<ProductDivisionService>();
builder.Services.AddScoped<LSProductService>();
builder.Services.AddScoped<LSUnitOfMeasureService>();
builder.Services.AddScoped<ExpeditionService>();
}