namespace CoreConnect.Commerce.Core;
public static class CommerceClaimTypes
public const string ResetPassword = "ResetPasswordToken";
public const string ConfirmAccount = "ConfirmAccountToken";
public const string CustomerId = "CustomerId";
public const string CompanyId = "CompanyId";
public const string CompanyInvoiceEmail = "CompanyInvoiceEmail";
public const string OrderId = "OrderId";
public const string ImpersonatedByCustomerId = "ImpersonatedByCustomerId";
public const string ImpersonatedByName = "ImpersonatedByName";
public const string ImpersonatedByEmail = "ImpersonatedByEmail";
public const string ImpersonatedByRole = "Role";
public const string CountryCode = "CountryCode";
public const string InvoiceId = "InvoiceId";
public const string InvoiceDate = "InvoiceDate";
public const string InvoicePdf = "InvoicePdf";
public const string CustomerType = "CustomerType";
public const string BusinessUnitKey = "BusinessUnitKey";
public static class Extensions
public static string CustomerId(this IRequestContext ctx)
return ctx.HttpContextAccessor?.HttpContext
?.User?.FindFirst(CommerceClaimTypes.CustomerId)?
/// Signin user company id.
public static string UserCompanyId(this IRequestContext ctx) => ctx.HttpContextAccessor?.HttpContext
?.User?.FindFirst(CommerceClaimTypes.CompanyId)?
/// Sigin in commerce user type.
public static string UserType(this IRequestContext ctx) => ctx.HttpContextAccessor?.HttpContext
?.User.FindFirst(CommerceClaimTypes.CustomerType)?
/// Singin user's specified or unique businessUnit key
/// <param name="ctx"></param>
public static string BusinessUnitKey(this IRequestContext ctx) => ctx.HttpContextAccessor?.HttpContext
?.User?.FindFirst(CommerceClaimTypes.BusinessUnitKey)?