Commit Graph

524 Commits

Author SHA1 Message Date
AmirReza Jamali 50e4f43738 feat: add AI recommendations flow for tenders
Implement company AI onboarding/recommendation models, services, repository, and tender UI integration with supporting tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 11:47:52 +03:30
a.jamali 83b32549ce Merge pull request 'Refactor network request handling by introducing AuthInterceptor for improved authentication management. Removed the previous request interceptor logic to streamline the code and enhance maintainability.' (#227) from auth-interceptor into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/227
Reviewed-by: Hadi Barzegar <barzagarhadi@gmail.com>
2026-06-13 16:27:49 +03:30
AmirReza Jamali 231d800b47 Fix AuthInterceptor replay logout-on-transient-error + add tests
Address PR re-review findings:
- Only a 401 on the replay falls through to logout; other DioExceptions
  (timeout, connection drop, 5xx) now propagate so a flaky network can't
  wipe a valid session and callers see the real error.
- Skip the refresh when the failed request's bearer no longer matches the
  stored one (a concurrent refresh already rotated it) and replay directly.
- Guard _logout() with a _loggingOut flag so the auth-failed callback fires
  once per burst rather than once per concurrent caller.

Add unit tests (fake Dio adapter + mocked prefs) covering the retry guard,
single-flight refresh, and non-401 replay propagation paths.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 16:20:23 +03:30
AmirReza Jamali deda384aaa Harden AuthInterceptor: retry guard, single-flight refresh, shared pref keys
Addresses PR review on the auth interceptor:

- Guard against unbounded retry recursion: tag the replayed request with
  extra['auth_retried'] and skip the refresh/replay path on a second 401 so
  it can't recurse refresh -> replay indefinitely. Drop the redundant manual
  Authorization header on the replay (onRequest re-injects it).
- Fix the concurrent-refresh race: coalesce concurrent 401s onto a single
  in-flight refresh future so the rotating refresh token is only consumed
  once, instead of later refreshes posting an already-consumed token and
  spuriously logging out. (Chose the shared-future approach over
  QueuedInterceptor, which deadlocks with the replay-via-same-Dio pattern.)
- Centralise the 'bearer' / 'refresh_token' / 'customer_data' pref keys in
  a PrefKeys constants class used by the interceptor, network manager, auth
  service and router so they can't silently diverge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 12:21:03 +03:30
AmirReza Jamali 633f0ba881 Refactor network request handling by introducing AuthInterceptor for improved authentication management. Removed the previous request interceptor logic to streamline the code and enhance maintainability. 2026-06-10 11:34:45 +03:30
a.jamali 7c123905b3 Merge pull request 'Add Docker support and enhance data models for tender details' (#226) from milliseconds-timestamps into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/226
2026-06-06 14:37:42 +03:30
AmirReza Jamali aa9c9444fa Remove unused DetailDropDown and TenderDetailCard components to streamline codebase and improve maintainability. These components were previously disabled and retained for potential future use. 2026-06-06 12:25:49 +03:30
AmirReza Jamali 86ed7bc665 Refactor tender detail models and UI components for improved clarity and functionality
- Updated the `Lot`, `Organization`, and `OrganizationAddress` models to enhance data mapping for tender details.
- Revised the `TenderData` model to include additional fields reflecting the API response structure.
- Improved UI components across desktop, mobile, and tablet views by commenting out unused sections for future use.
- Added new string constants for lot details in the tender information section.
- Enhanced unit tests to cover new model fields and ensure resilience to partial API payloads.
2026-06-05 19:42:09 +03:30
AmirReza Jamali dde66521f6 Add Docker support and enhance data models for tender details
- Introduced a .dockerignore file to optimize Docker builds by excluding unnecessary files.
- Updated the Dockerfile to use a Flutter base image, enabling web builds for the application.
- Added new data models for `Lot` and `OrganizationAddress` to represent tender details more accurately.
- Enhanced the `Organization` model to include `companyId` and a nested `address` field.
- Updated the `TenderData` model to include new fields such as `noticeTypeCode`, `formType`, and `lots`, reflecting the API response structure.
- Regenerated necessary code for data models to ensure compatibility with the updated structures.
2026-06-03 13:32:42 +03:30
a.jamali 8762ea7d62 Merge pull request 'Refactor date handling in tender data model and UI components. Added unixTimestampFromJson for parsing timestamps and updated timeConvertor to handle null values. Updated relevant model fields and UI to use the new parsing logic.' (#225) from milliseconds-timestamps into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/225
Reviewed-by: Hadi Barzegar <barzagarhadi@gmail.com>
2026-05-30 18:47:21 +03:30
AmirReza Jamali 83b77c05ef Refactor card movement logic in BoardViewModel to improve error handling and success validation
- Updated the handling of card movement results to differentiate between successful and unsuccessful API responses.
- Implemented rollback of board state and error messaging for failed moves, ensuring a more robust user experience.
- Enhanced the notification system to surface relevant error messages when card movements fail.
2026-05-30 18:46:13 +03:30
AmirReza Jamali e6b4720dcd Update iOS deployment target to 13.0, enhance Flutter integration, and improve tender submission flow
- Changed the iOS deployment target from 12.0 to 13.0 in Podfile and project settings.
- Updated AppDelegate to support implicit Flutter engine initialization.
- Modified Info.plist to include scene configuration for multiple scenes.
- Enhanced CompletionOfDocumentsRouteData to accept a tenderId parameter.
- Implemented tender submission functionality in TenderDetailViewModel and updated UI components to reflect loading states and success/error messages.
- Added new strings for submission success and error notifications.
2026-05-30 16:48:05 +03:30
AmirReza Jamali ae08b946f6 Refactor tenders pagination and enhance API integration
- Updated TendersRepository and TendersService to support cursor-based pagination.
- Modified TendersViewModel to manage pagination state and handle API responses more effectively.
- Replaced existing pagination UI components with a new WindowedPagination widget across desktop, mobile, and tablet views.
- Improved notification handling in the UI to reflect the presence of notifications dynamically.
- Adjusted main tenders slider to ensure proper rendering based on the current page index.
2026-05-26 18:30:46 +03:30
AmirReza Jamali 02057988dc Remove TaskStatus enum and related extensions, refactor BoardService and BoardResponse models for improved API integration, and update BoardViewModel to handle card movements between columns. Adjust UI components to reflect these changes and enhance error handling for card operations. 2026-05-26 10:41:34 +03:30
AmirReza Jamali 4b1260a437 Update home page navigation to reinitialize ViewModel after navigating to liked tenders 2026-05-25 18:21:13 +03:30
AmirReza Jamali 35af3e94ea Add liked tenders functionality to HomeRepository and ViewModel
- Integrated LikedTendersService into HomeRepository to fetch the count of user-liked tenders.
- Updated HomeViewModel to load and manage the userLikedTendersCount.
- Adjusted UI components across home pages to display the liked tenders count.
- Refactored date handling in date_utils.dart to improve timestamp parsing and validation.
- Enhanced unit tests for date utilities to cover new edge cases.
2026-05-24 18:23:37 +03:30
AmirReza Jamali 2515190576 Refactor date handling in tender data model and UI components. Added unixTimestampFromJson for parsing timestamps and updated timeConvertor to handle null values. Updated relevant model fields and UI to use the new parsing logic. Added unit tests for date utilities. 2026-05-24 15:28:47 +03:30
a.ghabeli 4525e06119 Merge pull request 'profile_changes' (#224) from profile_changes into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/224
2026-05-24 12:13:00 +03:30
amirrezaghabeli d87fc452c7 fixed tenders detail date times 2026-05-05 13:56:18 +03:30
amirrezaghabeli 00a3180499 edit key word api added 2026-04-25 12:13:49 +03:30
amirrezaghabeli eb75952b8e profile tabs fixed 2026-04-19 12:37:39 +03:30
amirrezaghabeli c6cb3221ab profile tabs added 2026-04-18 16:36:05 +03:30
a.ghabeli 437b5c7a66 Merge pull request 'problems' (#223) from problems into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/223
2026-04-16 16:48:36 +03:30
amirrezaghabeli cc0032b21d fixed logout at refresh failed 2026-04-16 16:36:55 +03:30
amirrezaghabeli 41bba5d32c fixed home 2026-04-16 09:10:37 +03:30
Karim Pirzargar 99d30a6eb5 update build 2026-03-09 16:12:50 +03:30
amirrezaghabeli 7ae5c25ebb changed to test api url 2025-11-23 11:54:20 +03:30
Nima Nakhsotin 105149e852 Update .drone.yml 2025-11-23 10:54:46 +03:30
amirrezaghabeli a5b01ffac4 Update ProfileData model to include companies and enhance profile UI
- Added a new field for companies in the ProfileData model to store associated company information.
- Updated JSON serialization methods to handle the new companies field.
- Modified profile page views to display the user's full name and company name, replacing previous role and department fields for improved clarity.
- Introduced new string constants for full name and phone in ProfileStrings.
2025-11-23 10:47:51 +03:30
amirrezaghabeli ae8501dc36 Refactor navigation structure and update asset references
- Swapped routes for Profile and Notification branches in the app's navigation structure.
- Updated the current index for navigation items in TabletNavigationWidget and related pages to reflect the new routing.
- Added a new logo SVG asset to the asset manager for branding consistency.
- Adjusted the pubspec.lock file to downgrade several package versions for compatibility.
2025-11-22 15:29:46 +03:30
amirrezaghabeli d01e028dc1 Refactor profile data handling and update UI components
- Changed references from companyProfileData to profileData across multiple profile page views for consistency.
- Updated UI elements to display user-specific information such as username, email, role, department, and position.
- Modified the profile screen to fetch user profile data instead of company profile data.
- Added new string constants for user-related fields in ProfileStrings.
2025-11-20 17:33:30 +03:30
amirrezaghabeli 64a1c30e6c Add logo SVG asset and improve authentication error handling
- Added a new logo SVG asset to the AssetsManager for better branding.
- Updated the AuthViewModel to notify listeners on authentication error changes.
- Modified DesktopNavigationWidget to use the new logo SVG with specified dimensions for improved layout.
2025-11-16 14:54:45 +03:30
amirrezaghabeli abf1cc3f7d Add board service and repository, update routes and assets
- Introduced BoardService and BoardRepository for managing board-related data.
- Updated app routes to reflect the new board screen structure.
- Added new board-related assets to the asset manager.
- Refactored BoardScreen navigation to utilize the new provider structure.
2025-11-11 12:58:05 +03:30
amirrezaghabeli a03e66f66b Enhance color theme and update board screen UI
- Added new color definitions for secondary and orange shades in AppColors.
- Updated TaskItem model to remove title and improve description handling.
- Refactored BoardScreen to utilize new color definitions and improve task display.
- Enhanced task status messaging and UI consistency across task cards.
2025-11-11 09:54:54 +03:30
amirrezaghabeli e03c87f99d Add board navigation and assets
- Introduced new board-related assets in AssetsManager.
- Updated NetworkManager to increase connection and receive timeouts to 20 seconds.
- Added BoardRouteData for navigation to the BoardScreen.
- Updated app routes to include the new board route.
- Modified DesktopNavigationWidget to include a navigation item for the board.
- Added a new string constant for the board label in TendersStrings.
2025-11-10 16:14:50 +03:30
a.ghabeli 8dc5e0ed29 Merge pull request 'Add 'Add Partnership' button to completion of documents pages' (#221) from add_Partnership_buton into main
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/221
2025-10-27 13:52:54 +03:30
amirrezaghabeli acd2a62b22 Add 'Add Partnership' button to completion of documents pages
- Introduced a new button labeled 'Add Partnership' on the desktop, mobile, and tablet versions of the Completion of Documents pages.
- The button is styled with a primary color background and rounded corners for improved UI consistency.
2025-10-27 13:52:19 +03:30
a.ghabeli eec8ea032d Merge pull request 'Update version number in pubspec.yaml to 1.1.1+7' (#220) from changed_version into main
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/220
2025-10-27 13:28:38 +03:30
amirrezaghabeli 2411ebbd0c Update version number in pubspec.yaml to 1.1.1+7 2025-10-27 13:27:59 +03:30
a.ghabeli 0f9b1de3ca Merge pull request 'Add clock asset and enhance meeting time dialogs' (#219) from design_changes into main
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/219
2025-10-27 13:23:33 +03:30
amirrezaghabeli de659ca9cf Add clock asset and enhance meeting time dialogs
- Added a new clock icon asset to the AssetsManager.
- Updated MeetingTimeBottomSheet and MeetingTimeDialog to include a close button for better user experience.
- Introduced MeetingTimeSuccessfulRegisteredBottomSheet and MeetingTimeSuccessfulRegisteredDialog for confirming meeting time registration.
- Refactored submission dialogs to improve layout and interaction consistency.
2025-10-27 13:22:51 +03:30
a.ghabeli b801d75f99 Merge pull request 'Enhance authentication flow and user role management' (#218) from fixed_role_bug into main
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/218
2025-10-14 12:26:41 +03:30
amirrezaghabeli 38222afcfa Enhance authentication flow and user role management
- Updated AuthViewModel to hydrate user data from storage on initialization.
- Added method to AuthRepository for retrieving stored customer data.
- Enhanced AuthService to save and retrieve customer data from SharedPreferences.
- Refactored UI components to use context.watch for user role updates in MeetingTimeDialog, TenderDetailActions, and TendersPage.
- Improved navigation logic in final completion pages to handle user interactions more effectively.
2025-10-14 12:24:04 +03:30
a.ghabeli a343cf2469 Merge pull request 'Implement role-based navigation in MeetingTimeDialog' (#217) from change_navigate into main
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/217
2025-10-14 10:25:57 +03:30
amirrezaghabeli cc16d28195 Implement role-based navigation in MeetingTimeDialog
- Added user role retrieval from AuthViewModel in MeetingTimeDialog.
- Updated navigation logic to conditionally push routes based on user role (admin or non-admin) when confirming meeting time.
2025-10-14 10:24:06 +03:30
a.ghabeli 63ec080e3b Merge pull request 'Enhance Customer model to include role attribute and update related components' (#216) from fixes into main
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/216
2025-10-14 09:14:05 +03:30
amirrezaghabeli 13dbb5fae5 Enhance Customer model to include role attribute and update related components
- Added a new `role` attribute to the `Customer` model in `customer.dart` and updated the corresponding generated files.
- Modified the `AuthViewModel` to set the user role based on the logged-in user's role.
- Updated UI components in `TenderDetailActions` and `DesktopTendersPage` to conditionally render elements based on the user's role.
- Refactored tests to validate the new role attribute in the `Customer` model.
2025-10-14 09:12:24 +03:30
a.ghabeli 504fa1e80a Merge pull request 'fix_bugs' (#215) from fix_bugs into main
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/215
2025-10-13 16:18:48 +03:30
amirrezaghabeli f37ddd1b88 Refactor tender status handling in desktop and tablet pages
- Updated the status checks in `_YourTendersDesktopPageState` and `_YourTendersTabletPageState` to use `TenderFeedback` values instead of string constants for better maintainability.
2025-10-13 16:18:13 +03:30
amirrezaghabeli f0cbe00b2f Update dependencies, enhance API endpoints, and refactor UI components
- Updated `pubspec.lock` to new package versions for `async`, `fake_async`, `leak_tracker`, and `vm_service`.
- Modified API endpoint for unread notifications to include `event_type=PUSH`.
- Refactored `CompletionOfDocumentsMobilePage` layout for improved structure.
- Simplified `DetailDropDown` widget by removing unnecessary animations.
- Updated `CommentBox` styling and adjusted padding for better UI consistency.
- Replaced deprecated `FormCard` implementation in final completion pages with a new widget structure.
- Enhanced button styles across various dialogs and pages for a cohesive design.
2025-10-13 16:10:18 +03:30