This commit is contained in:
xds
2025-10-31 17:11:40 +03:00
parent 5b9d2366db
commit d2458633db
11 changed files with 128 additions and 26 deletions

View File

@@ -1,6 +1,7 @@
package space.luminic.finance.mappers
import space.luminic.finance.dtos.UserDTO
import space.luminic.finance.dtos.UserDTO.TelegramAuthDTO
import space.luminic.finance.models.User
object UserMapper {
@@ -11,7 +12,18 @@ object UserMapper {
firstName = this.firstName,
tgId = this.tgId,
tgUserName = this.tgUserName,
photoUrl = this.photoUrl,
roles = this.roles
)
fun TelegramAuthDTO.toTelegramMap(): Map<String, String> =
mapOf(
"id" to id.toString(),
"first_name" to (first_name ?: ""),
"last_name" to (last_name ?: ""),
"username" to (username ?: ""),
"photo_url" to (photo_url ?: ""),
"auth_date" to auth_date.toString(),
"hash" to hash
)
}