Skip to content

Commit

Permalink
#11 Adds basic trade persistence
Browse files Browse the repository at this point in the history
- Includes a MongoDB entity, and its corresponding repository
  • Loading branch information
preslavrachev committed Aug 21, 2017
1 parent d20d598 commit 990c943
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
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
)
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>

0 comments on commit 990c943

Please sign in to comment.