package net.siegeln.cameleer.saas.license.dto;

import net.siegeln.cameleer.saas.license.LicenseEntity;

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

public record LicenseResponse(
        UUID id,
        UUID tenantId,
        String tier,
        Map<String, Object> features,
        Map<String, Object> limits,
        Instant issuedAt,
        Instant expiresAt,
        String token
) {
    public static LicenseResponse from(LicenseEntity e) {
        return new LicenseResponse(
                e.getId(), e.getTenantId(), e.getTier(),
                e.getFeatures(), e.getLimits(),
                e.getIssuedAt(), e.getExpiresAt(),
                e.getToken()
        );
    }
}
