Allow medications with only a generic name (no commercial name required) (#311)
* Initial plan * feat: allow generic name only for medications (frontend changes) - Add getMedDisplayName() helper for consistent name display - Update validation to require either commercial or generic name - Update all display locations to use display name fallback - Add i18n keys for nameOrGenericRequired in en.json and de.json - Remove required attribute from commercial name field - Update FIELD_LIMITS.name.min from 1 to 0 Co-authored-by: DanielVolz <3275994+DanielVolz@users.noreply.github.com> * feat: allow generic name only for medications (backend changes) - Update Zod schema to allow empty name with cross-field refinement - Update reminder scheduler to use name || genericName for display - Update planner routes to match medications by display name - Update existing tests to match new validation behavior Co-authored-by: DanielVolz <3275994+DanielVolz@users.noreply.github.com> * fix: update placeholder text and fix FIELD_LIMITS test - Remove "(optional)" from generic name placeholder in en/de - Update types.test.ts to expect FIELD_LIMITS.name.min = 0 Co-authored-by: DanielVolz <3275994+DanielVolz@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: DanielVolz <3275994+DanielVolz@users.noreply.github.com>
This commit is contained in:
@@ -192,7 +192,7 @@
|
||||
},
|
||||
"placeholders": {
|
||||
"commercial": "z.B. Ozempic",
|
||||
"generic": "z.B. Semaglutid (optional)",
|
||||
"generic": "z.B. Semaglutid",
|
||||
"takenBy": "Name eingeben und Enter drücken",
|
||||
"addPerson": "Weitere Person hinzufügen...",
|
||||
"weight": "z.B. 240",
|
||||
@@ -436,6 +436,7 @@
|
||||
},
|
||||
"validation": {
|
||||
"required": "Dieses Feld ist erforderlich",
|
||||
"nameOrGenericRequired": "Handelsname oder Wirkstoff ist erforderlich",
|
||||
"maxLength": "Maximal {{max}} Zeichen ({{current}}/{{max}})",
|
||||
"tooLong": "{{current}}/{{max}} Zeichen"
|
||||
},
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
},
|
||||
"placeholders": {
|
||||
"commercial": "e.g. Ozempic",
|
||||
"generic": "e.g. Semaglutide (optional)",
|
||||
"generic": "e.g. Semaglutide",
|
||||
"takenBy": "Type name and press Enter",
|
||||
"addPerson": "Add another person...",
|
||||
"weight": "e.g. 240",
|
||||
@@ -436,6 +436,7 @@
|
||||
},
|
||||
"validation": {
|
||||
"required": "This field is required",
|
||||
"nameOrGenericRequired": "Either commercial name or generic name is required",
|
||||
"maxLength": "Maximum {{max}} characters ({{current}}/{{max}})",
|
||||
"tooLong": "{{current}}/{{max}} characters"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user