Battery QA — LMT, GS1 Digital Link, and form improvements
Quality assurance pass covering LMT battery template accuracy, GS1 Digital Link persistence, PDF export reliability, and form validation improvements across all five battery categories.
Added
-
Searchable dropdown for large field lists — select fields with more than fifteen options now render as searchable comboboxes. Operators can type to filter rather than scrolling through long lists. Particularly useful for country selection and material category fields.
-
ISO 3166-1 country coverage — all country fields across battery templates now offer the full list of 195 countries via the new searchable dropdown. Previously, some fields offered only EU member states or free-text input.
-
Schema drift detection in CI — the continuous integration pipeline now blocks pull requests that modify the database schema without including a corresponding migration file. This prevents schema drift between the codebase and the database.
-
GTIN-14 validation — product GTIN fields now enforce exactly 14 digits and check for uniqueness across the platform. Duplicate GTIN submission is rejected with a clear error.
-
Product edit status guard — products with a status of Approved or Deprecated can no longer be edited. Editing an approved DPP requires creating a new version, in line with Article 77 of the EU Battery Regulation.
Fixed
-
GS1 Digital Link not persisting — the GS1 Digital Link URI (the QR code URL in
/01/{GTIN}/21/{serial}format) was being generated correctly but was not being saved to the product record. Operators who subsequently regenerated a QR code would get a correctly formatted URL, but the stored value was never written. Now fixed — the URI is written to the product record at generation time. -
PDF export crash — the DPP PDF export was throwing a runtime error for products with certain field configurations. Root cause was an assumption that a specific field would always be an array — adding an array guard resolves the crash for all configurations.
-
Negative numbers in numeric fields — numeric DPP fields (capacity, cycle life, efficiency, etc.) were accepting negative values that are not physically meaningful. All numeric fields now enforce a minimum of zero by default, with specific field minimums applied where regulation requires.
-
Form validation not enforcing field rules — the DPP wizard schema validation was not applying field-level validation rules (pattern matching, minimum, maximum) defined in the template configuration. Field constraints are now correctly enforced on form submission.
-
Document status defaulting to Verified — newly uploaded documents were being tagged with a status of "Verified" rather than "Pending". Documents now correctly enter a Pending state and require explicit verification before being marked as verified.
-
500 errors on DPP pages — a missing database column introduced in a prior update was causing server errors on all DPP detail pages in the staging environment. The migration applying the column is now included correctly.
-
Country fields standardised — eight free-text country fields across all five battery category templates have been converted to ISO 3166-1 select dropdowns. This ensures country values in published DPPs are machine-readable and consistently formatted.