File tree Expand file tree Collapse file tree 7 files changed +79
-2
lines changed
src/main/kotlin/eom/improve/kafkaboot Expand file tree Collapse file tree 7 files changed +79
-2
lines changed Original file line number Diff line number Diff line change 11package eom.improve.kafkaboot.model
22
33import eom.improve.kafkaboot.dto.Film
4- import eom.improve.kafkaboot.enum.MpaaRating
54import org.springframework.data.annotation.Id
65import org.springframework.data.relational.core.mapping.Table
76import java.math.BigDecimal
87import java.time.LocalDateTime
9- import java.util.*
108
119@Table(" film" )
1210data class FilmEntity (
Original file line number Diff line number Diff line change 1+ package eom.improve.kafkaboot.model
2+
3+ import org.springframework.data.annotation.Id
4+ import org.springframework.data.relational.core.mapping.Table
5+ import java.time.LocalDateTime
6+
7+ @Table(" inventory" )
8+ data class InventoryEntity (
9+ @Id
10+ val inventoryId : Int ,
11+ val filmId : Int ,
12+ val storeId : Int ,
13+ val lastUpdate : LocalDateTime
14+ )
Original file line number Diff line number Diff line change 1+ package eom.improve.kafkaboot.model
2+
3+ import org.springframework.data.annotation.Id
4+ import org.springframework.data.relational.core.mapping.Table
5+ import java.math.BigDecimal
6+ import java.time.LocalDateTime
7+
8+ @Table(" payment" )
9+ data class PaymentEntity (
10+ @Id
11+ val paymentId : Int ,
12+ val customerId : String ,
13+ val staffId : Int ,
14+ val rentalId : Int ,
15+ val amount : BigDecimal ,
16+ val paymentDate : LocalDateTime
17+ )
Original file line number Diff line number Diff line change 1+ package eom.improve.kafkaboot.model
2+
3+ import org.springframework.data.annotation.Id
4+ import org.springframework.data.relational.core.mapping.Table
5+ import java.time.LocalDateTime
6+
7+ @Table(" rental" )
8+ data class RentalEntity (
9+ @Id
10+ val rentalId : Int ,
11+ val rentalDate : LocalDateTime ,
12+ val inventoryId : Int ,
13+ val customerId : Int ,
14+ val returnDate : LocalDateTime ? = null ,
15+ val staffId : Int? = null ,
16+ val lastUpdate : LocalDateTime ? = null
17+ )
Original file line number Diff line number Diff line change 1+ package eom.improve.kafkaboot.repository
2+
3+ import eom.improve.kafkaboot.model.InventoryEntity
4+ import org.springframework.data.r2dbc.repository.R2dbcRepository
5+ import org.springframework.stereotype.Repository
6+ import reactor.core.publisher.Flux
7+
8+ @Repository
9+ interface InventoryRepository : R2dbcRepository <InventoryEntity , Int > {
10+ fun findAllByFilmId (filmId : Int ) : Flux <InventoryEntity >
11+ }
Original file line number Diff line number Diff line change 1+ package eom.improve.kafkaboot.repository
2+
3+ import eom.improve.kafkaboot.model.PaymentEntity
4+ import org.springframework.data.r2dbc.repository.R2dbcRepository
5+ import org.springframework.stereotype.Repository
6+ import reactor.core.publisher.Flux
7+
8+ @Repository
9+ interface PaymentRepository : R2dbcRepository <PaymentEntity , Int > {
10+ fun findAllByRentalId (rentalId : Int ) : Flux <PaymentEntity >
11+ }
Original file line number Diff line number Diff line change 1+ package eom.improve.kafkaboot.repository
2+
3+ import eom.improve.kafkaboot.model.RentalEntity
4+ import org.springframework.data.r2dbc.repository.R2dbcRepository
5+ import reactor.core.publisher.Flux
6+
7+ interface RentalRepository : R2dbcRepository <RentalEntity , Int > {
8+ fun findAllByInventoryId (inventoryId : Int ) : Flux <RentalEntity >
9+ }
You can’t perform that action at this time.
0 commit comments