// * Interface defining the contract for database operations // * Used by both PlaceDBHelper and ExcursionDBHelper // * Provides a common set of operations for managing entries and templates import 'package:sqflite/sqflite.dart'; /// Interface for database operations /// Implements the Repository pattern for database access abstract interface class IDb { /// Get the database instance Future get dB; /// Initialize the database and create necessary tables initDatabases(); /// Create database schema /// @param excursionDB Database instance /// @param version Schema version number onCreateDatabases(Database excursionDB, int version); /// Add a new main entry /// @param excursion Map of entry data /// @return ID of the new entry Future addMainEntry(Map excursion); /// Update an existing main entry /// @param excursion Map of updated entry data /// @return Number of rows affected Future updateMainEntry(Map excursion); /// Mark an entry as sent to the server /// @param id ID of the entry to update Future updateSent(int id); /// Add a new template entry /// @param templates Map of template data /// @return ID of the new template Future addTemplate(Map templates); /// Update an existing template /// @param template Map of updated template data Future updateTemplate(Map template); /// Get all main entries from the database /// @return List of all entries Future>> getAllMainEntries(); /// Get all templates from the database /// @return List of all templates Future>> getAllTemplates(); /// Delete all main entries from the database Future deleteAllMainEntries(); /// Delete all templates from the database Future deleteAllTemplates(); /// Delete a specific template /// @param id ID of the template to delete Future deleteTemplateById(String id); /// Delete a specific main entry /// @param id ID of the entry to delete Future deleteMainEntryById(String id); }