@using SteUp.Shared.Core.Dto @using SteUp.Shared.Core.Helpers @using SteUp.Shared.Core.Interface.LocalDb @inject IIspezioniService IspezioniService @* Riga di scelta di un punto vendita. E' un @code { [Parameter] public PuntoVenditaDto PuntoVendita { get; set; } = null!; [Parameter] public EventCallback OnStarting { get; set; } /// Vero se il rilevatore ha gia' un'ispezione aperta oggi su questo punto vendita. [Parameter] public bool Aperta { get; set; } private static readonly StatusBadgeHelper.BadgeSpec ApertaBadge = new("info", "ri-play-circle-line", "Ispezione di oggi"); // Indirizzo, citta', CAP e provincia su una riga sola con separatore " · ": // sono metadati, non meritano tre chip che fanno rumore. private string Luogo => string.Join(" · ", new[] { PuntoVendita.Indirizzo, PuntoVendita.Citta, string.Join(" ", new[] { PuntoVendita.Cap, PuntoVendita.Provincia } .Where(x => !x.IsNullOrEmpty())) } .Where(x => !x.IsNullOrEmpty())); private string AriaLabel => Aperta ? $"Riprendi l'ispezione di oggi su {PuntoVendita.CodMdep} {PuntoVendita.Descrizione}" : $"Apri ispezione su {PuntoVendita.CodMdep} {PuntoVendita.Descrizione}"; private async Task StartInspection() { await OnStarting.InvokeAsync(); SteupDataService.InspectionPageState.Ispezione = await IspezioniService.GetOrCreateIspezioneAsync( PuntoVendita.CodMdep!, DateTime.Now, UserSession.User.Username ); NavigationManager.NavigateTo("/ispezione"); } }