Feature/es 72 improve checkout system for online and cod orders#57
Merged
raouf-b-dev merged 39 commits intomasterfrom Dec 28, 2025
Merged
Conversation
…le IDs. Update Cart, Inventory, and Reservation entities to allow null IDs, reflecting changes in the database schema. Adjust related mappers and repositories to ensure compatibility with the new ID structure. Remove unused ID generation methods and clean up tests to align with the updated ID handling.
…d payment events. Introduced CONFIRM_ORDER, PAYMENT_COMPLETED, and PAYMENT_FAILED to JobNames, along with corresponding retry configurations to enhance job processing reliability.
…0 and cron version 4.3.5 to enhance scheduling capabilities. Also, include @types/luxon for improved type definitions.
…les to streamline the codebase. This cleanup eliminates unused ID generation logic and associated mock files, enhancing maintainability.
…ler for handling payment event emissions. This includes methods for emitting payment completed and failed events, utilizing BullMQ for job processing and logging for better traceability.
…nt method and updating error handling. Refactor all gateway implementations (COD, PayPal, Stripe) to support InfrastructureError instead of AppError, ensuring consistent error management across payment methods.
…ation, enhancing type safety and clarity. Update tests to reflect changes in order execution parameters and improve error handling for payment confirmation scenarios.
…dle respective payment webhooks. Implement error handling and response management for webhook processing, enhancing integration with payment gateways.
…ature verification. Implement placeholder methods for testing without actual event handling, setting the stage for future integration with PayPal and Stripe webhooks.
…scheduling methods for post-payment and post-confirmation flows. Refactor checkout scheduling logic to differentiate between online and COD payments, enhancing order processing capabilities and error handling.
… new order statuses for payment and confirmation phases. Added methods for checking payment status, confirmation status, and terminal states, enhancing order state management and transition logic.
… strings to numbers, enhancing type consistency. Introduced reservationId and updated payment handling methods to accommodate new order status logic, improving order management and validation processes.
…ment it in PostgresReservationRepository for retrieving all reservations by order ID. This enhances the repository's functionality and improves data retrieval capabilities.
…nd implement it in BullMqOrderScheduler. Update CancelOrderUseCase to schedule stock release upon order cancellation, enhancing order management and processing capabilities. Update tests to verify new scheduling behavior.
…ace, and related schema and mapper files to streamline order management. This change enhances type consistency and simplifies the order structure.
…handling idempotent requests. Add unit tests for IdempotencyInterceptor to ensure correct behavior in various scenarios, enhancing request management and error handling capabilities.
…ending orders. Add unit tests to verify functionality, including scenarios for successful expiration, repository failures, and partial cancellations, enhancing order management and processing reliability.
…for improved validation of checkout context. Update unit tests to reflect changes in order processing logic, including validation handling and error responses, enhancing overall checkout reliability and maintainability.
…backoff strategy, enhancing job resilience and error handling capabilities.
…der ID, enhancing reservation management. Update InventoryModule to include the new use case.
…dUseCase to manage payment completion and failure scenarios. These use cases enhance order processing by confirming payments, handling idempotency, and scheduling post-payment flows or stock releases as needed, improving overall order management and reliability.
…hancing order details with currency information. Update serialization to include currency in order data, improving clarity in order management.
…ic IDs instead of strings for order identification. Introduce findByStatusBefore method to enhance order retrieval capabilities based on status and date. Update tests to reflect changes in ID handling and ensure consistency across repositories.
…for mapping domain properties to DTO. This improves data handling and integration with domain value objects, ensuring consistency in shipping address representation.
…ices with corresponding tests. The PaymentMethodPolicy manages payment method validation and order status, while the ShippingAddressResolver handles address resolution from DTOs and customer data, enhancing order processing capabilities.
…or online payment validation, replacing the previous isOnlinePayment method. This change enhances the separation of concerns and improves the maintainability of the order scheduling logic.
…tests for stock reservation logic. This addition integrates the stock reservation process with the order workflow, ensuring proper handling of cart data and enhancing overall order processing capabilities.
…ests to ensure correct module resolution. This change improves code organization and maintainability by aligning import statements with the directory structure.
… manage stock release for orders. This addition integrates the stock release process into the order workflow, enhancing order processing capabilities and ensuring proper handling of reservations.
… to validate checkout process. This addition ensures proper validation of customer, cart, and shipping address, enhancing the order processing workflow and improving error handling for checkout scenarios.
…ndle checkout failure scenarios. This implementation enhances the order processing workflow by retrieving reservation IDs when not provided, improving error handling and overall reliability in the checkout process.
…creation. This addition integrates payment processing capabilities by utilizing payment gateways, creating payment entities, and managing payment intent details, enhancing the overall payment workflow.
…numeric IDs instead of strings for payment and refund identification. This change enhances type consistency across the payment processing module and introduces a new method for finding payments by gateway payment intent ID, improving overall functionality and maintainability.
…ase, and HandleStripeWebhookUseCase to manage payment webhook processing for PayPal and Stripe. This addition enhances the payment processing module by validating webhook signatures, mapping event types, and delegating to the HandlePaymentWebhookService for handling payment success and failure scenarios, improving overall reliability and maintainability of payment workflows.
…ncy field to order factory. This change streamlines the order entity structure and enhances the order factory by including currency information, improving overall clarity and functionality in order processing.
…s. This update streamlines the interface and introduces a structured way to handle payment events, enhancing clarity and maintainability in payment processing.
… Processing Logic. This update introduces the PaymentEventsProcessor, ConfirmOrderStep, and related job handlers to manage payment events and order confirmations. Additionally, it refactors the OrdersController and related services to improve type handling and streamline order processing, ensuring better maintainability and clarity in the workflow.
…e. This update adds StripeWebhookController and PayPalWebhookController to manage payment webhooks, enhancing the PaymentsController with new endpoints for processing webhooks. Additionally, it refactors the PaymentsModule to include necessary services and use cases for improved payment processing reliability and maintainability.
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.