For automating processes using following products:
- Google Drive to create invoices
- Google Calendar to retrieve schedule work
- fixer.io exchange api for exchange rates
Installing
Generate swagger client
swagger generate client
- Create a file named
.env
and put the two environment variables inside:
EXCHANGE_RATE_API="API TOKEN FROM openexchangerate"
DRIVE_ID="DRIVE ID FROM THE URL WHERE THE BACKUP JSON FILE EXISTS"
{
"name": "Name of the invoice file without extension",
"spreadSheetIdFromCopy": "The spreadsheetId from it copies the model",
"cellData": {
"numberInvoice": "A3",
"dateInvoice": "A4",
"datePayment": "A5",
"totalHours": "D15",
"quantity": "E15"
},
"companies": [
{
"name": {
"data": "name",
"cell": "H2"
},
"address": {
"data": "address",
"cell": "H3"
},
"description": {
"data": "description, also we can use the %s",
"cell": "C5"
},
"unitPrice": 20000,
"moneySymbol": "USD"
}
]
}
If no file is found, it can be downloaded from Google Drive from the environment variable DRIVE_ID
. The file name has to be invoices.json
name.
List of features
- Get working hours from Google calendar events
- Get the latest exchange rate of a currency
- Generate spreadsheet invoice
List of TODO
- Better logging
- Tests and use github workflow
- Retry if auth token has expired