The municipalities now come with their postal codes, so the lookup from
postal code works on a new company without loading anything. GeoNames
(CC BY 4.0) lists places rather than municipalities: a postal code goes
to a municipality only when the name and the province abbreviation match
exactly one of them (the name alone within Sardinia, whose abbreviations
changed), which covers 7,750 of 7,894 municipalities; the rest are mostly
renamed or merged ones that users complete by hand.
tools/Khaemhat.PlacesTool rebuilds both lists from the ISTAT sheet and
the GeoNames file, framework only, so the yearly update is repeatable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every later milestone stores its data through this layer, so it has to behave the same on both engines and be safe
by construction:
- Khaemhat.Data: explicit entity maps, typed queries over a safe expression subset, SqlFragment where every
interpolated value becomes a parameter, unit of work with transactions, repositories with audit columns and
optimistic concurrency on row_version, retries on transient errors.
- SQLite provider (STRICT tables, WAL, exact decimals as integers scaled by 10^6, Unicode case-insensitive LIKE,
serialised writes) and PostgreSQL 16+ provider (numeric(19,6), timestamptz, jsonb, advisory locks, database
creation and server info). Databases are configured from postgres:// and sqlite:// URLs whose password never
appears in messages.
- C# migrations with system and company catalogues, schema_version with checksums, one transaction per migration
under a lock, refusal of unknown applied versions; first system tables sys_companies and sys_settings.
- CompanyRegistry stores each company's database URL encrypted with the instance key (AES-256-GCM, HKDF-derived key,
purpose as associated data), so a copied row cannot be read for another company.
- tools/Khaemhat.DataModelTool, scripts/gen-datamodel.sh and scripts/new-migration.sh: the current schema section of
docs/DATA-MODEL.md is generated from the migrations and a test fails when it is stale.
- C# 14 binds array.Contains to MemoryExtensions over spans; the query translator unwraps the span conversion.
- Tests run every data scenario on SQLite and PostgreSQL (PostgreSQL in CI); ADR 0018 records where the contracts
differ from SPEC 5.1. Docs, wiki, changelog and status updated.
Closes#7, #8, #9, #10, #11, #12, #13, #14
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start development with the skeleton every later milestone builds on, so
that code, image and release path exist and are verified from day one.
- Khaemhat.sln with the ten projects of SPEC section 3 and six MSTest
projects; shared build rules with warnings as errors, analyzers and
Central Package Management restricted to the allowlist.
- Architecture tests and scripts/check-packages.sh fail on any project
reference or package that SPEC does not allow.
- Khaemhat.Web serves an Italian "under construction" page with the
official icons and version, plus /health/live, /health/ready and
/health (ADR 0012); honours KHAEMHAT_URLS and KHAEMHAT_LOG_LEVEL.
- docker/Dockerfile (non-root app user aligned to PUID/PGID by the
entrypoint, pg_dump 17, healthcheck, OCI and Unraid labels) and
compose files for PostgreSQL and a standalone SQLite demo.
- Gitea Actions: ci.yml (build, tests, image smoke test, PostgreSQL
16/17 on tags, YAML check), release.yml (image and release from a
vX.Y.Z tag, skipping versions already published) and wiki.yml.
- Development scripts, VS Code launch/tasks for debugging, and ADR
0012-0017 deciding the M0 open points of docs/STATUS.md.
Closes#1, #2, #3, #4, #5, #114
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gitea flags en dash, multiplication sign, minus sign and single angle
quotes as confusable characters, which put a warning on most pages;
use plain equivalents (docs/SPEC.md stays untouched). STATUS.md now
lists the issue numbers per milestone, the items waiting for the owner
and the open specification questions tracked by issue #114.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Prepare everything needed before development starts on Khaemhat, the
ERP + CRM for Italian SMEs:
- docs/SPEC.md: the original project specification, unchanged, plus
CLAUDE.md with operational rules and amendments (Gitea instead of
GitHub/GHCR, Docker image as the only deliverable).
- ADR 0001-0011 for the baseline decisions.
- Mockups: 22 high-resolution screens, the full gallery, 88 thumbnails
cropped from it, mockup.css and an index.
- Technical docs (architecture, data model, modules, API, MCP, deploy,
security, development process, status with open spec questions).
- Full draft wiki in docs/wiki (already published to the Gitea wiki).
- Icons in assets/ and deploy files for Docker Compose and Unraid,
pointing to the Gitea package registry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>