Closed tperale closed 3 years ago
The commit https://github.com/Sprtch/despinassy/commit/58dd5203f3a3a88ecb2821f907e3a2d37fbfab07 is introducing the first draft of a transaction logging scheme in the database.
I'm still not convinced with the way the "PrinterTransaction" are logged maybe having fields that mimic the IPCMESSAGE schema is a better way to do it or having reference directly to the printed part. The second way is more performant because we need to log less information and the Part
table can directly access all its related transaction but its impossible to log custom parts.
There are multiple way to do deal with this:
Part
table for custom print.PrinterTransaction
table that inherit from the same thing but represent different use case. This could be an interesting way to do it for the future as maybe printer won't only print Parts
depending on their configuration.The field "update_at" should be updated when a new transaction is added in the ScannerTransaction
table.
Let
erie
andvictoria
access their own table of the database to log data about respectively their barcode and their printer stat and settings.Printer
The printer table store the typical setting of the printer.
PrinterTransaction
Each printer interaction should be logged in the PrinterTransaction table logging which part has been printed and the number of time it is printer.
Simply save the json message received by the printer in the database.
Scanner
ScannerTransaction
Save each interaction with the barcode scanner. I still don't know if I should save every barcode scanned or exclude the commands. The mode the printer was in at the moment of scan is maybe an interesting value.
Channel
This table represent the interconnection between a printer (consumer) and Huron/barcode scanners (producer)