-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from appKom/47-receipt-filters-in-requests
47 receipt filters in requests
- Loading branch information
Showing
41 changed files
with
132 additions
and
102 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/com/example/autobank/controller/AdminController.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 1 addition & 7 deletions
8
src/main/kotlin/com/example/autobank/controller/CommitteeController.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/com/example/autobank/controller/EconomicrequestController.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/main/kotlin/com/example/autobank/controller/ReceiptController.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
src/main/kotlin/com/example/autobank/data/authentication/AuthenticatedUserResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
package com.example.autobank.data.authentication; | ||
|
||
import java.time.Instant | ||
|
||
class AuthenticatedUserResponse( | ||
val success: Boolean, | ||
val isadmin: Boolean, | ||
val issuperadmin: Boolean | ||
val issuperadmin: Boolean, | ||
val expiresat: Instant? | ||
) |
2 changes: 1 addition & 1 deletion
2
...ample/autobank/data/receipt/Attachment.kt → ...xample/autobank/data/models/Attachment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...com/example/autobank/data/receipt/Card.kt → .../com/example/autobank/data/models/Card.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...in/com/example/autobank/data/Committee.kt → ...example/autobank/data/models/Committee.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.example.autobank.data | ||
package com.example.autobank.data.models | ||
|
||
import jakarta.persistence.* | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...le/autobank/data/EconomicRequestReview.kt → ...bank/data/models/EconomicRequestReview.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../example/autobank/data/Economicrequest.kt → ...e/autobank/data/models/Economicrequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../example/autobank/data/receipt/Payment.kt → ...m/example/autobank/data/models/Payment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../example/autobank/data/receipt/Receipt.kt → ...m/example/autobank/data/models/Receipt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.example.autobank.data.receipt | ||
package com.example.autobank.data.models | ||
|
||
|
||
import jakarta.persistence.* | ||
|
2 changes: 1 addition & 1 deletion
2
...mple/autobank/data/receipt/ReceiptInfo.kt → ...ample/autobank/data/models/ReceiptInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...le/autobank/data/receipt/ReceiptReview.kt → ...ple/autobank/data/models/ReceiptReview.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
src/main/kotlin/com/example/autobank/data/receipt/CompleteReceipt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
src/main/kotlin/com/example/autobank/data/receipt/ReceiptAndReview.kt
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
src/main/kotlin/com/example/autobank/data/receipt/ReceiptListResponseBody.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.example.autobank.data.receipt | ||
|
||
import com.example.autobank.data.models.ReceiptInfo | ||
|
||
class ReceiptListResponseBody( | ||
val receipts: Array<ReceiptInfo>, | ||
val total: Long, | ||
) |
3 changes: 1 addition & 2 deletions
3
src/main/kotlin/com/example/autobank/data/receipt/ReceiptRequestBody.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
src/main/kotlin/com/example/autobank/data/receipt/ReceiptResponseBody.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
src/main/kotlin/com/example/autobank/repository/CommitteeRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/com/example/autobank/repository/EconomicRequestReviewRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/com/example/autobank/repository/EconomicrequestRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/com/example/autobank/repository/receipt/AttachmentRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/com/example/autobank/repository/receipt/CardRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
src/main/kotlin/com/example/autobank/repository/receipt/PaymentRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
src/main/kotlin/com/example/autobank/repository/receipt/ReceiptInfoViewRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/com/example/autobank/repository/receipt/ReceiptRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/com/example/autobank/repository/receipt/ReceiptReviewRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...lin/com/example/autobank/repository/receipt/specification/ReceiptInfoViewSpecification.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.example.autobank.repository.receipt.specification | ||
|
||
import com.example.autobank.data.models.ReceiptInfo | ||
import org.springframework.data.jpa.domain.Specification | ||
import jakarta.persistence.criteria.Predicate | ||
|
||
class ReceiptInfoSpecification( | ||
private val status: String?, | ||
private val committeeName: String?, | ||
private val search: String? | ||
) : Specification<ReceiptInfo> { | ||
override fun toPredicate( | ||
root: jakarta.persistence.criteria.Root<ReceiptInfo>, | ||
query: jakarta.persistence.criteria.CriteriaQuery<*>, | ||
criteriaBuilder: jakarta.persistence.criteria.CriteriaBuilder | ||
): Predicate? { | ||
val predicates = mutableListOf<Predicate>() | ||
|
||
|
||
if (status == "NONE") { | ||
predicates.add(criteriaBuilder.isNull(root.get<String>("latestReviewStatus"))) | ||
} else if (status == "DONE") { | ||
predicates.add(criteriaBuilder.isNotNull(root.get<String>("latestReviewStatus"))) | ||
}else if (status != null) { | ||
predicates.add(criteriaBuilder.equal(root.get<String>("latestReviewStatus"), status)) | ||
} | ||
|
||
if (committeeName != null) { | ||
val committeeNames = committeeName.split(",").map { it.trim() } | ||
predicates.add(root.get<String>("committeeName").`in`(committeeNames)) | ||
} | ||
|
||
if (search != null) { | ||
predicates.add(criteriaBuilder.like(root.get<String>("receiptName"), "%$search%")) | ||
} | ||
|
||
|
||
return criteriaBuilder.and(*predicates.toTypedArray()) | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/com/example/autobank/service/AttachmentService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/com/example/autobank/service/CommitteeService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/kotlin/com/example/autobank/service/EconomicRequestReviewService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/com/example/autobank/service/EconomicrequestService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.