package de.cannamanage.api.security;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;
import java.util.UUID;

/**
 * Custom UserDetails principal for member portal sessions.
 * Carries tenantId and memberId so portal controllers can enforce data scoping.
 */
public class PortalPrincipal extends User {

    private final UUID tenantId;
    private final UUID memberId;

    public PortalPrincipal(String username, String password,
                           Collection<? extends GrantedAuthority> authorities,
                           UUID tenantId, UUID memberId) {
        super(username, password, authorities);
        this.tenantId = tenantId;
        this.memberId = memberId;
    }

    public UUID getTenantId() {
        return tenantId;
    }

    public UUID getMemberId() {
        return memberId;
    }
}
