add init to Account & Transaction

This commit is contained in:
Victor Bodinaud
2022-02-14 16:19:21 +01:00
parent bb6992cadb
commit bf7c7e7144
2 changed files with 12 additions and 0 deletions

View File

@@ -10,4 +10,9 @@ import Foundation
class Account { class Account {
var id: String var id: String
var balance: Int var balance: Int
init(id: String, balance: Int) {
self.id = id
self.balance = balance
}
} }

View File

@@ -12,4 +12,11 @@ class Transaction {
var receiver: String var receiver: String
var amount: Int var amount: Int
var type: String var type: String
init(sender: String, receiver: String, amount: Int, type: String) {
self.sender = sender
self.receiver = receiver
self.amount = amount
self.type = type
}
} }