openfatture 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (414) hide show
  1. openfatture-1.1.0/.actrc +29 -0
  2. openfatture-1.1.0/.bumpversion.toml +26 -0
  3. openfatture-1.1.0/.claude/settings.local.json +52 -0
  4. openfatture-1.1.0/.dockerignore +58 -0
  5. openfatture-1.1.0/.env.demo +48 -0
  6. openfatture-1.1.0/.env.example +147 -0
  7. openfatture-1.1.0/.gitattributes +19 -0
  8. openfatture-1.1.0/.github/ISSUE_TEMPLATE/bug_report.md +48 -0
  9. openfatture-1.1.0/.github/ISSUE_TEMPLATE/feature_request.md +34 -0
  10. openfatture-1.1.0/.github/pull_request_template.md +39 -0
  11. openfatture-1.1.0/.github/workflows/media-generation.yml +194 -0
  12. openfatture-1.1.0/.github/workflows/media-optimization.yml +221 -0
  13. openfatture-1.1.0/.github/workflows/media-validation.yml +181 -0
  14. openfatture-1.1.0/.github/workflows/payment-tests.yml +231 -0
  15. openfatture-1.1.0/.github/workflows/release.yml +77 -0
  16. openfatture-1.1.0/.github/workflows/test.yml +111 -0
  17. openfatture-1.1.0/.gitignore +98 -0
  18. openfatture-1.1.0/.pre-commit-config.yaml +38 -0
  19. openfatture-1.1.0/.python-version +1 -0
  20. openfatture-1.1.0/.secrets.example +27 -0
  21. openfatture-1.1.0/CHANGELOG.md +171 -0
  22. openfatture-1.1.0/CONTRIBUTING.md +240 -0
  23. openfatture-1.1.0/Dockerfile +59 -0
  24. openfatture-1.1.0/LICENSE +21 -0
  25. openfatture-1.1.0/Makefile +45 -0
  26. openfatture-1.1.0/PKG-INFO +225 -0
  27. openfatture-1.1.0/QUICKSTART.md +257 -0
  28. openfatture-1.1.0/README.md +151 -0
  29. openfatture-1.1.0/SECURITY.md +201 -0
  30. openfatture-1.1.0/docker-compose.yml +69 -0
  31. openfatture-1.1.0/docs/AI_ARCHITECTURE.md +1145 -0
  32. openfatture-1.1.0/docs/ARCHITECTURE_DIAGRAMS.md +482 -0
  33. openfatture-1.1.0/docs/BATCH_OPERATIONS.md +113 -0
  34. openfatture-1.1.0/docs/CI_CD_MEDIA_AUTOMATION.md +734 -0
  35. openfatture-1.1.0/docs/CLI_REFERENCE.md +150 -0
  36. openfatture-1.1.0/docs/CONFIGURATION.md +1025 -0
  37. openfatture-1.1.0/docs/DEVELOPMENT.md +663 -0
  38. openfatture-1.1.0/docs/EMAIL_TEMPLATES.md +377 -0
  39. openfatture-1.1.0/docs/GLOSSARY.md +19 -0
  40. openfatture-1.1.0/docs/KB_INTEGRATION_BLUEPRINT.md +157 -0
  41. openfatture-1.1.0/docs/MEDIA_AUTOMATION.md +53 -0
  42. openfatture-1.1.0/docs/MEDIA_CAPTURE_PLAN.md +125 -0
  43. openfatture-1.1.0/docs/MEDIA_PRODUCTION_SCHEDULE.md +25 -0
  44. openfatture-1.1.0/docs/PAYMENT_TRACKING.md +834 -0
  45. openfatture-1.1.0/docs/PDF_GENERATION.md +994 -0
  46. openfatture-1.1.0/docs/QUICKSTART.md +542 -0
  47. openfatture-1.1.0/docs/README.md +52 -0
  48. openfatture-1.1.0/docs/guidelines/BEST_PRACTICES_2025.md +405 -0
  49. openfatture-1.1.0/docs/history/FIX_SUMMARY.md +301 -0
  50. openfatture-1.1.0/docs/history/IMPLEMENTATION_SUMMARY.md +177 -0
  51. openfatture-1.1.0/docs/history/NEXT_RELEASE_PLAN.md +47 -0
  52. openfatture-1.1.0/docs/history/PHASE_1_SUMMARY.md +417 -0
  53. openfatture-1.1.0/docs/history/PHASE_2_SUMMARY.md +576 -0
  54. openfatture-1.1.0/docs/history/PHASE_4_1_SUMMARY.md +557 -0
  55. openfatture-1.1.0/docs/history/PHASE_4_2_SUMMARY.md +392 -0
  56. openfatture-1.1.0/docs/history/PHASE_4_3_SUMMARY.md +486 -0
  57. openfatture-1.1.0/docs/history/PHASE_4_SUMMARY.md +3208 -0
  58. openfatture-1.1.0/docs/history/ROADMAP.md +189 -0
  59. openfatture-1.1.0/docs/history/session_final_summary.md +140 -0
  60. openfatture-1.1.0/docs/operations/SETUP_CI_CD.md +187 -0
  61. openfatture-1.1.0/docs/releases/v1.0.0.md +80 -0
  62. openfatture-1.1.0/docs/releases/v1.0.1.md +29 -0
  63. openfatture-1.1.0/docs/releases/v1.1.0.md +38 -0
  64. openfatture-1.1.0/docs/reports/COVERAGE_PROGRESS.md +137 -0
  65. openfatture-1.1.0/docs/reports/TEST_RESULTS_SUMMARY.md +351 -0
  66. openfatture-1.1.0/docs/storyboards/SCENARIO_A_ONBOARDING.md +44 -0
  67. openfatture-1.1.0/docs/storyboards/SCENARIO_B_INVOICE.md +44 -0
  68. openfatture-1.1.0/docs/storyboards/SCENARIO_C_AI.md +43 -0
  69. openfatture-1.1.0/docs/storyboards/SCENARIO_D_BATCH.md +42 -0
  70. openfatture-1.1.0/docs/storyboards/SCENARIO_E_PEC.md +44 -0
  71. openfatture-1.1.0/examples/AI_CHAT_ASSISTANT.md +588 -0
  72. openfatture-1.1.0/examples/AI_INVOICE_ASSISTANT.md +135 -0
  73. openfatture-1.1.0/examples/AI_TAX_ADVISOR.md +129 -0
  74. openfatture-1.1.0/examples/ai_invoice_assistant.py +287 -0
  75. openfatture-1.1.0/examples/ai_tax_advisor.py +308 -0
  76. openfatture-1.1.0/examples/demo/README.md +29 -0
  77. openfatture-1.1.0/examples/demo/clients.csv +4 -0
  78. openfatture-1.1.0/examples/demo/invoices.csv +4 -0
  79. openfatture-1.1.0/examples/demo/products.csv +4 -0
  80. openfatture-1.1.0/examples/demo/sdi-notifications/NS_2025-003.xml +13 -0
  81. openfatture-1.1.0/examples/demo/sdi-notifications/RC_2025-002.xml +21 -0
  82. openfatture-1.1.0/examples/demo/sdi-notifications/README.md +14 -0
  83. openfatture-1.1.0/examples/email_templates_example.py +257 -0
  84. openfatture-1.1.0/examples/payment_examples.py +835 -0
  85. openfatture-1.1.0/examples/pdf_examples.py +741 -0
  86. openfatture-1.1.0/makefiles/README.md +214 -0
  87. openfatture-1.1.0/makefiles/ai.mk +212 -0
  88. openfatture-1.1.0/makefiles/base.mk +96 -0
  89. openfatture-1.1.0/makefiles/ci.mk +241 -0
  90. openfatture-1.1.0/makefiles/dev.mk +201 -0
  91. openfatture-1.1.0/makefiles/docker.mk +198 -0
  92. openfatture-1.1.0/makefiles/media.mk +338 -0
  93. openfatture-1.1.0/makefiles/test.mk +202 -0
  94. openfatture-1.1.0/media/automation/README.md +166 -0
  95. openfatture-1.1.0/media/automation/scenario_a_onboarding.tape +52 -0
  96. openfatture-1.1.0/media/automation/scenario_b_invoice.tape +61 -0
  97. openfatture-1.1.0/media/automation/scenario_c_ai.tape +57 -0
  98. openfatture-1.1.0/media/automation/scenario_d_batch.tape +65 -0
  99. openfatture-1.1.0/media/automation/scenario_e_pec.tape +76 -0
  100. openfatture-1.1.0/media/automation/templates/common.tapeinc +135 -0
  101. openfatture-1.1.0/media/output/scenario_a_onboarding.mp4 +0 -0
  102. openfatture-1.1.0/media/output/scenario_b_invoice.mp4 +0 -0
  103. openfatture-1.1.0/media/output/scenario_c_ai.mp4 +0 -0
  104. openfatture-1.1.0/media/output/scenario_d_batch.mp4 +0 -0
  105. openfatture-1.1.0/media/output/scenario_e_pec.mp4 +0 -0
  106. openfatture-1.1.0/media/presets/OBS_OF-1440p60.json +59 -0
  107. openfatture-1.1.0/media/presets/README.md +10 -0
  108. openfatture-1.1.0/media/presets/resolve_of_timeline.yaml +38 -0
  109. openfatture-1.1.0/mypy.ini +45 -0
  110. openfatture-1.1.0/openfatture/__init__.py +10 -0
  111. openfatture-1.1.0/openfatture/ai/__init__.py +65 -0
  112. openfatture-1.1.0/openfatture/ai/agents/__init__.py +1 -0
  113. openfatture-1.1.0/openfatture/ai/agents/cash_flow_predictor.py +791 -0
  114. openfatture-1.1.0/openfatture/ai/agents/chat_agent.py +370 -0
  115. openfatture-1.1.0/openfatture/ai/agents/compliance/__init__.py +65 -0
  116. openfatture-1.1.0/openfatture/ai/agents/compliance/checker.py +470 -0
  117. openfatture-1.1.0/openfatture/ai/agents/compliance/heuristics.py +507 -0
  118. openfatture-1.1.0/openfatture/ai/agents/compliance/rules.py +638 -0
  119. openfatture-1.1.0/openfatture/ai/agents/compliance/sdi_patterns.py +435 -0
  120. openfatture-1.1.0/openfatture/ai/agents/invoice_assistant.py +278 -0
  121. openfatture-1.1.0/openfatture/ai/agents/models.py +193 -0
  122. openfatture-1.1.0/openfatture/ai/agents/payment_insight_agent.py +120 -0
  123. openfatture-1.1.0/openfatture/ai/agents/tax_advisor.py +316 -0
  124. openfatture-1.1.0/openfatture/ai/cache/__init__.py +46 -0
  125. openfatture-1.1.0/openfatture/ai/cache/config.py +130 -0
  126. openfatture-1.1.0/openfatture/ai/cache/memory.py +272 -0
  127. openfatture-1.1.0/openfatture/ai/cache/provider.py +305 -0
  128. openfatture-1.1.0/openfatture/ai/cache/strategy.py +137 -0
  129. openfatture-1.1.0/openfatture/ai/config/__init__.py +5 -0
  130. openfatture-1.1.0/openfatture/ai/config/settings.py +330 -0
  131. openfatture-1.1.0/openfatture/ai/context/__init__.py +5 -0
  132. openfatture-1.1.0/openfatture/ai/context/enrichment.py +309 -0
  133. openfatture-1.1.0/openfatture/ai/domain/__init__.py +50 -0
  134. openfatture-1.1.0/openfatture/ai/domain/agent.py +614 -0
  135. openfatture-1.1.0/openfatture/ai/domain/context.py +271 -0
  136. openfatture-1.1.0/openfatture/ai/domain/message.py +118 -0
  137. openfatture-1.1.0/openfatture/ai/domain/prompt.py +347 -0
  138. openfatture-1.1.0/openfatture/ai/domain/response.py +129 -0
  139. openfatture-1.1.0/openfatture/ai/ml/__init__.py +57 -0
  140. openfatture-1.1.0/openfatture/ai/ml/config.py +359 -0
  141. openfatture-1.1.0/openfatture/ai/ml/data_loader.py +502 -0
  142. openfatture-1.1.0/openfatture/ai/ml/features.py +575 -0
  143. openfatture-1.1.0/openfatture/ai/orchestration/__init__.py +173 -0
  144. openfatture-1.1.0/openfatture/ai/orchestration/human_loop.py +468 -0
  145. openfatture-1.1.0/openfatture/ai/orchestration/resilience.py +517 -0
  146. openfatture-1.1.0/openfatture/ai/orchestration/states.py +520 -0
  147. openfatture-1.1.0/openfatture/ai/orchestration/workflows/__init__.py +53 -0
  148. openfatture-1.1.0/openfatture/ai/orchestration/workflows/cash_flow_analysis.py +614 -0
  149. openfatture-1.1.0/openfatture/ai/orchestration/workflows/compliance_check.py +589 -0
  150. openfatture-1.1.0/openfatture/ai/orchestration/workflows/invoice_creation.py +931 -0
  151. openfatture-1.1.0/openfatture/ai/prompts/__init__.py +1 -0
  152. openfatture-1.1.0/openfatture/ai/prompts/chat_assistant.yaml +134 -0
  153. openfatture-1.1.0/openfatture/ai/prompts/invoice_assistant.yaml +116 -0
  154. openfatture-1.1.0/openfatture/ai/prompts/tax_advisor.yaml +310 -0
  155. openfatture-1.1.0/openfatture/ai/providers/__init__.py +32 -0
  156. openfatture-1.1.0/openfatture/ai/providers/anthropic.py +360 -0
  157. openfatture-1.1.0/openfatture/ai/providers/base.py +253 -0
  158. openfatture-1.1.0/openfatture/ai/providers/factory.py +309 -0
  159. openfatture-1.1.0/openfatture/ai/providers/ollama.py +340 -0
  160. openfatture-1.1.0/openfatture/ai/providers/openai.py +473 -0
  161. openfatture-1.1.0/openfatture/ai/rag/__init__.py +242 -0
  162. openfatture-1.1.0/openfatture/ai/rag/config.py +166 -0
  163. openfatture-1.1.0/openfatture/ai/rag/embeddings.py +354 -0
  164. openfatture-1.1.0/openfatture/ai/rag/indexing.py +284 -0
  165. openfatture-1.1.0/openfatture/ai/rag/knowledge_indexer.py +304 -0
  166. openfatture-1.1.0/openfatture/ai/rag/retrieval.py +305 -0
  167. openfatture-1.1.0/openfatture/ai/rag/sources.json +53 -0
  168. openfatture-1.1.0/openfatture/ai/rag/vector_store.py +421 -0
  169. openfatture-1.1.0/openfatture/ai/session/__init__.py +11 -0
  170. openfatture-1.1.0/openfatture/ai/session/manager.py +425 -0
  171. openfatture-1.1.0/openfatture/ai/session/models.py +419 -0
  172. openfatture-1.1.0/openfatture/ai/tools/__init__.py +12 -0
  173. openfatture-1.1.0/openfatture/ai/tools/client_tools.py +237 -0
  174. openfatture-1.1.0/openfatture/ai/tools/invoice_tools.py +308 -0
  175. openfatture-1.1.0/openfatture/ai/tools/knowledge_tools.py +120 -0
  176. openfatture-1.1.0/openfatture/ai/tools/models.py +206 -0
  177. openfatture-1.1.0/openfatture/ai/tools/registry.py +281 -0
  178. openfatture-1.1.0/openfatture/cli/__init__.py +1 -0
  179. openfatture-1.1.0/openfatture/cli/commands/__init__.py +1 -0
  180. openfatture-1.1.0/openfatture/cli/commands/ai.py +892 -0
  181. openfatture-1.1.0/openfatture/cli/commands/batch.py +266 -0
  182. openfatture-1.1.0/openfatture/cli/commands/cliente.py +269 -0
  183. openfatture-1.1.0/openfatture/cli/commands/config.py +179 -0
  184. openfatture-1.1.0/openfatture/cli/commands/email.py +216 -0
  185. openfatture-1.1.0/openfatture/cli/commands/fattura.py +555 -0
  186. openfatture-1.1.0/openfatture/cli/commands/init.py +258 -0
  187. openfatture-1.1.0/openfatture/cli/commands/interactive.py +79 -0
  188. openfatture-1.1.0/openfatture/cli/commands/notifiche.py +245 -0
  189. openfatture-1.1.0/openfatture/cli/commands/pec.py +96 -0
  190. openfatture-1.1.0/openfatture/cli/commands/report.py +324 -0
  191. openfatture-1.1.0/openfatture/cli/completion/README.md +295 -0
  192. openfatture-1.1.0/openfatture/cli/completion/__init__.py +1 -0
  193. openfatture-1.1.0/openfatture/cli/completion/_openfatture.bash +134 -0
  194. openfatture-1.1.0/openfatture/cli/completion/_openfatture.zsh +181 -0
  195. openfatture-1.1.0/openfatture/cli/completion/install.sh +191 -0
  196. openfatture-1.1.0/openfatture/cli/main.py +92 -0
  197. openfatture-1.1.0/openfatture/cli/ui/__init__.py +57 -0
  198. openfatture-1.1.0/openfatture/cli/ui/autocomplete.py +221 -0
  199. openfatture-1.1.0/openfatture/cli/ui/autocomplete_data.py +352 -0
  200. openfatture-1.1.0/openfatture/cli/ui/chat.py +562 -0
  201. openfatture-1.1.0/openfatture/cli/ui/config_wizard.py +517 -0
  202. openfatture-1.1.0/openfatture/cli/ui/dashboard.py +520 -0
  203. openfatture-1.1.0/openfatture/cli/ui/helpers.py +307 -0
  204. openfatture-1.1.0/openfatture/cli/ui/menus.py +946 -0
  205. openfatture-1.1.0/openfatture/cli/ui/progress.py +142 -0
  206. openfatture-1.1.0/openfatture/cli/ui/styles.py +33 -0
  207. openfatture-1.1.0/openfatture/core/__init__.py +1 -0
  208. openfatture-1.1.0/openfatture/core/batch/__init__.py +22 -0
  209. openfatture-1.1.0/openfatture/core/batch/invoice_processor.py +233 -0
  210. openfatture-1.1.0/openfatture/core/batch/operations.py +337 -0
  211. openfatture-1.1.0/openfatture/core/batch/processor.py +232 -0
  212. openfatture-1.1.0/openfatture/core/clienti/__init__.py +1 -0
  213. openfatture-1.1.0/openfatture/core/fatture/__init__.py +1 -0
  214. openfatture-1.1.0/openfatture/core/fatture/service.py +56 -0
  215. openfatture-1.1.0/openfatture/core/fiscale/__init__.py +1 -0
  216. openfatture-1.1.0/openfatture/core/prodotti/__init__.py +1 -0
  217. openfatture-1.1.0/openfatture/payment/README.md +701 -0
  218. openfatture-1.1.0/openfatture/payment/__init__.py +27 -0
  219. openfatture-1.1.0/openfatture/payment/application/__init__.py +48 -0
  220. openfatture-1.1.0/openfatture/payment/application/events.py +72 -0
  221. openfatture-1.1.0/openfatture/payment/application/listeners.py +58 -0
  222. openfatture-1.1.0/openfatture/payment/application/notifications/__init__.py +21 -0
  223. openfatture-1.1.0/openfatture/payment/application/notifications/notifier.py +387 -0
  224. openfatture-1.1.0/openfatture/payment/application/services/__init__.py +17 -0
  225. openfatture-1.1.0/openfatture/payment/application/services/insight_service.py +96 -0
  226. openfatture-1.1.0/openfatture/payment/application/services/matching_service.py +431 -0
  227. openfatture-1.1.0/openfatture/payment/application/services/payment_overview.py +150 -0
  228. openfatture-1.1.0/openfatture/payment/application/services/reconciliation_service.py +589 -0
  229. openfatture-1.1.0/openfatture/payment/application/services/reminder_scheduler.py +464 -0
  230. openfatture-1.1.0/openfatture/payment/cli/__init__.py +5 -0
  231. openfatture-1.1.0/openfatture/payment/cli/payment_cli.py +1157 -0
  232. openfatture-1.1.0/openfatture/payment/domain/__init__.py +26 -0
  233. openfatture-1.1.0/openfatture/payment/domain/enums.py +112 -0
  234. openfatture-1.1.0/openfatture/payment/domain/models.py +324 -0
  235. openfatture-1.1.0/openfatture/payment/domain/payment_allocation.py +53 -0
  236. openfatture-1.1.0/openfatture/payment/domain/value_objects.py +275 -0
  237. openfatture-1.1.0/openfatture/payment/infrastructure/__init__.py +15 -0
  238. openfatture-1.1.0/openfatture/payment/infrastructure/importers/__init__.py +50 -0
  239. openfatture-1.1.0/openfatture/payment/infrastructure/importers/base.py +240 -0
  240. openfatture-1.1.0/openfatture/payment/infrastructure/importers/csv_importer.py +391 -0
  241. openfatture-1.1.0/openfatture/payment/infrastructure/importers/factory.py +288 -0
  242. openfatture-1.1.0/openfatture/payment/infrastructure/importers/ofx_importer.py +269 -0
  243. openfatture-1.1.0/openfatture/payment/infrastructure/importers/presets.py +415 -0
  244. openfatture-1.1.0/openfatture/payment/infrastructure/importers/qif_importer.py +385 -0
  245. openfatture-1.1.0/openfatture/payment/infrastructure/repository.py +365 -0
  246. openfatture-1.1.0/openfatture/payment/matchers/__init__.py +34 -0
  247. openfatture-1.1.0/openfatture/payment/matchers/base.py +146 -0
  248. openfatture-1.1.0/openfatture/payment/matchers/composite.py +171 -0
  249. openfatture-1.1.0/openfatture/payment/matchers/date_window.py +203 -0
  250. openfatture-1.1.0/openfatture/payment/matchers/exact.py +156 -0
  251. openfatture-1.1.0/openfatture/payment/matchers/fuzzy.py +364 -0
  252. openfatture-1.1.0/openfatture/payment/matchers/iban.py +367 -0
  253. openfatture-1.1.0/openfatture/payment/templates/reminder_email.html +220 -0
  254. openfatture-1.1.0/openfatture/payment/templates/reminder_email.txt +41 -0
  255. openfatture-1.1.0/openfatture/sdi/__init__.py +1 -0
  256. openfatture-1.1.0/openfatture/sdi/digital_signature/__init__.py +15 -0
  257. openfatture-1.1.0/openfatture/sdi/digital_signature/certificate_manager.py +209 -0
  258. openfatture-1.1.0/openfatture/sdi/digital_signature/signer.py +201 -0
  259. openfatture-1.1.0/openfatture/sdi/digital_signature/verifier.py +227 -0
  260. openfatture-1.1.0/openfatture/sdi/notifiche/__init__.py +19 -0
  261. openfatture-1.1.0/openfatture/sdi/notifiche/parser.py +303 -0
  262. openfatture-1.1.0/openfatture/sdi/notifiche/processor.py +277 -0
  263. openfatture-1.1.0/openfatture/sdi/pec_sender/__init__.py +1 -0
  264. openfatture-1.1.0/openfatture/sdi/pec_sender/sender.py +271 -0
  265. openfatture-1.1.0/openfatture/sdi/validator/__init__.py +1 -0
  266. openfatture-1.1.0/openfatture/sdi/validator/xsd_validator.py +176 -0
  267. openfatture-1.1.0/openfatture/sdi/xml_builder/__init__.py +1 -0
  268. openfatture-1.1.0/openfatture/sdi/xml_builder/fatturapa.py +349 -0
  269. openfatture-1.1.0/openfatture/services/__init__.py +1 -0
  270. openfatture-1.1.0/openfatture/services/pdf/__init__.py +27 -0
  271. openfatture-1.1.0/openfatture/services/pdf/components/__init__.py +13 -0
  272. openfatture-1.1.0/openfatture/services/pdf/components/footer.py +42 -0
  273. openfatture-1.1.0/openfatture/services/pdf/components/header.py +78 -0
  274. openfatture-1.1.0/openfatture/services/pdf/components/qrcode.py +104 -0
  275. openfatture-1.1.0/openfatture/services/pdf/components/table.py +101 -0
  276. openfatture-1.1.0/openfatture/services/pdf/generator.py +406 -0
  277. openfatture-1.1.0/openfatture/services/pdf/templates/__init__.py +13 -0
  278. openfatture-1.1.0/openfatture/services/pdf/templates/base.py +296 -0
  279. openfatture-1.1.0/openfatture/services/pdf/templates/branded.py +115 -0
  280. openfatture-1.1.0/openfatture/services/pdf/templates/minimalist.py +41 -0
  281. openfatture-1.1.0/openfatture/services/pdf/templates/professional.py +65 -0
  282. openfatture-1.1.0/openfatture/storage/__init__.py +1 -0
  283. openfatture-1.1.0/openfatture/storage/database/__init__.py +5 -0
  284. openfatture-1.1.0/openfatture/storage/database/base.py +120 -0
  285. openfatture-1.1.0/openfatture/storage/database/models.py +384 -0
  286. openfatture-1.1.0/openfatture/utils/__init__.py +1 -0
  287. openfatture-1.1.0/openfatture/utils/config.py +190 -0
  288. openfatture-1.1.0/openfatture/utils/datetime.py +8 -0
  289. openfatture-1.1.0/openfatture/utils/email/__init__.py +28 -0
  290. openfatture-1.1.0/openfatture/utils/email/i18n/en.json +120 -0
  291. openfatture-1.1.0/openfatture/utils/email/i18n/it.json +120 -0
  292. openfatture-1.1.0/openfatture/utils/email/models.py +216 -0
  293. openfatture-1.1.0/openfatture/utils/email/renderer.py +353 -0
  294. openfatture-1.1.0/openfatture/utils/email/sender.py +480 -0
  295. openfatture-1.1.0/openfatture/utils/email/styles.py +274 -0
  296. openfatture-1.1.0/openfatture/utils/email/templates/base.html +59 -0
  297. openfatture-1.1.0/openfatture/utils/email/templates/base.txt +26 -0
  298. openfatture-1.1.0/openfatture/utils/email/templates/batch/riepilogo_batch.html +85 -0
  299. openfatture-1.1.0/openfatture/utils/email/templates/batch/riepilogo_batch.txt +43 -0
  300. openfatture-1.1.0/openfatture/utils/email/templates/sdi/invio_fattura.html +59 -0
  301. openfatture-1.1.0/openfatture/utils/email/templates/sdi/invio_fattura.txt +40 -0
  302. openfatture-1.1.0/openfatture/utils/email/templates/sdi/notifica_attestazione.html +31 -0
  303. openfatture-1.1.0/openfatture/utils/email/templates/sdi/notifica_attestazione.txt +17 -0
  304. openfatture-1.1.0/openfatture/utils/email/templates/sdi/notifica_consegna.html +42 -0
  305. openfatture-1.1.0/openfatture/utils/email/templates/sdi/notifica_consegna.txt +26 -0
  306. openfatture-1.1.0/openfatture/utils/email/templates/sdi/notifica_esito_accettata.html +31 -0
  307. openfatture-1.1.0/openfatture/utils/email/templates/sdi/notifica_esito_accettata.txt +17 -0
  308. openfatture-1.1.0/openfatture/utils/email/templates/sdi/notifica_esito_rifiutata.html +41 -0
  309. openfatture-1.1.0/openfatture/utils/email/templates/sdi/notifica_esito_rifiutata.txt +29 -0
  310. openfatture-1.1.0/openfatture/utils/email/templates/sdi/notifica_mancata_consegna.html +43 -0
  311. openfatture-1.1.0/openfatture/utils/email/templates/sdi/notifica_mancata_consegna.txt +29 -0
  312. openfatture-1.1.0/openfatture/utils/email/templates/sdi/notifica_scarto.html +57 -0
  313. openfatture-1.1.0/openfatture/utils/email/templates/sdi/notifica_scarto.txt +33 -0
  314. openfatture-1.1.0/openfatture/utils/email/templates/test/test_email.html +37 -0
  315. openfatture-1.1.0/openfatture/utils/email/templates/test/test_email.txt +22 -0
  316. openfatture-1.1.0/openfatture/utils/logging.py +267 -0
  317. openfatture-1.1.0/openfatture/utils/rate_limiter.py +302 -0
  318. openfatture-1.1.0/openfatture/utils/security.py +251 -0
  319. openfatture-1.1.0/openfatture/utils/validators.py +96 -0
  320. openfatture-1.1.0/pyproject.toml +195 -0
  321. openfatture-1.1.0/reports/coverage/coverage.payment.ini +13 -0
  322. openfatture-1.1.0/reports/coverage/coverage.xml +4551 -0
  323. openfatture-1.1.0/scripts/capture_screenshots.py +298 -0
  324. openfatture-1.1.0/scripts/check_ollama.sh +188 -0
  325. openfatture-1.1.0/scripts/generate_gifs.sh +311 -0
  326. openfatture-1.1.0/scripts/optimize_videos.sh +216 -0
  327. openfatture-1.1.0/scripts/reset_demo.py +299 -0
  328. openfatture-1.1.0/scripts/reset_demo.sh +73 -0
  329. openfatture-1.1.0/scripts/setup-act-secrets.sh +93 -0
  330. openfatture-1.1.0/scripts/test-actions.sh +114 -0
  331. openfatture-1.1.0/scripts/validate-actions.sh +95 -0
  332. openfatture-1.1.0/test-event.json +35 -0
  333. openfatture-1.1.0/tests/__init__.py +1 -0
  334. openfatture-1.1.0/tests/ai/__init__.py +1 -0
  335. openfatture-1.1.0/tests/ai/cache/__init__.py +1 -0
  336. openfatture-1.1.0/tests/ai/cache/test_cached_provider.py +426 -0
  337. openfatture-1.1.0/tests/ai/cache/test_lru_cache.py +492 -0
  338. openfatture-1.1.0/tests/ai/test_cash_flow_predictor_training.py +274 -0
  339. openfatture-1.1.0/tests/ai/test_invoice_assistant_integration.py +265 -0
  340. openfatture-1.1.0/tests/ai/test_invoice_workflows.py +197 -0
  341. openfatture-1.1.0/tests/ai/test_streaming.py +379 -0
  342. openfatture-1.1.0/tests/ai/test_tax_advisor_integration.py +347 -0
  343. openfatture-1.1.0/tests/ai/test_token_counter.py +154 -0
  344. openfatture-1.1.0/tests/cli/__init__.py +0 -0
  345. openfatture-1.1.0/tests/cli/test_cliente_commands.py +362 -0
  346. openfatture-1.1.0/tests/cli/test_config_commands.py +236 -0
  347. openfatture-1.1.0/tests/cli/test_fattura_commands.py +401 -0
  348. openfatture-1.1.0/tests/cli/test_init_commands.py +379 -0
  349. openfatture-1.1.0/tests/cli/test_pec_commands.py +132 -0
  350. openfatture-1.1.0/tests/cli/test_report_commands.py +399 -0
  351. openfatture-1.1.0/tests/conftest.py +324 -0
  352. openfatture-1.1.0/tests/integration/__init__.py +1 -0
  353. openfatture-1.1.0/tests/integration/test_invoice_workflow.py +354 -0
  354. openfatture-1.1.0/tests/payment/__init__.py +1 -0
  355. openfatture-1.1.0/tests/payment/application/__init__.py +1 -0
  356. openfatture-1.1.0/tests/payment/application/fake_listeners.py +9 -0
  357. openfatture-1.1.0/tests/payment/application/notifications/__init__.py +0 -0
  358. openfatture-1.1.0/tests/payment/application/notifications/test_notifier.py +541 -0
  359. openfatture-1.1.0/tests/payment/application/services/__init__.py +1 -0
  360. openfatture-1.1.0/tests/payment/application/services/test_matching_service.py +566 -0
  361. openfatture-1.1.0/tests/payment/application/services/test_payment_overview.py +158 -0
  362. openfatture-1.1.0/tests/payment/application/services/test_reconciliation_service.py +706 -0
  363. openfatture-1.1.0/tests/payment/application/services/test_reminder_scheduler.py +486 -0
  364. openfatture-1.1.0/tests/payment/application/services/test_transaction_insight_service.py +62 -0
  365. openfatture-1.1.0/tests/payment/application/test_event_listeners.py +111 -0
  366. openfatture-1.1.0/tests/payment/cli/__init__.py +0 -0
  367. openfatture-1.1.0/tests/payment/cli/test_payment_cli.py +1031 -0
  368. openfatture-1.1.0/tests/payment/conftest.py +172 -0
  369. openfatture-1.1.0/tests/payment/domain/__init__.py +1 -0
  370. openfatture-1.1.0/tests/payment/domain/test_enums.py +143 -0
  371. openfatture-1.1.0/tests/payment/domain/test_models.py +311 -0
  372. openfatture-1.1.0/tests/payment/domain/test_value_objects.py +244 -0
  373. openfatture-1.1.0/tests/payment/fixtures/intesa_sanpaolo_sample.csv +11 -0
  374. openfatture-1.1.0/tests/payment/fixtures/revolut_sample.csv +11 -0
  375. openfatture-1.1.0/tests/payment/fixtures/sample_statement.ofx +78 -0
  376. openfatture-1.1.0/tests/payment/fixtures/sample_statement.qif +51 -0
  377. openfatture-1.1.0/tests/payment/fixtures/unicredit_sample.csv +11 -0
  378. openfatture-1.1.0/tests/payment/infrastructure/__init__.py +1 -0
  379. openfatture-1.1.0/tests/payment/infrastructure/importers/__init__.py +1 -0
  380. openfatture-1.1.0/tests/payment/infrastructure/importers/test_base_importer_unit.py +205 -0
  381. openfatture-1.1.0/tests/payment/infrastructure/importers/test_csv_importer.py +210 -0
  382. openfatture-1.1.0/tests/payment/infrastructure/importers/test_csv_importer_unit.py +107 -0
  383. openfatture-1.1.0/tests/payment/infrastructure/importers/test_importer_factory_unit.py +76 -0
  384. openfatture-1.1.0/tests/payment/infrastructure/importers/test_ofx_importer.py +270 -0
  385. openfatture-1.1.0/tests/payment/infrastructure/importers/test_ofx_importer_unit.py +117 -0
  386. openfatture-1.1.0/tests/payment/infrastructure/importers/test_qif_importer.py +403 -0
  387. openfatture-1.1.0/tests/payment/matchers/__init__.py +1 -0
  388. openfatture-1.1.0/tests/payment/matchers/test_composite_matcher.py +349 -0
  389. openfatture-1.1.0/tests/payment/matchers/test_date_window_matcher.py +282 -0
  390. openfatture-1.1.0/tests/payment/matchers/test_exact_matcher.py +218 -0
  391. openfatture-1.1.0/tests/payment/matchers/test_fuzzy_matcher.py +332 -0
  392. openfatture-1.1.0/tests/payment/matchers/test_iban_matcher.py +259 -0
  393. openfatture-1.1.0/tests/payment/test_integration_workflow.py +594 -0
  394. openfatture-1.1.0/tests/services/__init__.py +1 -0
  395. openfatture-1.1.0/tests/services/pdf/__init__.py +1 -0
  396. openfatture-1.1.0/tests/services/test_pdf_generator.py +374 -0
  397. openfatture-1.1.0/tests/test_models.py +118 -0
  398. openfatture-1.1.0/tests/test_validators.py +87 -0
  399. openfatture-1.1.0/tests/unit/test_ai_invoice_assistant.py +378 -0
  400. openfatture-1.1.0/tests/unit/test_ai_tax_advisor.py +413 -0
  401. openfatture-1.1.0/tests/unit/test_batch_operations.py +360 -0
  402. openfatture-1.1.0/tests/unit/test_batch_processor.py +308 -0
  403. openfatture-1.1.0/tests/unit/test_digital_signature.py +346 -0
  404. openfatture-1.1.0/tests/unit/test_email_templates.py +547 -0
  405. openfatture-1.1.0/tests/unit/test_invoice_service.py +170 -0
  406. openfatture-1.1.0/tests/unit/test_logging.py +272 -0
  407. openfatture-1.1.0/tests/unit/test_pec_sender.py +152 -0
  408. openfatture-1.1.0/tests/unit/test_rate_limiter.py +299 -0
  409. openfatture-1.1.0/tests/unit/test_sdi_notifiche.py +273 -0
  410. openfatture-1.1.0/tests/unit/test_security.py +391 -0
  411. openfatture-1.1.0/tests/unit/test_validators_hypothesis.py +298 -0
  412. openfatture-1.1.0/tests/unit/test_xml_builder.py +257 -0
  413. openfatture-1.1.0/tests/unit/test_xsd_validator.py +315 -0
  414. openfatture-1.1.0/uv.lock +4818 -0
