namespace DXPBLL.Auth; // Composed view for the context-switch picker — one entry per party-role this user holds, // each carrying the tenant relationships (TDXPPARTYLINK rows) available under that party. // Two-level pick: choose a role/party, then choose which tenant relationship to operate in // (a party can have relationships with several GB5 clients at once). public class DXPContextDTO { public int DxpUserPartyRoleId { get; set; } public int DxpPartyId { get; set; } public string PartyLegalName { get; set; } = string.Empty; public byte PartyTypeCode { get; set; } public string RoleCode { get; set; } = string.Empty; public List Links { get; set; } = new(); } public class DXPContextLinkDTO { public int DxpPartyLinkId { get; set; } public int TenantId { get; set; } public string DatabaseName { get; set; } = string.Empty; public byte DatabaseType { get; set; } public int LocalPartyId { get; set; } public byte RelationshipType { get; set; } } public class DXPLoginResultDTO { public int DxpUserId { get; set; } public string FullName { get; set; } = string.Empty; public List Contexts { get; set; } = new(); // Populated only when the user has exactly one (role, tenant-link) combination — skips the // extra context-switch round trip for the common single-relationship case. public DXPTokenPair? Tokens { get; set; } // Populated whenever Tokens is NOT (i.e., the user must pick a context) — a short-lived JWT // carrying only dxp_user_id (no party/tenant/role claims yet). The client presents this as // the Bearer token on the ContextSwitch call, which is what lets ContextSwitch read the // caller's identity from a verified token instead of trusting a client-supplied DxpUserId. public string? IntermediateToken { get; set; } }