Modifiche e correzioni generali ai assisted

This commit is contained in:
rexeref committed 2026-10-10 19:18:28 +02:00
1 parent 05237cc7f1
commit c6543cc583
13 files changed
+1645 -321

No files matched your search

+18 -6
View File
@@ -6,7 +6,9 @@
#include <stdlib.h>
#include <string.h>
#include <ncurses.h>
#include <json-c/json.h>
#include "jsonFile.h"
#define PRODUCT_STOCK_UNLIMITED (-1)
struct product {
float cost;
@@ -14,23 +16,33 @@ struct product {
char name;
};
/* File */
int existsFile(const char *fname);
int createFile(const char *fname);
int renameDataFile(const char *oldName, const char *newName);
/* Prodotti */
json_object *getProducts(const char *fname);
void listProducts(const char *fname);
int addProduct(const char *fname, const char *name, double price);
int addProductWithInventory(const char *fname, const char *name, double price, int stock);
int addBundleProduct(const char *fname, const char *name, double price, json_object *components);
double getPrice(const char *fname, const char *name);
int updateProduct(const char *productsFile, const char *soldFile, const char *oldName, const char *newName, double price);
int updateProductWithInventory(const char *productsFile, const char *soldFile, const char *oldName, const char *newName, double price, int stock);
int getProductInventory(const char *fname, const char *name, int *stock, int *tracked);
int setProductInventory(const char *fname, const char *name, int stock, int tracked);
int consumeProductInventory(const char *fname, const char *name, int qty);
/* Copie vendute */
int getCount(const char *fname, const char *name);
void listSold(const char *fname);
int addSold(const char *fname, const char *name, int qty);
int updateSold(const char *fname, const char *name, int qty);
int deleteSold(const char *fname, const char *name);
int recordSale(const char *productsFile, const char *soldFile, const char *name, int qty);
/* Entrate */
double getTotalRevenue(const char *productsFile, const char *soldFile);
/* Config */
int ensureAppConfig(const char *fname);
int loadAppConfig(const char *fname);
int saveAppConfig(const char *fname);
#endif