You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#pragma once
|
|
|
|
|
#include <data.hpp>
|
|
|
|
|
#include <fs.hpp>
|
|
|
|
|
#include <future>
|
|
|
|
|
#include <json.hpp>
|
|
|
|
|
|
|
|
|
|
struct order {
|
|
|
|
|
std::string name;
|
|
|
|
|
std::string address;
|
|
|
|
|
std::string phone;
|
|
|
|
|
std::string email;
|
|
|
|
|
int id;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
inline void to_json(json &, const order &order);
|
|
|
|
|
inline void from_json(const json &, order &order);
|
|
|
|
|
|
|
|
|
|
class orders {
|
|
|
|
|
std::vector<order> data;
|
|
|
|
|
const with_data_directory &data_directory;
|
|
|
|
|
const fs::path &get_path();
|
|
|
|
|
void sort();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
void write();
|
|
|
|
|
void load();
|
|
|
|
|
orders(const with_data_directory &);
|
|
|
|
|
void push(json);
|
|
|
|
|
~orders();
|
|
|
|
|
};
|