#ifndef ACCOUNT_H_
#define ACCOUNT_H_

// Author: Steve Talbot

#pragma once

#include "MDA_EFSM.h"
#include "OutputProcessor.h"
#include "DATA.h"

#include "open_account_a.h"
#include "open_account_1.h"
#include "login_a.h"
#include "login_1.h"
#include "pin_a.h"
#include "pin_1.h"
#include "logout_a.h"
#include "logout_1.h"
#include "balance_a.h"
#include "balance_1.h"
#include "withdraw_a.h"
#include "withdraw_1.h"
#include "deposit_a.h"
#include "deposit_1.h"
#include "activate_a.h"
#include "activate_1.h"
#include "deactivate_a.h"
#include "deactivate_1.h"

using namespace std;

class Account {

public:
	Account();
	~Account();

	void removeCurrentConfiguration();

	bool open_account( int p_, int y_, int a_ );

	bool login( int y_ );
	bool pin( int p_ );
	bool logout();

	bool balance();
	bool withdraw( int w_ );
	bool deposit( int d_ );

	bool activate();
	bool deactivate();

	// setters ..
	void setMDA_EFSM( MDA_EFSM* M_ );
	void setOutputProcessor( OutputProcessor* OP_ );
	void setOpenAcountA( open_account_a* OA_ );
	void setLoginA( login_a* LI_ );
	void setPinA( pin_a* PI_ );
	void setLogoutA( logout_a* LO_ );
	void setBalanceA( balance_a* BA_ );
	void setWithdrawA( withdraw_a* W_ );
	void setDepositA( deposit_a* D_ );
	void setActivateA( activate_a* A_ );
	void setDeactivateA( deactivate_a* DA_ );

	void setMinBalance( int minBalance_ );
	void setOverdrawPenalty( int overdrawPenalty_ );
	void setMaxAttempts( int maxAttempts_ );

	// getters ..
	MDA_EFSM* getMDA_EFSM();
	OutputProcessor* getOutputProcessor();
	open_account_a* getOpenAcountA();
	login_a* getLoginA();
	pin_a* getPinA();
	logout_a* getLogoutA();
	balance_a* getBalanceA();
	withdraw_a* getWithdrawA();
	deposit_a* getDepositA();
	activate_a* getActivateA();
	deactivate_a* getDeactivateA();

	string getState();
	int getStateID();
	int getMinBalance();
	int getOverdrawPenalty();
	int getMaxAttempts();

	bool getIsActive();
	bool getIsOverdrawn();
	int getAttempts();


private:

	MDA_EFSM* _M;

	OutputProcessor* _OP;

	Data* _data;

	open_account_a* _OA;

	login_a* _LI;

	pin_a* _PI;

	logout_a* _LO;

	balance_a* _BA;

	withdraw_a* _W;

	deposit_a* _D;

	activate_a* _A;

	deactivate_a* _DA;

};

#endif /*ACCOUNT_H_*/
