Last active
August 6, 2020 16:23
-
-
Save DenisBronx/7cc03533cf3bdbae40fbb54aae10eb95 to your computer and use it in GitHub Desktop.
Repository Pattern Product gist
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
// 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