53 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			53 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| #ifndef USER_H
 | |
| #define USER_H
 | |
| 
 | |
| #include <map>
 | |
| #include <vector>
 | |
| #include <wx/wx.h>
 | |
| #include "Preferences.h"
 | |
| 
 | |
| struct operation {
 | |
|   wxString id;
 | |
|     unsigned int day;
 | |
|     unsigned int month;
 | |
|     unsigned int year;
 | |
|     double amount;
 | |
|     wxString description;
 | |
|     wxString category;
 | |
|     bool fix_cost;
 | |
|     wxString account;
 | |
|     bool checked;
 | |
| } ;
 | |
| 
 | |
| struct Account {
 | |
|   wxString id;
 | |
|     wxString name;
 | |
|     wxString number;
 | |
|     bool shared;
 | |
|     bool _default;
 | |
| };
 | |
| 
 | |
| class User
 | |
| {
 | |
| public:
 | |
|   ~User();
 | |
| 
 | |
|   wxString _id;
 | |
|   wxString _name;
 | |
|   wxString _password;
 | |
|   std::vector<Account> _accounts;
 | |
|   std::map<unsigned int, std::map<unsigned int, std::vector<operation> >* > _operations;
 | |
|   Preferences _preferences;
 | |
| 
 | |
|   struct category GetCategory(wxString catId);
 | |
|   wxString GetCategoryName(wxString catId);
 | |
|   wxString GetCategoryId(wxString catName);
 | |
|   wxString GetAccountName(wxString accountId);
 | |
|   wxString GetAccountId(wxString accountName);
 | |
|   int GetCategoriesNumber();
 | |
|   int GetAccountsNumber();
 | |
|   int GetOperationsNumber(int month, int year);
 | |
| };
 | |
| 
 | |
| #endif
 |