-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocalmediator.cpp
45 lines (35 loc) · 1.02 KB
/
localmediator.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "localmediator.h"
LocalMediator::LocalMediator(QSharedPointer<Bank> bank) : _bank(bank) {}
LocalMediator::~LocalMediator() {}
BankResponse<Account> LocalMediator::doGetAccount(QString id)
{
return _bank->getAccount(id);
}
BankResponse<ResponseStatus> LocalMediator::doCreateAccount(const Account &acc)
{
return _bank->createAccount(acc);
}
BankResponse<double> LocalMediator::doWithdraw(QString id, const double amount)
{
return _bank->withdraw(id, amount);
}
BankResponse<double> LocalMediator::doTop_up(QString id, const double amount)
{
return _bank->top_up(id, amount);
}
BankResponse<ResponseStatus> LocalMediator::doBlock(QString id)
{
return _bank->block(id);
}
BankResponse<ResponseStatus> LocalMediator::doUnblock(QString id)
{
return _bank->unblock(id);
}
BankResponse<bool> LocalMediator::doCheckPin(QString id, QString pin)
{
return _bank->checkPin(id, pin);
}
BankResponse<ResponseStatus> LocalMediator::doSetPin(QString id, QString newPin)
{
return _bank->setPin(id, newPin);
}