1
1
package com.ivy.data.repository
2
2
3
+ import com.ivy.base.model.TransactionType
3
4
import com.ivy.data.model.AccountId
4
5
import com.ivy.data.model.CategoryId
5
6
import com.ivy.data.model.Expense
6
7
import com.ivy.data.model.Income
7
8
import com.ivy.data.model.Transaction
8
9
import com.ivy.data.model.TransactionId
9
10
import com.ivy.data.model.Transfer
11
+ import com.ivy.data.model.primitive.NonNegativeLong
10
12
import java.time.LocalDateTime
13
+ import java.util.UUID
11
14
12
15
interface TransactionRepository {
13
16
suspend fun findById (id : TransactionId ): Transaction ?
@@ -23,40 +26,87 @@ interface TransactionRepository {
23
26
startDate : LocalDateTime ,
24
27
endDate : LocalDateTime
25
28
): List <Transaction >
29
+
26
30
suspend fun findAllByAccountAndBetween (
27
31
accountId : AccountId ,
28
32
startDate : LocalDateTime ,
29
33
endDate : LocalDateTime
30
34
): List <Transaction >
35
+
31
36
suspend fun findAllToAccountAndBetween (
32
37
toAccountId : AccountId ,
33
38
startDate : LocalDateTime ,
34
39
endDate : LocalDateTime
35
40
): List <Transaction >
41
+
36
42
suspend fun findAllDueToBetween (
37
43
startDate : LocalDateTime ,
38
44
endDate : LocalDateTime
39
45
): List <Transaction >
46
+
40
47
suspend fun findAllDueToBetweenByCategory (
41
48
startDate : LocalDateTime ,
42
49
endDate : LocalDateTime ,
43
50
categoryId : CategoryId
44
51
): List <Transaction >
52
+
45
53
suspend fun findAllDueToBetweenByCategoryUnspecified (
46
54
startDate : LocalDateTime ,
47
55
endDate : LocalDateTime ,
48
56
): List <Transaction >
57
+
49
58
suspend fun findAllDueToBetweenByAccount (
50
59
startDate : LocalDateTime ,
51
60
endDate : LocalDateTime ,
52
61
accountId : AccountId
53
62
): List <Transaction >
54
63
64
+ suspend fun findAllByCategoryAndTypeAndBetween (
65
+ categoryId : UUID ,
66
+ type : TransactionType ,
67
+ startDate : LocalDateTime ,
68
+ endDate : LocalDateTime
69
+ ): List <Transaction >
70
+
71
+ suspend fun findAllUnspecifiedAndTypeAndBetween (
72
+ type : TransactionType ,
73
+ startDate : LocalDateTime ,
74
+ endDate : LocalDateTime
75
+ ): List <Transaction >
76
+
77
+ suspend fun findAllUnspecifiedAndBetween (
78
+ startDate : LocalDateTime ,
79
+ endDate : LocalDateTime
80
+ ): List <Transaction >
81
+
82
+ suspend fun findAllByCategoryAndBetween (
83
+ categoryId : UUID ,
84
+ startDate : LocalDateTime ,
85
+ endDate : LocalDateTime
86
+ ): List <Transaction >
87
+
88
+ suspend fun findAllByRecurringRuleId (recurringRuleId : UUID ): List <Transaction >
89
+ suspend fun flagDeletedByAccountId (accountId : UUID )
90
+
55
91
suspend fun save (value : Transaction )
56
92
suspend fun saveMany (value : List <Transaction >)
57
93
58
94
suspend fun flagDeleted (id : TransactionId )
95
+ suspend fun flagDeletedByRecurringRuleIdAndNoDateTime (recurringRuleId : UUID )
59
96
suspend fun deleteById (id : TransactionId )
60
97
suspend fun deleteAllByAccountId (accountId : AccountId )
61
98
suspend fun deleteAll ()
99
+
100
+ suspend fun countHappenedTransactions (): NonNegativeLong
101
+ suspend fun findLoanTransaction (
102
+ loanId : UUID
103
+ ): Transaction ?
104
+
105
+ suspend fun findLoanRecordTransaction (
106
+ loanRecordId : UUID
107
+ ): Transaction ?
108
+
109
+ suspend fun findAllByLoanId (
110
+ loanId : UUID
111
+ ): List <Transaction >
62
112
}
0 commit comments