Skip to content

Commit a96fc74

Browse files
fix: STUD-423 - Add NEWM Payment Type to NEWM Studio
1 parent ded81b9 commit a96fc74

40 files changed

+930
-212
lines changed

.github/workflows/ktlint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
distribution: 'zulu'
1818
java-version: '21'
1919
- run: |
20-
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.5.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
20+
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.6.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
2121
- name: run ktlint
2222
run: |
2323
ktlint --reporter=checkstyle,output=build/ktlint-report.xml '**/*.kt*' '!**/generated/**'

buildSrc/src/main/kotlin/Versions.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@ object Versions {
55
const val APACHE_CURATORS = "5.8.0"
66
const val APACHE_TIKA = "3.1.0"
77
const val ARWEAVE4S = "0.21.0"
8-
const val AWS = "2.31.40"
8+
const val AWS = "2.31.45"
99
const val BOUNCY_CASTLE = "1.70"
1010
const val CAFFEINE = "3.2.0"
1111
const val CBOR = "0.4.1-NEWM"
1212
const val CLOUDINARY = "1.39.0"
1313
const val COROUTINES = "1.10.2"
1414
const val EXPOSED = "0.61.0"
15-
const val FLYWAYDB = "11.8.1"
15+
const val FLYWAYDB = "11.8.2"
1616
const val GOOGLE_TRUTH = "1.4.4"
1717
const val GRPC = "1.72.0"
1818
const val GRPC_KOTLIN = "1.4.3"
1919
const val HIKARICP = "6.3.0"
2020
const val I2P_CRYPTO = "0.3.0"
2121
const val JBCRYPT = "0.10.2"
2222
const val JSOUP = "1.20.1"
23-
const val JUNIT = "5.12.2"
23+
const val JUNIT = "5.13.1"
2424
const val J_AUDIO_TAGGER = "3.0.1"
2525
const val KOIN = "4.1.0-Beta8"
26-
const val KOIN_TEST = "4.1.0-Beta11"
26+
const val KOIN_TEST = "4.1.0-RC1"
2727
const val KOTLINX_DATETIME = "0.6.2"
2828
const val KOTLINX_SERIALIZATION = "1.8.1"
2929
const val KOTLIN_LOGGING = "7.0.7"
30-
const val KOTLIN_PLUGIN = "2.1.20"
31-
const val KTLINT = "1.5.0"
30+
const val KOTLIN_PLUGIN = "2.1.21"
31+
const val KTLINT = "1.6.0"
3232
const val KTLINT_PLUGIN = "12.1.1"
3333
const val KTOR = "3.1.3"
3434
const val KTOR_FLYWAY = "3.0.0"
@@ -37,17 +37,17 @@ object Versions {
3737
const val MOCKK = "1.14.2"
3838
const val NEWM = "2.5.0"
3939
const val POSTGRESQL = "42.7.5"
40-
const val PROTOBUF = "4.30.2"
40+
const val PROTOBUF = "4.31.0"
4141
const val PROTOBUF_PLUGIN = "0.8.18"
4242
const val QR_CODE_KOTLIN = "4.4.1"
4343
const val QUARTZ = "2.5.0"
4444
const val SCALA_JAVA8_COMPAT = "1.0.2"
45-
const val SENTRY = "8.11.1"
45+
const val SENTRY = "8.12.0"
4646
const val SHADOW_PLUGIN = "8.1.1"
4747
const val SPRING_SECURITY = "6.4.5"
4848
const val SSL_KICKSTART = "9.1.0"
4949
const val SWAGGER = "1.0.56"
50-
const val TEST_CONTAINERS = "1.21.0"
50+
const val TEST_CONTAINERS = "1.21.1"
5151
const val TYPESAFE = "1.4.3"
5252
const val VERSIONS_PLUGIN = "0.52.0"
5353
}

newm-server/src/main/kotlin/io/newm/server/config/repo/ConfigRepository.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ interface ConfigRepository {
5353
const val CONFIG_KEY_EVEARA_STATUS_CHECK_REFIRE = "eveara.statusCheckDeclinedMaxRefire"
5454
const val CONFIG_KEY_EMAIL_WHITELIST = "email.whitelist"
5555
const val CONFIG_KEY_DISTRIBUTION_PRICE_USD = "distribution.price.usd"
56+
const val CONFIG_KEY_DISTRIBUTION_PRICE_USD_NEWM = "distribution.price.usd.newm"
5657
const val CONFIG_KEY_OUTLET_STATUS_CHECK_MINUTES = "outlet.statusCheckMinutes"
5758
const val CONFIG_KEY_RECAPTCHA_ENABLED = "recaptcha.enabled"
5859
const val CONFIG_KEY_RECAPTCHA_MIN_SCORE = "recaptcha.minScore"

newm-server/src/main/kotlin/io/newm/server/database/migration/V27__ConfigUpdates.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.newm.server.database.migration
22

3-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_EVEARA_NEWM_EMAIL
43
import org.flywaydb.core.api.migration.BaseJavaMigration
54
import org.flywaydb.core.api.migration.Context
65
import org.jetbrains.exposed.sql.transactions.transaction
@@ -11,7 +10,7 @@ class V27__ConfigUpdates : BaseJavaMigration() {
1110
transaction {
1211
execInBatch(
1312
listOf(
14-
"INSERT INTO config VALUES ('$CONFIG_KEY_EVEARA_NEWM_EMAIL','[email protected]') ON CONFLICT(id) DO NOTHING",
13+
"INSERT INTO config VALUES ('eveara.newmEmail','[email protected]') ON CONFLICT(id) DO NOTHING",
1514
"ALTER TABLE songs ADD COLUMN IF NOT EXISTS distribution_release_id BIGINT",
1615
)
1716
)

newm-server/src/main/kotlin/io/newm/server/database/migration/V31__ConfigUpdates.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.newm.server.database.migration
22

3-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_EVEARA_STATUS_CHECK_MINUTES
43
import org.flywaydb.core.api.migration.BaseJavaMigration
54
import org.flywaydb.core.api.migration.Context
65
import org.jetbrains.exposed.sql.transactions.transaction
@@ -12,7 +11,7 @@ class V31__ConfigUpdates : BaseJavaMigration() {
1211
execInBatch(
1312
listOf(
1413
// default 24 hours
15-
"INSERT INTO config VALUES ('$CONFIG_KEY_EVEARA_STATUS_CHECK_MINUTES','1440') ON CONFLICT(id) DO NOTHING",
14+
"INSERT INTO config VALUES ('eveara.statusCheckMinutes','1440') ON CONFLICT(id) DO NOTHING",
1615
)
1716
)
1817
}

newm-server/src/main/kotlin/io/newm/server/database/migration/V39__ConfigUpdates.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.newm.server.database.migration
22

3-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_DISTRIBUTION_PRICE_USD
43
import org.flywaydb.core.api.migration.BaseJavaMigration
54
import org.flywaydb.core.api.migration.Context
65
import org.jetbrains.exposed.sql.transactions.transaction
@@ -12,7 +11,7 @@ class V39__ConfigUpdates : BaseJavaMigration() {
1211
execInBatch(
1312
listOf(
1413
// default $14.99
15-
"INSERT INTO config VALUES ('$CONFIG_KEY_DISTRIBUTION_PRICE_USD','14990000') ON CONFLICT(id) DO NOTHING",
14+
"INSERT INTO config VALUES ('distribution.price.usd','14990000') ON CONFLICT(id) DO NOTHING",
1615
)
1716
)
1817
}

newm-server/src/main/kotlin/io/newm/server/database/migration/V55__ConfigUpdates.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.newm.server.database.migration
22

3-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_EVEARA_STATUS_CHECK_REFIRE
43
import org.flywaydb.core.api.migration.BaseJavaMigration
54
import org.flywaydb.core.api.migration.Context
65
import org.jetbrains.exposed.sql.transactions.transaction
@@ -11,7 +10,7 @@ class V55__ConfigUpdates : BaseJavaMigration() {
1110
transaction {
1211
exec(
1312
// Check album status every 720(minutes) X 30(days) = 21600 minutes
14-
"INSERT INTO config VALUES ('$CONFIG_KEY_EVEARA_STATUS_CHECK_REFIRE','21600') ON CONFLICT(id) DO NOTHING",
13+
"INSERT INTO config VALUES ('eveara.statusCheckDeclinedMaxRefire','21600') ON CONFLICT(id) DO NOTHING",
1514
)
1615
}
1716
}

newm-server/src/main/kotlin/io/newm/server/database/migration/V57__ConfigUpdates.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package io.newm.server.database.migration
22

3-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_EARNINGS_CLAIM_ORDER_FEE
4-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_EARNINGS_MONITOR_PAYMENT_ADDRESS_TIMEOUT_MIN
53
import org.flywaydb.core.api.migration.BaseJavaMigration
64
import org.flywaydb.core.api.migration.Context
75
import org.jetbrains.exposed.sql.transactions.transaction
@@ -13,9 +11,9 @@ class V57__ConfigUpdates : BaseJavaMigration() {
1311
execInBatch(
1412
listOf(
1513
// Expire a ClaimOrder after 30 minutes by default
16-
"INSERT INTO config VALUES ('$CONFIG_KEY_EARNINGS_MONITOR_PAYMENT_ADDRESS_TIMEOUT_MIN','30') ON CONFLICT(id) DO NOTHING",
14+
"INSERT INTO config VALUES ('earnings.monitorPaymentAddressTimeoutMin','30') ON CONFLICT(id) DO NOTHING",
1715
// ClaimOrder takes 2 ada by default
18-
"INSERT INTO config VALUES ('$CONFIG_KEY_EARNINGS_CLAIM_ORDER_FEE','2000000') ON CONFLICT(id) DO NOTHING",
16+
"INSERT INTO config VALUES ('earnings.claimOrderFee','2000000') ON CONFLICT(id) DO NOTHING",
1917
// update claim_orders table to add a new column
2018
"""ALTER TABLE claim_orders ADD COLUMN IF NOT EXISTS payment_address TEXT NOT NULL""",
2119
"""ALTER TABLE claim_orders ADD COLUMN IF NOT EXISTS payment_amount BIGINT NOT NULL""",

newm-server/src/main/kotlin/io/newm/server/database/migration/V59__MarketplaceUpdates.kt

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
package io.newm.server.database.migration
22

3-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_MARKETPLACE_CURRENCY_ASSET_NAME
4-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_MARKETPLACE_CURRENCY_POLICY_ID
5-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_MARKETPLACE_INCENTIVE_MIN_AMOUNT
6-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_MARKETPLACE_MONITORING_RETRY_DELAY
7-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_MARKETPLACE_ORDER_LOVELACE
8-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_MARKETPLACE_PENDING_ORDER_TTL
9-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_MARKETPLACE_PENDING_SALE_TTL
10-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_MARKETPLACE_POINTER_POLICY_ID
11-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_MARKETPLACE_QUEUE_CONTRACT_ADDRESS
12-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_MARKETPLACE_SALE_CONTRACT_ADDRESS
13-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_MARKETPLACE_SALE_LOVELACE
143
import org.flywaydb.core.api.migration.BaseJavaMigration
154
import org.flywaydb.core.api.migration.Context
165
import org.jetbrains.exposed.sql.transactions.transaction
@@ -36,17 +25,17 @@ class V59__MarketplaceUpdates : BaseJavaMigration() {
3625
)
3726
""".trimIndent(),
3827
"INSERT INTO config VALUES ('marketplace.monitoringEnabled','true') ON CONFLICT(id) DO NOTHING",
39-
"INSERT INTO config VALUES ('$CONFIG_KEY_MARKETPLACE_MONITORING_RETRY_DELAY','30') ON CONFLICT(id) DO NOTHING",
40-
"INSERT INTO config VALUES ('$CONFIG_KEY_MARKETPLACE_SALE_CONTRACT_ADDRESS','addr_test1xrdcxs8czy6k778aa6dql97l97845qvk8ne3r895at74ntk40rxn7yxhflf44xw7hazl5ttaym2samu9av394s3e8cwq9dp8zt') ON CONFLICT(id) DO NOTHING",
41-
"INSERT INTO config VALUES ('$CONFIG_KEY_MARKETPLACE_QUEUE_CONTRACT_ADDRESS','addr_test1xzgsgmax3sf0u66ymfmyu6vaeuj7r2tv729uyh9gtd0ul5x40rxn7yxhflf44xw7hazl5ttaym2samu9av394s3e8cwqgar3zw') ON CONFLICT(id) DO NOTHING",
42-
"INSERT INTO config VALUES ('$CONFIG_KEY_MARKETPLACE_PENDING_SALE_TTL','300') ON CONFLICT(id) DO NOTHING",
43-
"INSERT INTO config VALUES ('$CONFIG_KEY_MARKETPLACE_PENDING_ORDER_TTL','300') ON CONFLICT(id) DO NOTHING",
44-
"INSERT INTO config VALUES ('$CONFIG_KEY_MARKETPLACE_ORDER_LOVELACE','4504110') ON CONFLICT(id) DO NOTHING",
45-
"INSERT INTO config VALUES ('$CONFIG_KEY_MARKETPLACE_SALE_LOVELACE','4504110') ON CONFLICT(id) DO NOTHING",
46-
"INSERT INTO config VALUES ('$CONFIG_KEY_MARKETPLACE_POINTER_POLICY_ID','8430a7e28b864f60cf0df03bbdaf842bc2565b8db2da5d675918d103') ON CONFLICT(id) DO NOTHING",
47-
"INSERT INTO config VALUES ('$CONFIG_KEY_MARKETPLACE_CURRENCY_POLICY_ID','769c4c6e9bc3ba5406b9b89fb7beb6819e638ff2e2de63f008d5bcff') ON CONFLICT(id) DO NOTHING",
48-
"INSERT INTO config VALUES ('$CONFIG_KEY_MARKETPLACE_CURRENCY_ASSET_NAME','744e45574d') ON CONFLICT(id) DO NOTHING",
49-
"INSERT INTO config VALUES ('$CONFIG_KEY_MARKETPLACE_INCENTIVE_MIN_AMOUNT','5000000') ON CONFLICT(id) DO NOTHING"
28+
"INSERT INTO config VALUES ('marketplace.monitoringRetryDelay','30') ON CONFLICT(id) DO NOTHING",
29+
"INSERT INTO config VALUES ('marketplace.saleContractAddress','addr_test1xrdcxs8czy6k778aa6dql97l97845qvk8ne3r895at74ntk40rxn7yxhflf44xw7hazl5ttaym2samu9av394s3e8cwq9dp8zt') ON CONFLICT(id) DO NOTHING",
30+
"INSERT INTO config VALUES ('marketplace.queueContractAddress','addr_test1xzgsgmax3sf0u66ymfmyu6vaeuj7r2tv729uyh9gtd0ul5x40rxn7yxhflf44xw7hazl5ttaym2samu9av394s3e8cwqgar3zw') ON CONFLICT(id) DO NOTHING",
31+
"INSERT INTO config VALUES ('marketplace.pendingSaleTimeToLive','300') ON CONFLICT(id) DO NOTHING",
32+
"INSERT INTO config VALUES ('marketplace.pendingOrderTimeToLive','300') ON CONFLICT(id) DO NOTHING",
33+
"INSERT INTO config VALUES ('marketplace.orderLovelace','4504110') ON CONFLICT(id) DO NOTHING",
34+
"INSERT INTO config VALUES ('marketplace.saleLovelace','4504110') ON CONFLICT(id) DO NOTHING",
35+
"INSERT INTO config VALUES ('marketplace.pointerPolicyId','8430a7e28b864f60cf0df03bbdaf842bc2565b8db2da5d675918d103') ON CONFLICT(id) DO NOTHING",
36+
"INSERT INTO config VALUES ('marketplace.currencyPolicyId','769c4c6e9bc3ba5406b9b89fb7beb6819e638ff2e2de63f008d5bcff') ON CONFLICT(id) DO NOTHING",
37+
"INSERT INTO config VALUES ('marketplace.currencyAssetName','744e45574d') ON CONFLICT(id) DO NOTHING",
38+
"INSERT INTO config VALUES ('marketplace.incentiveMinAmount','5000000') ON CONFLICT(id) DO NOTHING"
5039
)
5140
)
5241
}

newm-server/src/main/kotlin/io/newm/server/database/migration/V62__ConfigUpdates.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.newm.server.database.migration
22

3-
import io.newm.server.config.repo.ConfigRepository.Companion.CONFIG_KEY_NEWM_PLAYLIST_ID
43
import org.flywaydb.core.api.migration.BaseJavaMigration
54
import org.flywaydb.core.api.migration.Context
65
import org.jetbrains.exposed.sql.transactions.transaction
@@ -11,7 +10,7 @@ class V62__ConfigUpdates : BaseJavaMigration() {
1110
transaction {
1211
exec(
1312
// Add NEWM album id
14-
"INSERT INTO config VALUES ('$CONFIG_KEY_NEWM_PLAYLIST_ID','4I1cdKzkEzNotxwMPqtM6U') ON CONFLICT(id) DO NOTHING",
13+
"INSERT INTO config VALUES ('newm.playlist.id','4I1cdKzkEzNotxwMPqtM6U') ON CONFLICT(id) DO NOTHING",
1514
)
1615
}
1716
}

0 commit comments

Comments
 (0)