using EntitlementBLL.Auth; namespace EntitlementSL.Common; // Client-facing shape of a token pair — deliberately narrower than EntitlementBLL.Auth. // ClientTokenPair: RefreshTokenHash is a server-internal value (used only to look up // MENTITLEMENTCLIENTREFRESHTOKEN rows by hash) and must never be returned to the caller. public record ClientTokenResponse( string AccessToken, DateTime AccessTokenExpiresOn, string RefreshToken, DateTime RefreshTokenExpiresOn, int[] PendingAgreementVersionIds) { public static ClientTokenResponse From(ClientTokenPair pair, int[]? pendingAgreementVersionIds = null) => new(pair.AccessToken, pair.AccessTokenExpiresOn, pair.RefreshToken, pair.RefreshTokenExpiresOn, pendingAgreementVersionIds ?? Array.Empty()); }