package com.cameleer.server.app.license;

import java.time.Instant;
import java.util.Optional;

public interface LicenseRepository {
    Optional<LicenseRecord> findByTenantId(String tenantId);

    /** Insert or replace the row for tenantId. */
    void upsert(LicenseRecord record);

    /** Update last_validated_at to `now` and return rows affected (0 = no row). */
    int touchValidated(String tenantId, Instant now);

    /** Delete the row (used when the operator clears a license; not a public API in v1). */
    int delete(String tenantId);
}
