School Commit Init

This commit is contained in:
2024-08-31 12:07:21 +03:00
commit 0b130ee18c
2801 changed files with 4720552 additions and 0 deletions
@@ -0,0 +1,39 @@
#include "repository.h"
#include "domain.h"
#include <vector>
#include <algorithm>
void test_repository(){
Repository repository;
assert(repository.add(Bill("company1","serial1",100,true)) == true);
assert(repository.add(Bill("company1","serial1",200,false)) == false);
}
Repository::Repository(){
}
Repository::~Repository(){
}
bool Repository::add(Bill bill){
if(std::find(this->_bills.begin(),this->_bills.end(),bill) != this->_bills.end()){
return false;
}
this->_bills.push_back(bill);
return true;
}
std::vector<Bill>::iterator Repository::begin(){
return this->_bills.begin();
}
std::vector<Bill>::iterator Repository::end(){
return this->_bills.end();
}
std::vector<Bill> Repository::bills(){
return this->_bills;
}