Hi, you'll find the source codes of the BCG take home test here. This repo combines the DDD pattern and functional programming. This pattern made by me as the result of my experience in golang in professional work and side-projects.
|-- bcg-test
|-- domains
|-- inventory
|-- promotion
|-- configs
|-- migrations
|-- entities
|-- handler
|-- pkg
|-- repositories
Entities folder is where the business logic are.
Run go mod vendor
to download everything to vendor folder
Run every query on migrations folder
This repo has 3 unit test, for test scenario it is at domains/inventories/inventory_test
function calculateFinalPrice
. But, take a look at promotion_test.go
I have something cool right there, full unit
test for each scenario.
My time is running out, I need to do something urgent. So, my plan was to add graphql server on main.go
and call
function on handler
then the handler will call the inventory domain
- Validating stock on query
- GraphQL
- I have 3 TODO, 2 of them is because of the limitation of the test case. (search
TODO
)