Steve Yegge
d5239eeef9
Refactor: Extract duplicated validation logic to internal/validation
...
Extracted repeated priority and ID validation patterns from CLI commands
into reusable functions in internal/validation/bead.go.
Changes:
- Added ValidatePriority(): Combines parsing and error handling
- Added ValidateIDFormat(): Validates ID format and extracts prefix
- Added ValidatePrefix(): Validates prefix matching with database config
- Updated create.go and show.go to use new validation functions
- Simplified force flag logic to always call ValidatePrefix()
- Added comprehensive tests for all validation functions
- Added TODO comment for daemon mode validation enhancement
Results:
- Reduced code duplication by ~20 lines
- Centralized validation logic for easier maintenance
- Consistent error messages across all commands
- All tests passing
Fixes bd-g5p7
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-20 20:39:23 -05:00
..
2025-11-20 19:37:01 -05:00
2025-11-12 10:48:36 -08:00
2025-11-09 14:58:03 -08:00
2025-11-04 00:23:25 -08:00
2025-11-08 18:16:39 -08:00
2025-11-20 20:21:37 -05:00
2025-11-07 22:06:50 -08:00
2025-11-20 19:11:27 -05:00
2025-11-03 22:23:36 -08:00
2025-11-03 22:23:36 -08:00
2025-11-17 10:12:46 -07:00
2025-11-04 23:12:42 -08:00
2025-11-20 20:39:23 -05:00
2025-11-05 20:39:47 -08:00
2025-11-06 20:14:34 -08:00
2025-11-05 21:04:00 -08:00
2025-11-07 21:17:24 -08:00
2025-11-05 10:26:58 -08:00
2025-11-07 18:57:43 -08:00
2025-11-07 21:29:22 -08:00
2025-11-05 20:39:47 -08:00
2025-11-07 18:57:43 -08:00
2025-11-07 18:57:43 -08:00
2025-11-10 10:22:03 -08:00
2025-11-05 20:39:47 -08:00
2025-11-20 19:00:36 -05:00
2025-11-19 05:06:12 -05:00
2025-11-05 20:39:47 -08:00
2025-11-05 20:39:47 -08:00
2025-11-05 20:39:47 -08:00
2025-11-20 08:13:06 -08:00
2025-11-19 05:07:16 -05:00
2025-11-20 08:13:06 -08:00
2025-11-08 03:10:12 -08:00
2025-11-08 02:20:33 -08:00
2025-11-15 12:52:34 -08:00
2025-11-08 18:16:39 -08:00
2025-11-18 05:20:11 -05:00
2025-11-20 19:37:01 -05:00
2025-11-05 19:16:50 -08:00
2025-11-05 10:26:58 -08:00
2025-11-19 05:06:12 -05:00
2025-11-07 20:07:59 -08:00
2025-11-05 14:31:41 -08:00
2025-11-19 05:06:12 -05:00
2025-11-20 19:11:27 -05:00
2025-11-05 20:39:47 -08:00
2025-11-09 14:53:59 -08:00
2025-11-17 10:06:35 -07:00
2025-11-17 10:12:46 -07:00
2025-11-19 05:06:12 -05:00
2025-11-09 14:53:59 -08:00
2025-11-06 13:01:44 -08:00
2025-11-08 00:00:43 -08:00
2025-11-20 19:00:36 -05:00
2025-11-08 02:28:54 -08:00
2025-11-17 10:06:35 -07:00
2025-11-17 10:12:46 -07:00
2025-11-17 10:06:35 -07:00
2025-11-05 19:04:14 -08:00
2025-11-09 14:13:48 -08:00
2025-11-20 19:24:26 -05:00
2025-11-05 18:10:06 -08:00
2025-11-06 20:00:08 -08:00
2025-11-08 01:32:13 -08:00
2025-11-08 13:09:42 -08:00
2025-11-15 12:46:13 -08:00
2025-11-20 19:11:27 -05:00
2025-11-20 20:24:36 -05:00
2025-11-15 12:52:34 -08:00
2025-11-20 19:01:30 -05:00
2025-11-20 19:01:30 -05:00
2025-11-17 10:12:46 -07:00
2025-11-08 18:16:39 -08:00
2025-11-09 14:53:59 -08:00
2025-11-09 14:53:59 -08:00
2025-11-17 11:32:37 -07:00
2025-11-17 11:32:37 -07:00
2025-11-17 10:12:46 -07:00
2025-11-06 20:00:08 -08:00
2025-11-04 23:12:41 -08:00
2025-11-04 11:25:36 -08:00
2025-11-12 10:48:36 -08:00
2025-11-20 20:39:23 -05:00
2025-11-17 10:12:46 -07:00
2025-11-06 18:49:07 -08:00
2025-11-17 10:12:46 -07:00
2025-11-09 16:16:45 -08:00
2025-11-05 18:10:06 -08:00
2025-11-19 05:06:12 -05:00
2025-11-07 21:58:22 -08:00
2025-11-04 01:10:18 -08:00
2025-11-08 13:09:42 -08:00
2025-11-05 17:37:53 -08:00
2025-11-16 18:10:46 -07:00
2025-11-08 18:22:28 -08:00
2025-11-05 21:04:00 -08:00