-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Includes a MongoDB entity, and its corresponding repository
- Loading branch information
1 parent
d20d598
commit 990c943
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/main/kotlin/com/preslavrachev/cryptotrader/mvc/model/TradeRecord.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.preslavrachev.cryptotrader.mvc.model | ||
|
||
import org.springframework.data.annotation.Id | ||
import java.time.LocalDateTime | ||
|
||
data class TradeRecord( | ||
@Id var id: String? = null, | ||
val amount: Float, /* always in relation to the quote currency */ | ||
val quoteCurrency: String, /* e.g. BTC in BTC/USDT */ | ||
val baseCurrency: String, /* e.g. USDT in BTC/USDT */ | ||
val executionDateTime: LocalDateTime = LocalDateTime.now(), | ||
val orderScope: OrderScopeEnum = OrderScopeEnum.DEMO | ||
) |
6 changes: 6 additions & 0 deletions
6
...ain/kotlin/com/preslavrachev/cryptotrader/persistence/repository/TradeRecordRepository.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.preslavrachev.cryptotrader.persistence.repository | ||
|
||
import com.preslavrachev.cryptotrader.mvc.model.TradeRecord | ||
import org.springframework.data.mongodb.repository.MongoRepository | ||
|
||
interface TradeRecordRepository: MongoRepository<TradeRecord, String> |