mirror of
https://github.com/wahyd4/cash-code-test.git
synced 2026-08-16 16:56:03 +10:00
18 lines
420 B
Go
18 lines
420 B
Go
package commands
|
|
|
|
import (
|
|
"github.com/sirupsen/logrus"
|
|
"github.com/wahyd4/cash/domains"
|
|
)
|
|
|
|
// TotalBalanceCommand for getting the balance
|
|
type TotalBalanceCommand struct {
|
|
}
|
|
|
|
// Run gets the balance for a specific account when account is not nil, otherwise for the bank
|
|
func (command *TotalBalanceCommand) Run(bank *domains.Bank) error {
|
|
logrus.Infof("the total balance is %.2f", bank.TotalBalance())
|
|
|
|
return nil
|
|
}
|