Test task for «hitalent»
Google Doc with the brief
- Go 1.26 (older versions may work but not tested)
- Docker
git clone https://github.com/dima69/hitalent-test-task
cd hitalent-test-task
docker compose up --buildServer starts at http://localhost:8080
- Make sure Docker is running (testcontainers-go starts PostgreSQL automatically).
- Run:
go test -count=1 ./....
├── cmd/
│ └── server/
│ └── main.go # Entry point
├── internal/
│ ├── config/
│ │ └── config.go # Environment config
│ ├── department/ # Department entity
│ │ ├── handler.go # HTTP handlers
│ │ ├── service.go # Business logic
│ │ ├── repository.go # GORM repository
│ │ ├── model.go # Department + DepartmentTree
│ │ ├── response.go # JSON helpers
│ │ ├── handler_test.go
│ │ ├── service_test.go
│ │ ├── repository_test.go
│ │ ├── mock_test.go
│ │ └── testutil_test.go
│ ├── employee/ # Employee entity
│ │ ├── handler.go # HTTP handlers
│ │ ├── service.go # Business logic
│ │ ├── repository.go # GORM repository
│ │ ├── model.go # Employee model
│ │ ├── response.go # JSON helpers
│ │ ├── handler_test.go
│ │ ├── service_test.go
│ │ └── repository_test.go
│ └── testutil/
│ └── testdb.go # testcontainers setup
├── migrations/ # Goose SQL migrations
├── Dockerfile
├── docker-compose.yml
├── go.mod
├── go.sum
└── README.md