@@ -0,0 +1,29 @@
1
+ # act configuration file
2
+ # https://github.com/nektos/act
3
+
4
+ # Container architecture
5
+ --container-architecture linux/amd64
6
+
7
+ # Artifact storage path
8
+ --artifact-server-path /tmp/artifacts
9
+
10
+ # Environment and secrets
11
+ --env-file .env.act
12
+ --secret-file .secrets
13
+
14
+ # Verbose output
15
+ --verbose
16
+
17
+ # Platform images (using optimized catthehacker images)
18
+ --platform ubuntu-latest=catthehacker/ubuntu:act-latest
19
+ --platform ubuntu-22.04=catthehacker/ubuntu:act-22.04
20
+ --platform macos-latest=catthehacker/ubuntu:act-latest
21
+
22
+ # Use .gitignore
23
+ --use-gitignore=false
24
+
25
+ # Reuse containers for faster runs
26
+ --reuse=true
27
+
28
+ # Bind docker socket (for docker-in-docker)
29
+ --container-options "--privileged"
@@ -0,0 +1,26 @@
1
+ [tool.bumpversion]
2
+ current_version = "1.1.0"
3
+ parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
4
+ serialize = ["{major}.{minor}.{patch}"]
5
+ search = "{current_version}"
6
+ replace = "{new_version}"
7
+ regex = false
8
+ ignore_missing_version = false
9
+ tag = true
10
+ sign_tags = false
11
+ tag_name = "v{new_version}"
12
+ tag_message = "Bump version: {current_version} → {new_version}"
13
+ allow_dirty = false
14
+ commit = true
15
+ message = "Bump version: {current_version} → {new_version}"
16
+ commit_args = ""
17
+
18
+ [[tool.bumpversion.files]]
19
+ filename = "openfatture/__init__.py"
20
+ search = "__version__ = \"{current_version}\""
21
+ replace = "__version__ = \"{new_version}\""
22
+
23
+ [[tool.bumpversion.files]]
24
+ filename = "openfatture/ai/__init__.py"
25
+ search = "__version__ = \"{current_version}\""
26
+ replace = "__version__ = \"{new_version}\""
@@ -0,0 +1,52 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(uv run pytest:*)",
5
+ "Bash(uv run:*)",
6
+ "Bash(git add:*)",
7
+ "Bash(git commit:*)",
8
+ "Bash(git push:*)",
9
+ "Bash(python -m pytest tests/ai/test_streaming.py -v)",
10
+ "Bash(python -m pytest tests/ai/test_token_counter.py -v)",
11
+ "Bash(python -m pytest tests/ai/cache/test_lru_cache.py -v)",
12
+ "Bash(python -m pytest tests/ai/cache/test_cached_provider.py -v)",
13
+ "Bash(python -m pytest tests/ai/cache/ -v --tb=short)",
14
+ "Bash(tree:*)",
15
+ "Bash(find:*)",
16
+ "WebSearch",
17
+ "WebFetch(domain:claude.com)",
18
+ "WebFetch(domain:help.openai.com)",
19
+ "WebFetch(domain:support.anthropic.com)",
20
+ "WebFetch(domain:support.claude.com)",
21
+ "WebFetch(domain:developers.openai.com)",
22
+ "Bash(python -m pytest tests/ai/test_token_counter.py tests/ai/test_streaming.py tests/ai/cache/ -v --tb=short)",
23
+ "Bash(openfatture:*)",
24
+ "Bash(git lfs:*)",
25
+ "Bash(test:*)",
26
+ "Bash(make:*)",
27
+ "Bash(cat:*)",
28
+ "Bash(uv:*)",
29
+ "Bash(python -m pytest tests/payment/application/services/test_reminder_scheduler.py -v --tb=short)",
30
+ "Bash(python -m pytest tests/payment/application/services/test_reminder_scheduler.py -v)",
31
+ "Bash(gh run view:*)",
32
+ "Bash(act:*)",
33
+ "Bash(uv python:*)",
34
+ "Bash(gh run list:*)",
35
+ "Bash(gh run watch:*)",
36
+ "Bash(python -m pytest tests/payment/matchers/test_exact_matcher.py -v)",
37
+ "Bash(python -m pytest tests/payment/matchers/test_exact_matcher.py -v --tb=short)",
38
+ "Bash(python -m pytest tests/payment/matchers/test_fuzzy_matcher.py -v --tb=short)",
39
+ "Bash(python -m pytest tests/payment/matchers/test_fuzzy_matcher.py::TestFuzzyDescriptionMatcherBasic::test_fuzzy_description_high_similarity -xvs)",
40
+ "Bash(python -m pytest tests/payment/matchers/ -v --tb=no)",
41
+ "Bash(git log:*)",
42
+ "Bash(uv sync:*)",
43
+ "Read(//private/tmp/**)",
44
+ "Bash(tee:*)",
45
+ "Read(//tmp/**)",
46
+ "Bash(python:*)",
47
+ "Bash(sqlite3:*)"
48
+ ],
49
+ "deny": [],
50
+ "ask": []
51
+ }
52
+ }
@@ -0,0 +1,58 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ *.egg-info/
8
+ dist/
9
+ build/
10
+
11
+ # Virtual environments
12
+ venv/
13
+ env/
14
+ ENV/
15
+ .venv
16
+
17
+ # Testing
18
+ .pytest_cache/
19
+ .coverage
20
+ htmlcov/
21
+ .tox/
22
+
23
+ # IDE
24
+ .vscode/
25
+ .idea/
26
+ *.swp
27
+ *.swo
28
+ .DS_Store
29
+
30
+ # Git
31
+ .git/
32
+ .gitignore
33
+
34
+ # Documentation
35
+ docs/
36
+ *.md
37
+ !README.md
38
+ !LICENSE
39
+
40
+ # CI/CD
41
+ .github/
42
+
43
+ # Local data
44
+ data/
45
+ archivio/
46
+ *.db
47
+ *.sqlite
48
+ *.log
49
+
50
+ # Environment
51
+ .env
52
+ .env.local
53
+
54
+ # Development
55
+ Makefile
56
+ docker-compose.yml
57
+ Dockerfile
58
+ .dockerignore
@@ -0,0 +1,48 @@
1
+ DATABASE_URL=sqlite:///./openfatture_demo.db
2
+
3
+ CEDENTE_DENOMINAZIONE="OpenFatture Demo Studio"
4
+ CEDENTE_PARTITA_IVA=04567890123
5
+ CEDENTE_CODICE_FISCALE=DMOGLC85A01H501Y
6
+ CEDENTE_REGIME_FISCALE=RF19
7
+ CEDENTE_INDIRIZZO="Via Digitale 42"
8
+ CEDENTE_CAP=20100
9
+ CEDENTE_COMUNE=Milano
10
+ CEDENTE_PROVINCIA=MI
11
+ CEDENTE_NAZIONE=IT
12
+ CEDENTE_TELEFONO="+39 02 1234567"
13
+ CEDENTE_EMAIL=demo@openfatture.dev
14
+
15
+ PEC_ADDRESS=openfatture-demo@pec.it
16
+ PEC_PASSWORD=demo-password
17
+ PEC_SMTP_SERVER=smtp.pec.aruba.it
18
+ PEC_SMTP_PORT=465
19
+ SDI_PEC_ADDRESS=sdi01@pec.fatturapa.it
20
+
21
+ EMAIL_LOGO_URL=https://openfatture.dev/assets/logo.png
22
+ EMAIL_PRIMARY_COLOR=#001f3f
23
+ EMAIL_SECONDARY_COLOR=#2ECC71
24
+ EMAIL_FOOTER_TEXT="© 2025 OpenFatture Demo Studio - P.IVA 04567890123"
25
+
26
+ NOTIFICATION_EMAIL=team@openfatture.dev
27
+ NOTIFICATION_ENABLED=true
28
+ LOCALE=it
29
+
30
+ # AI Configuration - Using Ollama for deterministic demo
31
+ # No API keys required - fully local inference
32
+ AI_PROVIDER=ollama
33
+ AI_MODEL=llama3.2
34
+ OPENFATTURE_AI_OLLAMA_BASE_URL=http://localhost:11434
35
+ AI_TEMPERATURE=0.7
36
+ AI_MAX_TOKENS=2000
37
+ AI_CHAT_ENABLED=true
38
+ AI_TOOLS_ENABLED=false
39
+
40
+ # Alternative cloud providers (for production/CI use):
41
+ # AI_PROVIDER=anthropic
42
+ # AI_MODEL=claude-sonnet-4-5
43
+ # OPENFATTURE_AI_ANTHROPIC_API_KEY=sk-ant-your-key-here
44
+
45
+ # CI/CD Configuration (GitHub Actions)
46
+ # Use this configuration for automated media generation in CI
47
+ # Set ANTHROPIC_API_KEY as GitHub secret and it will be injected automatically
48
+ # Example workflow: .github/workflows/media-generation.yml
@@ -0,0 +1,147 @@
1
+ # ============================================================================
2
+ # OpenFatture Configuration Example
3
+ # ============================================================================
4
+ # Copy this file to .env and fill in your details
5
+ #
6
+ # REQUIRED fields (marked with *):
7
+ # - CEDENTE_* (your company data)
8
+ # - PEC_* (for SDI submission)
9
+ # - NOTIFICATION_EMAIL (for email features)
10
+ #
11
+ # OPTIONAL fields:
12
+ # - Digital signature, AI, Email branding, Custom paths
13
+ #
14
+ # See docs/CONFIGURATION.md for detailed documentation
15
+ # ============================================================================
16
+
17
+ # =====================
18
+ # Database
19
+ # =====================
20
+ DATABASE_URL=sqlite:///./openfatture.db
21
+
22
+ # For PostgreSQL (production):
23
+ # DATABASE_URL=postgresql://user:password@localhost:5432/openfatture
24
+
25
+ # =====================
26
+ # Your Company Data (Cedente Prestatore)
27
+ # =====================
28
+ CEDENTE_DENOMINAZIONE="Your Company Name"
29
+ CEDENTE_PARTITA_IVA=12345678901
30
+ CEDENTE_CODICE_FISCALE=RSSMRA80A01H501U
31
+ CEDENTE_REGIME_FISCALE=RF19 # RF19 = Regime forfettario
32
+ CEDENTE_INDIRIZZO="Via Roma 1"
33
+ CEDENTE_CAP=00100
34
+ CEDENTE_COMUNE=Roma
35
+ CEDENTE_PROVINCIA=RM
36
+ CEDENTE_NAZIONE=IT
37
+ CEDENTE_TELEFONO="+39 06 1234567"
38
+ CEDENTE_EMAIL=info@yourcompany.it
39
+
40
+ # =====================
41
+ # PEC Configuration (REQUIRED*)
42
+ # =====================
43
+ # Your PEC email address and password
44
+ PEC_ADDRESS=yourcompany@pec.it
45
+ PEC_PASSWORD=your_pec_password
46
+
47
+ # SMTP server configuration (depends on your PEC provider)
48
+ # Common providers:
49
+ # - Aruba: smtp.pec.aruba.it:465
50
+ # - Register: smtps.pec.register.it:465
51
+ # - Legalmail: smtp.legalmail.it:465
52
+ # - PosteCert: smtp.postecert.it:465
53
+ PEC_SMTP_SERVER=smtp.pec.aruba.it
54
+ PEC_SMTP_PORT=465
55
+
56
+ # SDI PEC address (usually doesn't change)
57
+ SDI_PEC_ADDRESS=sdi01@pec.fatturapa.it
58
+
59
+ # =====================
60
+ # Digital Signature (Optional)
61
+ # =====================
62
+ SIGNATURE_CERTIFICATE_PATH=/path/to/certificate.p12
63
+ SIGNATURE_CERTIFICATE_PASSWORD=cert_password
64
+
65
+ # =====================
66
+ # Email Templates & Notifications
67
+ # =====================
68
+ # Logo for email headers (optional - adds professional branding)
69
+ EMAIL_LOGO_URL=https://yourcompany.com/logo.png
70
+
71
+ # Brand colors for email templates (hex format)
72
+ EMAIL_PRIMARY_COLOR=#1976D2
73
+ EMAIL_SECONDARY_COLOR=#424242
74
+
75
+ # Custom footer text (optional - defaults to company info)
76
+ EMAIL_FOOTER_TEXT=© 2025 Your Company - P.IVA 12345678901
77
+
78
+ # Email address for automatic notifications (REQUIRED for email features)
79
+ # Receives: SDI notifications, batch summaries, system alerts
80
+ NOTIFICATION_EMAIL=admin@yourcompany.it
81
+
82
+ # Enable/disable automatic email notifications
83
+ NOTIFICATION_ENABLED=true
84
+
85
+ # Locale for emails and UI (it = Italian, en = English)
86
+ LOCALE=it
87
+
88
+ # =====================
89
+ # AI Configuration
90
+ # =====================
91
+ # Provider: openai, anthropic, or ollama (for local models)
92
+ AI_PROVIDER=anthropic
93
+ AI_MODEL=claude-3-5-sonnet-20241022
94
+ AI_API_KEY=sk-ant-your-api-key-here
95
+
96
+ # For OpenAI:
97
+ # AI_PROVIDER=openai
98
+ # AI_MODEL=gpt-4o
99
+ # AI_API_KEY=sk-your-openai-key-here
100
+
101
+ # For local models with Ollama (FREE):
102
+ # AI_PROVIDER=ollama
103
+ # AI_MODEL=llama3.2
104
+ # AI_BASE_URL=http://localhost:11434
105
+
106
+ # Generation parameters
107
+ AI_TEMPERATURE=0.7
108
+ AI_MAX_TOKENS=2000
109
+
110
+ # =====================
111
+ # AI Chat Assistant (Interactive Mode)
112
+ # =====================
113
+ # Enable AI chat features in interactive mode
114
+ AI_CHAT_ENABLED=true
115
+
116
+ # Chat session persistence
117
+ AI_CHAT_SESSIONS_DIR=~/.openfatture/ai/sessions
118
+
119
+ # Auto-save conversations
120
+ AI_CHAT_AUTO_SAVE=true
121
+
122
+ # Maximum messages per session (for context management)
123
+ AI_CHAT_MAX_MESSAGES=100
124
+
125
+ # Maximum tokens per session
126
+ AI_CHAT_MAX_TOKENS=8000
127
+
128
+ # =====================
129
+ # AI Tools & Function Calling
130
+ # =====================
131
+ # Enable function calling for AI agents
132
+ AI_TOOLS_ENABLED=true
133
+
134
+ # Tools to enable (comma-separated)
135
+ # Available: search_invoices, get_invoice_details, get_invoice_stats,
136
+ # search_clients, get_client_details, get_client_stats
137
+ AI_ENABLED_TOOLS=search_invoices,get_invoice_details,get_invoice_stats,search_clients,get_client_details,get_client_stats
138
+
139
+ # Require confirmation for destructive tools
140
+ AI_TOOLS_REQUIRE_CONFIRMATION=true
141
+
142
+ # =====================
143
+ # Paths (Optional - defaults to ~/.openfatture/)
144
+ # =====================
145
+ # DATA_DIR=/custom/path/to/data
146
+ # ARCHIVIO_DIR=/custom/path/to/archivio
147
+ # CERTIFICATES_DIR=/custom/path/to/certificates
@@ -0,0 +1,19 @@
1
+ # Git LFS Configuration for OpenFatture Media Assets
2
+ # Track large binary files with Git LFS to keep repository lightweight
3
+
4
+ # Video files
5
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
6
+ *.mov filter=lfs diff=lfs merge=lfs -text
7
+ *.avi filter=lfs diff=lfs merge=lfs -text
8
+ *.webm filter=lfs diff=lfs merge=lfs -text
9
+
10
+ # GIF animations
11
+ *.gif filter=lfs diff=lfs merge=lfs -text
12
+
13
+ # High-resolution images (2x Retina screenshots)
14
+ media/screenshots/**/*.png filter=lfs diff=lfs merge=lfs -text
15
+ media/diagrams/*.png filter=lfs diff=lfs merge=lfs -text
16
+
17
+ # Compressed archives
18
+ *.zip filter=lfs diff=lfs merge=lfs -text
19
+ *.tar.gz filter=lfs diff=lfs merge=lfs -text
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Create a report to help us improve
4
+ title: '[BUG] '
5
+ labels: bug
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Describe the Bug
10
+ A clear and concise description of what the bug is.
11
+
12
+ ## To Reproduce
13
+ Steps to reproduce the behavior:
14
+ 1. Run command '...'
15
+ 2. With configuration '...'
16
+ 3. See error
17
+
18
+ ## Expected Behavior
19
+ A clear and concise description of what you expected to happen.
20
+
21
+ ## Actual Behavior
22
+ What actually happened.
23
+
24
+ ## Environment
25
+ - OS: [e.g., macOS 14.0, Ubuntu 22.04]
26
+ - Python version: [e.g., 3.12.1]
27
+ - OpenFatture version: [e.g., 0.1.0]
28
+ - Installation method: [Poetry, pip, Docker]
29
+
30
+ ## Configuration
31
+ ```bash
32
+ # Relevant parts of your .env or config
33
+ # (Remove sensitive data!)
34
+ ```
35
+
36
+ ## Logs
37
+ ```
38
+ # Paste relevant logs here
39
+ ```
40
+
41
+ ## Screenshots
42
+ If applicable, add screenshots to help explain your problem.
43
+
44
+ ## Additional Context
45
+ Add any other context about the problem here.
46
+
47
+ ## Possible Solution
48
+ If you have ideas on how to fix this, please share!
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest an idea for OpenFatture
4
+ title: '[FEATURE] '
5
+ labels: enhancement
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Feature Description
10
+ A clear and concise description of the feature you'd like to see.
11
+
12
+ ## Use Case
13
+ Describe the problem this feature would solve.
14
+ Example: "As a freelancer, I need to..."
15
+
16
+ ## Proposed Solution
17
+ Describe how you envision this feature working.
18
+
19
+ ## Alternatives Considered
20
+ Describe alternative solutions or features you've considered.
21
+
22
+ ## Additional Context
23
+ Add any other context, mockups, or examples about the feature request here.
24
+
25
+ ## Priority
26
+ - [ ] Critical - Blocking my workflow
27
+ - [ ] High - Important for my use case
28
+ - [ ] Medium - Would be nice to have
29
+ - [ ] Low - Future enhancement
30
+
31
+ ## Willing to Contribute?
32
+ - [ ] Yes, I can implement this feature
33
+ - [ ] Yes, I can help with testing
34
+ - [ ] No, but I'm available for feedback
@@ -0,0 +1,39 @@
1
+ # Pull Request
2
+
3
+ ## Description
4
+ <!-- Describe your changes in detail -->
5
+
6
+ ## Type of Change
7
+ - [ ] Bug fix (non-breaking change which fixes an issue)
8
+ - [ ] New feature (non-breaking change which adds functionality)
9
+ - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
10
+ - [ ] Documentation update
11
+ - [ ] Performance improvement
12
+ - [ ] Code refactoring
13
+
14
+ ## Related Issue
15
+ <!-- Link to related issue: Fixes #123 -->
16
+
17
+ ## Testing
18
+ <!-- Describe the tests you added/modified -->
19
+
20
+ - [ ] Unit tests added/updated
21
+ - [ ] Integration tests added/updated
22
+ - [ ] All tests pass locally
23
+ - [ ] Manual testing performed
24
+
25
+ ## Checklist
26
+ - [ ] My code follows the project's code style (ran `make format`)
27
+ - [ ] I have performed a self-review of my code
28
+ - [ ] I have commented my code, particularly in hard-to-understand areas
29
+ - [ ] I have made corresponding changes to the documentation
30
+ - [ ] My changes generate no new warnings
31
+ - [ ] I have added tests that prove my fix is effective or that my feature works
32
+ - [ ] New and existing unit tests pass locally with my changes
33
+ - [ ] Any dependent changes have been merged and published
34
+
35
+ ## Screenshots (if applicable)
36
+ <!-- Add screenshots to help explain your changes -->
37
+
38
+ ## Additional Notes
39
+ <!-- Any additional information that reviewers should know -->
@@ -0,0 +1,194 @@
1
+ name: Media Generation
2
+
3
+ on:
4
+ schedule:
5
+ - cron: '0 2 * * *' # Daily 2 AM UTC
6
+ workflow_dispatch:
7
+ inputs:
8
+ scenario:
9
+ description: 'Scenario to generate'
10
+ required: true
11
+ default: 'all'
12
+ type: choice
13
+ options:
14
+ - all
15
+ - A
16
+ - B
17
+ - C
18
+ - D
19
+ - E
20
+ skip_optimization:
21
+ description: 'Skip video optimization'
22
+ type: boolean
23
+ default: false
24
+
25
+ env:
26
+ PYTHONUNBUFFERED: "1"
27
+ UV_SYSTEM_PYTHON: "1"
28
+
29
+ jobs:
30
+ generate:
31
+ runs-on: ubuntu-latest
32
+ timeout-minutes: 45
33
+ environment: media-automation
34
+
35
+ steps:
36
+ - name: Checkout repository
37
+ uses: actions/checkout@v4
38
+ with:
39
+ lfs: true
40
+ fetch-depth: 0
41
+
42
+ - name: Setup Git LFS
43
+ run: |
44
+ git lfs install
45
+ git lfs pull
46
+
47
+ - name: Install VHS
48
+ run: |
49
+ curl -fsSL https://github.com/charmbracelet/vhs/releases/download/v0.10.0/vhs_Linux_x86_64.tar.gz | tar -xz
50
+ sudo mv vhs /usr/local/bin/
51
+ vhs --version
52
+
53
+ - name: Install ffmpeg
54
+ run: |
55
+ sudo apt-get update
56
+ sudo apt-get install -y ffmpeg
57
+ ffmpeg -version
58
+
59
+ - name: Install uv
60
+ uses: astral-sh/setup-uv@v1
61
+ with:
62
+ enable-cache: true
63
+ cache-dependency-glob: "uv.lock"
64
+
65
+ - name: Install Python dependencies
66
+ run: uv sync --all-extras
67
+
68
+ - name: Configure Anthropic AI
69
+ env:
70
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
71
+ run: |
72
+ cat > .env <<EOF
73
+ # Database
74
+ DATABASE_URL=sqlite:///./openfatture_demo.db
75
+
76
+ # Cedente (demo data)
77
+ CEDENTE_DENOMINAZIONE="OpenFatture Demo Studio"
78
+ CEDENTE_PARTITA_IVA=04567890123
79
+ CEDENTE_CODICE_FISCALE=DMOGLC85A01H501Y
80
+ CEDENTE_REGIME_FISCALE=RF19
81
+ CEDENTE_INDIRIZZO="Via Digitale 42"
82
+ CEDENTE_CAP=20100
83
+ CEDENTE_COMUNE=Milano
84
+ CEDENTE_PROVINCIA=MI
85
+ CEDENTE_NAZIONE=IT
86
+ CEDENTE_TELEFONO="+39 02 1234567"
87
+ CEDENTE_EMAIL=demo@openfatture.dev
88
+
89
+ # AI Configuration - Anthropic Claude Sonnet 4.5
90
+ AI_PROVIDER=anthropic
91
+ AI_MODEL=claude-sonnet-4-5
92
+ OPENFATTURE_AI_ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
93
+ AI_TEMPERATURE=0.7
94
+ AI_MAX_TOKENS=2000
95
+ AI_CHAT_ENABLED=true
96
+ AI_TOOLS_ENABLED=true
97
+
98
+ # Notifications
99
+ NOTIFICATION_EMAIL=ci@openfatture.dev
100
+ NOTIFICATION_ENABLED=false
101
+ LOCALE=it
102
+ EOF
103
+
104
+ echo "✓ Anthropic configured with claude-sonnet-4-5"
105
+
106
+ - name: Verify Anthropic configuration
107
+ run: |
108
+ uv run python -c "
109
+ from openfatture.ai.config.settings import get_ai_settings
110
+ settings = get_ai_settings()
111
+ print(f'Provider: {settings.provider}')
112
+ print(f'Model: {settings.anthropic_model}')
113
+ print(f'Configured: {settings.is_provider_configured()}')
114
+ assert settings.provider == 'anthropic'
115
+ assert settings.anthropic_model == 'claude-sonnet-4-5'
116
+ assert settings.is_provider_configured()
117
+ print('✓ Anthropic configuration verified')
118
+ "
119
+
120
+ - name: Reset demo environment
121
+ run: |
122
+ chmod +x scripts/reset_demo.sh
123
+ ./scripts/reset_demo.sh
124
+ echo "✓ Demo environment ready"
125
+
126
+ - name: Generate video(s)
127
+ run: |
128
+ scenario="${{ github.event.inputs.scenario || 'all' }}"
129
+
130
+ if [ "$scenario" = "all" ]; then
131
+ echo "→ Generating all scenarios..."
132
+ make media-all
133
+ else
134
+ echo "→ Generating scenario $scenario..."
135
+ make media-scenario${scenario}
136
+ fi
137
+
138
+ - name: Check generated videos
139
+ id: check_videos
140
+ run: |
141
+ if compgen -G "media/output/*.mp4" > /dev/null; then
142
+ echo "found=true" >> "$GITHUB_OUTPUT"
143
+ echo "✓ MP4 assets detected in media/output/"
144
+ else
145
+ echo "found=false" >> "$GITHUB_OUTPUT"
146
+ echo "ℹ️ No MP4 assets generated in media/output/"
147
+ fi
148
+
149
+ - name: No videos generated
150
+ if: steps.check_videos.outputs.found != 'true'
151
+ run: echo "Skipping artifact upload and optimization trigger (no videos produced)."
152
+
153
+ - name: List generated videos
154
+ if: steps.check_videos.outputs.found == 'true'
155
+ run: |
156
+ echo "Generated videos:"
157
+ ls -lh media/output/*.mp4 | awk '{print " " $9 " (" $5 ")"}'
158
+
159
+ total_size=$(du -ch media/output/*.mp4 | grep total | awk '{print $1}')
160
+ echo "Total size: $total_size"
161
+
162
+ - name: Upload videos as artifacts
163
+ if: steps.check_videos.outputs.found == 'true'
164
+ uses: actions/upload-artifact@v4
165
+ with:
166
+ name: media-videos-${{ github.run_number }}
167
+ path: media/output/*.mp4
168
+ if-no-files-found: warn
169
+ retention-days: 7
170
+ compression-level: 0 # Videos are already compressed
171
+
172
+ - name: Trigger optimization workflow
173
+ if: ${{ steps.check_videos.outputs.found == 'true' && !inputs.skip_optimization }}
174
+ uses: peter-evans/repository-dispatch@v3
175
+ with:
176
+ token: ${{ secrets.GITHUB_TOKEN }}
177
+ event-type: media-optimization-trigger
178
+ client-payload: '{"run_id": "${{ github.run_id }}"}'
179
+
180
+ - name: Generate summary
181
+ run: |
182
+ echo "## 🎬 Media Generation Summary" >> $GITHUB_STEP_SUMMARY
183
+ echo "" >> $GITHUB_STEP_SUMMARY
184
+ if [ "${{ steps.check_videos.outputs.found }}" != "true" ]; then
185
+ echo "No videos were generated during this run." >> $GITHUB_STEP_SUMMARY
186
+ exit 0
187
+ fi
188
+
189
+ echo "**Scenario:** ${{ github.event.inputs.scenario || 'all' }}" >> $GITHUB_STEP_SUMMARY
190
+ echo "**Provider:** Anthropic Claude Sonnet 4.5" >> $GITHUB_STEP_SUMMARY
191
+ echo "**Videos generated:** $(find media/output -maxdepth 1 -name '*.mp4' | wc -l)" >> $GITHUB_STEP_SUMMARY
192
+ echo "" >> $GITHUB_STEP_SUMMARY
193
+ echo "### Files:" >> $GITHUB_STEP_SUMMARY
194
+ find media/output -maxdepth 1 -name '*.mp4' -type f -print0 | xargs -0 ls -lh | awk '{print "- " $9 " (" $5 ")"}' >> $GITHUB_STEP_SUMMARY