Minerva-System / minerva-go

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

Fix gRPC services so that they return `created_at` and `updated_at` fields #6

Open luksamuk opened 5 months ago

luksamuk commented 5 months ago

Currently, gRPC services return none of the fields created_at and updated_at. This is mostly due to the fact that the gRPC messages themselves have no knowledge of these fields, as they were introduced when creating models for GORM during the Golang port initial process.

Update protocol buffer messages and model mappers so that the information goes through as expected. Created entities should return proper values for the fields created_at and updated_at as needed.

One should be able to fetch entities from the REST API and they should have proper values for the fields aforementioned.

luksamuk commented 5 months ago

There is an official way to deal with Timestamps in protocol buffers, see commit 9131a0a.

luksamuk commented 5 months ago

IMPORTANT: The deleted_at field, after #7, will only exist for soft-delete cases (such as with companies), and they never really appear normally on the system. This field has been removed for now on most entities, and even if it returns, it shouldn't be needed anyway.

luksamuk commented 5 months ago

This bug could be related to how the mappers behave and it might be the case that the API has to return new schemas instead of the database models themselves, so I'm increasing the size of these tasks.