package de.effigenix.infrastructure.security;

/**
 * Authentication details for JWT-based authentication.
 *
 * Stores additional information extracted from JWT token:
 * - Username: User's username
 * - BranchId: User's assigned branch (for multi-branch filtering)
 *
 * This is stored in the Authentication.details field and can be accessed
 * by the SpringSecurityAuthorizationAdapter for resource-level authorization.
 *
 * Infrastructure Layer → Used by JwtAuthenticationFilter
 */
public class JwtAuthenticationDetails {

    private final String username;
    private final String branchId;

    public JwtAuthenticationDetails(String username, String branchId) {
        this.username = username;
        this.branchId = branchId;
    }

    public String getUsername() {
        return username;
    }

    public String getBranchId() {
        return branchId;
    }

    @Override
    public String toString() {
        return "JwtAuthenticationDetails{username='" + username + "', branchId='" + branchId + "'}";
    }
}
