Commit Graph
219 Commits
Author SHA1 Message Date
michaelschal 2f71b06744 Fix issue where non-admin users could see all groups
Add console logging for debugging group data access by user role and fix group filtering logic to ensure correct data is returned for non-admin users.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 28b81ac1-a55f-409c-b6a9-88ad420d8a9a
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/28b81ac1-a55f-409c-b6a9-88ad420d8a9a/6PoDWd4
2025-09-03 08:45:56 +00:00
michaelschal 510a62915b Restrict director access to assigned groups only
Update route protection logic to ensure directors can only access deliveries within their assigned groups.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 28b81ac1-a55f-409c-b6a9-88ad420d8a9a
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/28b81ac1-a55f-409c-b6a9-88ad420d8a9a/6PoDWd4
2025-09-03 08:40:25 +00:00
michaelschal 1a0171c49e Allow directors to access delivery information
Update server routes to grant 'directeur' role access to delivery information, previously restricted to 'admin' roles.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 28b81ac1-a55f-409c-b6a9-88ad420d8a9a
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/28b81ac1-a55f-409c-b6a9-88ad420d8a9a/6PoDWd4
2025-09-03 08:25:49 +00:00
michaelschal 1ccfc740b4 Ensure daily automatic backups are performed upon user login
Introduce a daily automatic backup check and execution triggered upon successful user login, ensuring data consistency and safety across the platform. This includes a new `checkAndPerformDailyBackup` method in `backupService.ts` and its integration into the login process in `localAuth.ts` and `localAuth.production.ts`.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 8e57b9d9-f2b2-427d-ba7a-757427e9b079
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/8e57b9d9-f2b2-427d-ba7a-757427e9b079/BLTvIk5
2025-09-02 17:54:11 +00:00
michaelschal 9dc199d188 Improve date handling for task creation and retrieval
Update client-side and server-side logic to correctly process and store date values, ensuring compatibility with PostgreSQL timestamp types. This includes converting string dates to Date objects before insertion and ensuring string IDs are converted to numbers for API calls.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f2b9c241-9fdd-4abd-9041-720afc8b27d6
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-09-02 10:19:37 +00:00
michaelschal 54aa499edd Fix task creation error by assigning default group
Correctly assigns a default `groupId` when creating tasks and improves group access validation logic.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f2b9c241-9fdd-4abd-9041-720afc8b27d6
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-09-02 09:28:21 +00:00
michaelschal 3b54c6fbdb Improve product expiry date filtering and supplier data retrieval
Refactor storage logic to correctly filter products by expiry date (expires_soon, expired, active) and update supplier DLC enablement check in routes.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f2b9c241-9fdd-4abd-9041-720afc8b27d6
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-09-02 08:47:11 +00:00
michaelschal e0bcfcdb13 Improve product filtering by adding dynamic status options for expiry dates
Update the server-side storage logic in `server/storage.ts` to correctly filter DLC products based on various expiry date statuses ('expires_soon', 'expires', 'en_cours', 'valides'), addressing an issue where certain products were not being displayed in empty lists.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f2b9c241-9fdd-4abd-9041-720afc8b27d6
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-09-02 08:38:52 +00:00
michaelschal ad7bd07670 Improve filtering for suppliers based on DLC status
Correctly filter suppliers to only show DLC-enabled ones when the DLC filter is applied in the API.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f2b9c241-9fdd-4abd-9041-720afc8b27d6
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-09-02 08:31:06 +00:00
michaelschal 7cdbdfff68 Expand administrative access to include additional user roles
Update API endpoint to grant 'directeur' and 'manager' roles access to user data, alongside existing 'admin' role.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f2b9c241-9fdd-4abd-9041-720afc8b27d6
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-09-02 07:40:27 +00:00
michaelschal 989b2c8c40 Grant task creation permissions to managers
Update shared/permissions.ts to add 'create' permission to manager role for tasks module. Also, add a permission check in server/routes.ts before creating a task.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f2b9c241-9fdd-4abd-9041-720afc8b27d6
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-09-02 07:34:30 +00:00
michaelschal f3785fb428 Update backup service to use native scheduling and fix production errors
Replaced node-cron with native setInterval for backup scheduling to resolve production issues related to dynamic requires.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: db1bcb73-80c1-4bff-8236-4ced2c07f75f
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-09-01 20:46:30 +00:00
michaelschal 68da9f1926 Improve automatic backup scheduling reliability
Replace native setTimeout with node-cron for daily automatic backups at 2:00 AM, improving scheduling robustness and adding timezone support.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: db1bcb73-80c1-4bff-8236-4ced2c07f75f
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-09-01 20:43:07 +00:00
michaelschal c09388c0aa Make delivery validation require a mandatory delivery note number
Enforce the requirement for a delivery note number (blNumber) during delivery validation on both the delivery and calendar modules. This change updates the frontend validation schema to make blNumber a required field with a minimum length, modifies the backend logic to reject validations without a blNumber, and integrates a new modal component for handling this validation process within the Deliveries page.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 98f01874-e00c-4bbe-9d71-b0b338001848
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/98f01874-e00c-4bbe-9d71-b0b338001848/yaZkPAT
2025-09-01 11:57:55 +00:00
michaelschal 8dec1c46ba Improve reconciliation process by skipping already validated deliveries
Update client-side logic in BLReconciliation to exclude deliveries with a 'reconciled' status from automatic verification. Modify server-side InvoiceVerificationService to implement permanent caching for reconciled invoices, preventing redundant checks.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: daf3525c-b971-454a-b0c0-7a9845e786cc
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-31 07:56:20 +00:00
michaelschal aef303b709 Improve reconciliation process by skipping already processed deliveries
Optimize the reconciliation page by pre-populating results for already reconciled deliveries and skipping them in the auto-verification loop. Also, add an API endpoint for administrators to diagnose cache status for reconciled deliveries.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: daf3525c-b971-454a-b0c0-7a9845e786cc
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-31 07:54:35 +00:00
michaelschal 9ed380a279 Improve task management by optimizing cache updates for reconciled invoices
Add new functionality to update invoice verification cache to permanent status after reconciliation. Introduce a new API endpoint for admins to trigger bulk updates of existing reconciled caches, addressing potential performance issues with repeated checks on verified items.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: daf3525c-b971-454a-b0c0-7a9845e786cc
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-31 07:49:05 +00:00
michaelschal 97b63b61e8 Improve invoice verification caching with permanent storage for reconciled items
Introduce adaptive caching durations for invoice verification: permanent caching for reconciled invoices, temporary caching for found invoices, and longer temporary caching for not-found invoices.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: daf3525c-b971-454a-b0c0-7a9845e786cc
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-31 07:39:11 +00:00
michaelschal 1aa3069d89 Improve how advertisements are displayed by fixing sorting
Adjust the advertisement retrieval to use direct column ordering instead of SQL CAST for better production compatibility and logging.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 0ec86cdf-a5be-4b0e-84a3-07b926f5cc80
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/0ec86cdf-a5be-4b0e-84a3-07b926f5cc80/0gylnen
2025-08-21 11:29:53 +00:00
michaelschal 6cf7631bdf Fix display issues and adjust year range for publicities
Correctly display publicities by fixing an issue that prevented data from rendering, and expand the selectable year range to include years from 2020 onwards.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 0ec86cdf-a5be-4b0e-84a3-07b926f5cc80
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/0ec86cdf-a5be-4b0e-84a3-07b926f5cc80/bg09zFa
2025-08-21 11:25:56 +00:00
michaelschal 19c41f11c3 Improve handling of yearly data to correctly process all years
Update year calculations to accurately reflect week and month assignments, particularly for transitional periods between years, and enhance API logging for debugging.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 0ec86cdf-a5be-4b0e-84a3-07b926f5cc80
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/0ec86cdf-a5be-4b0e-84a3-07b926f5cc80/ZJYssQp
2025-08-21 11:22:14 +00:00
michaelschal 172541c2b7 Make managers see orders from their assigned store automatically
Update manager role logic in routes.ts to automatically use the first assigned store for orders and deliveries, and handle cases where no stores are assigned.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 0ec86cdf-a5be-4b0e-84a3-07b926f5cc80
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/0ec86cdf-a5be-4b0e-84a3-07b926f5cc80/PHXoZau
2025-08-21 11:10:06 +00:00
michaelschal 1a21876978 Grant director access to all orders and refine manager order visibility
Update route logic to include 'directeur' role for admin-like access and adjust manager role to display orders from all accessible groups, while enforcing explicit store selection for employees.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 0ec86cdf-a5be-4b0e-84a3-07b926f5cc80
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/0ec86cdf-a5be-4b0e-84a3-07b926f5cc80/PHXoZau
2025-08-21 11:03:41 +00:00
michaelschal ceebe73b91 Ensure task list sorts correctly by number from smallest to largest
Fix task sorting by casting the publication number to an integer for accurate numerical ordering and update logging for better debugging insight.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 2e1318c6-77b3-4174-b8c7-432d781590ed
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/2e1318c6-77b3-4174-b8c7-432d781590ed/sW3Ppp1
2025-08-21 10:53:36 +00:00
michaelschal 739f58ff04 Update how advertisements are displayed to show smallest numbers first
Implement a new sorting mechanism for advertisements, displaying them in ascending order by their publication number, and add test data for advertisements.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 2e1318c6-77b3-4174-b8c7-432d781590ed
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/2e1318c6-77b3-4174-b8c7-432d781590ed/EyDMIMl
2025-08-21 10:44:01 +00:00
michaelschal d43e72fd70 Improve advertising list sorting for smaller numbers first
Add console logging to debug and confirm ascending order sorting by advertisement number in the database storage.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 2e1318c6-77b3-4174-b8c7-432d781590ed
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/2e1318c6-77b3-4174-b8c7-432d781590ed/TaNhylA
2025-08-21 10:35:03 +00:00
michaelschal 287b2aa702 Order advertisements by their number from smallest to largest
Update server/storage.ts to sort publicities by pubNumber in ascending order using asc(publicities.pubNumber).

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 2e1318c6-77b3-4174-b8c7-432d781590ed
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/2e1318c6-77b3-4174-b8c7-432d781590ed/D0szOHB
2025-08-21 10:22:17 +00:00
michaelschal 07f64d4713 Sort advertisements by publication number in descending order
Update server/storage.ts to sort publicities by `pubNumber` in descending order instead of `createdAt`.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 2e1318c6-77b3-4174-b8c7-432d781590ed
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/2e1318c6-77b3-4174-b8c7-432d781590ed/XToCG0X
2025-08-21 10:14:08 +00:00
michaelschal 58c62c3c8d Prevent deliveries from linking to orders from different stores
Implement validation to ensure that a delivery is only linked to an order belonging to the same store, preventing cross-store order linking in the delivery module.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 2e1318c6-77b3-4174-b8c7-432d781590ed
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/2e1318c6-77b3-4174-b8c7-432d781590ed/zdg8r7D
2025-08-21 10:02:39 +00:00
michaelschal 9dbb5e0768 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
2025-08-20 09:51:58 +00:00
michaelschal 46de48f459 Make sure directors and managers see correct store data
Fixes an issue where directors and managers might see data from multiple stores incorrectly. Ensures roles with limited store access only view their designated information and prompts explicit store selection when no store is chosen. Updates the UI to correctly display store selectors based on user roles. Also adds cache invalidation for user data upon authentication updates and refines API filtering for orders and deliveries to respect user roles and store selections.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 15f19c36-9aac-46a4-a181-3dc5f496fabd
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-20 08:46:04 +00:00
michaelschal f407cdceb7 Improve task feedback and show scheduled tasks to directors
Replace alerts with toast notifications for task operations and grant directors visibility into scheduled tasks, previously only visible to admins.

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/IUKNI3f
2025-08-19 11:35:36 +00:00
michaelschal 90480201ee Improve task date handling to prevent errors
Update task storage logic to correctly format and handle date values for PostgreSQL, preventing potential 500 errors caused by type mismatches and incorrect date parsing.

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/U0y2tJ3
2025-08-19 11:28:00 +00:00
michaelschal 24b7d67745 Improve task update logging and handle date formatting errors
Refine error logging in task update routes and storage, and adjust date handling to correctly process null or empty date strings, preventing runtime errors.

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/mibRh7v
2025-08-19 11:23:54 +00:00
michaelschal 54c637b7b6 Improve task update data handling and error logging
Refactors task update logic in server/routes.ts to correctly handle undefined and empty string values, and enhances error logging by including task ID, error details, and request body.

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/grlWN1D
2025-08-19 11:15:48 +00:00
michaelschal a2eecfb2ac Update task module presentation and resolve console errors
Refactor task route to use a new component and implement data validation and cleaning before updating tasks in the database to prevent errors.

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/grlWN1D
2025-08-19 11:12:49 +00:00
michaelschal 26579affb3 Restore previous task list view and fix task update issues
Revert client-side task routing to use the previous `TasksListSimple` component and implement server-side data cleaning for task updates, specifically addressing potential issues with `startDate` and `dueDate` when they are empty strings.

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/fN5Ayh3
2025-08-19 11:07:48 +00:00
michaelschal 0d863da97e Improve task management by handling date errors and ensuring data integrity
Implement robust error handling and data validation for task dates and properties in both frontend and backend to resolve production issues.

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/0taewQN
2025-08-19 07:39:33 +00:00
michaelschal aa1906a9bb Enhance task management with start dates and improved visibility
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
2025-08-19 07:23:52 +00:00
michaelschal 87cc2a0f88 Fix task due date not saving correctly to a future date
Add console logging to client and server to debug and fix an issue where task due dates were not being saved correctly, defaulting to the current date instead of the selected future date.

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/xi95nEa
2025-08-19 06:57:42 +00:00
michaelschal 81a51c6540 Fix error when updating announcements by adding missing get announcement functionality
Add the `getAnnouncement` method to `AnnouncementStorage` implementations and update the `IAnnouncementStorage` interface to resolve a `TypeError` during announcement updates.

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/JTP6mhE
2025-08-18 12:37:32 +00:00
michaelschal 8bbbd2476c Enhance announcement management and database interactions
Update announcement storage to join on username instead of ID, add logging for announcement updates, and implement error handling for non-existent announcements. Also, update schema imports.

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/JTP6mhE
2025-08-18 12:24:31 +00:00
michaelschal a75f7b66c4 Resolve unknown user display in announcements for better clarity
Fix user lookup in announcement messages to correctly display user names by selecting specific user fields and handling missing name data.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: cc2d271b-82f0-4d6a-9302-a0b067ffb429
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-18 12:16:03 +00:00
michaelschal c851aacb28 Fix automatic database backup system for production
Resolves an issue where the automatic backup service was not initialized in the production environment, preventing daily backups. Updates `docker-compose.yml` to include a backup directory and volume, modifies `index.production.ts` to import and initialize the backup service, and enhances `replit.md` with details of the fix. A new verification script `scripts/verify-backup-system.sh` is added to confirm the system's functionality.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: cc2d271b-82f0-4d6a-9302-a0b067ffb429
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-18 12:06:40 +00:00
michaelschal 02809d6463 Filter ticket views and stats by selected store for administrators
Refactors the SAV tickets page to allow administrators to filter tickets and statistics based on a selected store (groupId). Updates backend routes to conditionally filter by groupId when provided in the query parameters for both ticket listings and statistics retrieval. Enables query fetching only when user and store are initialized for administrators.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f9197b9b-a5b3-4469-a27d-930a9e9ee736
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/f9197b9b-a5b3-4469-a27d-930a9e9ee736/icib2nb
2025-08-18 10:24:01 +00:00
michaelschal 2028f761f3 Limit SAV ticket creation to administrative roles
Adjust SAV ticket creation permissions on both frontend and backend to restrict the 'employee' role, allowing only 'admin', 'directeur', and 'manager' roles to create tickets.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f9197b9b-a5b3-4469-a27d-930a9e9ee736
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/f9197b9b-a5b3-4469-a27d-930a9e9ee736/i2gFnxm
2025-08-18 10:19:01 +00:00
michaelschal 2ff22c4821 Fix ticket assignment to ensure it's assigned to the user's store
Correctly assigns SAV tickets to the user's group, resolving an issue where tickets were not being assigned to the creating user's store. Includes backend and frontend logic adjustments for accurate group assignment based on user roles and available groups.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f9197b9b-a5b3-4469-a27d-930a9e9ee736
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/f9197b9b-a5b3-4469-a27d-930a9e9ee736/i2gFnxm
2025-08-18 10:17:24 +00:00
michaelschal 4881833925 Add ability to mark products as out of stock and restore them
Introduce new API endpoints and storage logic for managing product stock status, including 'stock épuisé' and 'restore stock' functionalities with role-based access control.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f9197b9b-a5b3-4469-a27d-930a9e9ee736
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/f9197b9b-a5b3-4469-a27d-930a9e9ee736/JKfj3tT
2025-08-18 09:10:15 +00:00
michaelschal 4ff83da545 Improve invoice verification cache reliability and add expiration handling
Fix database storage to correctly check cache expiration and delete expired entries, preventing stale data from being served. Added logs for cache hits, misses, and expirations.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: e437ffed-c31b-44eb-9fd5-b6f9faa8e7ce
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/e437ffed-c31b-44eb-9fd5-b6f9faa8e7ce/6kmwY2j
2025-08-17 16:34:37 +00:00
michaelschal 971bda0012 Restore database connection for production environment
Fix issue in server/storage.ts where DatabaseStorage was not being used in production, causing database connection errors.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: e437ffed-c31b-44eb-9fd5-b6f9faa8e7ce
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/e437ffed-c31b-44eb-9fd5-b6f9faa8e7ce/6kmwY2j
2025-08-17 16:12:44 +00:00