@@ -730,6 +730,15 @@ func TestTransactionsList(t *testing.T) {
730730 err = store .CommitTransaction (ctx , & tx5 , nil )
731731 require .NoError (t , err )
732732
733+ tx6 := ledger .NewTransaction ().
734+ WithPostings (
735+ ledger .NewPosting ("world" , "users:charlie" , "EUR" , big .NewInt (30 )),
736+ ledger .NewPosting ("users:charlie" , "world" , "EUR" , big .NewInt (30 )),
737+ ).
738+ WithTimestamp (now )
739+ err = store .CommitTransaction (ctx , & tx6 , nil )
740+ require .NoError (t , err )
741+
733742 type testCase struct {
734743 name string
735744 query common.InitialPaginatedQuery [any ]
@@ -740,7 +749,7 @@ func TestTransactionsList(t *testing.T) {
740749 {
741750 name : "nominal" ,
742751 query : common.InitialPaginatedQuery [any ]{},
743- expected : []ledger.Transaction {tx5 , tx4 , tx3 , tx2 , tx1 },
752+ expected : []ledger.Transaction {tx6 , tx5 , tx4 , tx3 , tx2 , tx1 },
744753 },
745754 {
746755 name : "address filter" ,
@@ -767,7 +776,7 @@ func TestTransactionsList(t *testing.T) {
767776 Builder : query .Match ("account" , "users:" ),
768777 },
769778 },
770- expected : []ledger.Transaction {tx5 , tx4 , tx3 },
779+ expected : []ledger.Transaction {tx6 , tx5 , tx4 , tx3 },
771780 },
772781 {
773782 name : "address filter using segment and unbounded segment list" ,
@@ -776,7 +785,7 @@ func TestTransactionsList(t *testing.T) {
776785 Builder : query .Match ("account" , "users:..." ),
777786 },
778787 },
779- expected : []ledger.Transaction {tx5 , tx4 , tx3 },
788+ expected : []ledger.Transaction {tx6 , tx5 , tx4 , tx3 },
780789 },
781790 {
782791 name : "filter using metadata" ,
@@ -846,7 +855,7 @@ func TestTransactionsList(t *testing.T) {
846855 Builder : query .Not (query .Exists ("metadata" , "category" )),
847856 },
848857 },
849- expected : []ledger.Transaction {tx5 , tx4 },
858+ expected : []ledger.Transaction {tx6 , tx5 , tx4 },
850859 },
851860 {
852861 name : "filter using timestamp" ,
@@ -855,7 +864,16 @@ func TestTransactionsList(t *testing.T) {
855864 Builder : query .Match ("timestamp" , tx5 .Timestamp .Format (time .RFC3339Nano )),
856865 },
857866 },
858- expected : []ledger.Transaction {tx5 , tx4 },
867+ expected : []ledger.Transaction {tx6 , tx5 , tx4 },
868+ },
869+ {
870+ name : "filter using amount" ,
871+ query : common.InitialPaginatedQuery [any ]{
872+ Options : common.ResourceQuery [any ]{
873+ Builder : query .Gt ("amount[EUR]" , 50 ),
874+ },
875+ },
876+ expected : []ledger.Transaction {tx6 , tx1 },
859877 },
860878 }
861879
0 commit comments