Skip to content

Instantly share code, notes, and snippets.

@DenisBronx
Last active August 6, 2020 16:23
Show Gist options
  • Save DenisBronx/7cc03533cf3bdbae40fbb54aae10eb95 to your computer and use it in GitHub Desktop.
Save DenisBronx/7cc03533cf3bdbae40fbb54aae10eb95 to your computer and use it in GitHub Desktop.
Repository Pattern Product gist
// Entity
data class Product(
val id: String,
val name: String,
val price: Price
) {
// Value object
data class Price(
val nowPrice: Double,
val wasPrice: Double
) {
companion object {
val EMPTY = Price(0.0, 0.0)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment