-
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 #37 from appKom/33-create-get-and-delete-receipts-…
…endpoint 33 create get and delete receipts endpoint
- Loading branch information
Showing
15 changed files
with
220 additions
and
21 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
6 changes: 0 additions & 6 deletions
6
src/main/kotlin/com/example/autobank/data/ReceiptRequestBody.kt
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...n/com/example/autobank/data/Attachment.kt → ...ample/autobank/data/receipt/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
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,21 @@ | ||
package com.example.autobank.data.receipt | ||
|
||
import jakarta.persistence.* | ||
import org.jetbrains.annotations.NotNull | ||
|
||
@Entity | ||
@Table(name = "card") | ||
class Card ( | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "id") | ||
@NotNull | ||
val id: Int, | ||
|
||
@Column(name = "receipt_id") | ||
val receiptId: Int, | ||
|
||
@Column(name = "card_number") | ||
val card_number: String, | ||
|
||
) |
21 changes: 21 additions & 0 deletions
21
src/main/kotlin/com/example/autobank/data/receipt/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.example.autobank.data.receipt | ||
|
||
import jakarta.persistence.* | ||
import org.jetbrains.annotations.NotNull | ||
|
||
@Entity | ||
@Table(name = "payment") | ||
class Payment ( | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "id") | ||
@NotNull | ||
val id: Int, | ||
|
||
@Column(name = "receipt_id") | ||
val receiptId: Int, | ||
|
||
@Column(name = "account_number") | ||
val account_number: String, | ||
|
||
) |
2 changes: 1 addition & 1 deletion
2
...tlin/com/example/autobank/data/Receipt.kt → .../example/autobank/data/receipt/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 | ||
package com.example.autobank.data.receipt | ||
|
||
|
||
import jakarta.persistence.* | ||
|
7 changes: 7 additions & 0 deletions
7
src/main/kotlin/com/example/autobank/data/receipt/ReceiptPaymentInformation.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,7 @@ | ||
package com.example.autobank.data.receipt | ||
|
||
class ReceiptPaymentInformation ( | ||
val cardnumber: String?, | ||
val accountnumber: String?, | ||
val usedOnlineCard: Boolean, | ||
) |
11 changes: 11 additions & 0 deletions
11
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.example.autobank.data.receipt | ||
|
||
import com.example.autobank.data.receipt.Receipt | ||
import jakarta.persistence.Entity | ||
|
||
|
||
class ReceiptRequestBody { | ||
val receipt: Receipt? = null | ||
val receiptPaymentInformation: ReceiptPaymentInformation? = null | ||
val attachments: Array<String> = arrayOf() | ||
} |
11 changes: 11 additions & 0 deletions
11
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.example.autobank.data.receipt | ||
|
||
import com.example.autobank.data.receipt.Receipt | ||
import jakarta.persistence.Entity | ||
|
||
|
||
class ReceiptResponseBody { | ||
var receipt: Receipt? = null | ||
var receiptPaymentInformation: ReceiptPaymentInformation? = null | ||
var attachments: Array<String> = arrayOf() | ||
} |
4 changes: 2 additions & 2 deletions
4
src/main/kotlin/com/example/autobank/repository/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
package com.example.autobank.repository | ||
|
||
import com.example.autobank.data.Attachment | ||
import com.example.autobank.data.receipt.Attachment | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
import org.springframework.stereotype.Repository | ||
|
||
@Repository | ||
interface AttachmentRepository : JpaRepository<Attachment, Int> { | ||
|
||
fun findByReceiptId(receiptId: Int): List<Attachment> | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/kotlin/com/example/autobank/repository/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.example.autobank.repository | ||
|
||
import com.example.autobank.data.receipt.Card | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
import org.springframework.stereotype.Repository | ||
|
||
@Repository | ||
interface CardRepository : JpaRepository<Card, Int> { | ||
fun findFirstByReceiptId(id: Int): Card? | ||
|
||
|
||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/main/kotlin/com/example/autobank/repository/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.example.autobank.repository | ||
|
||
import com.example.autobank.data.receipt.Card | ||
import com.example.autobank.data.receipt.Payment | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
import org.springframework.stereotype.Repository | ||
|
||
@Repository | ||
interface PaymentRepository : JpaRepository<Payment, Int> { | ||
fun findFirstByReceiptId(id: Int): Payment? | ||
|
||
|
||
} |
3 changes: 2 additions & 1 deletion
3
src/main/kotlin/com/example/autobank/repository/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
package com.example.autobank.repository | ||
|
||
import com.example.autobank.data.Receipt | ||
import com.example.autobank.data.receipt.Receipt | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
import org.springframework.stereotype.Repository | ||
|
||
@Repository | ||
interface ReceiptRepository : JpaRepository<Receipt, Int> { | ||
fun findAllByOnlineUserId(onlineUserId: Int): List<Receipt> | ||
|
||
|
||
} |
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