Commit Graph

14 Commits

Author SHA1 Message Date
1b2fca85f8 [MCH-FE] feat: Connect Settings to real API
- Add settingsApi in lib/api.ts with get, update, getWhatsAppStatus,
  testWhatsApp and getSubscription endpoints
- Rewrite Settings.tsx to use React Query for data fetching
- Implement useQuery for loading settings and subscription data
- Implement useMutation for saving settings changes
- Add form state management with controlled inputs
- Add loading states, error handling and success notifications
- Add individual save buttons per section plus global save
- Add WhatsApp connection test functionality
- Display subscription details with token usage

Also includes exports API and export button components added by linter.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 02:34:59 -06:00
3ee915f001 [MCH-FE] refactor: Improve ThemeContext with useSyncExternalStore
- Replace useState+useEffect with useMemo for resolvedTheme
- Use useSyncExternalStore for tracking system theme changes
- Use useLayoutEffect for DOM mutations (applying dark class)
- Add useCallback and useMemo for performance optimization

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 02:28:26 -06:00
777693c7dd [MCH-FE] feat: Add dark mode theme support
- Add ThemeContext for system/light/dark theme management
- Update Layout with theme toggle button
- Add dark mode styles to components
- Update Tailwind config for dark mode support
- Add CSS transitions for smooth theme switching

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 02:27:08 -06:00
b1e75b8618 [MCH-FE] feat: Add PWA support with Vite plugin
- Install and configure vite-plugin-pwa
- Add manifest configuration for MiChangarrito
- Create SVG icons (192x192, 512x512) with MCH branding
- Add apple-touch-icon and favicon
- Update index.html with PWA meta tags
- Enable service worker with workbox for offline caching

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 02:26:58 -06:00
ad4ab40389 [MCH-FE] feat: Connect Fiado to real API
- Replace mock data with real API calls using React Query
- Add fiadosApi to lib/api.ts with all fiado endpoints
- Implement NewFiadoModal for creating fiados
- Implement PaymentModal for registering payments
- Add loading and error states
- Calculate stats dynamically from API data
- Show partial payment status and amount paid
- Display recent payments from actual payment records

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 02:16:15 -06:00
8199d622b1 [MCH-FE] feat: Connect Products to real API
Replace mock data with real API calls using React Query:
- useQuery for fetching products with category/search filters
- useMutation for create, update, and delete operations
- Add loading, error, and empty states
- Add create/edit modal with form validation
- Add delete confirmation modal
- Maintain existing UI structure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 02:15:31 -06:00
0385695d27 [MCH-FE] feat: Connect Inventory to real API
- Replace mock data with real API calls using React Query
- Add useQuery hooks for products, movements, low stock, and alerts
- Implement loading state with spinner
- Implement error state with retry button
- Add alerts banner for inventory warnings
- Add empty state messages for no data scenarios
- Add proper TypeScript interfaces for API responses

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 02:15:16 -06:00
969f8acb9a [MCH-FE] feat: Connect Customers to real API
- Replace mock data with React Query hooks
- Add CRUD operations (create/update customers)
- Add loading, error, and empty states
- Add modal for customer form
- Maintain existing UI structure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 02:15:12 -06:00
2c4db175c2 [MCH-FE] feat: Connect Dashboard to real API
Replace hardcoded mock data with TanStack Query hooks:
- dashboardApi.getStats() for stats cards (sales, orders, customers, fiado)
- ordersApi.getAll() for recent orders list
- inventoryApi.getLowStock() for low stock alerts

Add loading spinners and error states for each section.
Add TypeScript interfaces for API response types.
Add formatCurrency helper for MXN formatting.
Add Spanish labels for order status.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 02:15:04 -06:00
c8cf78e0db [MCH-FE] feat: Connect Orders to real API
- Replace mock data with useQuery for fetching orders from ordersApi
- Add useMutation for updating order status
- Implement loading state with spinner
- Add error state with retry button
- Add empty state when no orders found
- Show individual loading state on status update buttons

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 02:14:56 -06:00
00691fd1f7 [SPRINT-6] feat: Agregar paginas Tokens y CodiSpei
MCH-019 - Tienda de Tokens:
- Tokens.tsx con balance, paquetes y historial de uso
- Integracion con billingApi para checkout Stripe
- Visualizacion de costos por servicio

MCH-024 - CoDi/SPEI:
- CodiSpei.tsx con tabs CoDi y SPEI
- Generacion de QR CoDi para cobros
- Visualizacion de CLABE virtual
- Historial de transacciones

Actualizaciones:
- App.tsx: Rutas /tokens y /codi-spei
- Layout.tsx: Enlaces en navegacion
- api.ts: billingApi y subscriptionsApi

Sprint 6 - Frontend completado

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 04:32:43 -06:00
2ae94a679f fix: Corregir errores TypeScript y agregar dependencias i18n
- Agregar dependencias: i18next, react-i18next, i18next-browser-languagedetector
- Eliminar imports no utilizados (Search, Filter)
- Eliminar variables no utilizadas (refetch, generateCodeMutation)
- Renombrar params no usados con underscore (_supplier, _onRemove)

Build ahora pasa sin errores.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 05:21:30 -06:00
67d3eef6a5 Migración desde michangarrito/frontend - Estándar multi-repo v2
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 08:12:10 -06:00
663614c75e Initial commit 2026-01-16 14:05:46 +00:00