added project repository
This commit is contained in:
@@ -1,34 +1,36 @@
|
||||
import 'package:backend_dart/domain/entities/project.dart';
|
||||
import 'package:backend_dart/domain/interface/error.dart';
|
||||
import 'package:fpdart/fpdart.dart';
|
||||
|
||||
/// Interface for managing project data interactions.
|
||||
abstract class ProjectDataSource {
|
||||
/// Creates a new project in the data source.
|
||||
///
|
||||
/// Throws an error if the creation fails.
|
||||
Future<void> createProject(NewProject project);
|
||||
TaskEither<IError, Project> createProject(ProjectCreate project);
|
||||
|
||||
/// Retrieves a project by its unique ID.
|
||||
///
|
||||
/// Returns `null` if no project is found.
|
||||
Future<Project?> findProjectById(String id);
|
||||
TaskEither<IError, Project> findProjectById(String id);
|
||||
|
||||
/// Retrieves all projects associated with a specific user.
|
||||
///
|
||||
/// Returns an empty list if no projects are found.
|
||||
Future<List<Project>> findProjectsByUserId(String userId);
|
||||
TaskEither<IError,List<Project>> findProjectsByUserId(String userId);
|
||||
|
||||
/// Updates an existing project in the data source.
|
||||
///
|
||||
/// Throws an error if the update fails.
|
||||
Future<void> updateProject(ProjectUpdate project);
|
||||
TaskEither<IError, Project> updateProject(ProjectUpdate project);
|
||||
|
||||
/// Deletes a project by its unique ID.
|
||||
///
|
||||
/// Throws an error if the deletion fails.
|
||||
Future<void> deleteProject(String id);
|
||||
TaskEither<IError, Project> deleteProject(String id);
|
||||
|
||||
/// Retrieves all projects in the data source.
|
||||
///
|
||||
/// Returns an empty list if no projects exist.
|
||||
Future<List<Project>> findAllProjects();
|
||||
TaskEither<IError, List<Project>> findAllProjects();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user