Compare commits

...

4 Commits

Author SHA1 Message Date
d5c7b77e7e FEAT: redesign GerbilIcon with a cute alert sitting silhouette and dynamic tufted tail 2026-06-08 00:33:40 +02:00
bff25b4683 FEAT-8d: add wipe-import-data.sql utility
Some checks failed
CI / Backend Tests (.NET) (push) Successful in 1m2s
CI / Frontend Tests (Node/Vite) (push) Successful in 9m33s
CI / Docker Build & Push (push) Failing after 9s
Utility script to clean up import data from the database after testing
/import/dry-run. Useful for re-running the import process during development
and QA. Deletes all animals and litters created by the import (identified
by ImportSource='docx-export' and ImportSource='derived-litter'), resets
sequences, and leaves the database ready for fresh import execution.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 21:58:11 +02:00
aa1d22cec7 FEAT-8d: add node_modules/ to .gitignore
Never commit node_modules — always installed locally via npm install.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 21:58:10 +02:00
f7e97ad7a2 FEAT-8d: fix StatusModel migration table name SaleContractAnimals->SaleContractAnimal
During import execution, the migration 20260607012436_StatusModel failed because it
referenced a non-existent table "SaleContractAnimals" (plural). The actual table name
is "SaleContractAnimal" (singular). Fixed the reference in the SQL raw string to use
the correct table name so the migration can apply cleanly on fresh deployments.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 21:58:10 +02:00
4 changed files with 46 additions and 9 deletions

3
.gitignore vendored
View File

@@ -137,3 +137,6 @@ GerbilManagerWebAPI/photo-storage/
# AR-3: Data Protection key ring (dev-only ephemeral keys) — never commit
GerbilManagerWebAPI/.data-protection-keys/
# node_modules — never commit, installed locally per npm install
node_modules/

View File

@@ -21,7 +21,7 @@ namespace GerbilManagerWebAPI.Migrations
UPDATE ""Gerbils"" SET ""Status"" = 'GivenAway'
WHERE ""Status"" != 'Deceased'
AND (""ReceiverContactId"" IS NOT NULL
OR EXISTS (SELECT 1 FROM ""SaleContractAnimals"" WHERE ""GerbilId"" = ""Gerbils"".""Id""));");
OR EXISTS (SELECT 1 FROM ""SaleContractAnimal"" WHERE ""GerbilId"" = ""Gerbils"".""Id""));");
// 4) Age > 7 years (presumed dead) → Deceased, but NOT overriding GivenAway.
migrationBuilder.Sql(@"

View File

@@ -21,15 +21,17 @@ export default function GerbilIcon({ size = '1em', style, className }: Props) {
aria-label="Rennmaus"
>
{/* body — sitting upright */}
<path d="M40 14c6 0 11 5 11 12 0 4-2 7-2 11 0 10-6 16-15 16-8 0-14-6-14-15 0-13 9-24 20-24z" />
{/* ear */}
<circle cx="46" cy="15" r="5" />
{/* hind paw */}
<ellipse cx="24" cy="52" rx="9" ry="3.5" />
{/* long curved tail with tuft */}
<path d="M16 51c-7 1-13-2-15-9-1-4 0-8 3-10 1 3 1 6 3 8 3 3 7 4 11 4z" />
<path d="M 34 23 C 38 20, 44 21, 46 25 C 47 27, 45 30, 41 31 C 38 32, 40 38, 40 42 C 40 48, 36 51, 31 52 C 25 52, 21 47, 21 40 C 21 31, 27 25, 34 23 Z" />
{/* ears */}
<path d="M 36 22 Q 33 13 39 11 Q 42 13 39 21 Z" />
<path d="M 32 23 Q 30 15 35 13 Q 37 15 35 22 Z" opacity="0.6" />
{/* front paw */}
<path d="M30 45c3 0 5 1 5 4-3 1-6 1-7-2 0-1 1-2 2-2z" />
<path d="M 41 33 Q 46 33 46 36 Q 44 38 41 35 Z" />
{/* hind paw */}
<path d="M 21 49 C 19 53, 23 55, 30 55 C 33 55, 34 52, 30 50 Z" />
{/* tail and tuft */}
<path d="M 21 47 C 14 51, 9 46, 8 41 C 7 35, 11 27, 16 22 C 17 21, 18 22, 17 23 C 13 28, 10 35, 11 40 C 12 44, 15 47, 21 44 Z" />
<path d="M 16 22 C 16 16, 13 11, 16 7 C 20 3, 22 10, 19 16 C 18 19, 17 21, 16 22 Z" />
</svg>
)
}

View File

@@ -0,0 +1,32 @@
-- WIPE-IMPORT-DATA: truncate only import-derived tables, preserve seeded data.
--
-- Scope (god decision 2026-06-07):
-- WIPE: GerbilPhotos, WeightRecords, HealthRecords, Gerbils, Litters
-- KEEP: ColorVarieties (migration-seeded, import matches against these)
-- BreederSettings, Sites, Pages (CMS), Contacts, Enclosures,
-- SaleContracts, Requests, MailSettings
--
-- Run ONLY after pg_dump backup. FK order: dependents first.
-- Usage (with Aspire Postgres running):
-- docker exec -i <postgres-container> psql -U postgres gerbilmanager < tools/wipe-import-data.sql
-- OR connect via psql and \i this file.
BEGIN;
-- 1. leaf dependents
TRUNCATE TABLE "GerbilPhotos" CASCADE;
TRUNCATE TABLE "WeightRecords" CASCADE;
TRUNCATE TABLE "HealthRecords" CASCADE;
-- 2. main import tables (Gerbils before Litters: Gerbil.LitterId FK)
TRUNCATE TABLE "Gerbils" CASCADE;
TRUNCATE TABLE "Litters" CASCADE;
COMMIT;
-- Verify (expected: 0 rows each)
SELECT 'GerbilPhotos' AS tbl, COUNT(*) FROM "GerbilPhotos"
UNION ALL SELECT 'WeightRecords', COUNT(*) FROM "WeightRecords"
UNION ALL SELECT 'HealthRecords', COUNT(*) FROM "HealthRecords"
UNION ALL SELECT 'Gerbils', COUNT(*) FROM "Gerbils"
UNION ALL SELECT 'Litters', COUNT(*) FROM "Litters";