-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CU-863h5ec15: Split stream token mint among collaborators
- Loading branch information
1 parent
98c13ec
commit 603c913
Showing
13 changed files
with
165 additions
and
58 deletions.
There are no files selected for viewing
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
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
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
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
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
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
14 changes: 14 additions & 0 deletions
14
newm-server/src/main/kotlin/io/newm/server/serialization/SerializationModule.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 |
---|---|---|
@@ -1,13 +1,27 @@ | ||
package io.newm.server.serialization | ||
|
||
import io.newm.shared.serialization.BigDecimalSerializer | ||
import io.newm.shared.serialization.BigIntegerSerializer | ||
import kotlinx.serialization.json.Json | ||
import kotlinx.serialization.modules.SerializersModule | ||
import org.koin.dsl.module | ||
import java.math.BigDecimal | ||
import java.math.BigInteger | ||
|
||
/** | ||
* Anything marked as @Contextual will use the contextualSerializersModule to pick a serializer automatically. | ||
*/ | ||
private val contextualSerializersModule = SerializersModule { | ||
contextual(BigInteger::class, BigIntegerSerializer) | ||
contextual(BigDecimal::class, BigDecimalSerializer) | ||
} | ||
|
||
val serializationModule = module { | ||
single { | ||
Json { | ||
ignoreUnknownKeys = true | ||
explicitNulls = false | ||
serializersModule = contextualSerializersModule | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
|
@@ -67,7 +67,7 @@ class CollaborationRoutesTests : BaseApplicationTests() { | |
songId = songId, | ||
email = "[email protected]", | ||
role = "Role", | ||
royaltyRate = 0.5f, | ||
royaltyRate = 0.5f.toBigDecimal(), | ||
credited = true, | ||
featured = true | ||
) | ||
|
@@ -101,7 +101,7 @@ class CollaborationRoutesTests : BaseApplicationTests() { | |
val collaboration2 = Collaboration( | ||
email = "[email protected]", | ||
role = "Role2", | ||
royaltyRate = 2 * collaboration1.royaltyRate!!, | ||
royaltyRate = 2.toBigDecimal() * collaboration1.royaltyRate!!, | ||
credited = !collaboration1.credited!!, | ||
featured = !collaboration1.featured!!, | ||
) | ||
|
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 |
---|---|---|
|
@@ -165,7 +165,7 @@ class EvearaDistributionRepositoryTest : BaseApplicationTests() { | |
songId = songId, | ||
email = "[email protected]", | ||
role = "Artwork", | ||
royaltyRate = 0.0f, | ||
royaltyRate = 0.0f.toBigDecimal(), | ||
credited = true, | ||
status = CollaborationStatus.Accepted, | ||
), | ||
|
@@ -174,7 +174,7 @@ class EvearaDistributionRepositoryTest : BaseApplicationTests() { | |
songId = songId, | ||
email = "[email protected]", | ||
role = "Artist", | ||
royaltyRate = 10.0f, | ||
royaltyRate = 10.0f.toBigDecimal(), | ||
credited = true, | ||
status = CollaborationStatus.Accepted, | ||
), | ||
|
@@ -183,7 +183,7 @@ class EvearaDistributionRepositoryTest : BaseApplicationTests() { | |
songId = songId, | ||
email = "[email protected]", | ||
role = "Artist", | ||
royaltyRate = 10.0f, | ||
royaltyRate = 10.0f.toBigDecimal(), | ||
credited = true, | ||
status = CollaborationStatus.Accepted, | ||
), | ||
|
@@ -192,7 +192,7 @@ class EvearaDistributionRepositoryTest : BaseApplicationTests() { | |
songId = songId, | ||
email = "[email protected]", | ||
role = "Author (Lyrics)", | ||
royaltyRate = 0.0f, | ||
royaltyRate = 0.0f.toBigDecimal(), | ||
credited = true, | ||
status = CollaborationStatus.Accepted, | ||
), | ||
|
@@ -201,7 +201,7 @@ class EvearaDistributionRepositoryTest : BaseApplicationTests() { | |
songId = songId, | ||
email = "[email protected]", | ||
role = "Author (Lyrics)", | ||
royaltyRate = 0.0f, | ||
royaltyRate = 0.0f.toBigDecimal(), | ||
credited = true, | ||
status = CollaborationStatus.Accepted, | ||
), | ||
|
@@ -210,7 +210,7 @@ class EvearaDistributionRepositoryTest : BaseApplicationTests() { | |
songId = songId, | ||
email = "[email protected]", | ||
role = "Author (Lyrics)", | ||
royaltyRate = 0.0f, | ||
royaltyRate = 0.0f.toBigDecimal(), | ||
credited = true, | ||
status = CollaborationStatus.Accepted, | ||
), | ||
|
@@ -220,7 +220,7 @@ class EvearaDistributionRepositoryTest : BaseApplicationTests() { | |
songId = songId, | ||
email = "[email protected]", | ||
role = "Author (Lyrics)", | ||
royaltyRate = 0.0f, | ||
royaltyRate = 0.0f.toBigDecimal(), | ||
credited = true, | ||
status = CollaborationStatus.Accepted, | ||
), | ||
|
@@ -230,7 +230,7 @@ class EvearaDistributionRepositoryTest : BaseApplicationTests() { | |
songId = songId, | ||
email = "[email protected]", | ||
role = "Author (Lyrics)", | ||
royaltyRate = 0.0f, | ||
royaltyRate = 0.0f.toBigDecimal(), | ||
credited = true, | ||
status = CollaborationStatus.Accepted, | ||
), | ||
|
@@ -240,7 +240,7 @@ class EvearaDistributionRepositoryTest : BaseApplicationTests() { | |
songId = songId, | ||
email = "[email protected]", | ||
role = "Author (Lyrics)", | ||
royaltyRate = 0.0f, | ||
royaltyRate = 0.0f.toBigDecimal(), | ||
credited = true, | ||
status = CollaborationStatus.Accepted, | ||
), | ||
|
@@ -250,7 +250,7 @@ class EvearaDistributionRepositoryTest : BaseApplicationTests() { | |
songId = songId, | ||
email = "[email protected]", | ||
role = "Author (Lyrics)", | ||
royaltyRate = 0.0f, | ||
royaltyRate = 0.0f.toBigDecimal(), | ||
credited = true, | ||
status = CollaborationStatus.Accepted, | ||
), | ||
|
@@ -260,7 +260,7 @@ class EvearaDistributionRepositoryTest : BaseApplicationTests() { | |
songId = songId, | ||
email = "[email protected]", | ||
role = "Author (Lyrics)", | ||
royaltyRate = 0.0f, | ||
royaltyRate = 0.0f.toBigDecimal(), | ||
credited = true, | ||
status = CollaborationStatus.Accepted, | ||
), | ||
|
@@ -270,7 +270,7 @@ class EvearaDistributionRepositoryTest : BaseApplicationTests() { | |
songId = songId, | ||
email = "[email protected]", | ||
role = "Synthesizer", | ||
royaltyRate = 0.0f, | ||
royaltyRate = 0.0f.toBigDecimal(), | ||
credited = true, | ||
status = CollaborationStatus.Accepted, | ||
), | ||
|
@@ -280,7 +280,7 @@ class EvearaDistributionRepositoryTest : BaseApplicationTests() { | |
songId = songId, | ||
email = "[email protected]", | ||
role = "Producer", | ||
royaltyRate = 0.0f, | ||
royaltyRate = 0.0f.toBigDecimal(), | ||
credited = true, | ||
status = CollaborationStatus.Accepted, | ||
), | ||
|
Oops, something went wrong.