Commit Graph
56 Commits
Author SHA1 Message Date
michaelschal b9b85fba78 Fix task access and visibility for employee role users
Update client/src/pages/Tasks.tsx to restrict user fetching and action button visibility based on role ('admin', 'manager', 'directeur'). Also addresses 403 errors for employees in server routes.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: b163d4c0-de5e-4f4e-a9c0-aed4c7049718
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/b163d4c0-de5e-4f4e-a9c0-aed4c7049718/vMSppUD
2025-08-12 09:05:02 +00:00
michaelschal 072ad60ec1 Grant employees access to system features and tasks
Adjust permissions for employee role to access tasks and supplier data, and allow directors to validate DLC products.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: b163d4c0-de5e-4f4e-a9c0-aed4c7049718
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/b163d4c0-de5e-4f4e-a9c0-aed4c7049718/69xEJ3P
2025-08-12 08:56:22 +00:00
michaelschal 0949386425 Provide database schema details in a text file and via an API
Export the production PostgreSQL database schema to a text file and create a new API endpoint for accessing this information.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: b163d4c0-de5e-4f4e-a9c0-aed4c7049718
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/b163d4c0-de5e-4f4e-a9c0-aed4c7049718/kdCs97W
2025-08-12 08:32:42 +00:00
michaelschal 461290a4f8 Allow admin password to be changed and retained without resets
Modify production logic to prevent forced admin password resets on updates, allowing users to set and keep their own passwords unless explicitly overridden by an environment variable.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: b163d4c0-de5e-4f4e-a9c0-aed4c7049718
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/b163d4c0-de5e-4f4e-a9c0-aed4c7049718/kdCs97W
2025-08-12 08:18:45 +00:00
michaelschal 69777558ef Update authentication hook for database debugging page
Refactor the DatabaseDebug page to use the `useAuthUnified` hook instead of `useAuthSimple`.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: b163d4c0-de5e-4f4e-a9c0-aed4c7049718
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/b163d4c0-de5e-4f4e-a9c0-aed4c7049718/kdCs97W
2025-08-12 08:11:51 +00:00
michaelschal 52830fd85e Improve calendar display when many events are scheduled
Adjust UI components to better handle data overflow in calendar cells, ensuring all scheduled events are visible with modern design principles.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: b163d4c0-de5e-4f4e-a9c0-aed4c7049718
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/b163d4c0-de5e-4f4e-a9c0-aed4c7049718/HUXctpj
2025-08-11 21:34:28 +00:00
michaelschal 0be08e3fd5 Ensure delivery and package counts display correctly
Update stats panel and storage logic to correctly cast counts to numbers, resolving display issues for palettes and packages.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: b163d4c0-de5e-4f4e-a9c0-aed4c7049718
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/b163d4c0-de5e-4f4e-a9c0-aed4c7049718/HUXctpj
2025-08-11 21:31:49 +00:00
michaelschal 64cab30834 Update statistics to count only delivered palettes and packages
Modify SQL queries in DatabaseStorage to filter order and delivery counts, ensuring that only palettes and packages associated with delivered orders and deliveries are included in the statistics. This addresses an issue where counts were displaying incorrectly for delivered items.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: b163d4c0-de5e-4f4e-a9c0-aed4c7049718
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/b163d4c0-de5e-4f4e-a9c0-aed4c7049718/76gymRV
2025-08-11 21:26:32 +00:00
michaelschal 79cf87d067 Saved your changes before starting work
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: b163d4c0-de5e-4f4e-a9c0-aed4c7049718
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-11 21:20:39 +00:00
michaelschal ccab1686b8 Fix error preventing calendar from displaying correctly
Add missing Button import to CalendarGrid component to resolve ReferenceError.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/CRhacll
2025-08-11 21:16:05 +00:00
michaelschal 16a4e2e30b Improve production error troubleshooting and diagnostics
Update documentation and scripts to provide more detailed steps for diagnosing and resolving production errors, including checking logs, process status, and network connectivity.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/CRhacll
2025-08-11 21:13:55 +00:00
michaelschal f81b90018e Move order validation button to the order detail modal
Refactors the UI by removing the order validation button from the calendar grid and adding it to the order detail modal, improving user experience and interface cleanliness.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/CRhacll
2025-08-11 21:11:06 +00:00
michaelschal 95823a90c3 Improve visibility and debugging for order validation functionality
Add temporary debug logs and visible indicators to the CalendarGrid component to diagnose why the order validation button is not appearing for admins, and also include a direct SQL fix for CMD-55 status.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/3ec1Xks
2025-08-11 21:05:47 +00:00
michaelschal 687a1b41d4 Fix calendar errors and improve order delivery status handling
Adds TypeScript type annotations to the calendar component and refactors the order update logic to use fetch directly, improving robustness and addressing production errors.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/KuIk8gU
2025-08-11 20:55:33 +00:00
michaelschal 58f65dc086 Fix order status display and add immediate production correction guidance
Add a markdown document detailing an urgent fix for order CMD-55 not appearing correctly in the calendar, providing SQL and API solutions, along with verification steps. Also includes extensive logs related to user group querying and API calls for order and delivery data.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/KuIk8gU
2025-08-11 20:53:04 +00:00
michaelschal e626976f38 Automatically mark orders as delivered when deliveries are updated or validated
Implement automatic synchronization to update associated orders to 'delivered' status when a delivery's status is set to 'delivered' or when a delivery is validated, simplifying the order management workflow.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/KuIk8gU
2025-08-11 20:47:30 +00:00
michaelschal 213208d48f Improve order and delivery synchronization for accurate status tracking
Update the calendar page to fetch all orders and deliveries without date filters, enriching them for accurate analysis and specifically targeting CMD-55 to diagnose and fix status discrepancies.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/KuIk8gU
2025-08-11 20:43:52 +00:00
michaelschal 4422a561c7 Enhance order and delivery synchronization for better status accuracy
Fetch all orders and deliveries to enable client-side synchronization, specifically improving the handling of orders with delivered items but incorrect statuses, and adding detailed logging for order analysis.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/KuIk8gU
2025-08-11 20:40:52 +00:00
michaelschal d2e546c1bd Fix order delivery status synchronization issues and improve client-side handling
Implement a client-side sync logic to correct order statuses where deliveries are marked as 'delivered' but the order status is not updated, addressing synchronization problems reported by users.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/KuIk8gU
2025-08-11 20:38:01 +00:00
michaelschal de8e6ad9d6 Make the button visible for all users to interact with
The button is now correctly displayed, resolving a visibility issue.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/KuIk8gU
2025-08-11 20:36:36 +00:00
michaelschal c648396f57 Provide guide for immediate synchronization of order and delivery statuses
Add a guide document with SQL scripts and testing instructions for synchronizing order and delivery statuses, including fixing missing delivery dates.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/KuIk8gU
2025-08-11 20:35:49 +00:00
michaelschal a512352d6b Add a way to resynchronize order and delivery statuses
Adds a new API endpoint to manually synchronize order and delivery statuses, fixing orders not marked as 'delivered' when associated deliveries are. Includes a refresh button on the calendar for admins and toast notifications for sync results.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/KuIk8gU
2025-08-11 20:32:59 +00:00
michaelschal eb6a61492a Improve delivery status visibility for completed orders
Update frontend to correctly grey out delivered orders, aligning with user feedback.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/0tRkXvo
2025-08-11 20:29:48 +00:00
michaelschal 7c0c619d03 Improve logging and data retrieval for user and order management
Update logging to capture detailed user group assignments and order filtering parameters, enhancing debugging and performance analysis for administrative operations.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/0tRkXvo
2025-08-11 20:27:02 +00:00
michaelschal d14a4a31f6 Synchronize order and delivery statuses and dates in the calendar view
Fixes an issue where orders linked to delivered deliveries were not displaying the correct delivery date or status in the calendar. This includes updating the OrderDetailModal to show the correct dates, automatically updating order statuses when deliveries are marked as delivered, and providing a SQL script to correct existing data inconsistencies.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/0tRkXvo
2025-08-11 20:24:42 +00:00
michaelschal 6a2e5aad05 Prevent duplicate user entries by handling empty emails
Fixes an issue where creating or editing users with empty email fields would violate a unique constraint in the database. The solution involves updating user routes to treat empty email strings as NULL, adjusting validation schemas, and providing a script to clean existing data.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/zoO1uWT
2025-08-11 20:13:03 +00:00
michaelschal c77ea88e9d Fix user creation errors by handling empty emails properly
Adjust user creation schema to allow null emails, update data handling to convert empty strings to null, and provide a SQL script to clean up existing duplicate empty email entries, resolving the `users_email_key` constraint violation.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/aiHrulP
2025-08-11 20:08:37 +00:00
michaelschal b886f317ca Improve user creation process with better error logging and testing
Add detailed logging and a test script to diagnose and fix user creation failures in production.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/AwxJU6M
2025-08-11 20:04:57 +00:00
michaelschal 7235be8b84 Improve user data retrieval and add production debugging tools
Update the API to fetch users with simplified logic and introduce detailed SQL scripts and logging for production issue diagnosis.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/jzCmXCx
2025-08-11 20:00:10 +00:00
michaelschal 22bdbff494 Improve user data retrieval to include roles and group assignments
Update the API endpoint for fetching users to include their associated roles and group assignments, enhancing the detail of user data returned.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/fwSlq3W
2025-08-11 19:57:01 +00:00
michaelschal 07b848b127 Improve user group assignment debugging and logging in production
Add SQL debugging script and enhanced console logs to diagnose user group assignment issues in production, addressing user reports of unassigned groups.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/fwSlq3W
2025-08-11 19:53:26 +00:00
michaelschal f705fb4b1c Resolve issue with assigning users to groups in production environments
Adjust `server/storage.ts` to use raw SQL for inserting into `user_groups` when the `created_at` column is missing in production, and add a test script `test-user-groups.js` to verify this functionality.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/pp1SgYO
2025-08-11 19:49:32 +00:00
michaelschal 28b60b6bca Address issue where users cannot be assigned to groups in production
Add error handling to the user group assignment to gracefully handle missing `created_at` column in production environments, and document the fix.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/yj7Yt4E
2025-08-11 19:46:22 +00:00
michaelschal d84d3e656e Improve user authentication and group assignment logic
Refactor user and group management to dynamically import authentication modules based on environment and address a missing 'created_at' column error in user group assignments.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/oleRdyv
2025-08-11 19:41:37 +00:00
michaelschal f42a999b61 Fix password updates for administrators in production environments
Correctly import the production authentication module with the `.js` extension to resolve the ERR_MODULE_NOT_FOUND error.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/5WAXLXf
2025-08-11 19:38:38 +00:00
michaelschal e782580ab8 Integrate group assignment into user editing for a streamlined experience
Removes the separate group management modal and integrates group assignment directly into the user edit form. Updates the user role selection to include "directeur". Also, refactors the user management UI by removing the separate role display and associated text.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/yF4FWrX
2025-08-11 19:33:30 +00:00
michaelschal 37494e6570 Remove role management and update user role assignment functionality
The RoleManagement page and related routes have been removed. The Users page has been updated to remove role fetching and modify the user role update mutation to directly use the role name instead of a role ID. Type definitions for user roles have also been updated to reflect the change from role IDs to role names.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/reFhh9U
2025-08-11 19:28:39 +00:00
michaelschal e120b48539 Update user list to display names correctly even when first and last names are separate
Fix the display of user names in the user list to properly show first and last names, resolving an issue where names were incorrectly reported as "Nom non renseigné" in production.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/vetH0Gp
2025-08-11 18:41:20 +00:00
michaelschal 1e72358c6c Fix user editing and email field consistency across the platform
Update handleEditUser to prioritize firstName/lastName over the name field for user editing, and make the email field consistently optional in both create and edit forms.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/vetH0Gp
2025-08-11 18:35:13 +00:00
michaelschal a3b457f990 Update user profile to allow optional email and correct name updates
Fix bug where email was mandatory on user profile updates and ensure last name field updates correctly.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/vetH0Gp
2025-08-11 18:29:29 +00:00
michaelschal d85d62a5da Improve user update error handling for duplicate entries
Add specific error handling for duplicate username or email during user updates, returning 409 status codes and informative messages.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/vetH0Gp
2025-08-11 18:26:35 +00:00
michaelschal e7fb2c66f1 Make user creation and deletion more robust and prevent data loss
Update user schema to make username and password mandatory, adjust email validation, and handle foreign key constraints during user deletion, including updating the database_backups table.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/vetH0Gp
2025-08-11 18:12:20 +00:00
michaelschal fd92ce25d0 Update user deletion to reassign roles and fix foreign key constraint violations
Update the deleteUser function in DatabaseStorage to reassign roles assigned by the deleted user to the admin user, resolving a foreign key constraint error when deleting the 'system' user.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/vetH0Gp
2025-08-11 17:59:48 +00:00
michaelschal 2cb363c0b4 Fix user deletion to preserve data integrity
Updates the `deleteUser` method to handle foreign key constraints by transferring user-created records to an admin user before deletion, ensuring data integrity and preventing errors.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/vetH0Gp
2025-08-11 17:50:38 +00:00
michaelschal 8964d6660b Saved your changes before starting work
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-11 16:31:06 +00:00
michaelschal b079805288 Add missing API routes and improve system stability for production
Add missing API routes (/api/users, /api/roles, /api/deliveries) and resolve 404 errors in production, alongside improvements to authentication and core routing.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 54292eb6-296c-47a3-8f4e-c9967863556c
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-11 16:13:12 +00:00
michaelschal aa3b4567ac Fix empty deliveries by redeploying the application now
Adds a new debugging script to test deliveries and orders APIs in production, clarifies redeployment instructions in DEPLOYMENT-FIX.md.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 54292eb6-296c-47a3-8f4e-c9967863556c
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-11 16:09:31 +00:00
michaelschal cab6f5891b Fix database query for user groups and improve routing
Fixes a database error by adjusting the SQL query for user groups to exclude a non-existent column and improves main page routing to prevent 502 errors.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 54292eb6-296c-47a3-8f4e-c9967863556c
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-11 16:03:48 +00:00
michaelschal 8256d0b965 Fix production error related to missing user group creation date
Address the 'column user_groups.created_at does not exist' error in production by adjusting the getUserWithGroups query and ensuring admin authentication is functional.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 54292eb6-296c-47a3-8f4e-c9967863556c
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-11 15:56:52 +00:00
michaelschal a6efc91d14 Add emergency admin password reset and improve default admin setup
Implement an emergency endpoint for resetting the admin password in production, and enhance the default admin user creation logic to handle password migrations and force resets. Also, introduce a new script for resetting the admin password.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 54292eb6-296c-47a3-8f4e-c9967863556c
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-11 15:53:01 +00:00