feat: Enhance reference value types management with validation rules and metadata
Deploy Development / deploy (push) Successful in 46s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s

- Updated the backend to include new fields for validation rules and metadata in reference value types.
- Enhanced the AdminReferenceValueTypesPage to support new validation rules for different data types.
- Improved the ProfileReferenceValuesPage to handle validation and metadata for profile reference values.
- Added API endpoint for fetching reference value metadata enums to support frontend validation.
- Refactored frontend forms to incorporate new fields and validation logic for a better user experience.
This commit is contained in:
Lars committed 2026-04-06 21:25:42 +02:00
1 parent f04318f76a
commit 45e4e64f15
9 files changed
+864 -137

No files matched your search

+1
View File
@@ -42,6 +42,7 @@ export const api = {
// Persönliche Referenzwerte (Profil, historisch)
listReferenceValueTypes: () => req('/reference-value-types'),
listReferenceValueMetaEnums: () => req('/reference-value-meta/enums'),
listProfileReferenceValues: (typeKey) =>
req(`/profile-reference-values?type_key=${encodeURIComponent(typeKey)}`),
createProfileReferenceValue: (d) => req('/profile-reference-values', json(d)),
+49
View File
@@ -0,0 +1,49 @@
/** Labels für Referenzwert-Metadaten (Erfassung). */
export const REF_SOURCE_LABELS = {
manual_user: 'Manuell (Nutzer)',
manual_admin: 'Manuell (Admin)',
import_device: 'Import Gerät',
import_app: 'Import App',
derived_system: 'Abgeleitet (System)',
estimated_system: 'Geschätzt (System)',
test_entry: 'Testeintrag',
}
export const REF_METHOD_LABELS = {
direct_measurement: 'Direkte Messung',
lab_test: 'Labortest',
field_test: 'Feldtest',
questionnaire: 'Fragebogen',
formula_estimation: 'Formel-Schätzung',
trend_analysis: 'Trendanalyse',
device_algorithm: 'Geräte-Algorithmus',
manual_assessment: 'Manuelle Einschätzung',
imported_external: 'Extern importiert',
unknown: 'Unbekannt',
}
export const REF_CONFIDENCE_LABELS = {
high: 'Hoch',
medium: 'Mittel',
low: 'Niedrig',
unknown: 'Unbekannt',
}
export function labelSource(k) {
return REF_SOURCE_LABELS[k] || k || '–'
}
export function labelMethod(k) {
return REF_METHOD_LABELS[k] || k || '–'
}
export function labelConfidence(k) {
return REF_CONFIDENCE_LABELS[k] || k || '–'
}
export const VALUE_DATA_TYPE_LABELS = {
integer: 'Ganzzahl',
decimal: 'Dezimalzahl',
percentage: 'Prozent',
text: 'Text',
enum: 'Auswahl (ENUM)',
}