openfoodfacts / openfoodfacts-dart

Open Food Facts API Wrapper
https://pub.dev/packages/openfoodfacts
Apache License 2.0
169 stars 67 forks source link

Coordinate with the server to integrate the new moderation experience #885

Open teolemon opened 1 year ago

teolemon commented 1 year ago

What

The new moderation tool is about to be deployed. Will update this as a backend is finalized https://nutripatrol.openfoodfacts.org/api/docs

### API Endpoints for the new moderation experience
- [ ] POST /flags: Create a new flag for a product or image.
- [ ] GET /flags: Get a list of all flags.
- [ ] GET /flags/{flag_id}: Get a specific flag by its ID.
- [ ] POST /tickets: Create a new ticket for a product or image issue.
- [ ] GET /tickets: Get a list of all tickets.
- [ ] GET /tickets/{ticket_id}: Get a specific ticket by its ID.
- [ ] GET /tickets/{ticket_id}/flags: Get all flags associated with a specific ticket.
- [ ] PUT /tickets/{ticket_id}/status: Update the status of a ticket (open or closed).

Data Models

PoC @raphael0202 + Valentin

https://github.com/openfoodfacts/nutripatrol https://github.com/openfoodfacts/nutripatrol/blob/main/app/api.py

Part of

teolemon commented 9 months ago

@monsieurtanuki the API doc has just been deployed by @raphael0202

teolemon commented 4 months ago

@g123k @monsieurtanuki NutriPatrol is now live in production

Tickets only available to moderators Flagging available to everyone (logged-in) Flagging webviews by Valentin: A product https://nutripatrol.openfoodfacts.org/flag/product?barcode=3017620422003&source=web&flavor=off A image https://nutripatrol.openfoodfacts.org/flag/image?barcode=3017620422003&source=web&flavor=off&image_id=1

We can do it in two times, integrate as links to webviews, then integrate natively at a later point. All the more that integrations need to be done at several places, and that's some work: https://github.com/openfoodfacts/smooth-app/issues/5390

monsieurtanuki commented 4 months ago

@teolemon I guess it would be easy for me to replicate for nutripatrol what was done for prices, on the off-dart level. Then Valentin could work on the Smoothie side. @g123k Would that be ok with you or would you like Valentin to work on both off-dart and Smoothie for nutripatrol?

monsieurtanuki commented 4 months ago

@g123k ping

monsieurtanuki commented 3 months ago

Oh, I hadn't understood that nutripatrol couldn't be used as an API for the moment (e.g. "Login with your OpenFoodFacts account" when I click on https://nutripatrol.openfoodfacts.org/flag/product?barcode=3017620422003&source=web&flavor=off and there's no matching API flag entry).

raphael0202 commented 2 months ago

@monsieurtanuki I'm not sure to understand, Nutripatrol can be used as API:

https://nutripatrol.openfoodfacts.org/api/v1/flags

monsieurtanuki commented 2 months ago

@raphael0202 Fair enough. I guess I clicked on the first link provided, which opened a HTML page.

Valimp commented 1 month ago

Could you assign me this issue please ?