34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using AyCode.Core.Extensions;
|
|
using AyCode.Interfaces.StorageHandlers;
|
|
using AyCode.Utils.Extensions;
|
|
using Microsoft.AspNetCore.Components.Authorization;
|
|
using Newtonsoft.Json;
|
|
using TIAM.Core.Enums;
|
|
using TIAM.Entities.Products;
|
|
using TIAMWebApp.Shared.Application.Interfaces;
|
|
using TIAMWebApp.Shared.Application.Models.ClientSide;
|
|
|
|
namespace TIAMWebApp.Shared.Application.Services;
|
|
|
|
public abstract class SessionServiceClientBase(ISecureStorageHandler secureStorageHandler, AuthenticationStateProvider authStateProvider)
|
|
: AcWebSessionServiceClientBase(secureStorageHandler, authStateProvider), ISessionServiceClient
|
|
{
|
|
public bool HasCompany { get; set; } = false;
|
|
public bool IsDriver { get; set; } = false;
|
|
|
|
public Guid DriverPersmissionId { get; set; } = Guid.Empty;
|
|
|
|
public virtual List<Product> GetHotels()
|
|
{
|
|
return User != null ? User.UserModelDto.Products.Where(x => x.ProductType == ProductType.Hotel).ToList() : [];
|
|
}
|
|
|
|
public override async Task ClearAll()
|
|
{
|
|
HasCompany = false;
|
|
IsDriver = false;
|
|
DriverPersmissionId = Guid.Empty;
|
|
|
|
await base.ClearAll();
|
|
}
|
|
} |