Commit Graph

794 Commits

Author SHA1 Message Date
0f62a6330e Refactor: Update test files to improve mock structure and organization
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 6m57s
2025-12-15 01:07:08 -08:00
648f1c0239 Refactor: Update mocks in test files for improved structure and clarity
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 7m4s
2025-12-15 00:53:51 -08:00
066933ff6d Refactor: Update FlyerCountDisplay tests to use useFlyers hook and FlyersProvider
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 7m0s
2025-12-15 00:19:51 -08:00
6e8a8343e0 Refactor tests and API context integration
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 5m55s
- Updated tests in `useShoppingLists`, `useWatchedItems`, and various components to use `waitFor` for asynchronous assertions.
- Enhanced error handling in `errorHandler` middleware tests to include validation errors and status codes.
- Modified `AuthView`, `ProfileManager.Auth`, and `ProfileManager.Authenticated` tests to check for `AbortSignal` in API calls.
- Removed duplicate assertions in `auth.routes.test`, `budget.routes.test`, and `gamification.routes.test`.
- Introduced reusable logger matcher in `budget.routes.test`, `deals.routes.test`, `flyer.routes.test`, and `user.routes.test`.
- Simplified API client mock in `aiApiClient.test` to handle token overrides correctly.
- Removed unused `apiUtils.ts` file.
- Added `ApiContext` and `ApiProvider` for better API client management in React components.
2025-12-14 23:28:58 -08:00
69e2287870 linting done now fix unit tests
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 8m19s
2025-12-14 21:48:53 -08:00
43ca7f9df2 Refactor context and provider structure for improved organization and maintainability
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Has been cancelled
- Removed individual context files for Auth, Flyers, MasterItems, Modal, UserData, and their respective hooks.
- Introduced centralized provider files for each context, encapsulating logic and state management.
- Updated imports across the application to reflect the new structure, ensuring all hooks and contexts are correctly referenced.
- Enhanced the AppProviders component to streamline the wrapping of all context providers in the application.
- Improved type definitions and context management for better type safety and clarity.
2025-12-14 21:00:58 -08:00
82b7ce82e7 refactor: Add custom hooks for context access in various contexts
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Has been cancelled
2025-12-14 20:24:18 -08:00
8274f4c871 Refactor hooks and contexts for improved state management and modularity
Some checks are pending
Deploy to Test Environment / deploy-to-test (push) Has started running
- Updated `useActiveDeals` hook to include reset functionality for API calls.
- Enhanced `useApi` hook to provide a reset method for clearing state.
- Refactored `useAuth`, `useFlyers`, `useMasterItems`, `useModal`, and `useUserData` hooks to utilize context providers for better state management.
- Created new context files: `AuthContext`, `FlyersContext`, `MasterItemsContext`, `ModalContext`, and `UserDataContext` to encapsulate related state and logic.
- Updated tests for hooks to accommodate changes in context structure and reset functionality.
- Adjusted imports in `index.tsx` to reflect new context structure.
2025-12-14 20:08:15 -08:00
d3e546d02f refactor: Rename custom hooks for consistency and clarity
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Has been cancelled
2025-12-14 19:32:18 -08:00
f9115fdb73 refactor: Improve type inference and error handling in various services and tests
Some checks are pending
Deploy to Test Environment / deploy-to-test (push) Has started running
2025-12-14 19:25:08 -08:00
35c0fb3bfe refactor: Improve type inference and error handling in various services and tests
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Has been cancelled
2025-12-14 19:00:28 -08:00
d4739b5784 Refactor and update various service and route tests for improved type safety and clarity
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Has been cancelled
- Added a new notes file regarding the deprecation of the Google AI JavaScript SDK.
- Removed unused imports and fixed duplicate imports in admin and auth route tests.
- Enhanced type safety in error handling for unique constraint violations in auth routes.
- Simplified gamification route tests by removing unnecessary imports.
- Updated price route to improve type safety by casting request body.
- Improved mock implementations in system route tests for better type handling.
- Cleaned up user routes by removing unused imports.
- Enhanced AI API client tests with more robust type definitions for form data.
- Updated recipe database tests to remove unused error imports.
- Refactored flyer processing service tests for better type safety and clarity.
- Improved logger client to use `unknown` instead of `any` for better type safety.
- Cleaned up notification service tests to ensure proper type casting.
- Updated queue service tests to remove unnecessary imports and improve type handling.
- Refactored queue service workers tests for better type safety in job processors.
- Cleaned up user routes integration tests by removing unused imports.
- Enhanced tests setup for unit tests to improve type safety in mocked Express requests.
- Updated PDF converter tests for better type safety in mocked return values.
- Improved price parser tests to ensure proper handling of null and undefined inputs.
2025-12-14 18:02:16 -08:00
f73b1422ab feat: Update AI service to use new Google Generative AI SDK
Some checks are pending
Deploy to Test Environment / deploy-to-test (push) Has started running
- Refactored AIService to integrate with the latest GoogleGenAI SDK, updating the generateContent method signature and response handling.
- Adjusted error handling and logging for improved clarity and consistency.
- Enhanced mock implementations in tests to align with the new SDK structure.
refactor: Modify Admin DB service to use Profile type
- Updated AdminRepository to replace User type with Profile in relevant methods.
- Enhanced test cases to utilize mock factories for creating Profile and AdminUserView objects.
fix: Improve error handling in BudgetRepository
- Implemented type-safe checks for PostgreSQL error codes to enhance error handling in createBudget method.
test: Refactor Deals DB tests for type safety
- Updated DealsRepository tests to use Pool type for mock instances, ensuring type safety.
chore: Add new mock factories for testing
- Introduced mock factories for UserWithPasswordHash, Profile, WatchedItemDeal, LeaderboardUser, and UnmatchedFlyerItem to streamline test data creation.
style: Clean up queue service tests
- Refactored queue service tests to improve readability and maintainability, including better handling of mock worker instances.
docs: Update types to include UserWithPasswordHash
- Added UserWithPasswordHash interface to types for better clarity on user authentication data structure.
chore: Remove deprecated Google AI SDK references
- Updated code and documentation to reflect the migration to the new Google Generative AI SDK, removing references to the deprecated SDK.
2025-12-14 17:14:44 -08:00
eb0e183f61 Refactor test setup and improve mock implementations
Some checks are pending
Deploy to Test Environment / deploy-to-test (push) Has started running
- Introduced `createTestApp` utility to standardize Express app creation for tests, including JSON parsing, mock logger, and error handling.
- Updated all route tests to utilize `createTestApp`, enhancing consistency and reducing boilerplate code.
- Implemented `mockLogger` for cleaner test output and easier logging mock management.
- Adjusted passport mocks to ensure proper user authentication simulation across tests.
- Enhanced type safety by augmenting Express Request interface with `req.log` and `req.user` properties.
- Removed redundant code and improved readability in various test files.
2025-12-14 14:47:19 -08:00
edb0f8a38c Refactor database tests to improve type safety and error handling
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Has been cancelled
- Updated mock implementations in various database service tests to use specific types (Pool, PoolClient) instead of 'any'.
- Enhanced error handling in tests by explicitly defining error types and codes, improving clarity and maintainability.
- Removed unnecessary eslint-disable comments related to 'any' usage.
- Cleaned up transaction mock implementations to ensure proper type casting.
- Adjusted error handling in the UserRepository to provide more specific error messages for foreign key constraints.
- Improved test assertions to ensure they are more robust and type-safe.
2025-12-14 13:29:38 -08:00
56f14f6342 feat: Enhance API validation and error handling across routes
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Has been cancelled
- Added tests for invalid request bodies in price and recipe routes.
- Improved type safety in request handlers using Zod schemas.
- Introduced a consistent validation pattern for empty request bodies.
- Enhanced error messages for invalid query parameters in stats and user routes.
- Implemented middleware to inject mock logging for tests.
- Created a custom type for validated requests to streamline type inference.
2025-12-14 12:53:10 -08:00
9757f9dd9f Refactor MainLayout to use new hooks for flyers and master items; consolidate error handling
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Has been cancelled
Update error handling tests to ensure proper status assignment for errors
2025-12-14 11:05:04 -08:00
571ca59e82 refactor: Update tests and components for improved type safety and mock handling
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Failing after 3h11m16s
2025-12-14 01:38:21 -08:00
f891da687b Refactor tests to use mockClient for database interactions, improve error handling, and enhance modal functionality
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Has been cancelled
- Updated personalization.db.test.ts to use mockClient for query calls in addWatchedItem tests.
- Simplified error handling in shopping.db.test.ts, ensuring clearer error messages.
- Added comprehensive tests for VoiceAssistant component, including rendering and interaction tests.
- Introduced useModal hook with tests to manage modal state effectively.
- Created deals.db.test.ts to test deals repository functionality with mocked database interactions.
- Implemented error handling tests for custom error classes in errors.db.test.ts.
- Developed googleGeocodingService.server.test.ts to validate geocoding service behavior with mocked fetch.
2025-12-14 01:12:33 -08:00
7615d7746e feat: Enhance logging and type safety across various components and services
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Has been cancelled
2025-12-13 23:12:50 -08:00
77454b04c2 Add comprehensive tests for hooks, middleware, and routes
Some checks are pending
Deploy to Test Environment / deploy-to-test (push) Has started running
- Implement tests for `useFlyers`, `useMasterItems`, `useModal`, `useUserData` hooks to ensure correct functionality and error handling.
- Create tests for `fileUpload.middleware` and `validation.middleware` to validate file uploads and request data.
- Add tests for `AddressForm` and `AuthView` components to verify rendering, user interactions, and API calls.
- Develop tests for `deals.routes` to check authentication and response for best prices on watched items.
2025-12-13 21:30:43 -08:00
424cbaf0d4 feat: Implement deals repository and routes for fetching best watched item prices
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Has been cancelled
- Added a new DealsRepository class to interact with the database for fetching the best sale prices of watched items.
- Created a new route `/api/users/deals/best-watched-prices` to handle requests for the best prices of items the authenticated user is watching.
- Enhanced logging in the FlyerDataTransformer and FlyerProcessingService for better traceability.
- Updated tests to ensure proper logging and functionality in the FlyerProcessingService.
- Refactored logger client to support structured logging for better consistency across the application.
2025-12-13 20:02:18 -08:00
2affda25dc Refactor geocoding services and improve logging
- Updated the Nominatim geocoding service to use a class-based structure and accept a logger instance for better logging control.
- Modified tests for the Nominatim service to align with the new structure and improved logging assertions.
- Removed the disabled notification service test file.
- Added a new GeocodingFailedError class to handle geocoding failures more explicitly.
- Enhanced error logging in the queue service to include structured error objects.
- Updated user service to accept a logger instance for better logging in address upsert operations.
- Added request-scoped logger to Express Request interface for type-safe logging in route handlers.
- Improved logging in utility functions for better debugging and error tracking.
- Created a new GoogleGeocodingService class for Google Maps geocoding with structured logging.
- Added tests for the useAiAnalysis hook to ensure proper functionality and error handling.
2025-12-13 17:52:30 -08:00
728f4a5f7e Refactor useWatchedItems hook to utilize useApi for API calls, update tests accordingly
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Failing after 18m15s
- Replaced direct API calls in useWatchedItems with useApi hook for add and remove watched items.
- Updated tests for useWatchedItems to mock useApi and verify API interactions.
- Consolidated error handling for API calls in useWatchedItems.
- Adjusted related hooks and components to ensure compatibility with the new structure.
- Added new ScaleIcon component for UI consistency.
- Implemented useFlyerItems and useFlyers hooks for fetching flyer data.
- Created useMasterItems and useUserData hooks for managing master grocery items and user data.
- Developed useInfiniteQuery hook for handling paginated API responses.
- Added comprehensive tests for useApi and useInfiniteQuery hooks.
- Introduced comparePrices API endpoint and corresponding client-side functionality.
2025-12-13 08:57:15 -08:00
117f034b2b ADR1-3 on routes + db files
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 17m30s
2025-12-12 16:09:59 -08:00
e37a32c890 route testing refactoring using zod - ADR-003
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 16m3s
2025-12-12 13:16:58 -08:00
d004efb84b testing ADR - architectural decisions
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 16m21s
2025-12-12 10:57:49 -08:00
1bd27d7112 testing ADR - architectural decisions
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 14m37s
2025-12-12 00:23:12 -08:00
0b3d095c9c ADR ++ good
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Has been cancelled
2025-12-12 00:06:01 -08:00
8b06a66b17 testing ADR - architectural decisions
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Has been cancelled
2025-12-12 00:01:35 -08:00
d3d637ebfe unit test fixes + error refactor
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 13m41s
2025-12-11 21:17:48 -08:00
5d7598eadf unit test fixes + error refactor
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 12m45s
2025-12-11 20:26:34 -08:00
27ef5901f1 unit test fixes + error refactor
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 11m53s
2025-12-11 19:20:38 -08:00
0bc65574c2 unit test fixes + error refactor
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 10m52s
2025-12-11 18:23:59 -08:00
5f1901b93d unit test fixes + error refactor
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 10m20s
2025-12-11 14:16:25 -08:00
d6f0b446a5 add price history routes and implement modal hook; enhance MainLayout tests with default mock values
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 9m36s
2025-12-11 03:26:05 -08:00
6aa72dd90b unit test fixin
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 8m50s
2025-12-11 00:53:24 -08:00
99d0dba296 better errors for routes
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Failing after 8m2s
2025-12-10 22:53:30 -08:00
b929925a6e lots more tests !
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Failing after 7m32s
2025-12-10 21:02:01 -08:00
d1ff066d1b deploy changes for prod/test
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy-production (push) Has been cancelled
Deploy to Web Server flyer-crawler.projectium.com / deploy-to-test (push) Has been cancelled
Deploy to Test Environment / deploy-to-test (push) Failing after 7m21s
2025-12-10 17:21:07 -08:00
5ad632b8d0 deploy changes for prod/test
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy-to-test (push) Failing after 7m16s
Deploy to Web Server flyer-crawler.projectium.com / deploy-production (push) Has been skipped
Deploy to Test Environment / deploy-to-test (push) Failing after 7m22s
2025-12-10 13:51:30 -08:00
37cb1825af deploy changes to test and production environments
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy-to-test (push) Failing after 7m17s
Deploy to Web Server flyer-crawler.projectium.com / deploy-production (push) Has been skipped
Deploy to Test Environment / deploy-to-test (push) Failing after 7m23s
2025-12-10 13:14:34 -08:00
8d12f744bc main page improvements
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 8m2s
2025-12-10 12:42:07 -08:00
0694a5501f added genai rate limiting
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 7m47s
2025-12-10 10:29:57 -08:00
331df90f1b testing flyer upload
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 6m12s
2025-12-10 09:44:46 -08:00
7dc53831ff some minor log in fixes - also new flyer function
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 6m14s
2025-12-10 09:31:22 -08:00
8da5a2118e registration errors in progress
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 6m16s
2025-12-10 08:41:30 -08:00
7912d29961 home page errors in progress
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 8m50s
2025-12-09 23:41:18 -08:00
12e6b0b44d home page errors in progress
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 6m0s
2025-12-09 23:29:17 -08:00
e39a7560ee home page errors in progress
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 5m57s
2025-12-09 23:11:09 -08:00