Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds cancellation support for Import Books across the domain, API/resource layer, and UI, along with a related data-loading fix (supplier country) that avoids null reference issues.
Changes:
- Introduces import cancellation fields (
Cancelled,CancelledById/Name,CancelledReason) and domain cancellation behavior (ImportBook.Cancel,IsCancelled). - Wires cancellation through the API update path (module + facade) and exposes it in the UI (History tab).
- Replaces the generic supplier query repo with a custom
SupplierRepositorythat eagerly loadsCountry.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/Domain.LinnApps.Tests/ImportBookTests/WhenUpdating/WhenCancelling.cs | Adds a unit test asserting an import book becomes cancelled when updated with cancellation details. |
| src/Service/Modules/ImportBookModule.cs | Auto-populates CancelledById from the authenticated user when a cancel request is submitted. |
| src/Service.Host/client/src/components/imports/MainTab.js | Reorders invoice details section in the main import tab layout. |
| src/Service.Host/client/src/components/imports/HistoryTab.js | Adds a Cancel action and fields to display cancellation details/reason in the UI. |
| src/Resources/Imports/ImportBookResource.cs | Updates the import book API contract to include cancellation state and identity fields. |
| src/Persistence.LinnApps/ServiceDbContext.cs | Updates EF mapping for CancelledById and adds navigation mapping for CancelledBy. |
| src/Persistence.LinnApps/Repositories/SupplierRepository.cs | Adds a dedicated supplier query repository including Country. |
| src/IoC/PersistenceExtensions.cs | Registers SupplierRepository for IQueryRepository<Supplier>. |
| src/Facade/Services/ImportBookFacadeService.cs | Maps cancellation fields from resource into ImportUpdate and resolves cancelling employee. |
| src/Facade/ResourceBuilders/ImportBookResourceBuilder.cs | Shapes cancellation fields into the API resource and hardens supplier country shaping. |
| src/Domain.LinnApps/Imports/Models/ImportUpdate.cs | Adds CancelledBy and CancelledReason to the domain update model. |
| src/Domain.LinnApps/Imports/ImportBook.cs | Implements cancellation semantics (IsCancelled, Cancel) and triggers cancel via Update. |
lewisrenfrew
approved these changes
Apr 17, 2026
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.
ability to cancel imports
fix a bug that Sophie spotted