feat: portage ancienne API + enveloppe data systématique sur les réponses#14
Open
lucas-luchack wants to merge 6 commits into
Open
feat: portage ancienne API + enveloppe data systématique sur les réponses#14lucas-luchack wants to merge 6 commits into
lucas-luchack wants to merge 6 commits into
Conversation
Version Preview
|
0aa9783 to
7892205
Compare
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 28946910 | Triggered | Generic Password | 94206de | .github/workflows/ci.yml | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
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.
Contexte
Cette PR porte les fonctionnalités de l'ancienne API vers Adonis et standardise le format des réponses (enveloppe
data) sur l'ensemble des endpoints.Changements
1. Portage des fonctionnalités « ancienne API »
GET/POST events/:id/response) etGET events/:id/roster. Validators associés (app/validators/event.ts).GET stocks(résumé par good),GET stocks/:id/batches(lots avec quantité restante calculée FEFO),POST stocks/:id/batches/:batchId/discard. Logique métier isolée dansapp/services/stock_service.ts(calcul du remaining dérivé des mouvementsOUT, pas de valeur stockée).summary(coût + dernier prix) et:id/ingredients(recette avec stock et prix fournisseur).pointssurmembers,durationsurevents,rank/instructionsur le pivotproduct_goods(+ exposition viapivotColumnssur les modèlesGood/Product).request_logger_middleware.ts./v1protégé parmiddleware.auth(), préfixesv1/authetv1/account.MemberTransformer(avecrole/points), ajustementsUserTransformer.2. Standardisation de l'enveloppe
dataAuparavant l'enveloppe
{ data: ... }n'était appliquée que ponctuellement (et jamais sur les tableaux,BaseSerializerne wrappant pas les arrays). Désormais toute réponse ayant du contenu est enveloppée :providers/api_provider.ts: leserializeexporté normalise l'entrée (toPlain: modèle Lucid →.serialize(), tableau → map récursif) puis ajoute la branche manquante « tableau →{ data: [...] }».categories,furnitures,permissions,suppliers,stock_batches,stock_movements,fast_passes,logs,goods,members,roles,restocks,products) : chaque réponse passe parserialize(...).eventssimplifié.access_token.store,events.get/setResponse) :{ data: <valeur> }explicite (les primitives ne sont pas enveloppées par le serializer).case_converter_middleware: gère aussiBaseModeletDateTime(→ ISO) avant conversion snake_case.API.md: documentation du contrat de réponse.Tests
auth_guard,event_availability,stock_summary(assertions mises à jour pour le nouveau contrat{ data }).tsc --noEmitpasse.