Aggiunta selezione negozio
This commit is contained in:
10
SteUp.Shared/Core/Data/Contracts/ISteupDataService.cs
Normal file
10
SteUp.Shared/Core/Data/Contracts/ISteupDataService.cs
Normal 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; }
|
||||
}
|
||||
25
SteUp.Shared/Core/Data/SteupDataService.cs
Normal file
25
SteUp.Shared/Core/Data/SteupDataService.cs
Normal 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; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user