diff --git a/roadmap.md b/roadmap.md index 52e1aee..a39252b 100644 --- a/roadmap.md +++ b/roadmap.md @@ -1,9 +1,14 @@ # roadmap 1. write a parser for user messages such as `/in [name] [amount] [details]` and `/out [name] [amount] [details]` - **DONE**: `src/grammar` -2. attach metadata (`datetime`) to each message -3. write (append) to a ordered by datetime CSV file as double-entry bookkeeping registry -4. export CSV through HTTP URI e.g. `https://fragal.eu/expenses/` (protected by auth or encrypted) - use NGINX for this +2. attach metadata (`datetime`) to each message - **DONE** +3. write (append) to a ordered by datetime CSV file as double-entry bookkeeping registry - **DONE** +4. export CSV through HTTP URI e.g. `https://fragal.eu/expenses/` (protected by auth or encrypted) - use NGINX for this - **DONE** +4b. protect csv using token in request +5. add `categories` +6. reminder to update expenses at given hour, able to set it with `remindme ` or `remindme ` command + + 5. generate a **readable** report of expenses in a given period on query e.g. `/report [daily|weekly|/montly|/yearly]` or `/r [d|w|m|y]` 6. move from CSV to a SQLITE database for persistence, keeping functionality of point 4 7. add other functionalities such as setting limits for a period and alerting / memos diff --git a/src/grammar/expenses.l b/src/grammar/expenses.l index ec4727c..ec2aa72 100644 --- a/src/grammar/expenses.l +++ b/src/grammar/expenses.l @@ -14,14 +14,15 @@ {DIGIT}+ yylval.res=atoi(yytext); return TOK_INT; {DIGIT}+"."{DIGIT}* yylval.val=atof(yytext); return TOK_DOUBLE; +/* {DIGIT}+","{DIGIT}* yylval.val=atof(yytext); return TOK_DOUBLE; // TODO */ "-"|out|spesa yylval.cmd=BOT_CMD_OUT; return TOK_CMD_OUT; "+"|in|ricavo yylval.cmd=BOT_CMD_IN; return TOK_CMD_IN; del|storno yylval.cmd=BOT_CMD_DELETE; return TOK_CMD_DEL; report yylval.cmd=BOT_CMD_REPORT; return TOK_CMD_REPORT; -daily yylval.tsp=BOT_TS_DAILY; return TOK_TS_DAILY; -weekly yylval.tsp=BOT_TS_WEEKLY; return TOK_TS_WEEKLY; -monthly yylval.tsp=BOT_TS_MONTHLY; return TOK_TS_MONTHLY; -yearly yylval.tsp=BOT_TS_YEARLY; return TOK_TS_YEARLY; +daily|giorno yylval.tsp=BOT_TS_DAILY; return TOK_TS_DAILY; +weekly|sett|settimana yylval.tsp=BOT_TS_WEEKLY; return TOK_TS_WEEKLY; +monthly|mese yylval.tsp=BOT_TS_MONTHLY; return TOK_TS_MONTHLY; +yearly|anno yylval.tsp=BOT_TS_YEARLY; return TOK_TS_YEARLY; [a-zA-Z0-9_]+ yylval.str=g_string_new(yytext); return TOK_USER; /* user can't have special characters */ \"[^\n]+\" yylval.str=g_string_new(yytext); return TOK_STR; /* anything excepts '\n'; needs to be at the bottom of flex rules here */ [ \t]+ /* ignore whitespace */;