-
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.
FEATURE : implementation several entities #4
- Loading branch information
1 parent
428706f
commit e3902cd
Showing
7 changed files
with
79 additions
and
2 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
14 changes: 14 additions & 0 deletions
14
src/main/kotlin/eom/improve/kafkaboot/model/InventoryEntity.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,14 @@ | ||
package eom.improve.kafkaboot.model | ||
|
||
import org.springframework.data.annotation.Id | ||
import org.springframework.data.relational.core.mapping.Table | ||
import java.time.LocalDateTime | ||
|
||
@Table("inventory") | ||
data class InventoryEntity( | ||
@Id | ||
val inventoryId: Int, | ||
val filmId: Int, | ||
val storeId: Int, | ||
val lastUpdate: LocalDateTime | ||
) |
17 changes: 17 additions & 0 deletions
17
src/main/kotlin/eom/improve/kafkaboot/model/PaymentEntity.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,17 @@ | ||
package eom.improve.kafkaboot.model | ||
|
||
import org.springframework.data.annotation.Id | ||
import org.springframework.data.relational.core.mapping.Table | ||
import java.math.BigDecimal | ||
import java.time.LocalDateTime | ||
|
||
@Table("payment") | ||
data class PaymentEntity( | ||
@Id | ||
val paymentId: Int, | ||
val customerId: String, | ||
val staffId: Int, | ||
val rentalId: Int, | ||
val amount: BigDecimal, | ||
val paymentDate: LocalDateTime | ||
) |
17 changes: 17 additions & 0 deletions
17
src/main/kotlin/eom/improve/kafkaboot/model/RentalEntity.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,17 @@ | ||
package eom.improve.kafkaboot.model | ||
|
||
import org.springframework.data.annotation.Id | ||
import org.springframework.data.relational.core.mapping.Table | ||
import java.time.LocalDateTime | ||
|
||
@Table("rental") | ||
data class RentalEntity( | ||
@Id | ||
val rentalId: Int, | ||
val rentalDate: LocalDateTime, | ||
val inventoryId: Int, | ||
val customerId: Int, | ||
val returnDate: LocalDateTime? = null, | ||
val staffId: Int? = null, | ||
val lastUpdate: LocalDateTime? = null | ||
) |
11 changes: 11 additions & 0 deletions
11
src/main/kotlin/eom/improve/kafkaboot/repository/InventoryRepository.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 eom.improve.kafkaboot.repository | ||
|
||
import eom.improve.kafkaboot.model.InventoryEntity | ||
import org.springframework.data.r2dbc.repository.R2dbcRepository | ||
import org.springframework.stereotype.Repository | ||
import reactor.core.publisher.Flux | ||
|
||
@Repository | ||
interface InventoryRepository : R2dbcRepository<InventoryEntity, Int> { | ||
fun findAllByFilmId(filmId: Int) : Flux<InventoryEntity> | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/kotlin/eom/improve/kafkaboot/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,11 @@ | ||
package eom.improve.kafkaboot.repository | ||
|
||
import eom.improve.kafkaboot.model.PaymentEntity | ||
import org.springframework.data.r2dbc.repository.R2dbcRepository | ||
import org.springframework.stereotype.Repository | ||
import reactor.core.publisher.Flux | ||
|
||
@Repository | ||
interface PaymentRepository : R2dbcRepository<PaymentEntity, Int> { | ||
fun findAllByRentalId(rentalId: Int) : Flux<PaymentEntity> | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/kotlin/eom/improve/kafkaboot/repository/RentalRepository.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,9 @@ | ||
package eom.improve.kafkaboot.repository | ||
|
||
import eom.improve.kafkaboot.model.RentalEntity | ||
import org.springframework.data.r2dbc.repository.R2dbcRepository | ||
import reactor.core.publisher.Flux | ||
|
||
interface RentalRepository : R2dbcRepository<RentalEntity, Int> { | ||
fun findAllByInventoryId(inventoryId: Int) : Flux<RentalEntity> | ||
} |