migrate to c++, all layers done except for data access

This commit is contained in:
odweta
2026-08-13 21:32:30 +02:00
parent 4389466d40
commit 3b8c6f00f5
25 changed files with 228 additions and 242 deletions
+23
View File
@@ -0,0 +1,23 @@
#ifndef DAO_H
#define DAO_H
#include <string>
#include <vector>
#include "ticket.h"
using namespace std;
class Dao {
public:
string api_key;
string db_url;
void populate_env();
ticket_t fetch_ticket_create(string title, string description);
vector<ticket_t> fetch_ticket_get_all();
vector<ticket_t> fetch_ticket_get_by_status(string status);
ticket_t fetch_ticket_get_by_id(unsigned long id);
};
#endif // DAO_H
+15
View File
@@ -0,0 +1,15 @@
#ifndef HANDLER_H
#define HANDLER_H
#include <string>
#include "dao.h"
using namespace std;
int handle_create(Dao *dao, string title, string description);
int handle_list(Dao *dao);
int handle_list(Dao *dao, string status);
int handle_detail(Dao *dao, unsigned long id);
#endif // HANDLER_H
+8
View File
@@ -0,0 +1,8 @@
#ifndef PARSER_H
#define PARSER_H
#include "dao.h"
int parse_args(Dao *dao, int argc, char *argv[]);
#endif // PARSER_H
+12
View File
@@ -0,0 +1,12 @@
#ifndef PRINTER_H
#define PRINTER_H
#include <vector>
#include "ticket.h"
using namespace std;
void print_tickets(vector<ticket_t> tickets);
#endif // PRINTER_H
+18
View File
@@ -0,0 +1,18 @@
#ifndef TICKET_H
#define TICKET_H
#include <string>
#include <ctime>
using namespace std;
typedef struct {
unsigned long id;
string title;
string description;
string status;
string created_at;
string updated_at;
} ticket_t;
#endif // TICKET_H