.PHONY: dev run build test test-module test-user test-auth test-middleware test-pkg test-cover seed tidy

# jalankan server dengan hot-reload (butuh Air, lihat README bagian "Development dengan Hot-Reload")
dev:
	air

# jalankan server biasa tanpa hot-reload
run:
	go run ./cmd/api

# build binary production ke ./bin/api
build:
	go build -o ./bin/api ./cmd/api

# jalankan SELURUH unit test (semua module + package)
test:
	go test ./... -v

# jalankan test 1 module tertentu, contoh: make test-module m=user
# m bisa diisi nama folder apapun di bawah internal/modules atau internal/pkg
test-module:
	go test ./internal/modules/$(m)/... -v

test-middleware:
	go test ./internal/middleware/... -v

# test semua package pendukung (logger, response, utils, validator) sekaligus
test-pkg:
	go test ./internal/pkg/... -v

# jalankan semua test + tampilkan persentase coverage per file
test-cover:
	go test ./... -cover

# masukkan data master (lihat internal/database/seeder.go)
seed:
	go run ./cmd/seed

# rapikan go.mod / go.sum
tidy:
	go mod tidy