refatorando a arquitetura

This commit is contained in:
2026-07-15 18:47:19 -03:00
parent e57de50bc2
commit 9d1d75f3af
12 changed files with 374 additions and 307 deletions
+20
View File
@@ -0,0 +1,20 @@
package main
import (
"controle-de-estoque/internal/cli"
inmemory "controle-de-estoque/internal/repository/in_memory"
"controle-de-estoque/internal/service"
)
func main() {
// Aqui é o único lugar que "conhece" todas as camadas.
// Para trocar a persistência (ex: Postgres, arquivo JSON),
// basta trocar esta linha por outra implementação de
// repository.InventoryRepository — nada mais muda.
repo := inmemory.NewInventorytRepository()
svc := service.NewInventoryService(repo)
app := cli.NewApp(svc)
app.Run()
}