mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Ensure linked orders are marked as planned when deliveries are updated
Correctly update order status to 'planned' when a delivery is linked or edited in the calendar, addressing an issue where orders were not transitioning to the planned state. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 15f19c36-9aac-46a4-a181-3dc5f496fabd Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/15f19c36-9aac-46a4-a181-3dc5f496fabd/s75PPM5
This commit is contained in:
1 parent
20efd9251e
commit
9dbb5e0768
2 files changed
+70
-26
No files matched your search
@@ -3,7 +3,7 @@
|
||||
## Overview
|
||||
This platform is an enterprise weather management system with advanced multi-tenant logistics tracking and comprehensive order management capabilities. It provides robust delivery workflow management with enhanced reconciliation features, focusing on operational efficiency through detailed financial tracking, granular access controls, and sophisticated permission management.
|
||||
|
||||
**Business Vision & Market Potential:** The platform aims to streamline logistics and order fulfillment processes for businesses, improving efficiency and providing critical weather insights for operational planning. Its multi-tenant architecture makes it scalable for various enterprise sizes, offering a competitive edge in logistics management.
|
||||
The platform aims to streamline logistics and order fulfillment processes for businesses, improving efficiency and providing critical weather insights for operational planning. Its multi-tenant architecture makes it scalable for various enterprise sizes, offering a competitive edge in logistics management.
|
||||
|
||||
## User Preferences
|
||||
- Langue préférée : Français
|
||||
@@ -15,37 +15,34 @@ The platform is built with a clear separation of concerns, utilizing a modern fu
|
||||
|
||||
**UI/UX Decisions:**
|
||||
- Frontend uses React.js with custom UI components from `shadcn/ui` and styled with Tailwind CSS for a consistent and modern aesthetic.
|
||||
- The design emphasizes clean interfaces, responsive layouts for various screen sizes, and intuitive navigation.
|
||||
- Color schemes prioritize readability and user comfort, with an elegant gradient and shadow design for key elements like the weather widget.
|
||||
- The design emphasizes clean interfaces, responsive layouts, and intuitive navigation.
|
||||
- Color schemes prioritize readability and user comfort, with an elegant gradient and shadow design.
|
||||
- Calendar design is modern, with clean lines, clear separations, color-coded days, and a modal system for daily events.
|
||||
|
||||
**Technical Implementations & Design Patterns:**
|
||||
- **Frontend:** React.js for building interactive user interfaces. State management is handled efficiently with React Query for data fetching, caching, and synchronization.
|
||||
- **Frontend:** React.js for interactive user interfaces, with React Query for data fetching and state management.
|
||||
- **Backend:** Node.js Express (ESM) provides a robust API layer. Data validation is performed using Zod schemas.
|
||||
- **Database:** PostgreSQL is used as the primary data store, with Drizzle ORM facilitating interaction. Database migrations ensure schema consistency.
|
||||
- **Authentication:** Secure role-based access control (RBAC) is implemented for granular permissions.
|
||||
- **Multi-tenancy:** The system supports multi-tenant operations with group and permission management.
|
||||
- **Module for Backup:** An integrated PostgreSQL backup manager allows manual and scheduled backups, with tracking in a `DATABASE_BACKUPS` table. **PRODUCTION FIX (Août 2025)** : Correction critique du système de sauvegarde automatique en production - le service de sauvegarde n'était pas initialisé dans `index.production.ts`, empêchant la planification automatique quotidienne à 2h00. Fix appliqué avec import du service et configuration Docker complète (répertoire `/app/backups`, variables d'environnement, volumes persistants).
|
||||
- **Error Handling:** Robust error management ensures graceful degradation and informative logging, especially for production environments. API responses are logged conditionally to reduce console clutter in production.
|
||||
- **Data Synchronization:** Logic is implemented to ensure data consistency between development (in-memory storage) and production (PostgreSQL) environments, particularly for order status and relationships.
|
||||
- **Database:** PostgreSQL as the primary data store, with Drizzle ORM facilitating interaction and database migrations ensuring schema consistency.
|
||||
- **Authentication:** Secure role-based access control (RBAC) for granular permissions.
|
||||
- **Multi-tenancy:** Supports multi-tenant operations with group and permission management, ensuring data isolation between stores/groups.
|
||||
- **Backup System:** Integrated PostgreSQL backup manager for manual and scheduled backups.
|
||||
- **Error Handling:** Robust error management for graceful degradation and informative logging.
|
||||
- **Data Synchronization:** Logic ensures data consistency between development (in-memory storage) and production (PostgreSQL) environments.
|
||||
- **Caching:** Robust caching system for invoice verification results with automatic expiration, conflict resolution, and in-memory/database storage.
|
||||
|
||||
**Feature Specifications:**
|
||||
- **Weather Integration:** A comprehensive, modern weather interface displays detailed weather conditions sourced directly from the Visual Crossing API with French language support. Features intelligent date comparison using the same day of the week from the previous year for more relevant weather pattern analysis (e.g., Friday August 15, 2025 vs Friday August 16, 2024). Enhanced with automatic geolocation detection moved to weather settings utility page for better UX organization. Fixed critical production error by removing unused toast dependencies from weather widget (August 2025).
|
||||
- **Weather Integration:** A comprehensive weather interface displaying detailed conditions from the Visual Crossing API, with French language support, intelligent date comparison, and automatic geolocation detection.
|
||||
- **Order and Delivery Management:** Full CRUD operations for orders and deliveries, including linking orders to deliveries and managing their statuses.
|
||||
- **Reconciliation:** Functionality for reconciling Bills of Lading (BL) and invoices with immediate UI updates.
|
||||
- **Invoice Verification Cache:** Robust caching system for invoice verification results with automatic expiration and conflict resolution. Enhanced with unique constraint handling and graceful error management for production stability (August 2025). Fixed production SSL certificate errors and fetch timeout loops with enhanced error handling, network timeout protection, and error result caching to prevent infinite retry loops (August 2025). **MAJOR BUG FIX (August 2025)**: Resolved critical cache system failure - MemStorage was returning `undefined` for all cache lookups, preventing cache functionality entirely. Implemented working in-memory cache with Map-based storage and expiration logic. Fixed development mode to properly save verification results to cache. Added comprehensive cache operation logging for debugging. Verified complete cache workflow: miss → save → hit cycle working perfectly. **CRITICAL PRODUCTION FIX (August 2025)**: Fixed DatabaseStorage cache expiration bug - production was returning expired cache entries instead of checking expiration dates, causing repeated API calls despite existing cache. Added proper expiration verification and automatic cleanup of expired cache entries in PostgreSQL, matching MemStorage behavior.
|
||||
- **UI Scrollbar Optimization:** Eliminated redundant vertical scrollbar on the right side of the screen while preserving necessary internal page scrolling. Implemented global CSS rules with `overflow: hidden` on html/body/root and Layout height management to prevent vertical overflow issues in production (August 2025).
|
||||
- **Task Management:** Système complet de gestion des tâches avec fonctionnalités temporelles avancées - tri intelligent (pending > priorité > date), dates d'échéance avec sélecteur calendrier, indicateurs visuels pour tâches en retard/urgentes, filtres par échéance (aujourd'hui, cette semaine, en retard, sans échéance), vue Kanban et liste, badges colorés pour statut temporel. Interface optimisée pour suivi prioritaire des tâches non validées. Correction critique de l'isolation des données : chaque magasin ne voit maintenant que ses propres tâches (Août 2025). **PRODUCTION FIX (Août 2025)** : Résolution du problème de rechargements multiples nécessaires pour l'administrateur - le cache des tâches s'invalide maintenant automatiquement lors du changement de magasin sélectionné. **SÉLECTION DATE ÉCHÉANCE FIX (Août 2025)** : Correction du problème empêchant la sélection de dates d'échéance autres que le jour courant - suppression de la restriction `disabled` dans le calendrier, uniformisation du format d'envoi des dates, et alignement du schéma Drizzle (date au lieu de timestamp) avec la structure PostgreSQL production. **DATES DE DÉPART IMPLÉMENTÉES (Août 2025)** : Système complet de dates de départ avec logique de visibilité basée sur les rôles - Managers/Employés ne voient les tâches qu'à partir de leur date de départ, Admin/Directeur voient toutes les tâches avec styles visuels différents pour les tâches futures (fond gris, bordures pointillées, texte italique, badge "Future"). Interface utilisateur refonte complète avec NewTaskForm.tsx présentant clairement les deux dates (📅 départ, ⏰ échéance) avec règles de validation et explications des rôles de visibilité. **DESIGN ANGULAR (Août 2025)** : Suppression de tous les angles arrondis dans le formulaire de création/édition de tâches (NewTaskForm.tsx) - design plus épuré avec bordures droites pour un aspect plus professionnel. **FIX PRODUCTION (Août 2025)** : Correction du champ "Assigné à" qui avait par défaut "admin" en production (Tasks.tsx ligne 283) - maintenant vide par défaut comme attendu. Suppression complète des angles arrondis dans tous les composants de formulaires et modales (`rounded-none` ajouté aux Dialog, `borderRadius: '0px'` dans TaskFormInline). **UX AMÉLIORATION (Août 2025)** : Suppression du bouton "Annuler" redondant en haut du modal de création/modification des tâches - conservation uniquement du bouton en bas pour une interface plus épurée. **FIX CRITIQUE FILTRAGE GROUPES (Août 2025)** : Résolution définitive du problème de filtrage des groupes pour directeurs et managers - quand aucun groupe spécifique n'est sélectionné, les APIs renvoient maintenant un résultat vide au lieu d'afficher les données de tous les groupes assignés. Force la sélection explicite d'un groupe pour éviter l'affichage erroné de données multiples après rechargement de page. Ajout du sélecteur de groupe dans l'interface pour directeurs/managers avec auto-sélection si un seul groupe disponible.
|
||||
- **Information System (Announcements):** Système d'informations complet remplaçant la carte commandes clients dans le dashboard - gestion d'annonces avec niveaux de priorité (normal, important, urgent), contrôle d'accès basé sur les rôles (admin : CRUD complet, autres rôles : lecture seule), tri intelligent par priorité et date, filtrage par magasin pour administrateurs, interface moderne avec badges colorés et indicateurs visuels. **PRODUCTION FIX MAJEUR (Août 2025)** : Correction critique du problème d'affichage en production PostgreSQL - fix du filtrage pour inclure annonces globales + magasin sélectionné, correction des relations d'auteur avec username au lieu d'ID, design adapté pour correspondre exactement aux autres cartes du dashboard. **SUPPRESSION FIX (Août 2025)** : Correction du problème de suppression en production - ajout de la logique PostgreSQL manquante dans la route DELETE, les annonces peuvent maintenant être supprimées correctement en production. **MODAL DASHBOARD (Août 2025)** : Ajout d'un modal automatique dans le dashboard qui affiche la dernière annonce créée il y a moins de 2 jours - système de mémorisation localStorage pour éviter les re-affichages, interface avec priorités colorées, formatage français des dates, filtrage par magasin pour admins. **UTILISATEUR INCONNU FIX (Août 2025)** : Correction critique du problème "utilisateur inconnu" en production - création de la table `dashboard_messages` manquante, correction des noms de colonnes (`first_name` au lieu de `firstName`), amélioration de la logique de récupération des noms d'utilisateur avec fallback intelligent. **AFFICHAGE SIMPLIFIÉ (Août 2025)** : Suppression de l'affichage du nom de l'auteur des annonces pour simplifier l'interface - seul le nom du magasin/groupe est affiché si applicable. **FIX MODIFICATION PRODUCTION (Août 2025)** : Correction critique du problème de modification des annonces en production - la jointure PostgreSQL utilisait incorrectement `users.id` au lieu de `users.username` pour la relation avec `createdBy`, causant des erreurs 500. Fix appliqué avec correction de la jointure et ajout de logs de debug dans `announcementStorage.ts`. **MÉTHODE MANQUANTE FIX (Août 2025)** : Identification et correction de l'erreur "getAnnouncement is not a function" - ajout de la méthode `getAnnouncement` manquante dans l'interface `IAnnouncementStorage` et ses implémentations `AnnouncementDatabaseStorage` et `AnnouncementMemoryStorage` pour résoudre définitivement les erreurs 500 en production.
|
||||
- **DLC Module Permissions:** Correction des permissions de validation DLC pour permettre aux admin, directeur et manager de valider les produits DLC. Ajout de logs de debug pour traçabilité des validations (Août 2025).
|
||||
- **DLC UX Enhancement:** Ajout de tooltips explicatifs sur les icônes stock épuisé (PackageX) et restauration (RotateCcw) pour clarifier la différence entre "périmé" et "stock épuisé" et améliorer l'expérience utilisateur (Août 2025).
|
||||
- **Calendrier Design Moderne (Août 2025):** Refonte complète du design du calendrier `CalendarGrid.tsx` avec interface ultra-moderne - design épuré sans angles arrondis, séparations grises claires, weekends en fond gris, système de couleurs codées (gris=livré, vert=livraisons, bleu=commandes, jaune=planifiées), couleurs pastels douces, affichage jusqu'à 2 éléments par jour, bordures marquées et ombres subtiles. **Modal d'affichage** : système modal moderne pour visualiser tous les éléments d'un jour (remplace le popover) avec cartes individuelles, zone scrollable et design cohérent. **SYNCHRONISATION DEV ↔ PRODUCTION (Août 2025)** : Unification complète du fichier CalendarGrid.tsx - même code en développement et production, MAX_VISIBLE_ITEMS forcé à 2, bouton "+X autres" blanc/gris uniforme, styles compatibles dev/prod. Documentation de synchronisation fournie dans `SYNC_DEV_PRODUCTION.md`. **AMÉLIORATION STYLE (Août 2025)** : En-têtes de jour avec fond blanc et séparations plus claires (gray-100) pour un design plus épuré et professionnel.
|
||||
- **Harmonisation des Modales de Détail (Août 2025):** Uniformisation complète des modales de détail entre tous les modules (commandes, livraisons, calendrier) - tous utilisent le même composant `OrderDetailModal` avec ajout du champ 'type' nécessaire dans les handlers pour un affichage identique des informations détaillées partout.
|
||||
- **User and Permission Management:** Granular access controls ensuring that users (e.g., employees) have appropriate permissions for tasks like creating customer orders.
|
||||
- **Reporting:** Statistical reporting, including monthly summaries of deliveries based on `deliveredDate`.
|
||||
- **Task Management:** A comprehensive task management system with advanced temporal features, intelligent sorting (pending > priority > date), due dates with calendar selector, visual indicators for overdue/urgent tasks, filters by due date, Kanban and list views, and colored badges for temporal status. Includes start dates with role-based visibility.
|
||||
- **Information System (Announcements):** A complete announcement system with priority levels (normal, important, urgent), role-based access control (admin: full CRUD; others: read-only), intelligent sorting by priority and date, and store-based filtering for administrators. Includes an automatic dashboard modal for recent announcements.
|
||||
- **DLC Module:** Permissions allow admin, director, and manager roles to validate DLC products. Includes explanatory tooltips for UX enhancement.
|
||||
- **Reporting:** Statistical reporting, including monthly summaries of deliveries.
|
||||
- **UI Harmonization:** All detail modals across modules (orders, deliveries, calendar) use a unified component for consistent information display.
|
||||
|
||||
## External Dependencies
|
||||
- **API Météo:** Visual Crossing API for weather data.
|
||||
- **Database:** PostgreSQL.
|
||||
- **ORM:** Drizzle ORM for database interaction.
|
||||
- **UI Components:** `shadcn/ui`.
|
||||
- **Styling:** Tailwind CSS.
|
||||
- **API Météo:** Visual Crossing API
|
||||
- **Database:** PostgreSQL
|
||||
- **ORM:** Drizzle ORM
|
||||
- **UI Components:** `shadcn/ui`
|
||||
- **Styling:** Tailwind CSS
|
||||
Reference in new issue
Block a user