Test - #1033
Closed
SilviuMihnea wants to merge 2 commits into
Closed
Test#1033SilviuMihnea wants to merge 2 commits into
SilviuMihnea wants to merge 2 commits into
Conversation
Add new field model to catalog item Add mock data for catalog items model Add model support to catalog and facets Introduce a first-class "Model" field across the catalog stack. Adds a DB migration (AddCatalogItemModel), entity configuration (max length + index), and Model property on CatalogItem. API changes: GetAllItems and GetCatalogFacets accept model filters; faceting now returns per-model counts and a model total; OpenAPI specs updated. Client and service updates propagate model query parameters and include model in CatalogResult/CatalogItem DTOs; UI components (Web/Hybrid/ClientApp) display model values and expose a model facet that is shown only when a brand is selected (and cleared when the brand is cleared). CatalogAI indexing now includes model. Tests: new Playwright e2e test and multiple functional tests verify model filtering and facets. Small routing/config updates were made to include the new test in Playwright runs. Add inventory reservations and reservation logic Introduce InventoryReservation and ReservationStatus types plus EF configuration and tests to support holding stock for order lines. Register InventoryReservations in CatalogContext and apply InventoryReservationEntityTypeConfiguration (unique index on OrderId/ProductId for idempotency, indexes for lookup/expiry). Extend CatalogItem with ReservedStock, AvailableToPromise and methods Reserve, CommitReservation and ReleaseReservation to manage holds and commits with domain validations. Add comprehensive unit tests covering reservation lifecycle and CatalogItem reservation behavior. Add inventory reservation service and tests Introduce an InventoryReservationService with IInventoryReservationService and InventoryOptions to hold, commit and release stock for orders (all-or-nothing reservations). Register the service and options in DI and add InventoryOptions to appsettings. Use Postgres xmin as a concurrency token on CatalogItem to prevent double-reserving the last unit. Add functional tests exercising reservation, commit/release semantics and concurrency, and ensure the service mutates the CatalogContext without calling SaveChanges so callers can persist changes transactionally. Retry reservations; preserve ReservedStock Prevent ReservedStock from being clobbered when updating a CatalogItem via SetValues. Refactor OrderStatusChangedToAwaitingValidation handler to use IInventoryReservationService, add retry-on-concurrency (DbUpdateConcurrencyException) with a new InventoryOptions.MaxReservationAttempts setting (and appsettings entry), and introduce a RejectAsync helper to fail orders after retries are exhausted. Add functional tests (StockReservationHandlerTests) to validate reservation behaviour, outbox entries, and various edge cases (redelivery, unknown products, concurrent orders). Add StockConcurrencyRetry and commit events Introduce StockConcurrencyRetry service and register it in DI; refactor integration handlers to use the retry helper when reserving or committing stock so DbUpdateConcurrencyExceptions are retried and handled explicitly. Add InventoryReservationCommittedIntegrationEvent to announce committed reservations. Change IInventoryReservationService API to return SettledReservationLine lists from CommitAsync/ReleaseAsync (and add the SettledReservationLine type) and update InventoryReservationService to return the committed/released lines. Update functional tests to reflect the new return types and add coverage for payment committing reservations and published committed events. Release reservations on order cancellation Add support for releasing inventory when an order is cancelled. Introduces OrderStatusChangedToCancelledIntegrationEvent and InventoryReservationReleasedIntegrationEvent (with ReservationReleaseReason) plus a handler that releases holds via IInventoryReservationService, persists an outbox event, and publishes it. Registers the new subscription in Catalog API startup. Update Order aggregate to raise OrderCancelledDomainEvent when stock rejection leads to cancellation so holds are released and customers are notified. Add and extend tests: functional tests for cancellation scenarios (release, idempotency, after-payment behavior, availability to other orders) and unit tests for the order cancellation path. Add reservation expiry sweep and batch event save Introduce a background ReservationExpiryService that periodically finds and releases expired inventory holds for stalled orders. Add InventoryReservationExpiredIntegrationEvent and a new ICatalogIntegrationEventService.SaveEventsAndCatalogContextChangesAsync to persist multiple integration events atomically with catalog changes. Implement GetExpiredOrderIdsAsync in IInventoryReservationService and InventoryReservationService to enumerate lapsed orders for sweeping. Update CatalogIntegrationEventService to support saving and logging multiple events in a single resilient transaction. The change ensures expired releases and their expiry notifications are saved together and published reliably so orders don't hold stock indefinitely. Create inventory-reservation-status.md Revert "Add model to catalog item" This reverts commit 7eb03a9. Add model to catalog item Add new field model to catalog item Add mock data for catalog items model Add model support to catalog and facets Introduce a first-class "Model" field across the catalog stack. Adds a DB migration (AddCatalogItemModel), entity configuration (max length + index), and Model property on CatalogItem. API changes: GetAllItems and GetCatalogFacets accept model filters; faceting now returns per-model counts and a model total; OpenAPI specs updated. Client and service updates propagate model query parameters and include model in CatalogResult/CatalogItem DTOs; UI components (Web/Hybrid/ClientApp) display model values and expose a model facet that is shown only when a brand is selected (and cleared when the brand is cleared). CatalogAI indexing now includes model. Tests: new Playwright e2e test and multiple functional tests verify model filtering and facets. Small routing/config updates were made to include the new test in Playwright runs.
This reverts commit 39d4042.
Author
|
Sorry, opened this by mistake |
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.