Skip to content

Commit

Permalink
Refactor Account conversion and fix FIDE ID check.
Browse files Browse the repository at this point in the history
Remove unused `url` field from Account conversion logic and update AccountDto and AccountConverter accordingly. Correct SQL migration to check `fide_id` instead of `platform_id` for adding FIDE accounts. Includes a placeholder for generating `url` in AccountConverter.
  • Loading branch information
MichiBaum committed Dec 26, 2024
1 parent 20c6c34 commit 875e1dd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ class AccountDto(
val createdAt: LocalDate? = null
) {
fun toAccount(id: UUID? = null, games: Set<Game> = emptySet()): Account {
return Account(id = id, platformId = this.id, username = username, platform = platform, url = url, name = name, person = null, createdAt = createdAt, games = games)
return Account(id = id, platformId = this.id, username = username, platform = platform, name = name, person = null, createdAt = createdAt, games = games)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class AccountConverter {
id = account.idOrThrow(),
username = account.username,
platform = account.platform,
url = account.url,
url = "", // TODO create url
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SELECT
FROM
person p
WHERE
p.platform_id IS NOT NULL AND p.platform_id != '' AND -- Check that platform_id is not null and not empty
p.fide_id IS NOT NULL AND p.fide_id != '' AND -- Check that fide_id is not null and not empty
NOT EXISTS ( -- Check if the user has already a Fide account
SELECT 1
FROM account a
Expand Down

0 comments on commit 875e1dd

Please sign in to comment.