Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/#349 - history and scan lists now have displayed timestamps #401

Merged
merged 4 commits into from
Jun 17, 2021

Commits on Jun 4, 2021

  1. feature/openfoodfacts#349 - history and scan lists now have displayed…

    … timestamps
    
    History and Scan lists now behave differently from the other lists.
    They use "extra data": a product is in the History (or the Scan) list
    if it has as an "extra data" the "last seen timestamp" (or the last scan timestamp).
    
    Bad news: as it's a new concept in the app, we'll start from scratch for both lists.
    
    Impacted files:
    * `continuous_scan_model.dart`: new way of adding a product to scanned products; refactoring
    * `continuous_scan_page.dart`: unrelated color fix
    * `dao_product.dart`: added "last seen" and "last scan" as extra data, with a direct access to products that have those extra data
    * `dao_product_list.dart`: history and scan lists are now handled as "different" lists, computed from the "last seen" and "last scan" extra data; refactored
    * `product_list.dart`: added extra `int` data; cleaner "same product list" test
    * `product_list_dialog_helper.dart`: cleaner "same product list" test
    * `product_list_page.dart`: added dates to the display
    * `product_page.dart`: simplified history management
    * `smooth_product_card_found.dart`: added an optional `refresh` parameter, after visiting the product page
    monsieurtanuki committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    abc4fab View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2021

  1. feature/openfoodfacts#349 - now we store and display the whole histor…

    …y and scan timestamps
    
    In table `product_extra` we added an `int` column:
    * the primary keys are barcode and "extra key" (e.g. an id for each different list)
    * there is an `int` value and a `String` value
    * the `int` value is used for ordering data (timestamps or 1,2,3,...)
    * the `String` value is used for storing more complex data as json (e.g. the list of timestamps for history)
    
    The contents of table `product_extra` can be stored in flutter code with the new class `ProductExtra` (basically, `int` and `String`)
    
    For the moment the history and scan timestamps of each product are available via a lousy button at the end of the page.
    
    New file:
    * `product_extra.dart`: Extra data attached to a Product when it belongs to a ProductList
    
    Impacted files:
    * `dao_product.dart`: added an `int` column to the product extra table; now we use new class `ProductExtra`; refactored
    * `dao_product_list.dart`: now we use new class `ProductExtra`; refactored
    * `local_database.dart`: upgraded the db version because of a new column; added helper method `timestampToDateTime`
    * `product_list.dart`: now we use new class `ProductExtra`; refactored
    * `product_list_page.dart`: now we use new class `ProductExtra`
    * `product_page.dart`: added a sample button at the end of the page in order to display all history and scans related to the product
    monsieurtanuki committed Jun 9, 2021
    Configuration menu
    Copy the full SHA
    bcd1511 View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2021

  1. feature/openfoodfacts#349 - refactoring the db + storing the product …

    …refresh timestamps
    
    New files:
    * `abstract_dao.dart`: DAO abstraction
    * `dao_product_extra.dart`: DAO for Product Extra data
    
    Impacted files:
    * `barcode_product_query.dart`: automatically storing the product in the database
    * `continuous_scan_model.dart`: refactored
    * `dao_product.dart`: now extends new class `AbstractDao`; moved code to new class `DaoProductExtra`; refactored; optimized bulk actions
    * `dao_product_list.dart`: now extends new class `AbstractDao`; now using new class `DaoProductExtra`; removed a SQLite foreign key for performance reasons; not storing products anymore (it's done somewhere else)
    * `database_product_list_supplier.dart`: refactored because of `ProductListSupplier`
    * `local_database.dart`: new database version; added `DaoProductExtra`
    * `main.dart`: more verbose database crash message
    * `product_dialog_helper.dart`: minor refactoring
    * `product_list_supplier.dart`: refactored
    * `product_page.dart`: now we display the access, the scan and the refresh timestamps in the lousy temporary button
    * `product_query_model.dart`: removed the code regarding storing products in the database as it's now done in the `QueryProductListSupplier`
    * `product_query_page.dart`: minor refactoring
    * `product_query_page_helper.dart`: refactored because of `ProductListSupplier`
    * `query_product_list_supplier.dart`: automatically storing the products in the database; refactored because of `ProductListSupplier`
    monsieurtanuki committed Jun 17, 2021
    Configuration menu
    Copy the full SHA
    30b549e View commit details
    Browse the repository at this point in the history
  2. feature/openfoodfacts#349 - refactoring the db + storing the product …

    …refresh timestamps
    
    Impacted file:
    * `continuous_scan_model.dart`: minor private variable renaming
    monsieurtanuki committed Jun 17, 2021
    Configuration menu
    Copy the full SHA
    c9ee397 View commit details
    Browse the repository at this point in the history