Skip to content

Draft: Generic query search approach implemented in stores endpoint

KoeMai requested to merge 1664-prepare-store-backend-to-search-for-stores into master

Closes #1664

What does this MR do?

Search engine

A generic approach for search arguments is created.

Following filters are implemented

  • InList
  • StartWith

The following elements are implemented for store endpoint

  • cooperationStatus:in:value1,value2
  • teamStatus:in:value1,value2
  • name:sw:beginOfName

valueX and beginOfName can be replaced by field related values.

Using for search of stores in map

Replace special endpoint for map with store own endpoints. The map is for stores only, a different representation of the store lists.

  • Add an endpoint /api/stores which supports query search functions.
  • Extent endpoint /api/user/current/stores/details which supports query search functions.
  • Removed stores handling in endpoint /api/map/markers

How confident are you it won't break things if deployed?

Should not have side effects.

Links to related issues

How to test

API

  1. Checkout branch locally
  2. Login as foodsaver
  3. Go to API Doc
  4. Go to GET /api/stores
  5. Try to search with cooperationStatus:in:1,2
  6. Try to search with name:sw:betrieb_

Map

  1. Checkout branch locally
  2. Login as foodsaver
  3. Search for stores with open team
  4. Search for your stores
  5. Search for stores with no cooperation
  6. Combine searches

Screenshots (if applicable)

Checklist

  • added a test, or explain why one is not needed/possible...
  • no unrelated changes
  • asked someone for a code review
  • set a "for:" label to indicate who will be affected by this change
  • added to the next milestone (see https://gitlab.com/foodsharing-dev/foodsharing/-/milestones, unless it has a "for:Dev" label)
  • added an entry to CHANGELOG.md
  • added a short text that can be used in the release notes
  • Once your MR has been merged, you are responsible to create a testing issue in the Beta Testing forum: https://foodsharing.de/?page=bezirk&bid=734&sub=forum. Please change the MRs label to "state:Beta testing".
    • Consider writing a detailed description in German.
    • Describe in a few sentences, what should be tested from a user perspective.
    • Also mention different settings (e.g. different browsers, roles, ...) how this change can be tested.
    • Be aware, that also non technical people should understand.

Release notes text in German

Closes #1664

Edited by KoeMai

Merge request reports