Skip to content

Colinofdutysophie1#408

Merged
andrewfraser73 merged 3 commits intomainfrom
colinofdutysophie1
Apr 17, 2026
Merged

Colinofdutysophie1#408
andrewfraser73 merged 3 commits intomainfrom
colinofdutysophie1

Conversation

@andrewfraser73
Copy link
Copy Markdown
Contributor

ability to cancel imports
fix a bug that Sophie spotted

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SupplierRepository that eagerly loads Country.

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.

Comment thread tests/Unit/Domain.LinnApps.Tests/ImportBookTests/WhenUpdating/WhenCancelling.cs Outdated
Comment thread src/Facade/ResourceBuilders/ImportBookResourceBuilder.cs
Comment thread src/Facade/Services/ImportBookFacadeService.cs
Comment thread src/Service.Host/client/src/components/imports/HistoryTab.js
Comment thread src/Persistence.LinnApps/Repositories/SupplierRepository.cs Outdated
@andrewfraser73 andrewfraser73 merged commit 7131ce5 into main Apr 17, 2026
2 checks passed
@andrewfraser73 andrewfraser73 deleted the colinofdutysophie1 branch April 17, 2026 11:52
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.

3 participants