Skip to content

[Compass App] Refactor model #2431

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

Merged
merged 4 commits into from
Sep 9, 2024
Merged

[Compass App] Refactor model #2431

merged 4 commits into from
Sep 9, 2024

Conversation

miquelbeltran
Copy link
Member

This PR removes the compass_model subproject and moves each data model class to the respective app or server project.

Although this leads to code duplication, this is a more realistic implementation where clients and servers have their own respective data model class implementations.

The model classes for the server are located in server/lib/model.

Model classes for the app are located in two places:

  • API-only model: app/lib/data/services/api/model.
  • Domain model: app/lib/domain/model.

In general, models located under the domain are used across the app, while the API-only models are only used for interacting with the API client.

Tests have been updated.

Pre-launch Checklist

  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I read the Contributors Guide.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-devrel channel on Discord.

@miquelbeltran miquelbeltran marked this pull request as ready for review September 6, 2024 09:58
@miquelbeltran miquelbeltran merged commit 93b86b8 into compass-app Sep 9, 2024
1 check passed
@miquelbeltran miquelbeltran deleted the mb-refactor-model branch September 9, 2024 07:42
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 this pull request may close these issues.

2 participants