Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist data with MartenDB #18

Open
jhiben opened this issue Oct 31, 2023 · 1 comment · May be fixed by #50
Open

Persist data with MartenDB #18

jhiben opened this issue Oct 31, 2023 · 1 comment · May be fixed by #50
Assignees

Comments

@jhiben
Copy link
Owner

jhiben commented Oct 31, 2023

Persist the data represented by the domain layer into MartenDB.
This will require to migrate the DDD aggregates to an event sourced model.
We may need an application layer.
The persistence logic should be isolated into a Persistence layer.

@jhiben jhiben self-assigned this Dec 16, 2023
@jhiben
Copy link
Owner Author

jhiben commented Oct 4, 2024

We are not interested in persisting the CRUD models.

jhiben added a commit that referenced this issue Oct 15, 2024
Fixes #18

Persist data represented by the domain layer into MartenDB by implementing an event-sourced model and creating a Persistence layer.

* **Domain Layer Changes:**
  - Modify `RecordHistory` and `Workout` classes to implement event-sourced models.
  - Add methods to handle events, apply them to the state, and retrieve uncommitted events.
  - Ensure `SetNew` and `Comprise` methods raise events instead of directly modifying the state.

* **Persistence Layer:**
  - Add `WorkoutRecords.Persistence` project with necessary dependencies.
  - Implement `EventStore` class to handle event storage and retrieval using MartenDB.
  - Create `WorkoutRepository` and `RecordHistoryRepository` to persist and retrieve events for `Workout` and `RecordHistory` aggregates.

* **Application Layer:**
  - Add `WorkoutRecords.Application` project.
  - Implement `WorkoutService` and `RecordHistoryService` to handle business logic and interact with repositories.

* **API Configuration:**
  - Add `Startup.cs` to configure MartenDB and register repositories and services with the dependency injection container.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/jhiben/workout-records-api-dotnet/issues/18?shareId=XXXX-XXXX-XXXX-XXXX).
@jhiben jhiben linked a pull request Oct 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant