add achats import and hardware analyse

This commit is contained in:
2026-01-22 06:33:28 +01:00
parent 2b659920c2
commit b1f611d8ee
16 changed files with 1071 additions and 22 deletions

View File

@@ -49,6 +49,13 @@ func main() {
}
}()
// Activer WAL pour SQLite si disponible.
if driver == "sqlite3" {
if _, err := client.ExecContext(context.Background(), "PRAGMA journal_mode = WAL;"); err != nil {
log.Printf("activation WAL impossible: %v", err)
}
}
// Auto-creation du schema en dev. A remplacer par migrations en prod.
if err := client.Schema.Create(context.Background()); err != nil {
log.Fatalf("creation schema impossible: %v", err)
@@ -56,7 +63,10 @@ func main() {
// Route de sante pour verifier que le backend repond.
r.GET("/healthz", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"status": "ok"})
c.JSON(http.StatusOK, gin.H{
"status": "ok",
"version": "0.1.0",
})
})
handlers.RegisterRoutes(r, client)