formancehq/ledger

SaveMeta should include an ID and timestamp

Closed this issue · 1 comments

Is your feature request related to a problem? Please describe.
Currently metadata records are not assigned an ID or timestamp when saved to the ledger's DB.

Solution proposal
Similar to other methods on the ledger, add logic to calculate the next metadata ID. Add this to the ID field of the record. Get the current system time and add the timestamp to the record as well.

To do this we would either need to update the storage.Store interface's SaveMeta method to accept an ID and timestamp, or change the core.Metadata type to be a struct which has an ID and timestamp as fields in addition the the map[string]json.RawMessage.

Merged with #64!