2019-05-28 16:46:55 +00:00
|
|
|
#include "headers/Customer.h"
|
|
|
|
#include <iostream>
|
|
|
|
|
2019-06-20 11:08:02 +00:00
|
|
|
// moet aangepast worden om een verhicle_type toe te voegen
|
2019-06-24 23:15:30 +00:00
|
|
|
Customer::Customer(int id_, string name_)
|
2019-05-28 16:46:55 +00:00
|
|
|
: id { id_ }
|
|
|
|
, name { name_ }
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-06-20 11:08:02 +00:00
|
|
|
/*
|
|
|
|
creert een park_time object met start time= nu, en voegt t toe aan een vector.
|
|
|
|
*/
|
2019-05-28 16:46:55 +00:00
|
|
|
void Customer::clock_in( int s_id)
|
|
|
|
{
|
|
|
|
Park_time pt{id, s_id};
|
|
|
|
park_instances.push_back(pt);
|
|
|
|
}
|
2019-06-20 11:08:02 +00:00
|
|
|
|
|
|
|
// edit de laatste park_time obj in de vector zodat de end_time = now.
|
2019-05-28 16:46:55 +00:00
|
|
|
void Customer::clock_out(int s_id){
|
|
|
|
park_instances[park_instances.size()-1].clock_out(id, s_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-06-20 11:08:02 +00:00
|
|
|
// monthly report generation. moet nog een manier vinden om af te bakenen.
|
2019-05-28 16:46:55 +00:00
|
|
|
void Customer::gen_monthly(){
|
|
|
|
std::cout << "NAME: " << name << " card code: " << card_code << "\n";
|
|
|
|
std::cout << "-------------------------------------------------\n";
|
|
|
|
for (auto& i : park_instances) {
|
2019-05-28 16:57:33 +00:00
|
|
|
// TODO: need some logic to only include from this month
|
2019-05-28 16:46:55 +00:00
|
|
|
std::cout << i;
|
|
|
|
}
|
|
|
|
std::cout << "-------------------------------------------------\n\n";
|
|
|
|
}
|