diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-10-04 09:25:36 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-10-04 09:25:36 +0200 |
| commit | 4cfbd259d1a6fbe7592b8975eed399b46082edc1 (patch) | |
| tree | c6095f5d2e0f1eabae41ddb62a6adc74d2210f97 /include | |
| parent | 485e5ebf340857db07b1c8ecb5c63dcf3a908377 (diff) | |
import ui
Diffstat (limited to 'include')
| -rw-r--r-- | include/import_service.hpp (renamed from include/ai_service.hpp) | 28 | ||||
| -rw-r--r-- | include/ui.hpp | 1 |
2 files changed, 25 insertions, 4 deletions
diff --git a/include/ai_service.hpp b/include/import_service.hpp index cf0b67a..516257e 100644 --- a/include/ai_service.hpp +++ b/include/import_service.hpp @@ -18,12 +18,30 @@ #include "administration.hpp" +typedef uint32_t i_err; + +#define I_ERR_SUCCESS 0 +#define I_ERR_FAILED_UPLOAD 1 +#define I_ERR_FAILED_QUERY 2 +#define I_ERR_FAILED_IMPORT 3 + +typedef enum +{ + IMPORT_STARTING, + IMPORT_UPLOADING_FILE, + IMPORT_QUERYING, + IMPORT_WAITING_FOR_RESPONSE, + IMPORT_DONE, +} import_status; + typedef struct { time_t started_at; - bool finished; - char* result; -} ai_request; + invoice result; + char file_path[MAX_LEN_PATH]; + i_err error; + import_status status; +} import_invoice_request; typedef struct { @@ -33,4 +51,6 @@ typedef struct extern ai_provider_impl _chatgpt_api_provider; -ai_request* ai_document_to_invoice(char* file_path);
\ No newline at end of file +const char* import_error_to_str(i_err error); +const char* import_status_to_str(import_status status); +import_invoice_request* ai_document_to_invoice(char* file_path);
\ No newline at end of file diff --git a/include/ui.hpp b/include/ui.hpp index 33f6d18..931f302 100644 --- a/include/ui.hpp +++ b/include/ui.hpp @@ -47,6 +47,7 @@ typedef enum EDIT, CREATE, VIEW, + VIEW_IMPORT_REQUEST, } view_state; typedef struct |
