package dev.lions.unionflow.server.repository;

import dev.lions.unionflow.server.entity.BackupConfig;
import io.quarkus.hibernate.orm.panache.PanacheRepositoryBase;
import jakarta.enterprise.context.ApplicationScoped;

import java.util.Optional;
import java.util.UUID;

@ApplicationScoped
public class BackupConfigRepository implements PanacheRepositoryBase<BackupConfig, UUID> {

    /** Returns the single config row, or empty if not yet initialised. */
    public Optional<BackupConfig> getConfig() {
        return find("ORDER BY dateCreation ASC").firstResultOptional();
    }
}
