-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add feature to filter types of refill spot #13
Comments
Please check notion link for more details: |
[In the design there are some example tags next to the filter icons](https://www.figma.com/file/HfT3GwZlpR6q9RScMNdF5D/mymizu-Web-App?node-id=0%3A1)
Then if you click the filter icon there is a modal with the full range of sorting/filtering options displayed
- Please do not implement the sort filter yet, or how to refill
|
Hackathon 2023 Design Idea Dump: The search should be done in the Database (Eloquent ORM)
The search result is a logcial expressionFrom the above mock-up design The boolean expression becomes ( ("cold" or "filtered") and ("help yourself") and ("wi-fi" or "Rest space") ) Using the [[3, 1], [9], [4, 10]] a query would need to look like $users = DB::table('tags')->where([
['3','1'], // cold
['1','1'], // filtered
])->orWhere([
['9', '1'], // help yourself
])->orWhere([
['4', '1'], // wi-fi
['10', '1'], // Rest space
])->get(); The backend could generate this dynamically with something like the following app.get("/tags/search2", async (req, res) => {
const filters = req.filters; // [[3, 1], [9], [4, 10]]
query = DB::table('tags');
for (filter : filters) {
search_query = [];
for (f : filter) {
search_query.append([f, "1"]);
}
if (filter == filters.start()) {
query->where(search_query);
} else {
query->orWhere(search_query);
}
}
res.send(query->get());
}); Problems with current APIThe above proposal has 2 issues with the current
This means a potential new How buttons are added to filter listWhen the {
"id": 1,
"name": "Facilities",
"tags": [
{
"id": 4,
"name": "Wifi"
},
{
"id": 5,
"name": "Wheelchair-Accessible"
}
]
}, becomes a row of buttons where when clicked, the Finding if the place is openThe biggest issue of finding if a place is open is the fact time zones are different where you look. If 2 locations in Japan and Austrilla are open at This can be resolved into a boolean expression as (day == current_day_of_week) and (current_time > opening_time) and (current_time < closing_time) |
Depends on #9

Display filtering options so that users can narrow down selection
How to achieve with API:
/tags
endpoint to list out all available tags/taps/search
endpoint (tag_ids parameter), and this will mean results only include spots with those tagsThe text was updated successfully, but these errors were encountered: