Basic stock management and email considerations(WIP) #39
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.
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:
internal/application/usecase/checkout_usecase.go: Added logic to decrease stock when payment is authorized and handle stock updates for various payment status transitions (e.g., authorized, canceled, refunded). Also introduced email notifications for payment status changes. [1] [2] [3] [4]internal/application/usecase/order_usecase.go: IntegratedproductVariantRepofor stock management and added methods to decrease and increase stock based on payment status changes. [1] [2] [3] [4]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 addedCORS_ALLOWED_ORIGINSfor allowed origins configuration. [1] [2] [3]