-
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.
- Loading branch information
Showing
20 changed files
with
348 additions
and
15 deletions.
There are no files selected for viewing
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,4 @@ | ||
FROM openjdk:8-jdk-alpine | ||
ARG JAR_FILE=target/*.jar | ||
COPY ${JAR_FILE} app.jar | ||
ENTRYPOINT ["java","-jar","/app.jar"] |
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
48 changes: 48 additions & 0 deletions
48
src/main/kotlin/com/example/autobank/controller/AdminReceiptController.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,48 @@ | ||
package com.example.autobank.controller; | ||
|
||
import com.example.autobank.data.receipt.CompleteReceipt | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import com.example.autobank.data.receipt.Receipt; | ||
import com.example.autobank.service.ReceiptAdminService; | ||
import org.springframework.beans.factory.annotation.Autowired | ||
import org.springframework.web.bind.annotation.PathVariable | ||
import com.example.autobank.data.receipt.ReceiptInfo | ||
import com.example.autobank.service.AuthenticationService | ||
import org.springframework.web.bind.annotation.RequestParam | ||
|
||
|
||
@RestController | ||
@RequestMapping("/api/admin/receipt") | ||
class AdminReceiptController { | ||
|
||
@Autowired | ||
lateinit var receiptAdminService: ReceiptAdminService | ||
|
||
@Autowired | ||
lateinit var authenticationService: AuthenticationService | ||
|
||
@GetMapping("/all") | ||
fun getAllReceipts( @RequestParam from: Int, @RequestParam count: Int) | ||
: ResponseEntity<List<ReceiptInfo>> { | ||
if (!authenticationService.checkBankomMembership()) { | ||
return ResponseEntity.status(403).build() | ||
} | ||
|
||
return ResponseEntity.ok(receiptAdminService.getAll(from, count)) | ||
} | ||
/* | ||
@GetMapping("/get/{id}") | ||
fun getReceipt(@PathVariable id: Int): ResponseEntity<CompleteReceipt> { | ||
if (!authenticationService.checkBankomMembership()) { | ||
return ResponseEntity.status(403).build() | ||
} | ||
return ResponseEntity.ok(receiptAdminService.getReceipt(id)) | ||
} | ||
*/ | ||
|
||
} |
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
42 changes: 42 additions & 0 deletions
42
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.example.autobank.data.receipt | ||
|
||
|
||
import jakarta.persistence.Column | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.Id | ||
import jakarta.persistence.Table | ||
import java.math.BigDecimal | ||
import java.time.LocalDateTime | ||
|
||
data class CompleteReceipt( | ||
val receiptId: Int, | ||
|
||
val amount: BigDecimal, | ||
|
||
val receiptName: String, | ||
|
||
val receiptDescription: String, | ||
|
||
val receiptCreatedAt: LocalDateTime, | ||
|
||
val committeeName: String, | ||
|
||
val userFullname: String, | ||
|
||
val paymentOrCard: String, | ||
|
||
val attachmentCount: Int, | ||
|
||
val latestReviewStatus: String, | ||
|
||
val latestReviewCreatedAt: LocalDateTime, | ||
|
||
val paymentAccountNumber: String, | ||
|
||
|
||
val cardCardNumber: String, | ||
|
||
val attachments: List<String> | ||
|
||
|
||
) |
20 changes: 20 additions & 0 deletions
20
src/main/kotlin/com/example/autobank/data/receipt/ReceiptAndReview.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,20 @@ | ||
package com.example.autobank.data.receipt | ||
|
||
import jakarta.persistence.Column | ||
import jakarta.persistence.GeneratedValue | ||
import jakarta.persistence.GenerationType | ||
import jakarta.persistence.Id | ||
import org.hibernate.annotations.CreationTimestamp | ||
import org.jetbrains.annotations.NotNull | ||
import java.time.LocalDateTime | ||
|
||
|
||
class ReceiptAndReview ( | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "id") | ||
@NotNull | ||
val id: Int, | ||
|
||
|
||
) |
46 changes: 46 additions & 0 deletions
46
src/main/kotlin/com/example/autobank/data/receipt/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.example.autobank.data.receipt | ||
|
||
import jakarta.persistence.Column | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.Id | ||
import jakarta.persistence.Table | ||
import java.math.BigDecimal | ||
import java.time.LocalDateTime | ||
|
||
@Entity | ||
@Table(name = "receipt_info") | ||
class ReceiptInfo( | ||
@Id | ||
@Column(name = "receipt_id") | ||
val receiptId: Int, | ||
|
||
@Column(name = "amount") | ||
val amount: BigDecimal, | ||
|
||
@Column(name = "receipt_name") | ||
val receiptName: String, | ||
|
||
@Column(name = "receipt_description") | ||
val receiptDescription: String, | ||
|
||
@Column(name = "receipt_created_at") | ||
val receiptCreatedAt: LocalDateTime, | ||
|
||
@Column(name = "committee_name") | ||
val committeeName: String, | ||
|
||
@Column(name = "user_fullname") | ||
val userFullname: String, | ||
|
||
@Column(name = "payment_or_card") | ||
val paymentOrCard: String, | ||
|
||
@Column(name = "attachment_count") | ||
val attachmentCount: Int, | ||
|
||
@Column(name = "latest_review_status") | ||
val latestReviewStatus: String, | ||
|
||
@Column(name = "latest_review_created_at") | ||
val latestReviewCreatedAt: LocalDateTime | ||
) |
32 changes: 32 additions & 0 deletions
32
src/main/kotlin/com/example/autobank/data/receipt/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.example.autobank.data.receipt | ||
|
||
import jakarta.persistence.* | ||
import org.hibernate.annotations.CreationTimestamp | ||
import org.jetbrains.annotations.NotNull | ||
import java.time.LocalDateTime | ||
|
||
@Entity | ||
@Table(name = "receiptreview") | ||
class ReceiptReview ( | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "id") | ||
@NotNull | ||
val id: Int, | ||
|
||
@Column(name = "receipt_id") | ||
val receiptId: Int, | ||
|
||
@Column(name = "status") | ||
val status: String, | ||
|
||
@Column(name = "comment") | ||
val comment: String, | ||
|
||
@Column(name = "onlineuser_id") | ||
var onlineUserId: Int?, | ||
|
||
@CreationTimestamp | ||
@Column(name = "createdat") | ||
val createdat: LocalDateTime?, | ||
) |
2 changes: 1 addition & 1 deletion
2
...tobank/repository/AttachmentRepository.kt → ...epository/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
...ple/autobank/repository/CardRepository.kt → ...bank/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
2 changes: 1 addition & 1 deletion
2
.../autobank/repository/PaymentRepository.kt → ...k/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
12 changes: 12 additions & 0 deletions
12
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.example.autobank.repository.receipt | ||
|
||
import com.example.autobank.data.receipt.ReceiptInfo | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
import org.springframework.stereotype.Repository | ||
|
||
@Repository | ||
interface ReceiptInfoViewRepository : JpaRepository<ReceiptInfo, Int> { | ||
|
||
fun findByReceiptId(id: Int): ReceiptInfo | ||
|
||
} |
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/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
6 changes: 6 additions & 0 deletions
6
src/main/kotlin/com/example/autobank/service/PaymentCardService.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,6 @@ | ||
package com.example.autobank.service | ||
|
||
import org.springframework.stereotype.Service | ||
@Service | ||
class PaymentCardService { | ||
} |
Oops, something went wrong.