Here, instead of just checking the properties we should rather check that the document can be fetched from the database. I would call transaction.findTransactionById(...) or similar for this.