-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement account creation to pass test.
- Loading branch information
kamil.jedrzejuk
committed
Oct 1, 2024
1 parent
4224e56
commit b3bd216
Showing
3 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
src/main/kotlin/camilyed/github/io/currencyexchangeapi/Account.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package camilyed.github.io.currencyexchangeapi | ||
|
||
import java.util.UUID | ||
|
||
data class Account( | ||
val id: UUID, | ||
val owner: String, | ||
val balancePln: Double | ||
) |
10 changes: 10 additions & 0 deletions
10
src/main/kotlin/camilyed/github/io/currencyexchangeapi/AccountService.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package camilyed.github.io.currencyexchangeapi | ||
|
||
import java.util.* | ||
|
||
class AccountService { | ||
|
||
fun create(name: String, balance: Double): Account { | ||
return Account(id = UUID.randomUUID(), owner = name, balancePln = balance) | ||
} | ||
} |
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