Aggiunta selezione negozio

This commit is contained in:
2026-02-12 10:43:16 +01:00
parent d8bef12f30
commit 5afe4f4745
22 changed files with 397 additions and 2 deletions

View File

@@ -0,0 +1,10 @@
using SteUp.Shared.Core.Dto;
namespace SteUp.Shared.Core.Data.Contracts;
public interface ISteupDataService
{
Task Init();
List<PuntoVenditaDto> PuntiVenditaList { get; }
}

View File

@@ -0,0 +1,25 @@
using IntegryApiClient.Core.Domain.Abstraction.Contracts.Account;
using SteUp.Shared.Core.Data.Contracts;
using SteUp.Shared.Core.Dto;
using SteUp.Shared.Core.Interface.IntegryApi;
namespace SteUp.Shared.Core.Data;
public class SteupDataService(
IIntegrySteupService integrySteupService,
IUserSession userSession) : ISteupDataService
{
public Task Init()
{
return LoadDataAsync();
}
private async Task LoadDataAsync()
{
if (!await userSession.IsLoggedIn()) return;
PuntiVenditaList = await integrySteupService.RetrievePuntiVendita();
}
public List<PuntoVenditaDto> PuntiVenditaList { get; private set; } = [];
}

View File

@@ -0,0 +1,24 @@
using System.Text.Json.Serialization;
namespace SteUp.Shared.Core.Dto;
public class PuntoVenditaDto
{
[JsonPropertyName("codMdep")]
public string? CodMdep { get; set; }
[JsonPropertyName("descrizione")]
public string? Descrizione { get; set; }
[JsonPropertyName("indirizzo")]
public string? Indirizzo { get; set; }
[JsonPropertyName("cap")]
public string? Cap { get; set; }
[JsonPropertyName("citta")]
public string? Citta { get; set; }
[JsonPropertyName("provincia")]
public string? Provincia { get; set; }
}

View File

@@ -0,0 +1,24 @@
using MudBlazor;
using SteUp.Shared.Components.SingleElements.Modal;
namespace SteUp.Shared.Core.Helpers;
public class ModalHelper
{
public static async Task<DialogResult?> OpenSelectShop(IDialogService dialog)
{
var modal = await dialog.ShowAsync<ModalSelectShop>(
"ModalSelectShop",
new DialogParameters(),
new DialogOptions
{
FullScreen = false,
CloseButton = false,
NoHeader = true,
BackdropClick = true
}
);
return await modal.Result;
}
}

View File

@@ -0,0 +1,9 @@
using SteUp.Shared.Core.Dto;
namespace SteUp.Shared.Core.Interface.IntegryApi;
public interface IIntegrySteupService
{
//Retrieve
Task<List<PuntoVenditaDto>> RetrievePuntiVendita();
}

View File

@@ -0,0 +1,17 @@
using IntegryApiClient.Core.Domain.RestClient.Contacts;
using SteUp.Shared.Core.Dto;
using SteUp.Shared.Core.Interface.IntegryApi;
namespace SteUp.Shared.Core.Services;
public class IntegrySteupService(IIntegryApiRestClient integryApiRestClient) : IIntegrySteupService
{
private const string BaseRequest = "steup";
#region Retrieve
public Task<List<PuntoVenditaDto>> RetrievePuntiVendita() =>
integryApiRestClient.AuthorizedGet<List<PuntoVenditaDto>>($"{BaseRequest}/getPuntiVendita")!;
#endregion
}