Renamed the Repository protocol in the app target as TodoRepository.
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
import SwiftData
|
||||
|
||||
/// A protocol defining the interface for a data repository.
|
||||
///
|
||||
/// This protocol abstracts the underlying data persistence mechanism, allowing for
|
||||
/// dependency injection and easier testing. Implementations handle the storage and
|
||||
/// retrieval of model objects.
|
||||
protocol Repository {
|
||||
|
||||
/// Deletes a model object from the repository.
|
||||
///
|
||||
/// This method removes the specified object from persistent storage. The deletion
|
||||
/// is typically performed immediately, though the actual persistence may be deferred
|
||||
/// until a save operation occurs depending on the implementation.
|
||||
///
|
||||
/// - Parameter model: The model object to delete from the repository.
|
||||
func delete(_ model: some PersistentModel)
|
||||
|
||||
/// Inserts a new model object into the repository.
|
||||
///
|
||||
/// This method adds a new object to persistent storage. The object is typically
|
||||
/// tracked immediately, though the actual persistence may be deferred until a
|
||||
/// save operation occurs depending on the implementation.
|
||||
///
|
||||
/// - Parameter model: The model object to insert into the repository.
|
||||
func insert(_ model: some PersistentModel)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import SwiftData
|
||||
|
||||
/// A protocol defining the interface for a todo repository.
|
||||
///
|
||||
/// This protocol abstracts the underlying data persistence mechanism for todo tasks,
|
||||
/// allowing for dependency injection and easier testing. Implementations handle the
|
||||
/// storage and retrieval of Todo objects.
|
||||
protocol TodoRepository {
|
||||
|
||||
/// Deletes a todo task from the repository.
|
||||
///
|
||||
/// This method removes the specified todo from persistent storage. The deletion
|
||||
/// is typically performed immediately, though the actual persistence may be deferred
|
||||
/// until a save operation occurs depending on the implementation.
|
||||
///
|
||||
/// - Parameter todo: The todo task to delete from the repository.
|
||||
func delete(_ todo: Todo)
|
||||
|
||||
/// Inserts a new todo task into the repository.
|
||||
///
|
||||
/// This method adds a new todo to persistent storage. The todo is typically
|
||||
/// tracked immediately, though the actual persistence may be deferred until a
|
||||
/// save operation occurs depending on the implementation.
|
||||
///
|
||||
/// - Parameter todo: The todo task to insert into the repository.
|
||||
func insert(_ todo: Todo)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user