2026-06-21 03:12:43 +03:30
|
|
|
using Meezi.Core.Authorization;
|
2026-05-27 21:33:48 +03:30
|
|
|
using Meezi.Core.Enums;
|
|
|
|
|
|
|
|
|
|
namespace Meezi.Core.Interfaces;
|
|
|
|
|
|
|
|
|
|
public interface ITenantContext
|
|
|
|
|
{
|
|
|
|
|
string? UserId { get; }
|
|
|
|
|
string? CafeId { get; }
|
|
|
|
|
EmployeeRole? Role { get; }
|
|
|
|
|
PlanTier? PlanTier { get; }
|
|
|
|
|
string? Language { get; }
|
|
|
|
|
/// <summary>Active branch from JWT when employee is branch-scoped.</summary>
|
|
|
|
|
string? BranchId { get; }
|
|
|
|
|
bool IsSystemAdmin { get; }
|
|
|
|
|
bool IsAuthenticated { get; }
|
|
|
|
|
bool IsCafeOwner => Role == EmployeeRole.Owner;
|
2026-06-21 03:12:43 +03:30
|
|
|
/// <summary>
|
|
|
|
|
/// When non-null the employee has a custom role. These permissions override the static
|
|
|
|
|
/// <see cref="RolePermissions"/> matrix; the base <see cref="Role"/> still governs
|
|
|
|
|
/// café-wide vs. branch-scoped behaviour.
|
|
|
|
|
/// </summary>
|
|
|
|
|
IReadOnlySet<Permission>? CustomPermissions { get; }
|
2026-05-27 21:33:48 +03:30
|
|
|
}
|