mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Introduce task start dates, allowing for future task scheduling and better visibility for managers and employees. Admins can now see all tasks, while other roles only see tasks that have started or have no start date. Includes UI updates to visually distinguish future tasks and a new form for creating tasks with start and due dates. Replit-Commit-Author: Agent Replit-Commit-Session-Id: cc2d271b-82f0-4d6a-9302-a0b067ffb429 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/cc2d271b-82f0-4d6a-9302-a0b067ffb429/kX6A8MG
50 lines
12 KiB
Markdown
50 lines
12 KiB
Markdown
# Enterprise Weather Management Platform
|
|
|
|
## 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.
|
|
|
|
## User Preferences
|
|
- Langue préférée : Français
|
|
- Communication : Langue simple et accessible, éviter les détails techniques
|
|
- Nettoyage : Préfère un projet optimisé sans fichiers inutiles
|
|
|
|
## System Architecture
|
|
The platform is built with a clear separation of concerns, utilizing a modern full-stack JavaScript architecture.
|
|
|
|
**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.
|
|
|
|
**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.
|
|
- **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.
|
|
|
|
**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).
|
|
- **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é.
|
|
- **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`.
|
|
- **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`.
|
|
|
|
## 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. |