diff --git a/src/main/kotlin/id/walt/db/models/WalletOperationHistories.kt b/src/main/kotlin/id/walt/db/models/WalletOperationHistories.kt index 4be7d16..d7beb1a 100644 --- a/src/main/kotlin/id/walt/db/models/WalletOperationHistories.kt +++ b/src/main/kotlin/id/walt/db/models/WalletOperationHistories.kt @@ -1,12 +1,14 @@ package id.walt.db.models +import id.walt.crypto.utils.JsonUtils.toJsonObject import id.walt.service.WalletService import kotlinx.datetime.Clock import kotlinx.datetime.Instant import kotlinx.datetime.toKotlinInstant import kotlinx.serialization.Serializable -import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonObject +import kotlinx.serialization.json.jsonObject import kotlinx.uuid.UUID import kotlinx.uuid.exposed.KotlinxUUIDTable import kotlinx.uuid.generateUUID @@ -28,7 +30,7 @@ data class WalletOperationHistory( val wallet: UUID, val timestamp: Instant, val operation: String, - val data: String, + val data: JsonObject, ) { constructor(result: ResultRow) : this( id = result[WalletOperationHistories.id].value, @@ -36,7 +38,7 @@ data class WalletOperationHistory( wallet = result[WalletOperationHistories.wallet].value, timestamp = result[WalletOperationHistories.timestamp].toKotlinInstant(), operation = result[WalletOperationHistories.operation], - data = result[WalletOperationHistories.data], + data = Json.parseToJsonElement(result[WalletOperationHistories.data]).jsonObject, ) companion object { @@ -45,7 +47,7 @@ data class WalletOperationHistory( wallet = wallet.walletId, timestamp = Clock.System.now(), operation = operation, - data = Json.encodeToString(data) + data = data.toJsonObject() ) } } diff --git a/src/main/kotlin/id/walt/service/WalletServiceManager.kt b/src/main/kotlin/id/walt/service/WalletServiceManager.kt index fa9b98c..34d60ca 100644 --- a/src/main/kotlin/id/walt/service/WalletServiceManager.kt +++ b/src/main/kotlin/id/walt/service/WalletServiceManager.kt @@ -26,6 +26,21 @@ object WalletServiceManager { fun createWallet(forAccount: UUID): UUID { val accountName = AccountsService.getNameFor(forAccount) + // TODO: remove testing code / lock behind dev-mode + if (accountName?.contains("multi-wallet") == true) { + val second = Wallets.insert { + it[name] = "ABC Company wallet" + it[createdOn] = Clock.System.now().toJavaInstant() + }[Wallets.id].value + + AccountWalletMappings.insert { + it[account] = forAccount + it[wallet] = second + it[permissions] = AccountWalletPermissions.READ_ONLY + it[addedOn] = Clock.System.now().toJavaInstant() + } + } + val walletId = Wallets.insert { it[name] = "Wallet of $accountName" it[createdOn] = Clock.System.now().toJavaInstant() diff --git a/web/nuxt.config.ts b/web/nuxt.config.ts index 1e5ac09..a7a5bda 100644 --- a/web/nuxt.config.ts +++ b/web/nuxt.config.ts @@ -176,7 +176,7 @@ export default defineNuxtConfig({ runtimeConfig: { public: { projectId: process.env.ProjectId, - issuerCallbackUrl: process.env.IssuerCallbackUrl ?? "http://localhost:3000" + issuerCallbackUrl: process.env.IssuerCallbackUrl ?? "http://localhost:3000", } }, diff --git a/web/src/app.config.ts b/web/src/app.config.ts new file mode 100644 index 0000000..36a33e1 --- /dev/null +++ b/web/src/app.config.ts @@ -0,0 +1,10 @@ +export default defineAppConfig({ + enableCloudTenants: false, + localTenant: { + name : "walt.id GmbH", + logoImage : "/svg/waltid.svg", + inWalletLogoImage : "/svg/walt-s.svg", + bgImage : "/images/start-page-background.png", + showWaltidLoadingSpinner : true, + } +}) diff --git a/web/src/app.vue b/web/src/app.vue index 3881f38..4f4a7ba 100644 --- a/web/src/app.vue +++ b/web/src/app.vue @@ -29,10 +29,8 @@ InitApp(); const locale = useState("locale.i18n"); const tenant = await (useTenant()).value -const bgImg = tenant?.bgImg const name = tenant?.name const logoImg = tenant?.logoImage -const showWaltidLoadingSpinner = tenant?.showWaltidLoadingSpinner