Repository navigation
feat(admin): réglages et journal des actions (A-11, A-12) - #500
Open
Nascimento95 wants to merge 10 commits into
Open
Nascimento95 wants to merge 10 commits into
Nascimento95 wants to merge 10 commits into
Conversation
…1, A-12) Schemas of the settings (value in force, default, bounds, update with a reason) and of the journal (lines with author, target and its name, filters, periods). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…orce (A-11) GET /admin/settings, admin only. The catalog holds the settings the API reads and applies (premium.min_steps, max_pending_routes, certification, search clustering, recommendation weights) with their bounds and default; a stored value outside them reads as the default, like the code that uses it. Settings no code reads are left out, as changing them would do nothing. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
PATCH /admin/settings/:key, admin only: the value is held to the bounds of its key (a count is whole, weights name known components and are not all zero), then written with its journal line (before, after, reason) in one transaction. The API reads settings again within a minute at most. An unknown key answers 404, a value out of bounds 400. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
GET /admin/actions, admin only: the writes of the team, most recent first, filtered by author, kind of action, kind of target, one object and period, with the name of each target (account, route, place) as it is today. GET /admin/actions/filters gives the values the filters offer. Read only. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…1, A-12) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… the journal reads (A-11, A-12) French labels of the actions, targets and periods, of each setting and its explanation; the address filters of the journal; the name, label and link of the target of a line, none for an object that is gone. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… of a setting (A-11, A-12) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…fore and after (A-12) Journal, admins only: the lines the address asks for, filtered by author, action, target and period, and next to it the detail of one line with its reason, its target (a link while it exists) and the JSON before and after. Read only. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…its history (A-11) Réglages, admins only: the settings grouped by theme with their value and whether the team changed it, and the detail of one: explanation, value, default, bounds, last change and its history from the journal. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
« Modifier » opens a window with the value (one field, or one per weight, typed with a decimal comma), the bounds, and the required reason kept in the journal. A refused value is told in a toast; once saved, the list and the history are read again. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Oct 16, 2026
Open
This was referenced Oct 16, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Résultat et problème
Changer un seuil de l'app (Premium, limite de relecture, badge, regroupement de la carte, recommandation) demandait une mise en ligne ou un accès à la base, et rien ne gardait la trace de ce que l'équipe modifie dans l'admin. A-11 « Réglages » et A-12 « Journal » règlent les deux, pour l'admin seulement.
admin_actions(avant, après, motif).GET /admin/settings,PATCH /admin/settings/:key,GET /admin/actions, plusGET /admin/actions/filterspour remplir les filtres.Réglages gérés :
premium.min_steps,max_pending_routes,certification.min_verified_routes,certification.min_rating,certification.min_completed_routes,search.cluster_area_km2,recommendation.weights. Ce sont ceux que l'API lit réellement danssettings.Limites
premium.min_stepsde 4 à 5 change l'accès des parcours au prochain recalcul » : tenu pour le réglage et le journal, non démontrable pour l'accès.premium.min_stepsne sert aujourd'hui qu'à la fiche de modération (proposition Premium) ; aucun code ne s'en sert pour donner ou retirer l'accès, et le recalcul nocturne est le ticket Planifier le recalcul nocturne et le passage en needs_fix #56, absent.coherence.*(l'API utilise les valeurs par défaut),premium.min_ratings,premium.min_rating, les seuils de vérification des lieux. Le wiki Admin-Web › A-11 les cite : à ajouter quand le code les lira. Signalé sur l'Inbox.premium.min_steps1 à 20,max_pending_routes1 à 20,certification.*comptes 0 à 100,search.cluster_area_km20,1 à 10 000. Les autres suivent le code (note 0 à 5, poids 0 à 10, pas tous à zéro).Fixes #348
Écrans : A-11, A-12
Dépendance : PR empilée sur #499 (#341, base
issue/341-users-and-roles), elle-même sur #479, #398, #365 et #363.Comment vérifier
pnpm install,docker-compose up -d,pnpm --filter @widoo/api db:migrate && pnpm --filter @widoo/api db:seed,pnpm dev./reglagesou/journal.Tests : validation par clé (bornes, entiers, poids connus et non tous nuls), écriture avec journal avant/après et motif, 403 pour moderator et editor, filtres et périodes du journal, nom de la cible ; affichage des libellés et lecture de la saisie côté admin.
pnpm lint && pnpm typecheck && pnpm testverts en local (chaque commit passe lint et types) ; l'échec connu dereports/repository.test.ts(délai de 5 s) disparaît seulFormatage mécanique : non
Risque
Niveau : 2 — un réglage change le comportement de l'app et de la modération, de façon réversible et bornée ; aucune migration.
Taille : tous les commits sous 400 lignes utiles (le plus gros : 361).
Revue OWASP (ciblée)
admin_actionsdans la transaction du changement, avec le motif obligatoire ; le journal n'a aucune route d'écriture ni de suppression.cache-control: no-store; les états avant/après ne portent que ce que chaque action change.Retour arrière
Revert de la PR, sans migration. Les valeurs déjà enregistrées dans
settingsrestent valides pour le code d'avant (mêmes clés, mêmes bornes que celles qu'il lit) ; pour revenir aux défauts, remettre les valeurs par défaut dans l'admin avant le revert, ou supprimer les lignes desettingsconcernées. Le journal garde les lignes écrites.🤖 Generated with Claude Code