diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-09-27 18:38:35 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-09-27 18:38:35 +0200 |
| commit | d8c4d84dc75300c6d4d8b0adceafa33741960b92 (patch) | |
| tree | 00e2dfcc5c836d62fccff76c862e6ec3b0a74db8 /include | |
| parent | fa088bb60692ba02d30d39affa9a31d9e2b688e2 (diff) | |
added http lib, working on AI invoice importing
Diffstat (limited to 'include')
| -rw-r--r-- | include/administration.hpp | 2 | ||||
| -rw-r--r-- | include/ai_service.hpp | 26 | ||||
| -rw-r--r-- | include/log.hpp | 4 | ||||
| -rw-r--r-- | include/ui.hpp | 2 |
4 files changed, 30 insertions, 4 deletions
diff --git a/include/administration.hpp b/include/administration.hpp index 145bb5d..ec64833 100644 --- a/include/administration.hpp +++ b/include/administration.hpp @@ -35,7 +35,7 @@ #define MAX_LEN_TAXID 32 #define MAX_LEN_BUSINESSID 32 #define MAX_LEN_TAX_SECTION 16 -#define MAX_LEN_API_KEY 64 +#define MAX_LEN_API_KEY 256 #define MAX_LEN_INCOME_STATEMENT_REPORT_QUARTERS 400 #define MAX_LEN_QUARTERLY_REPORT_PROJECTS 200 diff --git a/include/ai_service.hpp b/include/ai_service.hpp new file mode 100644 index 0000000..b481b58 --- /dev/null +++ b/include/ai_service.hpp @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2025 Aldrik Ramaekers <aldrik.ramaekers@gmail.com> +* +* Permission to use, copy, modify, and/or distribute this software for any +* purpose with or without fee is hereby granted, provided that the above +* copyright notice and this permission notice appear in all copies. +* +* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#pragma once + +typedef struct +{ + time_t started_at; + bool finished; + char* result; +} ai_request; + +ai_request* ai_document_to_invoice(char* file_path);
\ No newline at end of file diff --git a/include/log.hpp b/include/log.hpp index cdb6a9f..bff3d05 100644 --- a/include/log.hpp +++ b/include/log.hpp @@ -29,12 +29,12 @@ typedef struct { u32 history_length; char history[MAX_LEN_LOG_HISTORY][MAX_LEN_LOG_TXT]; ImVec4 colors[MAX_LEN_LOG_HISTORY]; -} log; +} program_log; #define STOPWATCH_START tick_t timestamp_start = timer_current(); #define STOPWATCH_TIME (timer_elapsed(timestamp_start)*1000.0f) -log* get_log(); +program_log* get_log(); void log_clear(); void log_aerr(a_err errors); diff --git a/include/ui.hpp b/include/ui.hpp index 955964b..33f6d18 100644 --- a/include/ui.hpp +++ b/include/ui.hpp @@ -98,7 +98,7 @@ namespace ImGui void InputTextWithError(const char* text, char* buffer, size_t buf_size, bool has_error); int TextInputWithAutocomplete(const char* hint, char* buffer, size_t buf_size, char** suggestions, int suggestion_count, bool has_error); - bool FormFileSelector(char* buffer); + bool FormInvoiceFileSelector(char* text, char* buffer); void FormContactAutocomplete(contact* buffer, bool has_error); void FormInputTextWithErrorHint(const char* hint, char* buffer, size_t buf_size, bool has_error); void FormCountryCombo(char* buffer, size_t buf_size); |
