From 03a29cf93cf867c0f89cbe28ca9d1efd5ed32711 Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 23 Jul 2026 14:40:02 +0000 Subject: [PATCH] Validate PLZ/Packstationnummer/Postnummer format at checkout, pick up invoice layout fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Native HTML5 pattern validation, mirroring the same rules the backend now enforces (Orders.ts/Customers.ts, same commit on that repo): PLZ digit count by country (5/DE, 4/AT+CH), Packstationnummer 1-3 digits, Postnummer 6-10 digits — catches the exact mix-up (long number in Packstationnummer, short number in Postnummer) found in a real order's data while investigating this. Client-side only for instant feedback; the backend re-validates regardless. Also bumps @einfach-produktiv/invoicing to pick up the invoice PDF layout fixes (centered footer, clustered summary rows, relocated paid badge, stacked Packstation/Postnummer address lines). --- app/checkout/components/CheckoutContent.tsx | 38 +++++++++++++++++++-- package-lock.json | 2 +- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/app/checkout/components/CheckoutContent.tsx b/app/checkout/components/CheckoutContent.tsx index 5044414..f7f7a0f 100644 --- a/app/checkout/components/CheckoutContent.tsx +++ b/app/checkout/components/CheckoutContent.tsx @@ -20,6 +20,19 @@ import { readCheckoutDraft, writeCheckoutDraft, clearCheckoutDraft } from "../.. import type { ShippingMethod, PaymentMethod, TrustBadge, ShippingSettings } from "../../lib/payload"; import type { CustomerProfile } from "../../lib/customerAuth"; +// Native HTML5 pattern validation (instant, no round-trip) mirroring the +// same rules Orders.ts/Customers.ts enforce server-side — a plausibility +// check, not the source of truth (the backend re-validates regardless of +// what a customer's browser did or didn't catch). Only Germany/Austria/ +// Switzerland are offered in the country