Implement unique constraint on invoice verification cache key and handle duplicate entries gracefully in the backend. Replit-Commit-Author: Agent Replit-Commit-Session-Id: d43bd811-9372-45a7-8ac9-4a954c0538e1 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/d43bd811-9372-45a7-8ac9-4a954c0538e1/g5c0JYM
4.1 KiB
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/uiand 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_BACKUPStable. - 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).
- 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).
- 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.