Skip to content

Conversation

@gustaavik
Copy link
Member

This pull request introduces enhancements to the payment processing, stock management, and order seeding functionalities, along with updates to configuration handling and Docker commands. The changes aim to improve system reliability, streamline workflows, and add new capabilities for handling stock and payment statuses.

Payment Processing and Stock Management Enhancements:

Order Seeding Improvements:

  • cmd/seed/main.go: Enhanced order seeding to include product variant details (e.g., SKU, stock, price in cents) and updated database operations to reflect these changes. Added new tables to the data clearing process. [1] [2] [3] [4] [5]

Configuration Updates:

  • config/config.go: Updated CORS configuration to dynamically load allowed origins from environment variables, enabling more flexible deployment scenarios. [1] [2]

Docker Command Additions:

  • Makefile: Added new Docker commands (docker-build, docker-build-tag, docker-push, docker-build-push) to streamline image building and pushing workflows. [1] [2]

Environment Variable Cleanup:

  • .env.example: Removed unused environment variables related to PayPal and test databases, and added CORS_ALLOWED_ORIGINS for allowed origins configuration. [1] [2] [3]

- Implemented stock reservation logic during payment authorization in CheckoutUseCase.
- Added stock restoration for cancelled or failed payments in OrderUseCase.
- Introduced health check endpoint to monitor service status and database connectivity.
- Updated OrderItem structure to include ProductVariantID for better inventory management.
- Modified CORS middleware to allow dynamic configuration of allowed origins.
- Created migrations to add product_variant_id to order_items table for improved order tracking.
- Added comprehensive unit tests for stock management logic in OrderUseCase.
- Refactored OrderDTO and OrderSummaryDTO to include checkout_id and customer details.
@gustaavik gustaavik merged commit 2fc9a87 into development Jun 28, 2025
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