Minerva-System / minerva-go

Golang refactor of the Minerva System, an ERP-like system built for research purposes
0 stars 0 forks source link

System does not respect `company_id` #19

Open luksamuk opened 5 months ago

luksamuk commented 5 months ago

(This is a serious bug that should've been tested on #7, and perharps this is the time to create unit tests...)

company_id isn't being respected. This can be simulated by creating two companies, registering a user in one of them, and listing the users on both companies. The same user is appearing on both, so the company_id filter isn't working at all.

This could be a bug while generating the query. To simulate that, printing the queries on console could be a good thing to do.

It was noted on internal/connection/database.go that there is a logger being configured through SlogGorm, but query logging isn't implemented. Perharps it would be a good idea to do that according to log level.

Gorm documentation on logging: https://gorm.io/docs/logger.html