-
-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix progress indicator for account setup * Refactor Google & Plaid code to support multiple months & pagination * Refactor Google & Plaid code to support multiple months & pagination * Batch format & clear requests for sheets * Documentation improvements * Documentation improvements * Documentation improvements * Documentation improvements * Documentation improvements * Bump Version
- Loading branch information
1 parent
51a87a3
commit 1a1bcb0
Showing
13 changed files
with
500 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Providers APIs | ||
|
||
Mintable is designed to be pluggable, i.e. you can swap out Plaid or Google Sheets for another service of your choice. | ||
|
||
This document outlines what Mintable expects of a provider, and what constraints/functionality you need to adhere to/implement if you want to add a new provider. | ||
|
||
## Transactions (`ACCOUNT_PROVIDER`) API | ||
|
||
Account providers should provide an exported function which takes in a startDate and endDate, and returns a `Promise` of a raw list of transaction objects, i.e.: | ||
|
||
```javascript | ||
transactions = await require('../lib/providerName').fetchTransactions(startDate, endDate) | ||
``` | ||
|
||
At minimum, we expect `name`, `date`, and `amount` to be defined. | ||
|
||
For example, the following would an acceptable response (after promise resolution): | ||
|
||
```javascript | ||
[ | ||
{ "name": "Amazon.com", "date": "2019-04-16T07:00:00.000Z", "amount": -40.22 }, | ||
{ "name": "United Airlines", "date": "2019-04-06T07:00:00.000Z", "amount": -500 }, | ||
{ "name": "Uber", "date": "2019-04-04T07:00:00.000Z", "amount": -6.33 } | ||
] | ||
``` | ||
|
||
## Spreadsheets (`SHEET_PROVIDER`) API | ||
|
||
Spreadsheet providers should provide an exported function which takes in a map of sheet name to a list of transactions for that sheet, and return a `Promise` which resolves when all necessary operations to update that sheet are complete, i.e.: | ||
|
||
```javascript | ||
await require('../lib/providerName').updateSheets(updates, options) | ||
``` | ||
|
||
where `updates` come in the following format: | ||
|
||
```javascript | ||
{ | ||
"2019.04": [ | ||
{ "name": "Amazon.com", "date": "2019.04.16", "amount": -40.22 }, | ||
{ "name": "United Airlines", "date": "2019.04.26", "amount": -500 } | ||
], | ||
"2019.05": [ | ||
{ "name": "Uber", "date": "2019.05.11", "amount": -6.33 } | ||
] | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.