refactor all modal forms so we can use multiple on the same page - i.e. the same modal div but can use multiple modal JS on one page, i.e. Pay Period view can have modals on that page to edit ScheduledTransactions, Transactions, etc. This also means passing dataTableObj in from the link.
For properly determining pay period balances, we should have specific "income" budgets. Pay period balances can be calculated by subtracting the sum of all transaction amounts on non-income budgets from the sum of all transaction amounts on income budgets.
Status (balance, etc.) of current period with link to it (possibly in one of those big dashboard widgets?); this should be a reusable component that can be put on the index page too
Balances of the next N periods with links to them
shows all recurring budgets, and their balances for the current and next 2 pay periods
Need a way to do a real round-trip acceptance test (i.e. make a change in the DB from the UI, commit it, ensure it's reflected in the DB or elsewhere in the UI) and then roll it back. Don't know if we can do some sort of inner transaction for this, or need to make use of savepoints.
This should probably be done at the class-level. The tests will get too ugly if we have to do this much in one method.
Status (balance, etc.) of current period with link to it (possibly in one of those big dashboard widgets?); this should be a reusable component that can be put on the index page too
Balances of the next N periods with links to them
Calendar widget to find a budget for a specific date; redirects to the budget page for that date
Shows table of all recurring budgets for this period, along with budget amount, allocated amount, spent amount, remaining amount (and totals for all of those)
Show standing budgets and their balances, as well as any adjustments (transactions) this period
Around the time this issue was opened (just after TravisCI built 45) I was seeing a lot of intermittent acceptance test failures, where one of the selenium.get() calls would run forever. I fixed this by putting a timeout both on selenium calls, and on each test.
Need a cutoff date for transactions - i.e. don't show anything as unreconciled before this date. Should add a hybrid property or something on OFXTransaction and Transaction i.e. .unreconciled() that generates the appropriate query, including the cutoff date.
Need to archive all build artifacts. I guess I'll need S3 for this. Be sure to include the selenium HTML reports.
There doesn't seem to be a built-in way to archive results/reports from failed tests. So, I think the plan is as follows:
Have all test result output go to a results/ directory.
Include S3 credentials in the secure project env vars (either in .travis.yml or via the UI)
Add a script to after_success and after_failure that generates an index.html for everything in results/, then uses s3cmd or boto or something to sync that directory to a S3 bucket under $TRAVIS_REPO_SLUG/$TRAVIS_JOB_NUMBER/
I think the basic idea is to generate a DB and fill it with sample data, as of the sampledata and schema when Alembic was first introduced. Dump that to a SQL file. Then we init the db once just using create_all, dump that (A), load the static SQL from before migrations, run all the migrations, dump that (B) and compare A and B.
See if I can run at least some of these tests on a mobile browser, or the closest I can get (or maybe SauceLabs does free for OSS? Maybe just run them manually pre-release?)
add a Dockerfile, and add Docker as a supported install method
app installed via pip, via a built distribution (tox env will put the dist at .tox/dist/biweeklybudget-VERSION.zip; tox code for making sdist which is put in the tox config distdir and found with self.config.distdir.listdir()[0]; example of parsing tox config )
need a way to craft a transaction to put money in standing budgets; some sort of pseudo-transaction. i.e., how do we allocate funds to a standing budget?
logic to get Transactions and OFXTransactions for this view is reusable; use it in the notifications count bar ( #44 ).
2 columns, Transactions on left and OFXTransactions on right; each is a div/box with appropriate information, link to modal, and other links as needed
Need to be able to add Transactions dynamically; maybe best is to store a mapping of reconciles (i.e. OFXTransaction to Transaction) as a JS var; then we can re-populate the columns dynamically and call a method to match up as necessary (which would also be used for pre-population)
columns are individually scrollable
OFX boxes have a link to create a Transaction (modal for this, pre-populated with as much as we can) for the OFXTransaction and reconcile them; this updates the view
Transactions have a link to trigger modal to mark them as reconciled without a matching OFXTransaction, but with a note; this updates the view
Transactions have a link to their edit modal; this updates the view.
Dropping an OFX on a Transaction disables the edit modal link
Actual Reconciling
User drags an OFXTransaction onto a Transaction; Transaction is no longer droppable. This reconciles.
OFXTransaction can be dragged back to OFX column to "unreconcile"
Drop triggers Ajax validation; if it fails, OFXTransaction moves back to its column and a warning message is displayed.
Form Submission
Displays a confirmation screen; table of matched transactions to reconcile, and a "reconcile" check box for each. Submission sends to form handler, only reconciles the checked ones, updates DB then redirects back to /reconcile.
Reconcile modal - for a given reconcile ID, show the reconcile id, date, notes (if any), and links to the Transaction and OFXTransaction modals, as appropriate. Or maybe should just include all the info for all of them...
Accounts need to have a boolean flag for whether or not their OFXTransaction amounts should be negated when comparing to Transactions.
Using the above, OFXTransaction should have a hybrid property account_amount, that is generated using this boolean.
PayPeriod view - reconcile column in transaction table, with link for reconcile modal.
OFX view - reconcile column in transaction table, with link for reconcile modal.
Transaction view - reconcile column in transaction table, with link for reconcile modal.
Reusable logic to craft a query to get all unreconciled Transactions or OFXTransactions. For OFX, this should respect a RECONCILE_BEGIN_DATE setting and only return ones with dates after that (this should probably be a hybrid property with an expression).
Status (balance, etc.) of current period with link to it (possibly in one of those big dashboard widgets?); this should be a reusable component that can be put on the index page too
Balances of the next N periods with links to them
shows all recurring budgets, and their balances for the current and next 2 pay periods
notification if a budget balance goes negative (how to handle this per-pay-period / recurring? only current and next N?)
And the following methods which take a db_session and return a dict or object to be used by something downstream:
each active recurring budget, along with the budget amount, allocated amount (amount of scheduled transactions or actual transactions this period), the spent amount and the remaining amount.
Total allocated (budgets plus transactions), total spent, total remaining
All transactions for the period; this should combine ScheduledTransactions and Transactions into one list, ordered by date, and return them as either objects or dicts in a common format so they can be displayed in one table. This is not going to be a DataTable, or at least is not going to be searchable/filterable/orderable; it will be a fixed representation.
Acceptance test for BiweeklyPayPeriod._dict_for_sched_trans() - set a budget start date at the beginning of the second week of a month, so we have a block of 3 consecutive pay periods, the first and last of which span month changes and the middle of which does not. Generate ~56 Monthly ScheduledTransactions on consecutive days, so we have transactions for at least one week on either side of the block of 3 consecutive pay periods. Ensure that each of the 3 pay periods contain the right transactions in the right order.
Need to exempt any ScheduledTransactions that have been converted to Transactions
Given that a lot of the above use the same queries, we should explicitly cache the query results in the object.
For testing PayPeriod-related things (acceptance tests), biweeklybudget.settings_example.PAY_PERIOD_START_DATE should be set to the closest Friday to the current date.
Each Pay Period should be represented by a PayPeriod subclass (i.e. BiweeklyPayPeriod).
start and end date properties
properties to return the next and previous period
class method to get the period object for a given date
method to filter a SQLAlchemy query to this pay period, given the query object and a reference to the date property (i.e. .filter_query(query, Transaction.date) would filter query so Transaction.date is in the pay period.
Dates for pay periods will be based off of a PAY_START_DATE setting (the starting date of one arbitrary budget period).
Implement rules-based automatic reconciling of transactions.
The following will not reconcile transactions without manual confirmation. It will be implemented as a hook on the reconcile view added in #20, and will simply pre-populate the state of the reconcile, but can still be manually overridden.
Model for reconciling rules:
Each rule should have fields for each pertinent transaction field (account, name/memo, amount, etc.)
name/memo and other strings will be either exact match, contains, or regex
Amount will be either exact match, greater than, less than, or within X of Y
Should also have a date range field (i.e. the Transaction and OFXTransaction dates are within X days of each other; default to 7)
"unique" field, where this rule will only apply if it matches exactly one unreconciled Transaction and exactly one unreconciled OFXTransaction
view to list reconciling rules; buttons/links to add, edit, delete and make inactive.
properly generate add/edit modal
user can add reconciling rules using any combination of fields specified above; list view updates and DB is updated correctly
user can edit reconciling rules using any combination of fields specified above; list view updates and DB is updated correctly
user can delete reconciling rules; list view updates and DB is updated correctly
user can toggle active flag on reconciling rules; list view updates and DB is updated correctly
Sometimes we pull OFX data for an account, but don't want to reconcile the transactions - such as investment accounts, or credit accounts that we're just paying off.
Reconcile needs a way to convert ofx trans to internal trans (select budget) and a way to set internal trans as cash or otherwise mark as non-ofx reconcile.
Transactions can be associated with a Budget; link to that budget
scheduled with specific date, day of month, number per pay period, or "any date" per pay period
edit modal for these
add modal for these
refactor all modal forms so we can use multiple on the same page - i.e. the same modal div but can use multiple modal JS on one page, i.e. so the Pay Period view can have modals on that page to edit ScheduledTransactions, Transactions, etc. This also means passing dataTableObj in from the link.
account and budget; all other fields from model
view that shows all scheduled transactions, grouped by type (date/day of month/num per period)