mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-12 09:46:56 +02:00
feat: implement sidebar navigation and automated order management module with PostgreSQL client integration
This commit is contained in:
1 parent
d25ffdb3e7
commit
70c425befb
6 files changed
+351
-1
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { pgGetCommandesAuto } from "@/lib/pg-ff-client";
|
||||
|
||||
/**
|
||||
* GET /api/commandes-auto
|
||||
*
|
||||
* Retourne la liste des fournisseurs en commande automatique,
|
||||
* groupés par site (292, 579), avec franco et écart franco.
|
||||
*
|
||||
* Réponse :
|
||||
* [
|
||||
* {
|
||||
* site: "292",
|
||||
* codefou: "FOU123",
|
||||
* nomfou: "Nom Fournisseur",
|
||||
* franco: 500,
|
||||
* nb_articles: 12,
|
||||
* montant_cde: 620.50,
|
||||
* franco_atteint: true,
|
||||
* ecart_franco: -120.50
|
||||
* },
|
||||
* ...
|
||||
* ]
|
||||
*/
|
||||
export async function GET() {
|
||||
try {
|
||||
const rows = await pgGetCommandesAuto();
|
||||
return NextResponse.json(rows);
|
||||
} catch (e) {
|
||||
console.error("[api/commandes-auto]", e);
|
||||
return NextResponse.json({ error: "Erreur serveur" }, { status: 500 });
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user