Skip to content

feat!: modernize SDK contract, add CI tests, and improve migration docs#46

Merged
javorosas merged 11 commits intomainfrom
feat/v6-hardening-and-testing
Mar 31, 2026
Merged

feat!: modernize SDK contract, add CI tests, and improve migration docs#46
javorosas merged 11 commits intomainfrom
feat/v6-hardening-and-testing

Conversation

@javorosas
Copy link
Copy Markdown
Member

@javorosas javorosas commented Mar 30, 2026

Summary

  • switch IFacturapiClient to wrapper interfaces and update FacturapiClient accordingly
  • drop net452 and keep netstandard2.0, net6.0, and net8.0
  • add advanced factory FacturapiClient.CreateWithCustomHttpClient(...) (without expanding the public constructor)
  • harden wrappers (Retention.CancelAsync, StampDraftAsync + obsolete alias, null-safe query builder, ConfigureAwait(false) consistency)
  • add FacturapiTest regression suite and run tests in CI before NuGet publish
  • refresh README + CHANGELOG with migration-first guidance

Commits

  1. feat!: modernize client contract and runtime targets
  2. test(ci): add regression test project and run it before publish
  3. docs: prioritize migration guidance and update usage examples

Validation

  • dotnet restore
  • dotnet build facturapi-net.sln -c Release --no-restore
  • dotnet test FacturapiTest/FacturapiTest.csproj -c Release --no-build

Copy link
Copy Markdown
Contributor

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

This PR introduces a breaking v6 update for the Facturapi .NET SDK that modernizes the public contract (wrapper interfaces), updates supported target frameworks, adds a regression test suite to CI, and refreshes migration-focused documentation.

Changes:

  • Replace concrete wrapper types in IFacturapiClient/FacturapiClient with wrapper interfaces, and update wrappers to implement those interfaces.
  • Drop net452, add SourceLink/symbol packaging settings, and introduce an advanced factory for injecting a custom HttpClient.
  • Add FacturapiTest regression tests and run them in CI before packing/publishing; update README/CHANGELOG with v6 migration guidance.

Reviewed changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
facturapi-net.sln Adds test project to solution and new build configurations.
facturapi-net.csproj Drops net452, bumps version to 6.0.0, adds SourceLink/symbol settings, excludes test sources from library compilation.
Wrappers/WebhookWrapper.cs Implements IWebhookWrapper and adds ConfigureAwait(false) to internal awaits.
Wrappers/ToolWrapper.cs Implements IToolWrapper and adds ConfigureAwait(false) to internal awaits.
Wrappers/RetentionWrapper.cs Implements IRetentionWrapper, fixes retention list route name, hardens CancelAsync (token + shared error handling + disposal).
Wrappers/ReceiptWrapper.cs Implements IReceiptWrapper and adds ConfigureAwait(false) to internal awaits.
Wrappers/ProductWrapper.cs Implements IProductWrapper and adds ConfigureAwait(false) to internal awaits.
Wrappers/OrganizationWrapper.cs Implements IOrganizationWrapper and adds ConfigureAwait(false) to internal awaits.
Wrappers/InvoiceWrapper.cs Implements IInvoiceWrapper, introduces StampDraftAsync + obsolete legacy alias, adds ConfigureAwait(false) to internal awaits.
Wrappers/IWebhookWrapper.cs New interface to enable mocking/DI of webhook operations.
Wrappers/IToolWrapper.cs New interface to enable mocking/DI of tool operations.
Wrappers/IRetentionWrapper.cs New interface to enable mocking/DI of retention operations.
Wrappers/IReceiptWrapper.cs New interface to enable mocking/DI of receipt operations.
Wrappers/IProductWrapper.cs New interface to enable mocking/DI of product operations.
Wrappers/IOrganizationWrapper.cs New interface to enable mocking/DI of organization operations.
Wrappers/IInvoiceWrapper.cs New interface to enable mocking/DI of invoice operations (incl. legacy obsolete member).
Wrappers/ICustomerWrapper.cs New interface to enable mocking/DI of customer operations.
Wrappers/ICatalogWrapper.cs New interface to enable mocking/DI of catalog operations.
Wrappers/ICartaporteCatalogWrapper.cs New interface to enable mocking/DI of Carta Porte catalog operations.
Wrappers/CustomerWrapper.cs Implements ICustomerWrapper and adds ConfigureAwait(false) to internal awaits.
Wrappers/CatalogWrapper.cs Implements ICatalogWrapper and adds ConfigureAwait(false) to internal awaits.
Wrappers/CartaporteCatalogWrapper.cs Implements ICartaporteCatalogWrapper and adds ConfigureAwait(false) to internal awaits.
Wrappers/BaseWrapper.cs Ensures error-path content read uses ConfigureAwait(false).
Router/Router.cs Makes query-string building null/empty-safe and ignores empty keys.
Router/RetentionRouter.cs Renames ListRetentionss to ListRetentions.
README.md Adds v6 migration guidance and updates examples for async usage + custom HttpClient factory.
Properties/AssemblyInfo.cs Adds InternalsVisibleTo("FacturapiTest") to support testing internals.
IFacturapiClient.cs Switches wrapper properties from concrete wrappers to interfaces.
FacturapiTest/FacturapiTest.csproj Adds a net6 test project with xUnit.
FacturapiTest/ClientCompatibilityTests.cs Adds regression tests for query building, retention cancel error parsing, legacy stamp method, and custom HttpClient disposal behavior.
FacturapiClient.cs Updates public surface to wrapper interfaces; adds CreateWithCustomHttpClient and ownership-based disposal.
CHANGELOG.md Documents v6 breaking changes, migration guide, and notable fixes/additions.
.github/workflows/deploy.yml Runs dotnet test before packing/publishing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@javorosas javorosas merged commit 8fd389f into main Mar 31, 2026
3 checks passed
@javorosas javorosas deleted the feat/v6-hardening-and-testing branch March 31, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants