Provide Product type and functions for sorting lists of products
{ id : Basics.Int
, source : String
, manufacturer : String
, product_code : String
, description : String
, scale : String
, category : String
, url : String
, image_url : Maybe String
, price : String
, display_short_description : Basics.Bool
, indexed : Basics.Bool
, first_seen : Date
, last_price_update : Date
}
Product type
Possible sort directions
{ columnName : String
, accessor : Product -> String
, direction : SortDirection
}
Details of what column is currently sorted, and how to sort it
sortDirection : String -> SortDescription -> SortDirection
Given a column name and the current sort description, determine the appropriate sort direction
toggleSort : String -> (Product -> String) -> SortDescription -> SortDescription
Given a column name to sort on and the current sort description, determine the new sort description
productSources : List String
List of product sources