feat: guided import and export for parties, items, prices, opening stock and chart of accounts (#44)

Companies starting on Khaemhat need to bring their master data from another
system or a spreadsheet, and the chart of accounts has no Italian exchange
standard, so SPEC 12.12 asks for a guided wizard and an own layout.

- Administration > Import / export: CSV (separator and encoding guessed),
  XLSX (in-house reader, first sheet) and JSON, automatic column mapping with
  aliases, row-by-row check, error report, import confirmation and log entry.
- Rows go through PartyService, ItemService and PriceListService, so the
  import has exactly the rules, error codes and history of the forms; options
  cover existing and missing codes, VIES and city from postal code.
- Export writes the same columns as the import, plus empty templates.
- Opening stock and the chart of accounts (khaemhat-coa layout, natura, tipo,
  flag) are check-only until M6 and M7 add the ledgers to write into.
- PartyService.SaveAsync takes an explicit VIES switch for the import.
- ADR 0031, wiki Import-Export, CHANGELOG and STATUS updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-12 11:52:59 +01:00
1 parent 3dbbaba86e
commit caa33a2cee
29 files changed
+4783 -90

No files matched your search

@@ -147,6 +147,17 @@ internal static class KhaemhatServices
services.AddSingleton<Khaemhat.Application.Parties.PartyService>();
services.AddSingleton<Khaemhat.Application.Items.ItemService>();
services.AddSingleton<Khaemhat.Application.Items.PriceListService>();
// Guided import and export (ADR 0031): the entities in the order of the screen.
services.AddSingleton<Khaemhat.Application.ImportExport.IImportTarget>(sp => ActivatorUtilities.CreateInstance<Khaemhat.Application.ImportExport.PartiesImportTarget>(
sp, Khaemhat.Core.Parties.PartyKind.Customer));
services.AddSingleton<Khaemhat.Application.ImportExport.IImportTarget>(sp => ActivatorUtilities.CreateInstance<Khaemhat.Application.ImportExport.PartiesImportTarget>(
sp, Khaemhat.Core.Parties.PartyKind.Supplier));
services.AddSingleton<Khaemhat.Application.ImportExport.IImportTarget, Khaemhat.Application.ImportExport.ItemsImportTarget>();
services.AddSingleton<Khaemhat.Application.ImportExport.IImportTarget, Khaemhat.Application.ImportExport.PricesImportTarget>();
services.AddSingleton<Khaemhat.Application.ImportExport.IImportTarget, Khaemhat.Application.ImportExport.OpeningStockImportTarget>();
services.AddSingleton<Khaemhat.Application.ImportExport.IImportTarget, Khaemhat.Application.ImportExport.ChartOfAccountsImportTarget>();
services.AddSingleton<Khaemhat.Application.ImportExport.ImportService>();
services.AddSingleton<ExchangeRateService>();
services.AddHttpClient<EcbRatesClient>(c => c.Timeout = TimeSpan.FromSeconds(30));
services.AddHttpClient<ViesClient>(c => c.Timeout = TimeSpan.FromSeconds(20));