core-legacy/models/schedule_dbo.h
Tobias Reisinger 51ab1d7982 fix: save id as blob, not as string
add: some progress to new discovery
add: some tests
remove: migrations. restarting for now
2020-02-23 20:06:14 +01:00

54 lines
920 B
C++

#ifndef EMGAUWA_CORE_SCHEDULE_DBO_H
#define EMGAUWA_CORE_SCHEDULE_DBO_H
#include <string>
#include <sqlite3.h>
#include <uuid/uuid.h>
#include <json/value.h>
#include <helpers.h>
#include "period.h"
#include "period_list.h"
class schedule_dbo
{
public:
uuid_t id;
char name[128];
period_list *periods;
bool
update();
bool
insert();
bool
remove();
~schedule_dbo();
Json::Value
to_json();
static void
free_list(schedule_dbo **schedules_list);
static schedule_dbo**
get_by_simple(const char *key, const void *value, intptr_t bind_func, int bind_func_param);
static schedule_dbo**
get_by(helpers::sql_filter_builder **filters);
static schedule_dbo**
get_all();
static int
parse_id(const char *id_str, uuid_t result);
static void
unparse_id(const uuid_t id, char *result);
};
#endif //EMGAUWA_CORE_SCHEDULE_DBO_H