Merged
Conversation
Replaces in-memory order storage with PostgreSQL for the Order service. This change introduces a robust and persistent data layer, enabling reliable order management. Key changes include: - Integration of `pgxpool` for efficient database connection pooling. - Implementation of `goose` for managing database schema migrations. - Addition of `docker-compose` configurations for core services, Inventory (MongoDB), and Order (PostgreSQL) within a shared network. - Updated `OrderRepository` interface and concrete implementation to use `pgxpool.Pool` for database operations (Get, Save). - Modification of the `Order` repository model to include `db` tags, `created_at`, `updated_at` timestamps, and nullable fields (`transaction_uuid`, `payment_method`). - Introduction of a `.env` file for environment-specific database credentials and `Taskfile` commands (`up-all`, `down-all`, etc.) for simplified environment setup and teardown. - Updates to service logic and API error handling to reflect the new persistence layer.
This introduces MongoDB as the primary data store for the inventory service. The previous in-memory repository has been replaced with a MongoDB-backed implementation, allowing for persistent storage of inventory parts. Key changes include: - New MongoDB repository with CRUD operations and initial data generation. - MongoDB connection details are now loaded from the `.env` file. - The `docker-compose.yml` for inventory service is updated to use the `MONGO_PORT` environment variable. - Added dependencies for `godotenv` and `go.mongodb.org/mongo-driver`.
Refactors the order service's data persistence layer to support multiple repository implementations. - Moves PostgreSQL-specific repository logic from `order/internal/repository/order` to `order/internal/repository/postgres`. - Encapsulates database migration within the `postgres` package's initialization. - Adds a new `order/internal/repository/inmemory` package providing a simple in-memory data store for orders. - Updates `main.go` to leverage the new `postgres.NewRepository` function, allowing for easier swapping of persistence backends. This change improves modularity and enables easier testing with different data storage mechanisms.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.