implemented other repos, services, objects ...

This commit is contained in:
2025-01-01 21:36:20 +00:00
parent 6d980a980e
commit 10c72f22c5
51 changed files with 5940 additions and 502 deletions
@@ -0,0 +1,20 @@
import 'package:fpdart/fpdart.dart';
import 'package:backend_dart/domain/entities/project.dart';
import 'package:backend_dart/domain/interface/error.dart';
abstract class ProjectRepository {
/// Creates a new project.
TaskEither<IError, Project> create(ProjectCreate project);
/// Finds a project by its unique ID.
TaskEither<IError, Project> findById(String id);
/// Updates an existing project.
TaskEither<IError, Project> update(ProjectUpdate project);
/// Deletes a project by its unique ID.
TaskEither<IError, void> delete(String id);
/// Finds all projects.
TaskEither<IError, List<Project>> findAll();
}
@@ -0,0 +1,23 @@
import 'package:fpdart/fpdart.dart';
import 'package:backend_dart/domain/entities/project_task.dart';
import 'package:backend_dart/domain/interface/error.dart';
abstract class ProjectTaskRepository {
/// Creates a new project task.
TaskEither<IError, ProjectTask> create(ProjectTaskCreate task);
/// Finds a project task by its unique ID.
TaskEither<IError, ProjectTask> findById(String id);
/// Finds all tasks for a specific project.
TaskEither<IError, List<ProjectTask>> findByProjectId(String projectId);
/// Updates an existing project task.
TaskEither<IError, ProjectTask> update(ProjectTaskUpdate task);
/// Deletes a project task by its unique ID.
TaskEither<IError, void> delete(String id);
/// Finds all project tasks.
TaskEither<IError, List<ProjectTask>> findAll();
}
@@ -0,0 +1,26 @@
import 'package:fpdart/fpdart.dart';
import 'package:backend_dart/domain/entities/time_entry.dart';
import 'package:backend_dart/domain/interface/error.dart';
abstract class TimeEntryRepository {
/// Creates a new time entry.
TaskEither<IError, TimeEntry> create(TimeEntryCreate timeEntry);
/// Finds a time entry by its unique ID.
TaskEither<IError, TimeEntry> findById(String id);
/// Finds all time entries for a specific user.
TaskEither<IError, List<TimeEntry>> findByUserId(String userId);
/// Finds all time entries for a specific project.
TaskEither<IError, List<TimeEntry>> findByProjectId(String projectId);
/// Updates an existing time entry.
TaskEither<IError, TimeEntry> update(TimeEntryUpdate timeEntry);
/// Deletes a time entry by its unique ID.
TaskEither<IError, void> delete(String id);
/// Finds all time entries.
TaskEither<IError, List<TimeEntry>> findAll();
}