package com.xfestudio.xfeservermanager.infra.security;

import java.time.Instant;
import java.util.UUID;

public record SessionRecord(
        UUID id,
        UUID accountId,
        byte[] tokenHash,
        byte[] csrfHash,
        Instant createdAt,
        Instant lastSeenAt,
        Instant authenticatedAt,
        boolean totpVerified,
        Instant expiresAt,
        Instant revokedAt) {

    public SessionRecord {
        tokenHash = tokenHash.clone();
        csrfHash = csrfHash.clone();
    }

    @Override
    public byte[] tokenHash() {
        return tokenHash.clone();
    }

    @Override
    public byte[] csrfHash() {
        return csrfHash.clone();
    }
}
