GEWIS / sudosos-backend

SudoSOS is a Node.js-based Bar and POS system made for study association GEWIS.
https://sudosos.gewis.nl
GNU Affero General Public License v3.0
4 stars 3 forks source link

`SubTransactionRowResponse`, `TransactionReportResponse`, etc. typings are wrong. #117

Open JustSamuel opened 8 months ago

JustSamuel commented 8 months ago

The product in the SubTransactionRowResponse is a BaseProductResponse but also has a revision so its neither a BaseProductResponse nor a ProductResponse.

Solution would be to do use the Revision to correctly create an index key but for the response drop the revision from the respons as the revision should be hidden to the end-user.

Even better, actually create a query for the TransactionReport instead of the heavy post-query processing we do now. Should also reduce the runtime of the end-point. With the new TypeOrm this query should be doable.

See line 387 of the transaction-service.ts