package de.assecutor.votianlt.repository;

import de.assecutor.votianlt.model.InvoiceTemplate;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface InvoiceTemplateRepository extends MongoRepository<InvoiceTemplate, String> {

    /**
     * Find the invoice template for a specific user
     */
    Optional<InvoiceTemplate> findByUserId(String userId);

    /**
     * Check if a template exists for a user
     */
    boolean existsByUserId(String userId);

    /**
     * Delete the template for a user
     */
    void deleteByUserId(String userId);
}
