buchhalter-ai / buchhalter-ai-cli

The buchhalter open-source command line tool to automate invoice downloads from suppliers. Free, customizable, and designed for seamless financial workflow integration.
https://buchhalter.ai
Other
4 stars 1 forks source link

DRAFT: Uploading Invoice documents to Buchhalter API, if a Premium subscription is available #42

Closed andygrunwald closed 4 months ago

andygrunwald commented 4 months ago

This is a DRAFT Pull Request - Still work in progress

What is this PR doing?

This Pull Request does a lot, let me go through it

API Token: Read token on bootup if available

If an API token has been entered (via the connect command), the API token is read on bootup now.

Document Archive is using a map instead of a slice

The document archive is now using a map data structure - with the document hash as key. This allows to store more information per single file. We require this for uploading to know where the file is.

Browser + Client: Add document to Archive, once moved

If the browser or client package downloads a new document, it is getting moved to the final destination. Once done, the document gets added to the (local) document archive.

Archive: Exclude _local and .log from archive

If the --dev --log options are used, a log file is created. This log file has been part of our document archive. We excluded it as well as _local recipe files.

Document Upload (WIP)

The functionality to upload a document is not implemented yet, however, the checking mechanism, if the document is already available in the API, has been implemented.

Right now, we are getting blocked by the Rate limiter.

Open Questions

For the document upload / check, a team selection need to be run - The user need to choose which team the documents need to be uploaded. Right now, we just select the first team - How should this be done if multiple teams are available?

Suggestion: We limit teams to one right now in the MVP