docs: add console system documentation and design docs
Console README with usage instructions, keybindings reference, architecture overview, and test commands. Updated root README with console section, updated architecture diagram, and installation instructions. Includes approved design doc and implementation plan. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
44
README.md
44
README.md
@@ -61,6 +61,15 @@ Autopartes/
|
|||||||
│ ├── dashboard.js # Lógica JavaScript
|
│ ├── dashboard.js # Lógica JavaScript
|
||||||
│ └── start_dashboard.sh # Script de inicio
|
│ └── start_dashboard.sh # Script de inicio
|
||||||
│
|
│
|
||||||
|
├── console/ # Consola Pick/VT220
|
||||||
|
│ ├── main.py # Punto de entrada
|
||||||
|
│ ├── db.py # Capa de datos abstracta
|
||||||
|
│ ├── core/ # Framework (app, screens, nav, keys)
|
||||||
|
│ ├── screens/ # 14 pantallas (menú, CRUD, búsqueda)
|
||||||
|
│ ├── renderers/ # VT220 (curses) y moderno (Rich)
|
||||||
|
│ ├── utils/ # Formato y API VIN
|
||||||
|
│ └── tests/ # 116 tests
|
||||||
|
│
|
||||||
├── vehicle_scraper/ # Herramientas de web scraping
|
├── vehicle_scraper/ # Herramientas de web scraping
|
||||||
│ ├── rockauto_scraper.py # Scraper RockAuto
|
│ ├── rockauto_scraper.py # Scraper RockAuto
|
||||||
│ ├── rockauto_scraper_v2.py # Scraper mejorado
|
│ ├── rockauto_scraper_v2.py # Scraper mejorado
|
||||||
@@ -73,6 +82,25 @@ Autopartes/
|
|||||||
└── QUICK_START.sh # Guía rápida de inicio
|
└── QUICK_START.sh # Guía rápida de inicio
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Consola Pick/VT220
|
||||||
|
|
||||||
|
Interfaz de terminal inspirada en los sistemas Pick/D3, 100% operada con teclado. Incluye dos modos de visualización:
|
||||||
|
|
||||||
|
- **VT220** (curses): Terminal clásica verde sobre negro con caracteres de caja
|
||||||
|
- **Modern** (Rich): Interfaz moderna con colores y estilos TUI
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Modo clásico VT220
|
||||||
|
python -m console
|
||||||
|
|
||||||
|
# Modo moderno
|
||||||
|
python -m console --mode modern
|
||||||
|
```
|
||||||
|
|
||||||
|
Funcionalidades: navegación por vehículo (marca→modelo→año→motor), búsqueda por número de parte, búsqueda full-text, decodificador VIN (NHTSA), catálogo por categorías, comparador OEM vs aftermarket, y administración CRUD completa.
|
||||||
|
|
||||||
|
116 tests automatizados. Ver [`console/README.md`](console/README.md) para documentación completa.
|
||||||
|
|
||||||
## Instalación
|
## Instalación
|
||||||
|
|
||||||
### Requisitos Previos
|
### Requisitos Previos
|
||||||
@@ -91,6 +119,7 @@ Autopartes/
|
|||||||
2. **Instalar dependencias**
|
2. **Instalar dependencias**
|
||||||
```bash
|
```bash
|
||||||
pip install flask requests beautifulsoup4 lxml
|
pip install flask requests beautifulsoup4 lxml
|
||||||
|
pip install rich # Opcional: para modo moderno de consola
|
||||||
```
|
```
|
||||||
|
|
||||||
3. **Inicializar la base de datos (opcional - ya incluye datos)**
|
3. **Inicializar la base de datos (opcional - ya incluye datos)**
|
||||||
@@ -110,7 +139,14 @@ python3 server.py
|
|||||||
|
|
||||||
El dashboard estará disponible en: `http://localhost:5000`
|
El dashboard estará disponible en: `http://localhost:5000`
|
||||||
|
|
||||||
### Usar la Interfaz CLI
|
### Iniciar la Consola Pick/VT220
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python -m console # Modo VT220 (clásico)
|
||||||
|
python -m console --mode modern # Modo moderno (Rich)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Usar la Interfaz CLI Legacy
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd vehicle_database/scripts
|
cd vehicle_database/scripts
|
||||||
@@ -275,9 +311,9 @@ engines ─┴─────────────┘
|
|||||||
│ │ │
|
│ │ │
|
||||||
v v v
|
v v v
|
||||||
┌─────────────────┐ ┌──────────────────┐ ┌──────────────────┐
|
┌─────────────────┐ ┌──────────────────┐ ┌──────────────────┐
|
||||||
│ Flask API │ │ CLI Interface │ │ CSV Importer │
|
│ Flask API │ │ Pick Console │ │ CSV Importer │
|
||||||
└────────┬────────┘ └──────────────────┘ └──────────────────┘
|
└────────┬────────┘ │ (VT220/Rich) │ └──────────────────┘
|
||||||
│
|
│ └──────────────────┘
|
||||||
v
|
v
|
||||||
┌─────────────────┐
|
┌─────────────────┐
|
||||||
│ Web Dashboard │
|
│ Web Dashboard │
|
||||||
|
|||||||
189
console/README.md
Normal file
189
console/README.md
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
# AUTOPARTES Console - Sistema Pick/VT220
|
||||||
|
|
||||||
|
Interfaz de consola para el catálogo de autopartes, inspirada en los sistemas Pick/D3 con estética de terminal VT220. Funciona 100% con teclado.
|
||||||
|
|
||||||
|
## Requisitos
|
||||||
|
|
||||||
|
- Python 3.8+
|
||||||
|
- SQLite 3 (incluido con Python)
|
||||||
|
- Paquete `rich` (solo para modo moderno)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pip install rich # Opcional, solo para --mode modern
|
||||||
|
```
|
||||||
|
|
||||||
|
## Inicio Rápido
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Modo VT220 (clásico, verde sobre negro)
|
||||||
|
python -m console
|
||||||
|
|
||||||
|
# Modo moderno (Rich/TUI con colores)
|
||||||
|
python -m console --mode modern
|
||||||
|
|
||||||
|
# Especificar base de datos
|
||||||
|
python -m console --db /ruta/a/vehicle_database.db
|
||||||
|
|
||||||
|
# Ver versión
|
||||||
|
python -m console --version
|
||||||
|
```
|
||||||
|
|
||||||
|
## Modos de Visualización
|
||||||
|
|
||||||
|
### VT220 (por defecto)
|
||||||
|
- Terminal clásica verde sobre negro
|
||||||
|
- Caracteres de dibujo de cajas (box-drawing)
|
||||||
|
- Compatible con cualquier terminal
|
||||||
|
- Usa la librería `curses` (incluida en Python)
|
||||||
|
|
||||||
|
### Modern
|
||||||
|
- Interfaz moderna con colores y estilos Rich
|
||||||
|
- Tema azul/cian
|
||||||
|
- Requiere `pip install rich`
|
||||||
|
- Si `rich` no está instalado, cae automáticamente a modo VT220
|
||||||
|
|
||||||
|
## Menú Principal
|
||||||
|
|
||||||
|
```
|
||||||
|
╔══════════════════════════════════════╗
|
||||||
|
║ AUTOPARTES v1.0.0 ║
|
||||||
|
║ Sistema de Catalogo de Autopartes ║
|
||||||
|
╠══════════════════════════════════════╣
|
||||||
|
║ 1. Buscar por Vehiculo ║
|
||||||
|
║ 2. Buscar por Numero de Parte ║
|
||||||
|
║ 3. Buscar por Texto ║
|
||||||
|
║ 4. Decodificar VIN ║
|
||||||
|
║ 5. Catalogo por Categoria ║
|
||||||
|
║ ────────────────────────── ║
|
||||||
|
║ 6. Admin: Partes ║
|
||||||
|
║ 7. Admin: Fabricantes ║
|
||||||
|
║ 8. Admin: Referencias Cruzadas ║
|
||||||
|
║ 9. Import/Export ║
|
||||||
|
║ ────────────────────────── ║
|
||||||
|
║ S. Estadisticas del Sistema ║
|
||||||
|
║ 0. Salir ║
|
||||||
|
╚══════════════════════════════════════╝
|
||||||
|
```
|
||||||
|
|
||||||
|
## Teclas de Función
|
||||||
|
|
||||||
|
| Tecla | Acción |
|
||||||
|
|-------|--------|
|
||||||
|
| `0-9` | Seleccionar opción del menú / saltar a campo |
|
||||||
|
| `ENTER` | Confirmar selección |
|
||||||
|
| `ESC` | Regresar / Cancelar |
|
||||||
|
| `F1` | Ayuda / Lista de búsqueda |
|
||||||
|
| `F2` | Modo edición |
|
||||||
|
| `F3` | Buscar |
|
||||||
|
| `F4` | Referencias cruzadas |
|
||||||
|
| `F5` | Refrescar |
|
||||||
|
| `F6` | Vehículos relacionados |
|
||||||
|
| `F9` | Guardar |
|
||||||
|
| `F10` | Menú principal |
|
||||||
|
| `TAB` / `↓` | Siguiente campo |
|
||||||
|
| `↑` | Campo anterior |
|
||||||
|
| `PgUp/PgDn` | Navegación por páginas |
|
||||||
|
| `←→` | Scroll horizontal (comparador) |
|
||||||
|
|
||||||
|
## Pantallas
|
||||||
|
|
||||||
|
### 1. Búsqueda por Vehículo
|
||||||
|
Navegación jerárquica: Marca → Modelo → Año → Motor.
|
||||||
|
Cada nivel muestra una lista filtrable con búsqueda incremental.
|
||||||
|
|
||||||
|
### 2. Búsqueda por Número de Parte
|
||||||
|
Campo de entrada para número de parte. Busca en partes OEM, aftermarket y referencias cruzadas.
|
||||||
|
|
||||||
|
### 3. Búsqueda por Texto
|
||||||
|
Búsqueda full-text (FTS5) en nombres y descripciones de partes con resultados paginados.
|
||||||
|
|
||||||
|
### 4. Decodificador VIN
|
||||||
|
Ingresa un VIN de 17 caracteres. Consulta la API de NHTSA (con caché de 30 días) y muestra información del vehículo.
|
||||||
|
|
||||||
|
### 5. Catálogo por Categoría
|
||||||
|
Navega: Categorías → Grupos → Partes, independiente de la selección de vehículo.
|
||||||
|
|
||||||
|
### 6-9. Administración
|
||||||
|
- **Partes**: CRUD completo de partes OEM
|
||||||
|
- **Fabricantes**: CRUD de fabricantes aftermarket
|
||||||
|
- **Referencias Cruzadas**: CRUD de referencias cruzadas entre partes
|
||||||
|
- **Import/Export**: Importar CSV, exportar JSON
|
||||||
|
|
||||||
|
### Detalle de Parte
|
||||||
|
Vista completa de la parte con alternativas aftermarket. F4 para referencias cruzadas, F6 para vehículos compatibles.
|
||||||
|
|
||||||
|
### Comparador
|
||||||
|
Columnas lado a lado: OEM vs alternativas aftermarket con barras de calidad, porcentaje de ahorro y scroll horizontal.
|
||||||
|
|
||||||
|
### Estadísticas
|
||||||
|
Dashboard con contadores de la base de datos (marcas, modelos, partes, etc.) y métricas de cobertura.
|
||||||
|
|
||||||
|
## Arquitectura
|
||||||
|
|
||||||
|
```
|
||||||
|
console/
|
||||||
|
├── main.py # Punto de entrada, --mode vt220|modern
|
||||||
|
├── config.py # Configuración (DB, colores, paginación)
|
||||||
|
├── db.py # Capa de datos abstracta (SQLite)
|
||||||
|
│
|
||||||
|
├── core/
|
||||||
|
│ ├── app.py # Controlador principal
|
||||||
|
│ ├── screens.py # Clase base Screen
|
||||||
|
│ ├── navigation.py # Pila de navegación y breadcrumbs
|
||||||
|
│ └── keybindings.py # Constantes de teclas y registro
|
||||||
|
│
|
||||||
|
├── screens/
|
||||||
|
│ ├── menu_principal.py # Menú principal (12 opciones)
|
||||||
|
│ ├── vehiculo_nav.py # Drill-down: marca → modelo → año → motor
|
||||||
|
│ ├── buscar_parte.py # Búsqueda por número de parte
|
||||||
|
│ ├── buscar_texto.py # Búsqueda full-text (FTS)
|
||||||
|
│ ├── vin_decoder.py # Decodificador VIN (API NHTSA)
|
||||||
|
│ ├── catalogo.py # Categorías → grupos → partes
|
||||||
|
│ ├── parte_detalle.py # Detalle con alternativas
|
||||||
|
│ ├── comparador.py # Comparador OEM vs aftermarket
|
||||||
|
│ ├── estadisticas.py # Dashboard de estadísticas
|
||||||
|
│ ├── admin_partes.py # CRUD partes
|
||||||
|
│ ├── admin_fabricantes.py # CRUD fabricantes
|
||||||
|
│ ├── admin_crossref.py # CRUD referencias cruzadas
|
||||||
|
│ └── admin_import.py # Import/Export CSV/JSON
|
||||||
|
│
|
||||||
|
├── renderers/
|
||||||
|
│ ├── base.py # Interfaz abstracta BaseRenderer
|
||||||
|
│ ├── curses_renderer.py # Modo VT220 (curses)
|
||||||
|
│ └── textual_renderer.py # Modo moderno (Rich)
|
||||||
|
│
|
||||||
|
├── utils/
|
||||||
|
│ ├── formatting.py # Formato de tablas, moneda, números
|
||||||
|
│ └── vin_api.py # Cliente API NHTSA
|
||||||
|
│
|
||||||
|
└── tests/
|
||||||
|
├── test_db.py # 36 tests - capa de datos
|
||||||
|
├── test_core.py # 31 tests - keybindings, navigation, screens
|
||||||
|
├── test_utils.py # 30 tests - utilidades de formato
|
||||||
|
└── test_integration.py # 19 tests - integración con MockRenderer
|
||||||
|
```
|
||||||
|
|
||||||
|
## Tests
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Ejecutar todos los tests (116 total)
|
||||||
|
python -m pytest console/tests/ -v
|
||||||
|
|
||||||
|
# Ejecutar por módulo
|
||||||
|
python -m pytest console/tests/test_db.py -v
|
||||||
|
python -m pytest console/tests/test_core.py -v
|
||||||
|
python -m pytest console/tests/test_utils.py -v
|
||||||
|
python -m pytest console/tests/test_integration.py -v
|
||||||
|
```
|
||||||
|
|
||||||
|
## Capa de Datos
|
||||||
|
|
||||||
|
La clase `Database` en `db.py` abstrae todas las consultas SQL. Diseñada para migrar de SQLite a PostgreSQL cambiando solo la implementación interna.
|
||||||
|
|
||||||
|
Métodos principales:
|
||||||
|
- `get_brands()`, `get_models()`, `get_years()`, `get_engines()`
|
||||||
|
- `get_categories()`, `get_groups()`, `get_parts()`
|
||||||
|
- `get_part()`, `get_alternatives()`, `get_cross_references()`
|
||||||
|
- `search_parts()`, `search_part_number()`
|
||||||
|
- `decode_vin()`, `get_stats()`
|
||||||
|
- Métodos CRUD para administración
|
||||||
198
docs/plans/2026-02-14-pick-console-design.md
Normal file
198
docs/plans/2026-02-14-pick-console-design.md
Normal file
@@ -0,0 +1,198 @@
|
|||||||
|
# Pick-Style Console System - Design Document
|
||||||
|
|
||||||
|
**Date:** 2026-02-14
|
||||||
|
**Status:** Approved
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Console-based autoparts catalog system inspired by Pick/D3 operating systems with VT220 terminal aesthetics. Runs entirely from keyboard in a real terminal (CLI), with two selectable rendering modes: classic VT220 (curses) and modern TUI (textual).
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- **Platform:** Real CLI terminal (Python), no web browser
|
||||||
|
- **Users:** Sales counter staff AND warehouse/admin personnel
|
||||||
|
- **Style:** Pick-inspired with ANSI colors, box drawing, formatted tables
|
||||||
|
- **Data:** Abstract DB layer (SQLite today, PostgreSQL migration planned)
|
||||||
|
- **Renderers:** Two modes selectable via `--mode vt220|modern`
|
||||||
|
- **Input:** 100% keyboard-driven with F-keys, menus, and incremental search
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
```
|
||||||
|
┌─────────────────────────────────────┐
|
||||||
|
│ Capa de Presentación │
|
||||||
|
│ ┌──────────┐ ┌───────────────┐ │
|
||||||
|
│ │ curses │ │ textual │ │
|
||||||
|
│ │ (VT220) │ │ (moderno) │ │
|
||||||
|
│ └─────┬─────┘ └──────┬────────┘ │
|
||||||
|
│ └────────┬────────┘ │
|
||||||
|
│ Interface común │
|
||||||
|
├─────────────────────────────────────┤
|
||||||
|
│ Capa de Lógica / Screens │
|
||||||
|
│ Menús, Navegación, Formularios, │
|
||||||
|
│ Búsqueda, CRUD │
|
||||||
|
├─────────────────────────────────────┤
|
||||||
|
│ Capa de Datos (DB) │
|
||||||
|
│ SQLite hoy → PostgreSQL mañana │
|
||||||
|
└─────────────────────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
## File Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
console/
|
||||||
|
├── main.py # Entry point, --mode vt220|modern
|
||||||
|
├── config.py # DB path, colors, key mappings
|
||||||
|
├── db.py # Abstract DB layer (SQLite/PostgreSQL)
|
||||||
|
│
|
||||||
|
├── core/
|
||||||
|
│ ├── screens.py # Screen base class
|
||||||
|
│ ├── widgets.py # Lista, Formulario, Tabla, Barra
|
||||||
|
│ ├── navigation.py # Screen stack, breadcrumb, history
|
||||||
|
│ └── keybindings.py # F-keys, ESC, TAB mappings
|
||||||
|
│
|
||||||
|
├── screens/
|
||||||
|
│ ├── menu_principal.py # Main menu (9 options + exit)
|
||||||
|
│ ├── vehiculo_nav.py # Drill-down: brand → model → year → engine
|
||||||
|
│ ├── buscar_parte.py # Search by part number
|
||||||
|
│ ├── buscar_texto.py # Full-text search (FTS)
|
||||||
|
│ ├── vin_decoder.py # VIN decoder (NHTSA API)
|
||||||
|
│ ├── catalogo.py # Categories → groups → parts
|
||||||
|
│ ├── parte_detalle.py # Part detail with alternatives
|
||||||
|
│ ├── comparador.py # OEM vs aftermarket comparison
|
||||||
|
│ ├── estadisticas.py # System statistics dashboard
|
||||||
|
│ ├── admin_partes.py # Parts CRUD
|
||||||
|
│ ├── admin_fabricantes.py # Manufacturers CRUD
|
||||||
|
│ ├── admin_crossref.py # Cross-references CRUD
|
||||||
|
│ └── admin_import.py # Import/Export CSV
|
||||||
|
│
|
||||||
|
├── renderers/
|
||||||
|
│ ├── curses_renderer.py # VT220 mode (curses)
|
||||||
|
│ └── textual_renderer.py # Modern mode (textual/rich)
|
||||||
|
│
|
||||||
|
└── utils/
|
||||||
|
├── formatting.py # Table formatting, numbers, currency
|
||||||
|
└── vin_api.py # NHTSA VIN API client
|
||||||
|
```
|
||||||
|
|
||||||
|
## Screens
|
||||||
|
|
||||||
|
### Main Menu
|
||||||
|
- 9 numbered options + 0 to exit
|
||||||
|
- F-key bar at bottom
|
||||||
|
- Header with system name and version
|
||||||
|
|
||||||
|
### 1. Vehicle Navigation (Drill-Down)
|
||||||
|
- Sequential selection: Brand → Model → Year → Engine
|
||||||
|
- Each step shows filterable list with incremental search
|
||||||
|
- Arrow keys + ENTER to select, ESC to go back
|
||||||
|
- Leads to categories/groups/parts for selected vehicle
|
||||||
|
|
||||||
|
### 2. Part Number Search
|
||||||
|
- Single input field for part number
|
||||||
|
- Searches OEM, aftermarket, and cross-references
|
||||||
|
- Results show type, number, description, source
|
||||||
|
- Select result to see full detail
|
||||||
|
|
||||||
|
### 3. Text Search (FTS)
|
||||||
|
- Uses SQLite FTS5 full-text search
|
||||||
|
- Searches part names and descriptions
|
||||||
|
- Paginated results with relevance ranking
|
||||||
|
|
||||||
|
### 4. VIN Decoder
|
||||||
|
- Input 17-character VIN
|
||||||
|
- Calls NHTSA API (with cache)
|
||||||
|
- Shows decoded vehicle info
|
||||||
|
- Option to view compatible parts
|
||||||
|
|
||||||
|
### 5. Category Catalog
|
||||||
|
- Browse: Categories → Groups → Parts
|
||||||
|
- Independent of vehicle selection
|
||||||
|
|
||||||
|
### 6-9. Administration
|
||||||
|
- CRUD screens with Pick-style positional forms
|
||||||
|
- Numbered fields, TAB/arrow navigation
|
||||||
|
- F1 for lookup lists on foreign key fields
|
||||||
|
- F9 to save, ESC to cancel (with dirty check)
|
||||||
|
- Import/Export CSV with file path input
|
||||||
|
|
||||||
|
### 10. Part Detail
|
||||||
|
- Full part info in form layout (label.....: value)
|
||||||
|
- Aftermarket alternatives table below
|
||||||
|
- F4 for cross-references, F6 for vehicles
|
||||||
|
|
||||||
|
### 11. Part Comparator
|
||||||
|
- Side-by-side columns: OEM vs aftermarket alternatives
|
||||||
|
- Visual quality bars, savings percentage
|
||||||
|
- Cross-reference numbers at bottom
|
||||||
|
- Horizontal scroll if more than 3 columns
|
||||||
|
|
||||||
|
### 12. Statistics Dashboard
|
||||||
|
- Database counters (brands, models, parts, etc.)
|
||||||
|
- Coverage metrics (vehicles with parts, top brands)
|
||||||
|
- VIN cache status
|
||||||
|
|
||||||
|
## Key Bindings
|
||||||
|
|
||||||
|
| Key | Action |
|
||||||
|
|-----|--------|
|
||||||
|
| 0-9 | Select menu option / jump to field |
|
||||||
|
| ENTER | Confirm selection |
|
||||||
|
| ESC | Go back / Cancel |
|
||||||
|
| F1 | Help / Lookup list |
|
||||||
|
| F2 | Edit mode |
|
||||||
|
| F3 | Search |
|
||||||
|
| F4 | Cross-references |
|
||||||
|
| F5 | Refresh |
|
||||||
|
| F6 | Related vehicles |
|
||||||
|
| F9 | Save |
|
||||||
|
| F10 | Main menu |
|
||||||
|
| TAB / ↓ | Next field |
|
||||||
|
| ↑ | Previous field |
|
||||||
|
| PgUp/PgDn | Page navigation |
|
||||||
|
| ←→ | Scroll columns (comparator) |
|
||||||
|
|
||||||
|
## Data Layer
|
||||||
|
|
||||||
|
Abstract interface with two implementations:
|
||||||
|
|
||||||
|
```python
|
||||||
|
class Database:
|
||||||
|
def get_brands() -> list
|
||||||
|
def get_models(brand=None) -> list
|
||||||
|
def get_vehicles(brand, model, year, engine) -> list
|
||||||
|
def get_categories() -> list
|
||||||
|
def get_groups(category_id) -> list
|
||||||
|
def get_parts(group_id=None, mye_id=None) -> list
|
||||||
|
def get_part(part_id) -> dict
|
||||||
|
def get_alternatives(part_id) -> list
|
||||||
|
def get_cross_references(part_id) -> list
|
||||||
|
def search_parts(query) -> list
|
||||||
|
def search_part_number(number) -> list
|
||||||
|
def decode_vin(vin) -> dict
|
||||||
|
def get_stats() -> dict
|
||||||
|
# CRUD methods for admin...
|
||||||
|
```
|
||||||
|
|
||||||
|
SQLite implementation reads directly from `vehicle_database.db`. PostgreSQL implementation will use psycopg2 with same interface.
|
||||||
|
|
||||||
|
## Renderer Interface
|
||||||
|
|
||||||
|
```python
|
||||||
|
class Renderer:
|
||||||
|
def init_screen()
|
||||||
|
def clear()
|
||||||
|
def draw_header(title, subtitle)
|
||||||
|
def draw_footer(keys)
|
||||||
|
def draw_menu(items, selected)
|
||||||
|
def draw_table(headers, rows, page_info)
|
||||||
|
def draw_form(fields, focused_field)
|
||||||
|
def draw_detail(labels_values)
|
||||||
|
def draw_comparison(columns)
|
||||||
|
def draw_filter_list(items, filter_text, selected)
|
||||||
|
def draw_stats(data)
|
||||||
|
def get_key() -> key_event
|
||||||
|
def show_message(text, type) # info/error/confirm
|
||||||
|
```
|
||||||
|
|
||||||
|
Curses implementation uses box drawing chars, ANSI colors (green/amber on black). Textual implementation uses Rich widgets with modern styling.
|
||||||
1982
docs/plans/2026-02-14-pick-console-plan.md
Normal file
1982
docs/plans/2026-02-14-pick-console-plan.md
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user