Updates the `createBackorderConfirmation` API call to dynamically specify whether to create a backorder (reliquat) or not.
Introduces a `toBackorder` parameter, enabling the API to handle both "with backorder" and "without backorder" scenarios based on user selection. This centralizes the backorder status setting within a single API call.
Additionally, adds loading indicators to the backorder dialog buttons for improved user feedback during the confirmation process.
Corrects API endpoints for creating, processing with, and processing without backorder confirmations.
Adds a new `isBackorder` getter to stock picking records for identifying backordered items, and improves the robustness of the `isDone` getter.
Integrates backorder detection into the reception validation process, prompting a dedicated confirmation dialog when a backorder is present.
Introduces new state management and methods (`withBackorder`, `withoutBackorder`) in the reception details model to handle the backorder confirmation logic.
Enhances the primary button component with a `backgroundColor` property for greater customization.
Implements the API calls necessary to handle backorder confirmations.
This enables the application to manage scenarios where the received product quantity is less than requested. It provides functions to:
- Generate the backorder confirmation popup.
- Process the confirmation to create a backorder.
- Process the confirmation to cancel the backorder.
Refactors the reception process to provide clearer control over data synchronization and validation.
- Replaces the `isDraft` property with `synchronized` in `StockPickingRecordEntity` to accurately represent the local data's sync status with the backend.
- Introduces a new API endpoint and corresponding logic for `validateStockPicking`, allowing finalization of receptions.
- Splits the "Save" action into "Synchronize data" and "Validate reception" on the details page. "Validate" now implicitly performs a synchronization first.
- Updates UI elements (cards, quick actions) to reflect the new synchronization state and expose the new actions.
- Corrects a typo in the `updateAllMoveLineOnStockPicking` API method name.
- Improves local data update logic for scanned items, marking them as unsynchronized.
Moves the `fromList` method from a factory constructor within the DTO class to an instance method within an extension. This refactors the way DTOs are instantiated from lists, promoting better organization of related utility logic outside the main class definition.
Introduces the ability to validate a stock reception by sending updated move line quantities to the backend.
This includes:
- Adding a new API call to update stock picking move lines.
- Integrating a "Validate Reception" button within the quick actions component on the reception details page.
- Implementing the logic to gather move line data and call the new API endpoint.
- Enhancing error messages on the scan page for products not expected in the current reception.
- Improving type safety for API response data.
Introduces an `isDraft` property to `StockPickingRecordEntity` to mark receptions with local modifications.
Automatically sets a reception to draft status when a product's quantity is incremented via scanning. Displays a 'Brouillon' chip on reception cards to provide visual feedback for draft operations.
Ensures reception details are refreshed after scanning to reflect the updated draft status and provides immediate error feedback when no product is found during a scan.
Moves product lookup from external API calls to a local ObjectBox database. This improves performance and enables offline product identification during scanning.
Removes the standalone scanner page, consolidating barcode scanning functionality directly into the reception flow for a more streamlined user experience.
Updates ObjectBox entity fields by removing `final` modifiers, allowing the database to manage and update persisted data effectively. Introduces new methods in the reception scan model to support local product checks, retrieval, and quantity increment for scanned items.
Fetches detailed move line and move data, including product information, for stock picking records from the API. Centralizes ObjectBox persistence within `toEntity()` methods for product, move line, and move models, ensuring data is saved upon conversion. Correctly associates product entities with move line and move entities in the local database. Refactors API call processing to directly return mapped entities, leveraging the updated `toEntity()` behavior.
Enables offline capabilities and improved data access for stock picking records.
API calls now prioritize local ObjectBox storage when offline and persist fetched data upon successful remote retrieval.
Introduces comprehensive model-to-entity conversion logic for stock picking data and its related models.
Updates UI components and state management to directly consume ObjectBox entities, optimizing data display and interaction.
Adjusts ObjectBox entity schema for improved flexibility and adds utility getters.
Refactors the `getAllStockPiking` API call to directly return a list of `StockPickingRecordModel`.
This change simplifies the data structure by removing the `StockPickingResponseModel` wrapper, making the `receptions` state in `ReceptionPageState` a direct, non-nullable list. It improves type safety and reduces verbose property access in the UI.
Introduces a comprehensive set of ObjectBox entities to support local storage and management of stock picking data.
This includes:
* `StockPickingRecordEntity`: The primary entity for stock picking records, encompassing various attributes and relations.
* Related entities: `StockPickingCompanyEntity`, `StockPickingPartnerEntity`, `StockPickingLocationEntity`, and `StockPickingTypeEntity` for associated data.
* Move entities: `MoveLineWithoutPackageEntity` and `MoveWithoutPackageEntity` for detailed product movements within a picking record, including relations to product data.
These entities enable efficient local data persistence and querying for stock picking operations.
Moves `StockPickingCompanyModel`, `StockPickingPartnerModel`,
`StockPickingLocationModel`, and `StockPickingTypeModel` to
`stock_picking_record_model.dart`. This consolidates related schema
definitions for improved organization and clarity.
Enables the floating action button on the reception details page
to navigate to the scanner route, streamlining the workflow.
Improves JSON deserialization for product and stock picking models by
using custom `fromJson` methods and explicit `JsonKey` mappings.
This ensures robust parsing of fields like barcode, display name, and product IDs.
Adds a new `ecart` getter to calculate the difference between requested
and received quantities for stock moves.
Updates the reception details page to display a list of products
with their requested, received, and calculated difference quantities.
Removes redundant JSON-RPC fields from the `stock.picking/web_read` API call.
Refactors `StockPickingRecordModel` to use generic `fromJson` utility functions for robust JSON deserialization, gracefully handling null or unexpected values for various fields.
Updates the stock picking API call to filter by `picking_type_code` ("incoming") instead of a hardcoded `picking_type_id`, enhancing clarity and maintainability.
Removes unnecessary `id`, `jsonrpc`, and `method` parameters from the API request and the `userId` field from the model.
Refactors the product data model to primarily store `id`, `barcode`, and `displayName`. This simplifies the product structure, focusing on essential attributes for inventory and scanning operations.
Optimizes API calls for stock picking to fetch more relevant product details. Unnecessary fields are removed, and specific product attributes like `barcode` and `quantity` are now explicitly requested for stock moves.
Moves `StockPickingRecordModel` to its own dedicated file for improved code organization and maintainability. Updates all affected UI components and scanner logic to align with the revised product model.
Introduces an `isDone` extension property for stock picking records to simplify status checks.
Enhances the `StockPickingCard` to visually represent the picking's completion status with a distinct icon and color (green for 'done', grey for 'in progress'), improving clarity at a glance. Information row values are now consistently uppercased.
Conditionally displays scan-related actions (QuickActionComponent and FloatingActionButton) in the reception details page, making them available only when the picking is not yet completed. This guides users by preventing interactions on finished operations.
Performs a comprehensive project rename from 'barcode_scanner' to 'e_scan' (or 'eScan' for user-facing labels). This update spans all relevant files, including:
- Application IDs and bundle identifiers for Android, iOS, macOS, and Linux.
- VS Code launch configurations.
- Dart package import paths.
- Project names and titles in `pubspec.yaml`, `README.md`, and platform-specific configurations (e.g., CMakeLists, Info.plist, AndroidManifest).
Implements a dedicated page for viewing detailed stock picking information.
- Introduces `getStockPikingById` API call to fetch a single stock picking record by ID.
- Enhances `MainAppbarComponent` to support customizable leading widgets, enabling a back button on detail pages.
- Improves `QuickActionComponent` by allowing optional `onTap` callbacks for actions, making buttons conditionally visible and reusable across different contexts.
- Adds `margin` property to `StockPickingCard` for flexible layout adjustments.
- Refactors `ReceptionDetailsPage` to utilize the new API call and display a single stock picking's details, adapting its app bar and quick actions accordingly.
Updates the sign-in API endpoint to `/simpos/v1/sign_in`.
Captures the `set-cookie` header from successful sign-in responses and stores it as a `sessionId`.
Persists the session ID using secure storage and includes it in subsequent API requests via the `Cookie` header for improved session management.
Extends the `AuthModel` to include the new `sessionId` field.
Enables navigation from the reception list to a new reception details page, passing the selected reception's ID.
Refactors the `StockPickingCard` into a dedicated component and adds loading indicators to the reception list.
Adds a new API call (`getAllStockPiking`) to retrieve stock picking records from the backend.
Refactors stock picking data models:
- Renames models for better clarity (e.g., `StockPickingResponse` to `StockPickingResponseModel`).
- Makes all model fields nullable to handle varying API responses gracefully.
- Introduces specific nested models (`StockPickingCompanyModel`, `StockPickingPartnerModel`, `StockPickingLocationModel`, `StockPickingTypeModel`) for related entities, enhancing type safety and data structure.
Integrates the new API call into `ReceptionPageModel` and introduces distinct loading states (`loadingUser`, `loadingReceptions`) for improved UI feedback.
Renames `AuthStruct` to `AuthModel` and `ProductStruct` to `ProductModel` to align with a consistent data model naming convention.
Updates all relevant imports, type declarations, and method signatures across the application to reflect these changes, improving codebase clarity and maintainability.
Includes minor code style improvements and refactorings in other components.
Replaces the mocked login flow with an actual API call to an authentication endpoint.
Updates the `AuthStruct` schema to align with the new API response, including fields for `accessToken`, `dbName`, `uid`, `name`, and `username`.
Introduces a `UserConnectedProvider` service for managing the storage and retrieval of authenticated user details, centralizing this logic and replacing prior direct local storage methods.
Integrates the new authentication process and user storage service into the login, reception, and profile pages for a unified experience.
Adjusts the splash screen duration to reflect the real-time nature of the authentication check.
Adds an `image` field to the user data structure to support profile pictures.
Introduces a new profile page and sets up navigation from the home screen.
Changes the product list page provider to auto dispose for improved resource management.
Enables viewing and editing existing product details by passing the product ID to the form page. The form now loads and displays the product data based on the provided ID.
Adds a delete button to each item in the product list, allowing users to remove products directly from the list view.
Updates navigation from the product list and scanner pages to pass the product ID when navigating to the product form.
Includes minor code style changes by applying the `sort_constructors_first` lint rule and updates dependencies (`flutter_lints`, `lints`).
Configures the ObjectBox ProductEntity to allow assigning IDs. Adds a helper to convert ProductStruct to ProductEntity for easier storage.
Saves scanned products directly to the local ObjectBox store.
Updates the ProductListPage to fetch and display locally stored products from ObjectBox upon initialization.
Includes minor UI adjustments in the scanned product component and scanner page, and fixes loading state handling in HomePageModel.
Integrates Objectbox database initialization into the main application startup process.
Adds `path` and `path_provider` as direct dependencies, which are typically required for Objectbox to locate the database directory.
Adds the ObjectBox database dependency for local data persistence.
Updates the Product ID field type from nullable String to non-nullable int with a default value of 0 to align with ObjectBox's integer ID requirements. Includes necessary generated files for plugin registration and model serialization.
Introduces a side navigation drawer on the home page to improve navigation and centralize user actions.
Displays the logged-in user's information (name, email) in the drawer header.
Adds a link to the Product List page ("Inventaire") within the drawer.
Moves the logout functionality to the drawer, ensuring user data is also cleared from local storage upon logout.
Ensures user data is saved to local storage during the login process and fetched when the home page loads.
Includes minor text updates on the Product Form page.
Replaces print statements with debugPrint across the application to prevent logging in release builds.
Removes unused imports and variables for minor code cleanup.