|
|
|
#ifndef CAMPSERVICE_H
|
|
|
|
#define CAMPSERVICE_H
|
|
|
|
|
|
|
|
#include <core.h>
|
|
|
|
#include <addressbookdata.h>
|
|
|
|
#include <accservice.h>
|
|
|
|
#include "data/camp-data.h"
|
|
|
|
#include "settings/campsettings.h"
|
|
|
|
#include "camp-odb.hxx"
|
|
|
|
|
|
|
|
class CampService : public Service<CampData>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CampService();
|
|
|
|
void addPerson(CampDataPtr data, AddressbookDataPtr address);
|
|
|
|
void addService(CampDataPtr data, AccServicePtr service);
|
|
|
|
void addService(CampDataPtr data, AccServicePtr service, QDecDouble price, QString description);
|
|
|
|
void setOwner(CampDataPtr data, AddressItemPtr person);
|
|
|
|
CampDataPtr create();
|
|
|
|
void calculate(CampDataPtr data);
|
|
|
|
void saveCamp(CampDataPtr data);
|
|
|
|
|
|
|
|
private:
|
|
|
|
ServiceItemPtr addServiceInt(CampDataPtr data, AccServicePtr service);
|
|
|
|
void calcPeople(CampDataPtr data);
|
|
|
|
void calcServices(CampDataPtr data);
|
|
|
|
void calcPrice(CampDataPtr data);
|
|
|
|
void addAccFee(CampDataPtr data, AddressItemPtr item, int startAge, int endAge, int days);
|
|
|
|
CampSettingsPtr m_settings;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CAMPSERVICE_H
|