mvc/objects/BankAccountView.go
2025-02-23 22:22:43 +01:00

26 lines
514 B
Go

package objects
import (
"fmt"
"mvc/interfaces"
)
type BankAccountView struct {
model BankAccountModel
}
var _ interfaces.IObserver = &BankAccountView{}
func NewBankAccountView(model BankAccountModel) BankAccountView {
return BankAccountView{
model: model,
}
}
func (bv *BankAccountView) Update() error {
fmt.Print("\033[H\033[2J")
fmt.Printf("Kontostand: %v\n", bv.model.GetBalance())
fmt.Println("Bitte Kontobewegung eingeben: [+ = Einzahlung / - = Abhebung] + Betrag (ex. +100.0)")
return nil
}